Bug #3646 and Issue #306 - Learning paths, the old Conference tool, Booking tool, Social network tool, Surveys: Fixing person name order and sorting to be dependable on the internationalization settings.

skala
Ivan Tcholakov 16 years ago
parent 56abaf7551
commit 9dce81ad53
  1. 4
      main/newscorm/aicc_api.php
  2. 2
      main/newscorm/aicc_hacp.php
  3. 2
      main/newscorm/scorm_api.php
  4. 2
      main/online/online_whoisonline.php
  5. 6
      main/reservation/rsys.php
  6. 2
      main/social/contacts.inc.php
  7. 7
      main/social/data_personal.inc.php
  8. 2
      main/social/group_contact.inc.php
  9. 26
      main/social/profile.php
  10. 2
      main/social/qualify_contact.inc.php
  11. 2
      main/social/select_friend_response.php
  12. 9
      main/social/select_options.php
  13. 2
      main/social/show_search_image.inc.php
  14. 2
      main/survey/create_new_survey.php
  15. 34
      main/survey/fillsurvey.php
  16. 42
      main/survey/survey.lib.php
  17. 2
      main/survey/survey_invitation.php
  18. 4
      main/survey/survey_invite.php
  19. 8
      whoisonline.php

@ -153,7 +153,7 @@ function LMSGetValue(param) {
result='<?php echo $_user['user_id']; ?>';
}else if(param == 'cmi.core.student_name'){
<?php
$who=addslashes($_user['lastName'].", ".$_user['firstName']);
$who=addslashes(api_get_person_name($_user['firstName'], $_user['lastName']));
echo "result='$who';";
?>
}else if(param == 'cmi.core.lesson_location'){
@ -209,7 +209,7 @@ function LMSGetValue(param) {
break;
case 'cmi.core.student_name' :
<?php
$who=addslashes($_user['firstName'].",".$_user['lastName']);
$who=addslashes(api_get_person_name($_user['firstName'], $_user['lastName']));
echo "result='$who';";
?> break;
case 'cmi.core.lesson_location' :

@ -106,7 +106,7 @@ if(!empty($_REQUEST['command']))
$result = $s_ec.$error_code.$crlf.$s_et.$error_text.$crlf.$s_ad.$crlf;
$result .= '[Core]'.$crlf;
$result .= $tab.'Student_ID='.$_user['user_id'].$crlf;
$result .= $tab.'Student_Name='.$_user['lastName'].', '.$_user['firstName'].$_user['user_id'].$crlf;
$result .= $tab.'Student_Name='.api_get_person_name($_user['firstName'], $_user['lastName']).$crlf;
$result .= $tab.'Lesson_Location='.$oItem->get_lesson_location().$crlf;
$result .= $tab.'Credit='.$oItem->get_credit().$crlf;
$result .= $tab.'Lesson_Status='.$oItem->get_status().$crlf;

@ -325,7 +325,7 @@ function LMSGetValue(param)
}else if(param == 'cmi.core.student_name'){
// ---- cmi.core.student_name
<?php
$who=addslashes($_user['lastName'].", ".$_user['firstName']);
$who=addslashes(api_get_person_name($_user['firstName'], $_user['lastName']));
echo "result='$who';";
?>
}else if(param == 'cmi.core.lesson_location'){

@ -79,7 +79,7 @@ foreach($Users as $enreg)
<td width="99%"><a <?php if($enreg['status'] == 1) echo 'class="master"'; ?> name="user_<?php echo $enreg['user_id']; ?>" href="<?php echo api_get_self(); ?>?showPic=<?php if($showPic == $enreg['user_id']) echo '0'; else echo $enreg['user_id']; ?>#user_<?php echo $enreg['user_id']; ?>"><b><?php echo $enreg['username']; ?></b></a></td>
</tr>
<tr>
<td width="99%"><small><?php echo api_ucfirst($enreg['lastname']).' '.api_ucfirst($enreg['firstname']); ?></small></td>
<td width="99%"><small><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']); ?></small></td>
</tr>
<?php if($showPic == $enreg['user_id']): ?>

@ -1237,7 +1237,7 @@ class Rsys {
$sql = "SELECT i1.name as col0,c.name as col1,
DATE_FORMAT(r1.start_at ,'%Y-%m-%d %H:%i') as col2,
DATE_FORMAT(r1.end_at ,'%Y-%m-%d %H:%i') as col3, CONCAT(u.lastname,' ',u.firstname) as col4,
DATE_FORMAT(r1.end_at ,'%Y-%m-%d %H:%i') as col3, ".(api_is_western_name_order() ? "CONCAT(u.firstname,' ',u.lastname)" : "CONCAT(u.lastname,' ',u.firstname)")." as col4,
DATE_FORMAT(s.start_at ,'%Y-%m-%d %H:%i') as col5,
DATE_FORMAT(s.end_at ,'%Y-%m-%d %H:%i') as col6, s.accepted as col7
FROM ".Rsys :: getTable('subscription')." s, ".Rsys :: getTable('reservation')." r1, ".Database :: get_main_table(TABLE_MAIN_USER)." u," .Rsys :: getTable('item')." i1,".Rsys :: getTable('category')." c
@ -1315,14 +1315,14 @@ class Rsys {
}
/*$sql = "SELECT dummy AS col0, CONCAT(u.lastname,' ',u.firstname) AS col1, s.user_id AS col2, accepted AS col3
/*$sql = "SELECT dummy AS col0, ".(api_is_western_name_order() ? "CONCAT(u.firstname,' ',u.lastname)" : "CONCAT(u.lastname,' ',u.firstname)")." AS col1, s.user_id AS col2, accepted AS col3
FROM ".Rsys :: getTable('subscription')." s
INNER JOIN ".Database :: get_main_table(TABLE_MAIN_USER)." u ON s.user_id = u.user_id ";
if (!empty ($_GET['rid'])) {
$sql .= " WHERE s.reservation_id = '".$_GET['rid']."'";
}
$sql .= " ORDER BY col".$column." ".$direction." LIMIT ".$from.",".$per_page;*/
$sql = "SELECT dummy AS col0, CONCAT(u.lastname,' ',u.firstname) AS col1, s.user_id AS col2, accepted AS col3, r.start_at, r.end_at, s.start_at, s.end_at
$sql = "SELECT dummy AS col0, ".(api_is_western_name_order() ? "CONCAT(u.firstname,' ',u.lastname)" : "CONCAT(u.lastname,' ',u.firstname)")." AS col1, s.user_id AS col2, accepted AS col3, r.start_at, r.end_at, s.start_at, s.end_at
FROM ".Rsys :: getTable('subscription')." s,".Database :: get_main_table(TABLE_MAIN_USER)." u,".Database :: get_main_table(TABLE_MAIN_RESERVATION_RESERVATION)." r
where u.user_id = s.user_id
and s.reservation_id = r.id";

@ -29,7 +29,7 @@ $image_path = UserManager::get_user_picture_path_by_id ($user_id,'web',false,tru
echo '&nbsp;&nbsp;Dokeos&nbsp;&nbsp;-&nbsp;&nbsp;';
$user_id=api_get_user_id();
$user_info=api_get_user_info($user_id);
echo $name_user=api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']) ;
echo $name_user=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
?></td>
</tr>
</table>

@ -103,10 +103,17 @@ $language_variable=api_xml_http_response_encode(get_lang('PersonalData'));
echo '<div class="social-profile-info" style="float:left;position:relative">';
echo '<dt>'.api_xml_http_response_encode(get_lang('UserName')).'</dt>
<dd>'. api_xml_http_response_encode($user_info['username']).' </dd>';
if (api_is_western_name_order()) {
echo '<dt>'.api_xml_http_response_encode(get_lang('FirstName')).'</dt>
<dd>'. api_xml_http_response_encode($user_info['firstname']).'</dd>';
echo '<dt>'.api_xml_http_response_encode(get_lang('LastName')).'</dt>
<dd>'. api_xml_http_response_encode($user_info['lastname']).'</dd>';
} else {
echo '<dt>'.api_xml_http_response_encode(get_lang('LastName')).'</dt>
<dd>'. api_xml_http_response_encode($user_info['lastname']).'</dd>';
echo '<dt>'.api_xml_http_response_encode(get_lang('FirstName')).'</dt>
<dd>'. api_xml_http_response_encode($user_info['firstname']).'</dd>';
}
echo '<dt>'.api_xml_http_response_encode(get_lang('OfficialCode')).'</dt>
<dd>'. api_xml_http_response_encode($user_info['official_code']).'</dd>';
echo '<dt>'.api_xml_http_response_encode(get_lang('Email')).'</dt>

@ -59,7 +59,7 @@ for ($p=0;$p<count($list_groups);$p++) {
while ($j<$number_of_images) {
if ($list_friends_file[$j]<>"") {
$user_info=api_get_user_info($list_friends_id[$j]);
$user_name=api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']) ;
$user_name=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
if($list_friends_file[$j]==='unknown.jpg') {
$big='';
} else {

@ -199,8 +199,8 @@ $interbreadcrumb[]= array (
if (isset($_GET['u']) && is_numeric($_GET['u'])) {
$info_user=api_get_user_info($_GET['u']);
$interbreadcrumb[]= array (
'url' => '#',
'name' => $info_user['firstName'].' '.$info_user['lastName']
'url' => 'javascript: void(0);',
'name' => api_get_person_name($info_user['firstName'], $info_user['lastName'])
);
}
if (isset($_GET['u'])) {
@ -382,13 +382,13 @@ function get_logged_user_course_html($my_course, $count) {
if ( $my_course['date_start']=='0000-00-00' ) {
$session['dates'] = get_lang('WithoutTimeLimits');
if ( api_get_setting('show_session_coach') === 'true' ) {
$session['coach'] = get_lang('GeneralCoach').': '.$sessioncoach['lastname'].' '.$sessioncoach['firstname'];
$session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
}
$active = true;
} else {
$session ['dates'] = ' - '.get_lang('From').' '.$my_course['date_start'].' '.get_lang('To').' '.$my_course['date_end'];
if ( api_get_setting('show_session_coach') === 'true' ) {
$session['coach'] = get_lang('GeneralCoach').': '.$sessioncoach['lastname'].' '.$sessioncoach['firstname'];
$session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
}
$active = ($date_start <= $now && $date_end >= $now)?true:false;
}
@ -449,9 +449,15 @@ Display :: display_header(null);
$img_array= UserManager::get_user_picture_path_by_id($user_id,'web',true,true);
//print_r($user_info);
// Added by Ivan Tcholakov, 03-APR-2009.
if (USE_JQUERY_CORNERS_SCRIPT) {
//
echo $s="<script>$(document).ready( function(){
$('.rounded').corners();
});</script>";
//
}
//
//echo '<div id="actions">';
//echo '<a href="../auth/profile.php?show=1"">'.Display::return_icon('edit.gif').'&nbsp;'.api_convert_encoding(get_lang('EditInformation'),'UTF-8',$charset).'</a>';
@ -486,7 +492,7 @@ echo '<div class="actions-title">';
if ($user_id == api_get_user_id())
echo get_lang('ViewMySharedProfile');
else
echo get_lang('ViewSharedProfile').' - '.ucfirst($user_info['firstname']).' '.$user_info['lastname'];
echo get_lang('ViewSharedProfile').' - '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
echo '</div>';
@ -542,14 +548,14 @@ echo '<div id="social-profile-wrapper">';
while ($j<$number_of_images) {
if ($list_friends_file[$j]<>"") {
$my_user_info=api_get_user_info($list_friends_id[$j]);
$name_user=$my_user_info['firstName'].' '.$my_user_info['lastName'];
$name_user=api_get_person_name($my_user_info['firstName'], $my_user_info['lastName']);
$friend_html.='<div id=div_'.$list_friends_id[$j].' class="image_friend_network" ><span><center>';
// the height = 92 must be the sqme in the image_friend_network span style in default.css
$friends_profile = UserFriend::get_picture_user($list_friends_id[$j], $list_friends_file[$j], 92, 'medium_', 'width="85" height="90" ');
$friend_html.='<a href="profile.php?u='.$list_friends_id[$j].'&amp;'.$link_shared.'">';
$friend_html.='<img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' id="imgfriend_'.$list_friends_id[$j].'" title="'.$name_user.'" />';
$friend_html.= '</center></span>';
$friend_html.= '<center class="friend">'.$my_user_info['firstName'].' '.$my_user_info['lastName'].'</a></center>';
$friend_html.= '<center class="friend">'.api_get_person_name($my_user_info['firstName'], $my_user_info['lastName']).'</a></center>';
$friend_html.= '</div>';
}
$j++;
@ -702,7 +708,7 @@ echo '<div id="social-profile-container">';
echo '</div>';
} else {
echo '&nbsp;<a href="../messages/send_message_to_userfriend.inc.php?height=365&width=610&user_friend='.$user_id.'&view=profile&view_panel=1" class="thickbox" title="'.get_lang('SendMessage').'">'.Display::return_icon('message_new.png').'&nbsp;&nbsp;'.get_lang('SendMessage').'</a><br />';
//echo '&nbsp;&nbsp;<a href="#">'.get_lang('SendMessage').'</a>';
//echo '&nbsp;&nbsp;<a href="javascript: void(0);">'.get_lang('SendMessage').'</a>';
}
echo '</div>';
echo '<br />';
@ -831,7 +837,7 @@ echo '<div id="social-profile-container">';
<dd>'. $user_info['username'].' </dd>';
if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
echo '<dt>'.get_lang('Name').'</dt>
<dd>'. $user_info['firstname'].' '.$user_info['lastname'].'</dd>';
<dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
if (!empty($user_info['official_code']))
echo '<dt>'.get_lang('OfficialCode').'</dt>
<dd>'.$user_info['official_code'].'</dd>';
@ -849,7 +855,7 @@ echo '<div id="social-profile-container">';
echo '<dl>';
if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
echo '<dt>'.get_lang('Name').'</dt>
<dd>'. $user_info['firstname'].' '.$user_info['lastname'].'</dd>';
<dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
echo '</div>';
}

@ -27,7 +27,7 @@ $user_friend_relation=UserFriend::get_relation_between_contacts(api_get_user_id(
<td width="50%"><br/>
<img src="<?php echo Security::remove_XSS($img_user[1]); ?>" />
<?php
echo '<br /><br />'.$name_user=api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']);
echo '<br /><br />'.$name_user=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
?>
</td>
<td width="50%"><div align="left">

@ -60,7 +60,7 @@ cellpadding="0" cellspacing="0" bgcolor="#9DACBF">
<?php
$user_id=$list_get_invitation[$i]['user_sender_id'];
$user_info=api_get_user_info($user_id);
echo api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']);
echo api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
?></td>
</tr>
</table></td>

@ -10,16 +10,17 @@ $search=Database::escape_string(Security::remove_XSS($_POST['search']));
$current_date=date('Y-m-d H:i:s',time());
$html_form='<select id="id_search_name" name="id_search_name" size="8"" style="width:350px;">';
$user_id = api_get_user_id();
$is_western_name_order = api_is_western_name_order();
if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') {
$sql = 'SELECT DISTINCT u.user_id as id,concat(u.firstname," ",u.lastname," ","( ",u.email," )") as name
$sql = 'SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_my_user_friend.' uf ' .
'INNER JOIN '.$tbl_my_user.' AS u ON uf.friend_user_id = u.user_id ' .
'WHERE relation_type<>6 AND friend_user_id<>'.(int)$user_id.' AND concat(u.firstName,u.lastName) like CONCAT("%","'.$search.'","%") ';
'WHERE relation_type<>6 AND friend_user_id<>'.(int)$user_id.' AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") ';
} elseif (api_get_setting('allow_social_tool')=='false' && api_get_setting('allow_message_tool')=='true') {
$valid=api_get_setting('time_limit_whosonline');
$sql='SELECT DISTINCT u.user_id as id,concat(u.firstname," ",u.lastname," ","( ",u.email," )") as name
$sql='SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_my_user.' u INNER JOIN '.$track_online_table.' t ON u.user_id=t.login_user_id
WHERE DATE_ADD(login_date,INTERVAL "'.$valid.'" MINUTE) >= "'.$current_date.'" AND concat(u.firstName,u.lastName) like CONCAT("%","'.$search.'","%") ';
WHERE DATE_ADD(login_date,INTERVAL "'.$valid.'" MINUTE) >= "'.$current_date.'" AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") ';
}
$res=Database::query($sql,__FILE__,__LINE__);

@ -63,7 +63,7 @@ if (count($list_path_friends)!=0) {
while ($j<$number_of_images) {
if ($list_friends_file[$j]<>"") {
$user_info=api_get_user_info($list_friends_id[$j]);
$user_name=api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']) ;
$user_name=api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName']));
$friends_profile = UserFriend::get_picture_user($list_friends_id[$j], $list_friends_file[$j], 92);
$friend_html.='<div onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_'.$list_friends_id[$j].' >
<span><center><img src="'.$friends_profile['file'].'" '.$friends_profile['style'].' id="imgfriend_'.$list_friends_id[$j].'" title="'.$user_name.'" onclick=load_thick(\'qualify_contact.inc.php?path_user="'.urlencode($list_friends_dir[$j].$list_friends_file[$j]).'&amp;id_user="'.$list_friends_id[$j].'"\',"") /></center></span>

@ -215,7 +215,7 @@ if ((isset($_GET['action']) && $_GET['action'] == 'edit') && !empty($survey_id)
// Aditional Parameters
$form -> addElement('html','<div class="row">
<div class="label">
<a href="javascript://" onclick="advanced_parameters()" ><span id="plus_minus">&nbsp;'.Display::return_icon('div_show.gif',null,array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'</span></a>
<a href="javascript: void(0);" onclick="javascript: advanced_parameters();" ><span id="plus_minus">&nbsp;'.Display::return_icon('div_show.gif',null,array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'</span></a>
</div>
<div class="formw">
&nbsp;

@ -337,29 +337,49 @@ if ($survey_data['form_fields']!='' && $survey_data['anonymous'] == 0 && is_arra
'style' => 'width: 75%; float: ' . ($text_dir == 'rtl' ? 'right;' : 'left;')
));
if (api_is_western_name_order()) {
if ($list['firstname'] == 1 ) {
//FIRST NAME
$form->addElement('text', 'firstname', get_lang('FirstName'), array ('size' => 40));
if (api_get_setting('profile', 'name') !== 'true') {
$form->freeze(array ('firstname'));
}
$form->applyFilter(array ('firstname'), 'stripslashes');
$form->applyFilter(array ('firstname'), 'trim');
$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
}
if ($list['lastname'] == 1) {
// LAST NAME
$form->addElement('text', 'lastname', get_lang('LastName'), array ('size' => 40));
if (api_get_setting('profile', 'name') !== 'true')
if (api_get_setting('profile', 'name') !== 'true') {
$form->freeze(array ('lastname'));
}
$form->applyFilter(array ('lastname'), 'stripslashes');
$form->applyFilter(array ('lastname'), 'trim');
$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
}
} else {
if ($list['lastname'] == 1) {
// LAST NAME
$form->addElement('text', 'lastname', get_lang('LastName'), array ('size' => 40));
if (api_get_setting('profile', 'name') !== 'true') {
$form->freeze(array ('lastname'));
}
$form->applyFilter(array ('lastname'), 'stripslashes');
$form->applyFilter(array ('lastname'), 'trim');
$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
}
if ($list['firstname'] == 1 ) {
//FIRST NAME
$form->addElement('text', 'firstname', get_lang('FirstName'), array ('size' => 40));
if (api_get_setting('profile', 'name') !== 'true')
if (api_get_setting('profile', 'name') !== 'true') {
$form->freeze(array ('firstname'));
}
$form->applyFilter(array ('firstname'), 'stripslashes');
$form->applyFilter(array ('firstname'), 'trim');
$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
}
}
if ($list['official_code'] == 1) {
// OFFICIAL CODE

@ -1270,12 +1270,13 @@ class survey_manager
if ($all_user_info)
{
$order_clause = api_sort_by_first_name() ? ' ORDER BY user.firstname, user.lastname' : ' ORDER BY user.lastname, user.firstname';
$sql = "SELECT DISTINCT answered_user.user as invited_user, user.firstname, user.lastname, user.user_id
FROM $table_survey_answer answered_user
LEFT JOIN $table_user as user
ON answered_user.user = user.user_id
WHERE survey_id= '".Database::escape_string($survey_data['survey_id'])."'
ORDER BY user.lastname, user.firstname";
WHERE survey_id= '".Database::escape_string($survey_data['survey_id'])."'".
$order_clause;
}
else
{
@ -1299,16 +1300,6 @@ class survey_manager
}
class question
{
// the html code of the form
@ -2598,8 +2589,8 @@ class SurveyUtil {
echo '<a href="reporting.php?action=deleteuserreport&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;user='.Security::remove_XSS($_GET['user']).'" >'.Display::return_icon('delete.gif', get_lang('Delete')).' '.get_lang('DeleteSurveyByUser').'</a>';
// export the user report
echo '<a href="#" onclick="document.form1a.submit();">'.Display::return_icon('csv.gif', get_lang('ExportAsCSV')).' '.get_lang('ExportAsCSV').'</a> ';
echo '<a href="#" onclick="document.form1b.submit();">'.Display::return_icon('excel.gif', get_lang('ExportAsXLS')).' '.get_lang('ExportAsXLS').'</a> ';
echo '<a href="javascript: void(0);" onclick="document.form1a.submit();">'.Display::return_icon('csv.gif', get_lang('ExportAsCSV')).' '.get_lang('ExportAsCSV').'</a> ';
echo '<a href="javascript: void(0);" onclick="document.form1b.submit();">'.Display::return_icon('excel.gif', get_lang('ExportAsXLS')).' '.get_lang('ExportAsXLS').'</a> ';
echo '<form id="form1a" name="form1a" method="post" action="'.api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user_id='.Security::remove_XSS($_GET['user']).'">';
echo '<input type="hidden" name="export_report" value="export_report">';
echo '<input type="hidden" name="export_format" value="csv">';
@ -2630,7 +2621,7 @@ class SurveyUtil {
{
if ($survey_data['anonymous'] == 0)
{
$name = $person['lastname'].' '.$person['firstname'];
$name = api_get_person_name($person['firstname'], $person['lastname']);
$id = $person['user_id'];
if($id == ''){
$id = $person['invited_user'];
@ -3018,8 +3009,8 @@ class SurveyUtil {
echo '<input type="hidden" name="export_format" value="xls">';
echo '</form>';
echo '<form id="form2" name="form2" method="post" action="'.api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&survey_id='.Security::remove_XSS($_GET['survey_id']).'">';
//echo '<a class="survey_export_link" href="#" onclick="document.form1a.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
//echo '<a class="survey_export_link" href="#" onclick="document.form1b.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'excel.gif">&nbsp;'.get_lang('ExportAsXLS').'</a>';
//echo '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1a.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
//echo '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1b.submit();"><img align="absbottom" src="'.api_get_path(WEB_IMG_PATH).'excel.gif">&nbsp;'.get_lang('ExportAsXLS').'</a>';
// the table
echo '<br /><table class="data_table" border="1">';
// getting the number of options per question
@ -3182,7 +3173,7 @@ class SurveyUtil {
$rs = api_sql_query($sql, __FILE__, __LINE__);
if($row = Database::fetch_array($rs))
{
$user_displayed = $row['lastname'].' '.$row['firstname'];
$user_displayed = api_get_person_name($row['firstname'], $row['lastname']);
}
else
{
@ -3410,7 +3401,7 @@ class SurveyUtil {
$rs = api_sql_query($sql, __FILE__, __LINE__);
if($row = Database::fetch_array($rs))
{
$user_displayed = $row['lastname'].' '.$row['firstname'];
$user_displayed = api_get_person_name($row['firstname'], $row['lastname']);
}
else
{
@ -3667,7 +3658,7 @@ class SurveyUtil {
$rs = api_sql_query($sql, __FILE__, __LINE__);
if($row = Database::fetch_array($rs))
{
$user_displayed = $row['lastname'].' '.$row['firstname'];
$user_displayed = api_get_person_name($row['firstname'], $row['lastname']);
}
else
{
@ -4219,7 +4210,7 @@ class SurveyUtil {
$result = api_sql_query($sql, __FILE__, __LINE__);
$row = Database::fetch_array($result);
$recipient_email = $row['email'];
$recipient_name = $row['lastname'].' '.$row['firstname'];
$recipient_name = api_get_person_name($row['firstname'], $row['lastname'], null, PERSON_NAME_EMAIL_ADDRESS);
}
else {
/** @todo check if the address is a valid email */
@ -4227,7 +4218,7 @@ class SurveyUtil {
}
// sending the mail
$sender_name = $_user['lastName'].' '.$_user['firstName'];
$sender_name = api_get_person_name($_user['firstName'], $_user['lastName'], null, PERSON_NAME_EMAIL_ADDRESS);
$sender_email = $_user['mail'];
$replyto = array();
@ -4287,11 +4278,12 @@ class SurveyUtil {
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
// Selecting all the invitations of this survey AND the additional emailaddresses (the left join)
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
$sql = "SELECT user
FROM $table_survey_invitation as table_invitation
LEFT JOIN $table_user as table_user
ON table_invitation.user = table_user.user_id
WHERE survey_code='".Database::escape_string($survey_code)."' ORDER BY lastname, firstname";
WHERE survey_code='".Database::escape_string($survey_code)."'".$order_clause;
$defaults = array();
$defaults['course_users'] = array();
@ -4647,7 +4639,7 @@ class SurveyUtil {
CONCAT('<a href=\"survey.php?survey_id=',survey.survey_id,'\">',survey.title,'</a>') AS col1,
survey.code AS col2,
count(survey_question.question_id) AS col3,
CONCAT(user.firstname, ' ', user.lastname) AS col4,
".(api_is_western_name_order() ? "CONCAT(user.firstname, ' ', user.lastname)" : "CONCAT(user.lastname, ' ', user.firstname)")." AS col4,
survey.lang AS col5,
survey.avail_from AS col6,
survey.avail_till AS col7,
@ -4707,7 +4699,7 @@ class SurveyUtil {
survey.title AS col1,
survey.code AS col2,
count(survey_question.question_id) AS col3,
CONCAT(user.firstname, ' ', user.lastname) AS col4,
".(api_is_western_name_order() ? "CONCAT(user.firstname, ' ', user.lastname)" : "CONCAT(user.lastname, ' ', user.firstname)")." AS col4,
survey.lang AS col5,
survey.avail_from AS col6,
survey.avail_till AS col7,

@ -149,7 +149,7 @@ while ($row = mysql_fetch_assoc($res))
echo '<tr>';
if (is_numeric($row['user']))
{
echo ' <td><a href="../user/userInfo.php?editMainUserInfo='.$row['user'].'">'.$row['firstname'].' '.$row['lastname'].'</a></td>';
echo ' <td><a href="../user/userInfo.php?editMainUserInfo='.$row['user'].'">'.api_get_person_name($row['firstname'], $row['lastname']).'</a></td>';
}
else
{

@ -115,11 +115,11 @@ $form = new FormValidator('publish_form','post', api_get_self().'?survey_id='.$s
$form->addElement('header', '', $tool_name);
// Course users
$complete_user_list = CourseManager :: get_user_list_from_course_code($_course['id'], true, $_SESSION['id_session'], '', 'ORDER BY lastname');
$complete_user_list = CourseManager :: get_user_list_from_course_code($_course['id'], true, $_SESSION['id_session'], '', api_sort_by_first_name() ? 'ORDER BY firstname' : 'ORDER BY lastname');
$possible_users = array ();
foreach ($complete_user_list as $index => $user)
{
$possible_users[$user['user_id']] = $user['lastname'].' '.$user['firstname'];
$possible_users[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']);
}
$users = $form->addElement('advmultiselect', 'course_users', get_lang('CourseUsers'), $possible_users, 'style="width: 250px; height: 200px;"');
$users->setElementTemplate('

@ -33,7 +33,7 @@ $htmlHeadXtra[] = '<link rel="stylesheet" href="./main/inc/lib/javascript/thickb
$htmlHeadXtra[] = '<script type="text/javascript">
$(document).ready(function (){
$("input#id_btn_send_invitation").bind("click", function(){
if (confirm("'.get_lang('SendMessageInvitation').'")) {
if (confirm("'.get_lang('SendMessageInvitation', '').'")) {
$("#form_register_friend").submit();
}
});
@ -42,7 +42,7 @@ function change_panel (mypanel_id,myuser_id) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#id_content_panel").html("'.get_lang('Loading').'"); },
$("#id_content_panel").html("'.get_lang('Loading', '').'"); },
type: "POST",
url: "main/messages/send_message.php",
data: "panel_id="+mypanel_id+"&user_id="+myuser_id,
@ -61,14 +61,14 @@ function action_database_panel(option_id,myuser_id) {
}
my_txt_content=$("#txt_area_invite").val();
if (my_txt_content.length==0 || my_txt_subject.length==0) {
$("#display_response_id").html("&nbsp;&nbsp;&nbsp;'.get_lang('MessageEmptyMessageOrSubject').'");
$("#display_response_id").html("&nbsp;&nbsp;&nbsp;'.get_lang('MessageEmptyMessageOrSubject', '').'");
setTimeout("message_information_display()",3000);
return false;
}
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {
$("#display_response_id").html("'.get_lang('Loading').'"); },
$("#display_response_id").html("'.get_lang('Loading', '').'"); },
type: "POST",
url: "main/messages/send_message.php",
data: "panel_id="+option_id+"&user_id="+myuser_id+"&txt_subject="+my_txt_subject+"&txt_content="+my_txt_content,

Loading…
Cancel
Save