[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /html/res/adm/pages grps.gif /interface mydesk.tab /lonnet/perl lonnet.pm doc/loncapafiles loncapafiles.lpml

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 21 Nov 2005 19:08:29 -0000


raeburn		Mon Nov 21 14:08:29 2005 EDT

  Added files:                 
    /loncom/html/res/adm/pages	grps.gif 

  Modified files:              
    /loncom/interface	mydesk.tab 
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom/auth	lonroles.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Adding link to Groups in inline menu, adding GRPS button, adding request.course.groups to %env to allow easy access to a user's active groups.
  
  
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.66 loncom/interface/mydesk.tab:1.67
--- loncom/interface/mydesk.tab:1.66	Mon Oct 10 11:38:18 2005
+++ loncom/interface/mydesk.tab	Mon Nov 21 14:08:16 2005
@@ -34,7 +34,7 @@
 4:3:pvgr:$crs:stat.gif:course[_6]:stats[_1]:gopost('/adm/statistics','Problem Statistics');:View course assessment statistics
 5:1:clear
 5:1:courseenv_student_classlist_view:any:clst.gif:course[_12]:roster[_1]:go('/adm/viewclasslist');:View course roster
-5:1:pcst:$crs:enrl.gif:course[_7]:enroll[_1]:go('/adm/dropadd');:Drop/Add students in this course
+5:1:pcst:$crs:enrl.gif:course[_7]:enroll[_1]:go('/adm/dropadd');:Manage student enrollment and groups in this course
 5:1:pmky:$requested_domain:keys.gif:manage[_1]:acc keys[_1]:go('/adm/managekeys');:Manage Access Keys
 5:2:clear
 5:2:pcst:$crs:cprv.gif:user[_1]:roles[_1]:go('/adm/createuser');:Create a user or modify the roles and privileges of a user
@@ -54,7 +54,10 @@
 6:3:clear
 6:3:pccc:$requested_domain:mcrs.gif:modify:course:go('/adm/modifycourse');:Modify course settings
 7:1:clear
-7:1:pgan:$crs:new.gif:what is[_1]:new[_2]:go('/adm/whatsnew');:What's new?
+7:1:course:any:grps.gif:course[_10]:groups[_1]:go('/adm/coursegroups');:Enter my groups in the course
+7:1:course_vcg:any:grps.gif:course[_11]:groups[_2]:go('/adm/coursegroups');:Enter any group in the course
+7:1:course_mdg:any:grps.gif:course[_12]:groups[_3]:go('/adm/coursegroups');:Edit any group in the course
+7:1:pgan:$crs:new.gif:what is[_1]:new[_1]:go('/adm/whatsnew');:What's new?
 7:2:clear
 7:2:adv:rcm:egrd.gif:enter[_1]:grades[_2]:go('/adm/grades');:Enter grades from check-out assessment resources
 7:2:pusc:$requested_domain:sctr.gif:send[_1]:scantron[_1]:gocmd('/adm/grades','scantronupload');:Send Scantron data to a course
@@ -64,9 +67,9 @@
 10:2:any:any:com.gif:commu-[_1]:nication[_1]:go('/adm/communicate');:Send and receive messages
 10:3:clear
 10:3:ppsa:$requested_domain:mail.gif:bulk[_1]:e-mail[_1]:go('/adm/notify');:Send and display broadcast e-mail
-10:3:course_plc:any:bchat.gif:course[_10]:chat[_1]:chat_win();:Enter the chatroom for the course
+10:3:course_plc:any:bchat.gif:course[_13]:chat[_1]:chat_win();:Enter the chatroom for the course
 11:1:clear
-11:1:course:any:src.gif:search[_1]:course[_11]:go('/adm/searchcat');:Search the contents of this course
+11:1:course:any:src.gif:search[_1]:course[_14]:go('/adm/searchcat');:Search the contents of this course
 11:1:pbre:$requested_domain:src.gif:search[_2]:library[_1]:go('/adm/searchcat');:Search the database of published resources
 11:2:any:any:pref.gif:prefer-[_1]:ences[_1]:go('/adm/preferences');:Set my user preferences
 11:3:any:any:logout.gif:exit[_1]: [_1]:go('/adm/logout');:Exit LON-CAPA
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.459 doc/loncapafiles/loncapafiles.lpml:1.460
--- doc/loncapafiles/loncapafiles.lpml:1.459	Thu Nov 17 16:33:14 2005
+++ doc/loncapafiles/loncapafiles.lpml	Mon Nov 21 14:08:20 2005
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.459 2005/11/17 21:33:14 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.460 2005/11/21 19:08:20 raeburn Exp $ -->
 
 <!--
 
@@ -3685,6 +3685,16 @@
 <status>works/unverified</status>
 </file>
 <file>
+<source>loncom/interface/loncoursegroups.pm</source>
+<target dist='default'>home/httpd/lib/perl/Apache/loncoursegroups.pm</target>
+<categoryname>handler</categoryname>
+<description>
+Allows course coordinators to create groups, modify existing groups (including    
+adding, expiring or deleting group members, or modifying group member privileges.
+</description>
+<status>works/unverified</status>
+</file>
+<file>
 <source>loncom/interface/lonmsg.pm</source>
 <target dist='default'>home/httpd/lib/perl/Apache/lonmsg.pm</target>
 <categoryname>handler</categoryname>
@@ -5676,6 +5686,7 @@
 feedback.gif;
 forw.gif;
 grds.gif;
+grps.gif;
 group.gif;
 help.gif;
 info.gif;
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.136 loncom/auth/lonroles.pm:1.137
--- loncom/auth/lonroles.pm:1.136	Tue Nov 15 16:39:28 2005
+++ loncom/auth/lonroles.pm	Mon Nov 21 14:08:24 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.136 2005/11/15 21:39:28 raeburn Exp $
+# $Id: lonroles.pm,v 1.137 2005/11/21 19:08:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -126,6 +126,11 @@
 		if ($tstatus eq 'is') {
 		    $where=~s/^\///;
 		    my ($cdom,$cnum,$csec)=split(/\//,$where);
+# check for course groups
+                    my %coursegroups = &Apache::lonnet::get_active_groups(
+                          $env{'user.domain'},$env{'user.name'},$cdom, $cnum);
+                    my $cgrps = join(':',keys(%coursegroups));
+
 # store role if recent_role list being kept
                     if ($env{'environment.recentroles'}) {
 			&Apache::lonhtmlcommon::store_recent('roles',
@@ -227,7 +232,8 @@
 		    &Apache::lonnet::appenv(
 					   'request.role'        => $trolecode,
 					   'request.role.domain' => $cdom,
-					   'request.course.sec'  => $csec);
+					   'request.course.sec'  => $csec,
+                                           'request.course.groups' => $cgrps);
                     my $tadv=0;
 		    my $msg=&mt('Entering course ...');
 
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.681 loncom/lonnet/perl/lonnet.pm:1.682
--- loncom/lonnet/perl/lonnet.pm:1.681	Mon Nov 21 10:41:29 2005
+++ loncom/lonnet/perl/lonnet.pm	Mon Nov 21 14:08:29 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.681 2005/11/21 15:41:29 raeburn Exp $
+# $Id: lonnet.pm,v 1.682 2005/11/21 19:08:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3743,6 +3743,23 @@
     return $result;
 }
 
+sub get_active_groups {
+    my ($udom,$uname,$cdom,$cnum) = @_;
+    my $now = time;
+    my %groups = ();
+    foreach my $key (keys(%env)) {
+        if ($key =~ m-user\.role\.gr\./([^/]+)/([^/]+)/(\w+)$-) {
+            my ($start,$end) = split(/\./,$env{$key});
+            if (($end!=0) && ($end<$now)) { next; }
+            if (($start!=0) && ($start>$now)) { next; }
+            if ($1 eq $cdom && $2 eq $cnum) {
+                $groups{$3} = $env{$key} ;
+            }
+        }
+    }
+    return %groups;
+}
+
 # ------------------------------------------------------------------ Plain Text
 
 sub plaintext {