소스 검색

[svn r16401] order users invited by lastname, firstname

Eric Marguin 16 년 전
부모
커밋
23bf77d049
1개의 변경된 파일10개의 추가작업 그리고 5개의 파일을 삭제
  1. 10 5
      main/survey/survey.lib.php

+ 10 - 5
main/survey/survey.lib.php

@@ -24,7 +24,7 @@
 *	@package dokeos.survey
 *	@package dokeos.survey
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code
 	@author Julio Montoya Armas <gugli100@gmail.com>, Dokeos: Personality Test modification and rewriting large parts of the code
 	@author Julio Montoya Armas <gugli100@gmail.com>, Dokeos: Personality Test modification and rewriting large parts of the code
-* 	@version $Id: survey.lib.php 16249 2008-09-05 15:46:31Z elixir_inter $
+* 	@version $Id: survey.lib.php 16401 2008-09-21 17:45:28Z elixir_inter $
 *
 *
 * 	@todo move this file to inc/lib
 * 	@todo move this file to inc/lib
 * 	@todo use consistent naming for the functions (save vs store for instance)
 * 	@todo use consistent naming for the functions (save vs store for instance)
@@ -4101,10 +4101,15 @@ class SurveyUtil {
 	{
 	{
 		// Database table definition
 		// Database table definition
 		$table_survey_invitation 	= Database :: get_course_table(TABLE_SURVEY_INVITATION);
 		$table_survey_invitation 	= Database :: get_course_table(TABLE_SURVEY_INVITATION);
-	
-		// Selecting all the invitations of this survey
-		$sql = "SELECT user FROM $table_survey_invitation WHERE survey_code='".Database::escape_string($survey_code)."'";
-	
+	 	$table_user = Database :: get_main_table(TABLE_MAIN_USER);
+	 	
+        // Selecting all the invitations of this survey
+        $sql = "SELECT user 
+                FROM $table_survey_invitation as table_invitation
+                INNER 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";	
+		
 		$defaults = array();
 		$defaults = array();
 		$defaults['course_users'] = array();
 		$defaults['course_users'] = array();
 		$defaults['additional_users'] = '';
 		$defaults['additional_users'] = '';