[LON-CAPA-cvs] cvs: loncom /interface loncoursegroups.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 23 Feb 2006 17:23:13 -0000


raeburn		Thu Feb 23 12:23:13 2006 EDT

  Modified files:              
    /loncom/interface	loncoursegroups.pm 
  Log:
  Breadcrumb links only need to behave in a unique way when completing creation of a new course.  Also need to make sure %usertools contains users as keys when modifying existing membership.  Lastly only suppress display of privileges information on results page when completing deletion or expiration of memberships.     
  
  
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.7 loncom/interface/loncoursegroups.pm:1.8
--- loncom/interface/loncoursegroups.pm:1.7	Tue Feb 21 17:40:45 2006
+++ loncom/interface/loncoursegroups.pm	Thu Feb 23 12:23:09 2006
@@ -782,7 +782,7 @@
                        \@sections,\%states,\%navbuttons,$rowColor1,$rowColor2);
                 last;
             } else {
-                if (($state  =~ /^\w+result$/) && ($i > 0)) {
+                if (($state eq 'result') && ($i > 0)) {
                     &Apache::lonhtmlcommon::add_breadcrumb(
     {href=>"javascript:backPage(document.$state,'$states{$action}[0]')",
       text=>"$trail{$action}{$states{$action}[$i]}"});
@@ -2914,6 +2914,11 @@
                   &Apache::loncommon::get_env_multiple('form.userpriv_'.$priv);
                 foreach my $user (@users) {
                     $group_privs{$user} .= $priv.':';
+                    if ($state eq 'memresult') { 
+                        unless (exists($$usertools{$user}{$tool})) {
+                            $$usertools{$user}{$tool} = 1;
+                        }
+                    }
                 }
             } else {
                 if (@{$defprivs} > 0) {
@@ -2985,7 +2990,7 @@
                 }
             }
         }
-    }   
+    }
 
     foreach my $user (sort(keys(%{$usertools}))) {
         my $type;
@@ -3024,13 +3029,14 @@
     if ($num_ok) {
         foreach my $type (sort(keys(%added))) { 
             $r->print(&mt('The following users were successfully [_1]',$type));
-            if ($type eq 'activated' || $type eq 'added' || $type eq 'reenabled') {
+            if (!($type eq 'deleted' ||  $type eq 'expired')) {   
                 $r->print(&mt(' with the following privileges'));
             }
             $r->print(':<br />');
             foreach my $user (@{$added{$type}}) {
-                my $privlist;
-                if ($type eq 'activated' || $type eq 'added') {
+                my $privlist = '';
+                if (!($type eq 'deleted' ||  $type eq 'expired')) {
+                    $privlist = ': ';
                     my @privs = split(/:/,$group_privs{$user});
                     my $curr_tool = '';
                     foreach my $priv (@privs) {
@@ -3042,7 +3048,7 @@
                     }
                     $privlist =~ s/, $//;
                 }
-                $r->print($$userdata{$user}[$$idx{fullname}].'&nbsp;-&nbsp;'.$user.': '.$privlist.'<br />');
+                $r->print($$userdata{$user}[$$idx{fullname}].'&nbsp;-&nbsp;'.$user.$privlist.'<br />');
             }
         }
     }