Bug #3646 and Issue #306 - Messages, metadata and training reports (part 1): Fixing person name order and sorting to be dependable on the internationalization settings.

skala
Ivan Tcholakov 16 years ago
parent 150163859a
commit 6b7bd06ddb
  1. 4
      main/messages/new_message.php
  2. 2
      main/messages/send_message.php
  3. 4
      main/messages/send_message_to_userfriend.inc.php
  4. 2
      main/metadata/md_document.php
  5. 2
      main/metadata/md_link.php
  6. 4
      main/mySpace/access_details.php
  7. 86
      main/mySpace/admin.php

@ -198,7 +198,7 @@ if (isset($_GET['rs'])) {
'name' => get_lang('SocialNetwork') 'name' => get_lang('SocialNetwork')
); );
} else { } else {
$interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('Messages')); $interbreadcrumb[] = array ('url' => 'javascript: void(0);', 'name' => get_lang('Messages'));
$interbreadcrumb[]= array ( $interbreadcrumb[]= array (
'url' => 'outbox.php', 'url' => 'outbox.php',
'name' => get_lang('Outbox') 'name' => get_lang('Outbox')
@ -209,7 +209,7 @@ if (isset($_GET['rs'])) {
); );
} }
$interbreadcrumb[]= array ( $interbreadcrumb[]= array (
'url' => '#', 'url' => 'javascript: void(0);',
'name' => get_lang('ComposeMessage') 'name' => get_lang('ComposeMessage')
); );

@ -51,7 +51,7 @@ if ($panel_id==2) {
} }
if ($panel_id==1) { if ($panel_id==1) {
?> ?>
<td height="20"><?php echo api_xml_http_response_encode(get_lang('To')); ?> &nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<?php echo api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']); ?></td> <td height="20"><?php echo api_xml_http_response_encode(get_lang('To')); ?> &nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;<?php echo api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName'])); ?></td>
<td height="20"><?php echo api_xml_http_response_encode(get_lang('Subject')); ?> :<br/><input id="txt_subject_id" type="text" style="width:200px;"></td> <td height="20"><?php echo api_xml_http_response_encode(get_lang('Subject')); ?> :<br/><input id="txt_subject_id" type="text" style="width:200px;"></td>
<td height="20"><?php echo api_xml_http_response_encode(get_lang('Message')); ?> :<br/><textarea id="txt_area_invite" rows="3" cols="25"></textarea></td> <td height="20"><?php echo api_xml_http_response_encode(get_lang('Message')); ?> :<br/><textarea id="txt_area_invite" rows="3" cols="25"></textarea></td>
<td height="20"><input type="button" value="<?php echo api_xml_http_response_encode(get_lang('NewMessage')); ?>" onclick="hide_display_message()" />&nbsp;&nbsp;&nbsp; <input type="button" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>" onclick="action_database_panel('5','<?php echo $user_id;?>')" /></td> <td height="20"><input type="button" value="<?php echo api_xml_http_response_encode(get_lang('NewMessage')); ?>" onclick="hide_display_message()" />&nbsp;&nbsp;&nbsp; <input type="button" value="<?php echo api_xml_http_response_encode(get_lang('SendMessage')); ?>" onclick="action_database_panel('5','<?php echo $user_id;?>')" /></td>

@ -34,7 +34,7 @@ if ( isset($_REQUEST['user_friend']) ) {
<img class="message-image-info" src="<?php echo $info_path_friend['dir'].$info_path_friend['file']; ?>"/> <img class="message-image-info" src="<?php echo $info_path_friend['dir'].$info_path_friend['file']; ?>"/>
<?php <?php
if ($panel != 1) { if ($panel != 1) {
echo '<br /><center>'.api_xml_http_response_encode($info_user_friend['firstName'].' '.$info_user_friend['lastName']).'</center>'; echo '<br /><center>'.api_xml_http_response_encode(api_get_person_name($info_user_friend['firstName'], $info_user_friend['lastName'])).'</center>';
} }
?> ?>
</div> </div>
@ -46,7 +46,7 @@ if ( isset($_REQUEST['user_friend']) ) {
if ($panel == 1) { if ($panel == 1) {
//normal message //normal message
$user_info=api_get_user_info($userfriend_id); $user_info=api_get_user_info($userfriend_id);
echo api_xml_http_response_encode(get_lang('To')); ?> :&nbsp;&nbsp;&nbsp;&nbsp;<?php echo api_xml_http_response_encode($user_info['firstName'].' '.$user_info['lastName']); ?> echo api_xml_http_response_encode(get_lang('To')); ?> :&nbsp;&nbsp;&nbsp;&nbsp;<?php echo api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName'])); ?>
<br /> <br />
<br /><?php echo api_xml_http_response_encode(get_lang('Subject')); ?> :<br /><input id="txt_subject_id" type="text" style="width:300px;"><br/> <br /><?php echo api_xml_http_response_encode(get_lang('Subject')); ?> :<br /><input id="txt_subject_id" type="text" style="width:300px;"><br/>
<br /><?php echo api_xml_http_response_encode(get_lang('Message')); ?> :<br /><textarea id="txt_area_invite" rows="4" cols="41"></textarea> <br /><?php echo api_xml_http_response_encode(get_lang('Message')); ?> :<br /><textarea id="txt_area_invite" rows="4" cols="41"></textarea>

@ -90,7 +90,7 @@ function mdo_generate_default_xml_metadata()
if (isset($_user)) if (isset($_user))
{ {
$xhtDoc->xht_param['author'] = "BEGIN:VCARD\\nFN:" . $xhtDoc->xht_param['author'] = "BEGIN:VCARD\\nFN:" .
$_user['firstName']." ".$_user['lastName'] . api_get_person_name($_user['firstName'], $_user['lastName'], null, PERSON_NAME_EMAIL_ADDRESS) .
"\\nEMAIL:".$_user['mail'] . "\\nEND:VCARD\\n"; "\\nEMAIL:".$_user['mail'] . "\\nEND:VCARD\\n";
} }

@ -90,7 +90,7 @@ function mdo_generate_default_xml_metadata()
if (isset($_user)) if (isset($_user))
{ {
$xhtDoc->xht_param['author'] = "BEGIN:VCARD\\nFN:" . $xhtDoc->xht_param['author'] = "BEGIN:VCARD\\nFN:" .
$_user['firstName']." ".$_user['lastName'] . api_get_person_name($_user['firstName'], $_user['lastName'], null, PERSON_NAME_EMAIL_ADDRESS) .
"\\nEMAIL:".$_user['mail'] . "\\nEND:VCARD\\n"; "\\nEMAIL:".$_user['mail'] . "\\nEND:VCARD\\n";
} }

@ -112,7 +112,7 @@ if (api_is_xml_http_request()) {
$DataSet->AddAllSeries(); $DataSet->AddAllSeries();
$DataSet->RemoveSerie('Date'); $DataSet->RemoveSerie('Date');
$DataSet->SetAbsciseLabelSerie('Date'); $DataSet->SetAbsciseLabelSerie('Date');
$DataSet->SetYAxisName(api_ucfirst(get_lang('MinMinutes'))); $DataSet->SetYAxisName(get_lang('Minutes'));
$graph_id = api_get_user_id().'AccessDetails'.api_get_course_id(); $graph_id = api_get_user_id().'AccessDetails'.api_get_course_id();
$DataSet->AddAllSeries(); $DataSet->AddAllSeries();
@ -216,7 +216,7 @@ foreach ($connections as $key=>$data) {
} }
api_display_tool_title(get_lang('DetailsStudentInCourse')); api_display_tool_title(get_lang('DetailsStudentInCourse'));
echo '<div class="actions">'; echo '<div class="actions">';
echo '<strong>'.get_lang('User').': '.$mainUserInfo['firstName'].' '.$mainUserInfo['lastName'].'</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>'.get_lang('Course').': '.$course_code.'</strong></div>'; echo '<strong>'.get_lang('User').': '.api_get_person_name($mainUserInfo['firstName'], $mainUserInfo['lastName']).'</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>'.get_lang('Course').': '.$course_code.'</strong></div>';
?> ?>
<div id="container-9"> <div id="container-9">

@ -34,12 +34,12 @@ $tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
=============================================================================== ===============================================================================
*/ */
function exportCsv($a_header,$a_data) function exportCsv($a_header,$a_data)
{ {
global $archiveDirName; global $archiveDirName;
$fileName = 'administrators.csv'; $fileName = 'administrators.csv';
$archivePath = api_get_path(SYS_PATH).$archiveDirName.'/'; $archivePath = api_get_path(SYS_ARCHIVE_PATH);
$archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='; $archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
if(!$open = fopen($archivePath.$fileName,'w+')) if(!$open = fopen($archivePath.$fileName,'w+'))
@ -56,7 +56,6 @@ $tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
} }
$info .= "\r\n"; $info .= "\r\n";
foreach($a_data as $data) foreach($a_data as $data)
{ {
foreach($data as $infos) foreach($data as $infos)
@ -76,7 +75,7 @@ $tbl_admin = Database :: get_main_table(TABLE_MAIN_ADMIN);
} }
return $message; return $message;
} }
/** /**
@ -89,15 +88,33 @@ les stagiaires dont il est le
responsable. responsable.
*/ */
if (isset($_POST['export'])) {
$order_clause = ' ORDER BY lastname ASC';
} else {
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
}
$sqlAdmins = " SELECT user.user_id,lastname,firstname,email $sqlAdmins = " SELECT user.user_id,lastname,firstname,email
FROM $tbl_user as user, $tbl_admin as admin FROM $tbl_user as user, $tbl_admin as admin
WHERE admin.user_id=user.user_id WHERE admin.user_id=user.user_id".$order_clause;
ORDER BY lastname ASC
"; $resultAdmins = api_sql_query($sqlAdmins, __FILE__, __LINE__);
$resultAdmins = api_sql_query($sqlAdmins); if (api_is_western_name_order()) {
echo '<table class="data_table">
echo '<table class="data_table"> <tr>
<th>
'.get_lang('FirstName').'
</th>
<th>
'.get_lang('LastName').'
</th>
<th>
'.get_lang('Email').'
</th>
</tr>
';
} else {
echo '<table class="data_table">
<tr> <tr>
<th> <th>
'.get_lang('LastName').' '.get_lang('LastName').'
@ -110,6 +127,7 @@ echo '<table class="data_table">
</th> </th>
</tr> </tr>
'; ';
}
$a_header[]=get_lang('LastName'); $a_header[]=get_lang('LastName');
$a_header[]=get_lang('FirstName'); $a_header[]=get_lang('FirstName');
@ -124,58 +142,45 @@ if(mysql_num_rows($resultAdmins)>0){
$s_firstname=$a_admins["firstname"]; $s_firstname=$a_admins["firstname"];
$s_email=$a_admins["email"]; $s_email=$a_admins["email"];
if($i%2==0){ if ($i%2==0) {
$s_css_class="row_odd"; $s_css_class="row_odd";
if ($i%20==0 && $i!=0) {
if($i%20==0 && $i!=0){ if (api_is_western_name_order()) {
echo '<tr> echo '<tr><th>'.get_lang('FirstName').'</th><th>'.get_lang('LastName').'</th><th>'.get_lang('Email').'</th></tr>';
<th> } else {
'.get_lang('LastName').' echo '<tr><th>'.get_lang('LastName').'</th><th>'.get_lang('FirstName').'</th><th>'.get_lang('Email').'</th></tr>';
</th> }
<th>
'.get_lang('FirstName').'
</th>
<th>
'.get_lang('Email').'
</th>
</tr>';
} }
} else {
}
else{
$s_css_class="row_even"; $s_css_class="row_even";
} }
$i++; $i++;
echo "<tr class=".$s_css_class."><td>$s_lastname</td><td>$s_firstname</td><td><a href='mailto:".$s_email."'>$s_email</a></td></tr>"; if (api_is_western_name_order()) {
echo "<tr class=".$s_css_class."><td>$s_firstname</td><td>$s_lastname</td><td><a href='mailto:".$s_email."'>$s_email</a></td></tr>";
} else {
echo "<tr class=".$s_css_class."><td>$s_lastname</td><td>$s_firstname</td><td><a href='mailto:".$s_email."'>$s_email</a></td></tr>";
}
$a_data[$i_user_id]["lastname"]=$s_lastname; $a_data[$i_user_id]["lastname"]=$s_lastname;
$a_data[$i_user_id]["firstname"]=$s_firstname; $a_data[$i_user_id]["firstname"]=$s_firstname;
$a_data[$i_user_id]["email"]=$s_email; $a_data[$i_user_id]["email"]=$s_email;
} }
} }
//No results //No results
else{ else {
echo '<tr><td colspan="3" "align=center">'.get_lang("NoResults").'</td></tr>'; echo '<tr><td colspan="3" "align=center">'.get_lang("NoResults").'</td></tr>';
} }
echo '</table>'; echo '</table>';
if(isset($_POST['export'])){ if(isset($_POST['export'])){
exportCsv($a_header,$a_data); exportCsv($a_header,$a_data);
} }
echo "<br /><br />"; echo "<br /><br />";
echo "<form method='post' action='admin.php'> echo " <form method='post' action='admin.php'>
<button type='submit' class='save' name='export' value='".get_lang('exportExcel')."'>".get_lang('exportExcel')."</button> <button type='submit' class='save' name='export' value='".get_lang('exportExcel')."'>".get_lang('exportExcel')."</button>
<form>"; <form>";
@ -186,4 +191,3 @@ echo "<form method='post' action='admin.php'>
*/ */
Display::display_footer(); Display::display_footer();
?>

Loading…
Cancel
Save