Browse Source

[svn r21665] logic changes - Allow register student, in group - (partial FS#4366)

Isaac Flores 15 years ago
parent
commit
939807eccb
3 changed files with 22 additions and 13 deletions
  1. 12 3
      main/group/group.php
  2. 8 8
      main/group/group_space.php
  3. 2 2
      main/inc/lib/groupmanager.lib.php

+ 12 - 3
main/group/group.php

@@ -1,4 +1,4 @@
-<?php // $Id: group.php 20611 2009-05-13 22:21:08Z iflorespaz $
+<?php // $Id: group.php 21665 2009-06-30 00:14:57Z iflorespaz $
  
 /*
 ==============================================================================
@@ -46,12 +46,21 @@
 */
 // name of the language file that needs to be included
 $language_file = 'group';
-include ('../inc/global.inc.php');
+require_once '../inc/global.inc.php';
 $this_section=SECTION_COURSES;
 
 // notice for unauthorized people.
 api_protect_course_script(true); 
- 
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
+$htmlHeadXtra[] = '<script type="text/javascript">
+$(document).ready( function() {
+	for (i=0;i<$(".actions").length;i++) {
+		if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {
+			$(".actions:eq("+i+")").hide();
+		}		
+	}
+ } ); 
+ </script>';
 $nameTools = get_lang('GroupManagement');
 
 /*

+ 8 - 8
main/group/group_space.php

@@ -1,4 +1,4 @@
-<?php //$Id: group_space.php 20611 2009-05-13 22:21:08Z iflorespaz $
+<?php //$Id: group_space.php 21665 2009-06-30 00:14:57Z iflorespaz $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -38,24 +38,24 @@
 */
 // name of the language file that needs to be included
 $language_file = "group";
-include ('../inc/global.inc.php');
+require_once '../inc/global.inc.php';
 /*
 -----------------------------------------------------------
 	Libraries & config files
 -----------------------------------------------------------
 */
-include_once (api_get_path(LIBRARY_PATH).'course.lib.php');
-include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
-include_once (api_get_path(LIBRARY_PATH).'sortabletable.class.php');
-require_once (api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php');
-require_once (api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php');
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
+require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
+require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
+require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
+require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
 /*
 ==============================================================================
 		MAIN CODE
 ==============================================================================
 */
 $current_group = GroupManager :: get_group_properties($_SESSION['_gid']);
-if(!is_array($current_group) ) {
+if (!is_array($current_group) ) {
 //display some error message
 }
 

+ 2 - 2
main/inc/lib/groupmanager.lib.php

@@ -157,9 +157,9 @@ class GroupManager
 						ug.user_id is_member,
 						COUNT(ug2.id) number_of_members
 					FROM ".$table_group." `g`
-					INNER JOIN ".$table_group_user." `ug`
+					LEFT JOIN ".$table_group_user." `ug`
 					ON `ug`.`group_id` = `g`.`id` AND `ug`.`user_id` = '".$_user['user_id']."'
-					INNER JOIN ".$table_group_user." `ug2`
+					LEFT JOIN ".$table_group_user." `ug2`
 					ON `ug2`.`group_id` = `g`.`id`";
 		}