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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sun, 24 Aug 2008 12:54:58 -0000


raeburn		Sun Aug 24 08:54:58 2008 EDT

  Modified files:              
    /loncom/interface	loncoursegroups.pm 
  Log:
  - subroutine: topic_bar() moved to lonhtmlcommon.pm to be more widely available.
  - @buildsections no longer needed as loncommon::get_course_users() can handle sectionpick including 'none' and/or 'all'.
  
  
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.77 loncom/interface/loncoursegroups.pm:1.78
--- loncom/interface/loncoursegroups.pm:1.77	Thu May  8 19:25:29 2008
+++ loncom/interface/loncoursegroups.pm	Sun Aug 24 08:54:55 2008
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursegroups.pm,v 1.77 2008/05/08 23:25:29 raeburn Exp $
+# $Id: loncoursegroups.pm,v 1.78 2008/08/24 12:54:55 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -406,7 +406,6 @@
     my @types = ();
     my @roles = ();
     my @sections = ();
-    my @buildsections = ();
     my %users = ();
     my %userdata = ();
     my @members = ();
@@ -566,16 +565,11 @@
         }
         if (defined($env{'form.sectionpick'})) {
             @sections=&Apache::loncommon::get_env_multiple('form.sectionpick');
-            if (grep/^all$/,@sections) {
-                @buildsections = sort {$a cmp $b} keys(%sectioncount);
-            } else {
-                @buildsections = @sections;
-            }
         }
     }
 
     if (($state eq 'pick_members') || ($state eq 'pick_privs') || ($state eq 'change_privs')) {
-        &build_members_list($cdom,$cnum,\@types,\@roles,\@buildsections,\%users,
+        &build_members_list($cdom,$cnum,\@types,\@roles,\@sections,\%users,
                             \%userdata);
     }
     if ($state eq 'pick_members') {
@@ -1580,8 +1574,7 @@
                   'for different group members?',
     );
     my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored);
-    &topic_bar($r,$image,$lt{'gnde'});
-    $r->print('
+    $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'gnde'}).'
      <table class="LC_descriptive_input">
       <tr>
        <td class="LC_description">'.$lt{'gnam'}.':</td>
@@ -1719,8 +1712,7 @@
 
     my @sections = keys(%{$sectioncount});
 
-    &topic_bar($r,$image,$lt{'pipa'});
-    $r->print('
+    $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'pipa'}).'
      <b>'.$lt{'gmem'}.'</b><br />'.$lt{'picr'});
     if ($action eq 'create') {
         $r->print($lt{'meof'}.'<br />'.$lt{'ifno'}.'<br />'.$lt{'asub'});
@@ -1790,8 +1782,7 @@
         }
     }
     my ($table) = &date_setting_table($starttime,$endtime,$formname);
-    &topic_bar($r,$image,$lt{'sten'});
-    $r->print('
+    $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'sten'}).'
     '.$table.'
     ');
     return;
@@ -2029,7 +2020,7 @@
             $r->print(&check_uncheck_tools($r,$available));
         }
     }
-    &topic_bar($r,$img,$lt{'gpme'});
+    $r->print(&Apache::lonhtmlcommon::topic_bar($img,$lt{'gpme'}));
     if (keys(%members) > 0) {
         $r->print('
     <table>
@@ -2178,7 +2169,7 @@
             }
         }
     }
-    &topic_bar($r,$img,$lt{'uprv'});
+    $r->print(&Apache::lonhtmlcommon::topic_bar($img,$lt{'uprv'}));
     if ((($action eq 'create') && (@{$available} > 0)) || 
         (($action eq 'modify') && ($formname eq 'change_settings'))) {
         my %specific = (
@@ -2419,11 +2410,11 @@
     $r->print('
 <br />
 ');
-    &topic_bar($r,1,$lt{'grse'});
+    $r->print(&Apache::lonhtmlcommon::topic_bar(1,$lt{'grse'}));
     &print_current_settings($r,$action,$functions,$startdate,$enddate,
 			    $groupname,$description,$granularity,$quota,
 			    \@available,\@unavailable,$gpterm,$ucgpterm);
-    &topic_bar($r,2,$lt{'mogm'});
+    $r->print(&Apache::lonhtmlcommon::topic_bar(2,$lt{'mogm'}));
     my $numcurrent = &current_membership($r,$cdom,$cnum,$formname,$groupname,
                                          \@available,\@unavailable,$fixedprivs,
 			                 $granularity,$specificity);
@@ -2673,7 +2664,7 @@
     } else {
         $nexttext = $$navbuttons{'mose'};
     }
-    &topic_bar($r,3,&mt('Members to delete or expire'));
+    $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('Members to delete or expire')));
     my $exp_or_del = 0;
     if (ref($$memchg{'deletion'}) eq 'ARRAY') {
         if (@{$$memchg{'deletion'}} > 0) {
@@ -2701,7 +2692,7 @@
         $r->print($lt{'nome'}.'<br />');
     }
     
-    &topic_bar($r,4,&mt('Setting optional privileges for specific group members'));
+    $r->print(&Apache::lonhtmlcommon::topic_bar(4,&mt('Setting optional privileges for specific group members')));
 
     my $numchgs = &member_privileges_form($r,$action,$formname,$tools,
                                           $toolprivs,$fixedprivs,$userdata,
@@ -2758,7 +2749,7 @@
         $nexttext = $$navbuttons{'adme'};
     }
 
-    &topic_bar($r,6,&mt('Setting optional privileges for specific group members'));
+    $r->print(&Apache::lonhtmlcommon::topic_bar(6,&mt('Setting optional privileges for specific group members')));
 
     &member_privileges_form($r,$action,$formname,$tools,$toolprivs,
                             $fixedprivs,$userdata,$usertools,$idx,undef,
@@ -3466,8 +3457,7 @@
     if (exists($$stored{'autodrop'})) {
         $drop = $$stored{'autodrop'};
     }
-    &topic_bar($r,$image,$$lt{'endi'});
-    $r->print('
+    $r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).'
     <b>'.$$lt{'gmma'}.':</b><br />'.$$lt{'adds'}.'<br />'.$$lt{'drops'}.'<br /><br />
    <nobr>'.$$lt{'auad'}.':&nbsp;
     <label><input type="radio" name="autoadd" value="on" />on&nbsp;&nbsp;</label><label><input type="radio" name="autoadd" value="off" checked="checked" />off</label>');
@@ -3494,7 +3484,7 @@
     } else {
         @sections = ('all','none');
     }
-    &topic_bar($r,$image,$$lt{'pirs'});
+    $r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'pirs'}));
     my @roles = &standard_roles();
     my %customroles = &Apache::lonhtmlcommon::course_custom_roles($cdom,$cnum);
     $r->print(&Apache::loncommon::start_data_table().
@@ -3995,18 +3985,6 @@
     return;
 }
 
-sub topic_bar {
-    my ($r,$imgnum,$title) = @_;
-    $r->print('
-<div class="LC_topic_bar">
-    <img alt="'.&mt('Step [_1]',$imgnum).
-	      '"src="/res/adm/pages/bl_step'.$imgnum.'.gif" />&nbsp;
-    <span>'.$title.'</span>
-</div>
-');
-    return;
-}
-
 sub check_changes {
     my ($member_changes,$memchg) = @_;
     my %exclusions;