Diff for /loncom/interface/loncoursegroups.pm between versions 1.8 and 1.14

version 1.8, 2006/02/23 17:23:09 version 1.14, 2006/05/01 19:37:33
Line 102  sub handler { Line 102  sub handler {
 sub print_main_menu {  sub print_main_menu {
     my ($r,$cdom,$cnum,$function,$tabcol,$functions,$idx,$view_permission,      my ($r,$cdom,$cnum,$function,$tabcol,$functions,$idx,$view_permission,
         $manage_permission,$action,$rowColor1,$rowColor2) = @_;          $manage_permission,$action,$rowColor1,$rowColor2) = @_;
     $r->print(&header('Course Groups',&mt('LON-CAPA Course Groups'),      $r->print(&header('Course Groups',undef,undef,undef,undef,$function));
               undef,undef,undef,undef,$function));  
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"/adm/coursegroups",          ({href=>"/adm/coursegroups",
           text=>"Course Groups",});            text=>"Course Groups",});
     $r->print(&Apache::lonhtmlcommon::breadcrumbs      $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Groups'));
               (undef,'Course Groups'));  
     &display_groups($r,$cdom,$cnum,$function,$tabcol,$functions,$idx,      &display_groups($r,$cdom,$cnum,$function,$tabcol,$functions,$idx,
                     $view_permission,$manage_permission,$action,$rowColor1,                      $view_permission,$manage_permission,$action,$rowColor1,
                     $rowColor2);                      $rowColor2);
Line 465  sub group_administration { Line 463  sub group_administration {
         }          }
     }      }
   
     if ($action eq 'create') {      if (($action eq 'create') || 
           ($action eq 'modify' && $state eq 'pick_members')) {
         if (defined($env{'form.types'})) {          if (defined($env{'form.types'})) {
             @types=&Apache::loncommon::get_env_multiple('form.types');              @types=&Apache::loncommon::get_env_multiple('form.types');
         }          }
Line 721  function changeSort(caller) { Line 720  function changeSort(caller) {
     }      }
   
     my $loaditems =  &onload_action($action,$state);      my $loaditems =  &onload_action($action,$state);
     $r->print(&header('Course Groups Manager',&mt('LON-CAPA Groups Manager'),      $r->print(&header('Course Groups Manager',
                           $jscript,$action,$state,$page,$function,$loaditems));        $jscript,$action,$state,$page,$function,$loaditems));
   
     if ($env{'form.refpage'} eq 'enrl') {      if ($env{'form.refpage'} eq 'enrl') {
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
Line 772  function changeSort(caller) { Line 771  function changeSort(caller) {
                 &Apache::lonhtmlcommon::add_breadcrumb(                  &Apache::lonhtmlcommon::add_breadcrumb(
                    {text=>"$trail{$action}{$state}"});                     {text=>"$trail{$action}{$state}"});
                 $r->print(&Apache::lonhtmlcommon::breadcrumbs                  $r->print(&Apache::lonhtmlcommon::breadcrumbs
                      (undef,'Course Groups Manager'));    ('Course Groups Manager'));
                 &display_control($r,$cdom,$cnum,$tabcol,$action,$state,$page,                  &display_control($r,$cdom,$cnum,$tabcol,$action,$state,$page,
                        \%sectioncount,$groupname,$description,$functions,                         \%sectioncount,$groupname,$description,$functions,
                        \@tools,\%toolprivs,\%fixedprivs,$startdate,$enddate,                         \@tools,\%toolprivs,\%fixedprivs,$startdate,$enddate,
Line 797  function changeSort(caller) { Line 796  function changeSort(caller) {
                         &Apache::lonhtmlcommon::add_breadcrumb(                          &Apache::lonhtmlcommon::add_breadcrumb(
                    {text=>"View groups"});                     {text=>"View groups"});
         $r->print(&Apache::lonhtmlcommon::breadcrumbs          $r->print(&Apache::lonhtmlcommon::breadcrumbs
                      (undef,'Course Groups Manager'));    ('Course Groups Manager'));
         &display_groups($r,$cdom,$cnum,$function,$tabcol,$functions,$idx,          &display_groups($r,$cdom,$cnum,$function,$tabcol,$functions,$idx,
                         $view_permission,$manage_permission,$action,                          $view_permission,$manage_permission,$action,
                         $rowColor1,$rowColor2);                          $rowColor1,$rowColor2);
Line 951  sub display_control { Line 950  sub display_control {
 }  }
   
 sub header {  sub header {
     my ($bodytitle,$title,$jscript,$action,$state,$page,$function,$loaditems) = @_;      my ($bodytitle,$jscript,$action,$state,$page,$function,$loaditems) = @_;
     my $html=&Apache::lonxml::xmlbegin();      my $start_page=
     my $bodytag=&Apache::loncommon::bodytag($bodytitle,$function,$loaditems);   &Apache::loncommon::start_page($bodytitle,
          '<script type="text/javascript">'.
          $jscript.'</script>',
          {'function'    => $function,
    'add_entries' => $loaditems,});
     my $output = <<"END";      my $output = <<"END";
 $html  $start_page
 <head>  <form method="POST" name="$state">
 <title>$title</title>  
 <script type="text/javascript">  
 $jscript  
 </script>  
 </head>  
 $bodytag  
 <form method="post" name="$state">  
   
 END  END
     if ($action eq 'create' || $action eq 'modify') {      if ($action eq 'create' || $action eq 'modify') {
Line 979  END Line 975  END
   
 sub onload_action {  sub onload_action {
     my ($action,$state) = @_;      my ($action,$state) = @_;
     my $loaditems;      my %loaditems;
     if ((defined($env{'form.origin'})) && ($action eq 'create') &&      if ((defined($env{'form.origin'})) && ($action eq 'create') &&
                 ($state eq 'pick_name' || $state eq 'pick_members' ||                   ($state eq 'pick_name' || $state eq 'pick_members' || 
                  $state eq 'pick_privs')) {                   $state eq 'pick_privs')) {
         unless ($env{'form.origin'} eq '') {          unless ($env{'form.origin'} eq '') {
             $loaditems =       $loaditems{'onload'} = 
              'onload="javascript:setFormElements(document.'.$state.')"';   'javascript:setFormElements(document.'.$state.')';
         }          }
     }      }
     if (($action eq 'modify') &&      if (($action eq 'modify') &&
                 ($state eq 'change_settings' || $state eq 'change_members' ||                  ($state eq 'change_settings' || $state eq 'change_members' ||
                  $state eq 'change_privs' || $state eq 'add_members' ||                   $state eq 'change_privs' || $state eq 'add_members' ||
                  $state eq 'pick_members')) {                   $state eq 'pick_members')) {
             $loaditems =   $loaditems{'onload'} = 
              'onload="javascript:setFormElements(document.'.$state.')"';      'javascript:setFormElements(document.'.$state.')';
     }      }
     return $loaditems;      return \%loaditems;
 }  }
   
 sub footer {  sub footer {
       my $end_page = &Apache::loncommon::end_page();
        return(<<ENDFOOT);         return(<<ENDFOOT);
    <input type="hidden" name="sortby" value="$env{'form.sortby'}" />     <input type="hidden" name="sortby" value="$env{'form.sortby'}" />
   </form>    </form>
  </body>  $end_page
 </html>  
 ENDFOOT  ENDFOOT
 }  }
   

Removed from v.1.8  
changed lines
  Added in v.1.14


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>