Juan Carlos Raña преди 15 години
родител
ревизия
9e5262723e
променени са 2 файла, в които са добавени 21 реда и са изтрити 21 реда
  1. 11 11
      main/wiki/index.php
  2. 10 10
      main/wiki/wiki.inc.php

+ 11 - 11
main/wiki/index.php

@@ -364,7 +364,7 @@ if ($_GET['view'])
 
 						$userinfo=Database::get_user_info_from_id($last_row['is_editing']);
 
-						$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
+						$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
 						Display::display_normal_message($is_being_edited, false);
 
 					}
@@ -585,7 +585,7 @@ if ($_GET['action']=='mactiveusers')
 			$userinfo=Database::get_user_info_from_id($obj->user_id);
 			$row = array ();
 
-			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
+			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
 			$row[] ='<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($obj->user_id).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.$obj->NUM_EDIT.'</a>';
 			$rows[] = $row;
 		}
@@ -605,7 +605,7 @@ if ($_GET['action']=='usercontrib')
 {
 	$userinfo=Database::get_user_info_from_id(Security::remove_XSS($_GET['user_id']));
 
-	echo '<div class="actions">'.get_lang('UserContributions').': <a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a></div>';
+	echo '<div class="actions">'.get_lang('UserContributions').': <a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a><a href="'.api_get_self().'?cidReq='.$_course[id].'&action=usercontrib&user_id='.urlencode($row['user_id']).'&group_id='.Security::remove_XSS($_GET['group_id']).'"></a></div>';
 
 
 	if(api_is_allowed_to_edit() || api_is_platform_admin()) //only by professors if page is hidden
@@ -1147,7 +1147,7 @@ if ($_GET['action']=='links')
 				$row = array ();
 				$row[] =$ShowAssignment;
 				$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode($obj->reflink).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.Security::remove_XSS($obj->title).'</a>';
-				$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
+				$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
 				$row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
 				$rows[] = $row;
 			}
@@ -1462,7 +1462,7 @@ if ($_GET['action']=='edit')
 
 					$userinfo=Database::get_user_info_from_id($row['is_editing']);
 
-					$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
+					$is_being_edited= get_lang('ThisPageisBeginEditedBy').' <a href=../user/userInfo.php?uInfo='.$userinfo['user_id'].'>'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a>. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').'';
 					Display::display_normal_message($is_being_edited, false);
 					exit;
 				}
@@ -1754,7 +1754,7 @@ if ($_GET['action']=='history' or Security::remove_XSS($_POST['HistoryDifference
 				echo ' '.get_lang('By').' ';
 				if ($row['user_id']<>0)
 				{
-					echo '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>';
+					echo '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a>';
 				}
 				else
 				{
@@ -1952,7 +1952,7 @@ if ($_GET['action']=='recentchanges')
 			$row[] = $ShowAssignment.$icon_task;
 			$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode($obj->reflink).'&amp;view='.$obj->id.'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.$obj->title.'</a>';
 			$row[] = $obj->version>1 ? get_lang('EditedBy') : get_lang('AddedBy');
-			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
+			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
 			$rows[] = $row;
 		}
 
@@ -2039,7 +2039,7 @@ if ($_GET['action']=='allpages')
 			$row = array ();
 			$row[] =$ShowAssignment.$icon_task;
 			$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode(Security::remove_XSS($obj->reflink)).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.Security::remove_XSS($obj->title).'</a>';
-			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
+			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '. $userinfo['firstname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
 			$row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
 
 			if(api_is_allowed_to_edit()|| api_is_platform_admin())
@@ -2187,7 +2187,7 @@ if ($_GET['action']=='discuss')
 
 			echo $icon_assignment.'&nbsp;&nbsp;&nbsp;'.$row['title'];
 
-			echo ' ('.get_lang('MostRecentVersionBy').' <a href="../user/userInfo.php?uInfo='.$lastuserinfo['user_id'].'">'.api_get_person_name($lastuserinfo['firstname'], $lastuserinfo['lastname']).'</a> '.$lastversiondate.$countWPost.')'.$avg_WPost_score.' '; //TODO: read avg score
+			echo ' ('.get_lang('MostRecentVersionBy').' <a href="../user/userInfo.php?uInfo='.$lastuserinfo['user_id'].'">'.api_get_person_name($lastuserinfo['lastname'].', '.$lastuserinfo['firstname']).'</a> '.$lastversiondate.$countWPost.')'.$avg_WPost_score.' '; //TODO: read avg score
 
 			echo '</div>';
 
@@ -2303,7 +2303,7 @@ if ($_GET['action']=='discuss')
 
 				require_once api_get_path(INCLUDE_PATH).'/lib/usermanager.lib.php';
 				$user_id=$row['userc_id'];
-				$name = api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
+				$name = api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']);
 				$attrb=array();
 				if ($user_id<>0)
 				{
@@ -2359,7 +2359,7 @@ if ($_GET['action']=='discuss')
 			echo '<p><table>';
 			echo '<tr>';
 			echo '<td rowspan="2">'.$author_photo.'</td>';
-			echo '<td style=" color:#999999"><a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a> ('.$author_status.') '.$row['dtime'].' - '.get_lang('Rating').': '.$row['p_score'].' '.$imagerating.' </td>';
+			echo '<td style=" color:#999999"><a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a> ('.$author_status.') '.$row['dtime'].' - '.get_lang('Rating').': '.$row['p_score'].' '.$imagerating.' </td>';
 			echo '</tr>';
 			echo '<tr>';
 			echo '<td>'.$row['comment'].'</td>';

+ 10 - 10
main/wiki/wiki.inc.php

@@ -1593,7 +1593,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
 		//first, current author and time
 		//Who is the author?
 		$userinfo=	Database::get_user_info_from_id($lastuser);
-		$email_user_author= get_lang('EditedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
+		$email_user_author= get_lang('EditedBy').': '.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']);
 
 		//When ?
 		$year = substr($lastime, 0, 4);
@@ -1632,7 +1632,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
 		//first, current author and time
 		//Who is the author of last message?
 		$userinfo=	Database::get_user_info_from_id($lastuser);
-		$email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
+		$email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']);
 
 		//When ?
 		$year = substr($lastime, 0, 4);
@@ -1679,7 +1679,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
 
 		//Who is the author?
 		$userinfo=	Database::get_user_info_from_id($row['user_id']);
-		$email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
+		$email_user_author= get_lang('AddedBy').': '.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']);
 
 		//When ?
 		$year = substr($row['dtime'], 0, 4);
@@ -1718,7 +1718,7 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
 
 		//Who is the author?
 		$userinfo=	Database::get_user_info_from_id(api_get_user_id());	//current user
-		$email_user_author= get_lang('DeletedBy').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
+		$email_user_author= get_lang('DeletedBy').': '.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']);
 
 
 		//When ?
@@ -1741,12 +1741,12 @@ function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='')
 			if(empty($charset)){$charset='ISO-8859-1';}
 			$headers = 'Content-Type: text/html; charset='. $charset;
 			$userinfo = Database::get_user_info_from_id($row['user_id']);	//$row['user_id'] obtained from tbl_wiki_mailcue
-			$name_to = api_get_person_name($userinfo['firstname'], $userinfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS);
+			$name_to = api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname'], null, PERSON_NAME_EMAIL_ADDRESS);
 			$email_to = $userinfo['email'];
 			$sender_name = api_get_setting('emailAdministrator');
 			$sender_email = api_get_setting('emailAdministrator');
 			$email_subject = get_lang('EmailWikiChanges').' - '.$_course['official_code'];
-			$email_body = get_lang('DearUser').' '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).',<br /><br />';
+			$email_body = get_lang('DearUser').' '.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).',<br /><br />';
 			$email_body .= $emailtext.' <strong>'.$_course['name'].' - '.$group_name.'</strong><br /><br /><br />';
 			$email_body .= $email_user_author.' ('.$email_date_changes.')<br /><br /><br />';
 			$email_body .= $email_assignment.'<br /><br /><br />';
@@ -1881,7 +1881,7 @@ function auto_add_page_users($assignment_type)
 	$link2teacher=$_POST['title']= $title_orig."_uass".api_get_user_id();
 
 	//first: teacher name, photo, and assignment description (original content)
-    $content_orig_A='<div align="center" style="font-size:24px; background-color: #F5F8FB;  border:double">'.$photo.get_lang('Teacher').': '.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</div><br/><div>';
+    $content_orig_A='<div align="center" style="font-size:24px; background-color: #F5F8FB;  border:double">'.$photo.get_lang('Teacher').': '.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</div><br/><div>';
 	$content_orig_B='<h1>'.get_lang('AssignmentDescription').'</h1></div><br/>'.$_POST['content'];
 
     //Second: student list (names, photo and links to their works).
@@ -1896,7 +1896,7 @@ function auto_add_page_users($assignment_type)
 			$image_path = UserManager::get_user_picture_path_by_id($assig_user_id,'web',false, true);
 			$image_repository = $image_path['dir'];
 			$existing_image = $image_path['file'];
-			$name = api_get_person_name($o_user_to_add['firstname'], $o_user_to_add['lastname']);
+			$name = api_get_person_name($o_user_to_add['lastname'].', '.$o_user_to_add['firstname']);
 			$photo= '<img src="'.$image_repository.$existing_image.'" alt="'.$name.'"  width="40" height="50" align="bottom" title="'.$name.'"  />';
 
 			$is_tutor_of_group = GroupManager :: is_tutor_of_group($assig_user_id,$_clean['group_id']); //student is tutor
@@ -1926,7 +1926,7 @@ function auto_add_page_users($assignment_type)
 				$_POST['content']='<div align="center" style="font-size:24px; background-color: #F5F8FB;  border:double">'.$photo.get_lang('Student').': '.$name.'</div>[['.$link2teacher.' | '.get_lang('AssignmentLinktoTeacherPage').']] '; //If $content_orig_B is added here, the task written by the professor was copied to the page of each student. TODO: config options
 
 			   //AssignmentLinktoTeacherPage
-			 	$all_students_pages[] = '<li>'.api_get_person_name($o_user_to_add['firstname'], $o_user_to_add['lastname']).' [['.$_POST['title']."_uass".$assig_user_id.' | '.$photo.']] '.$status_in_group.'</li>';
+			 	$all_students_pages[] = '<li>'.strtoupper(api_get_person_name($o_user_to_add['lastname'].', '.$o_user_to_add['firstname'])).' [['.$_POST['title']."_uass".$assig_user_id.' | '.$photo.']] '.$status_in_group.'</li>';
 
 				$_POST['assignment']=2;
 
@@ -2031,7 +2031,7 @@ function display_wiki_search_results($search_term, $search_content=0)
 			$row = array ();
 			$row[] =$ShowAssignment;
 			$row[] = '<a href="'.api_get_self().'?cidReq='.$_course[id].'&action=showpage&title='.urlencode($obj->reflink).'&group_id='.Security::remove_XSS($_GET['group_id']).'">'.$obj->title.'</a>';
-			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['firstname'], $userinfo['lastname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
+			$row[] = $obj->user_id <>0 ? '<a href="../user/userInfo.php?uInfo='.$userinfo['user_id'].'">'.api_get_person_name($userinfo['lastname'].', '.$userinfo['firstname']).'</a>' : get_lang('Anonymous').' ('.$obj->user_ip.')';
 			$row[] = $year.'-'.$month.'-'.$day.' '.$hours.":".$minutes.":".$seconds;
 
 			if(api_is_allowed_to_edit()|| api_is_platform_admin())