Diff for /loncom/interface/lonmodifycourse.pm between versions 1.70 and 1.71

version 1.70, 2014/03/17 02:45:25 version 1.71, 2014/03/31 01:37:28
Line 226  sub get_filters { Line 226  sub get_filters {
 }  }
   
 sub print_modification_menu {  sub print_modification_menu {
     my ($r,$cdesc,$domdesc,$dom,$type) = @_;      my ($r,$cdesc,$domdesc,$dom,$type,$cid,$coursehash) = @_;
     &print_header($r,$type);      &print_header($r,$type);
     my ($ccrole,$categorytitle,$setquota_text,$setuploadquota_text,$setparams_text,$cat_text);      my ($ccrole,$categorytitle,$setquota_text,$setuploadquota_text,$setparams_text,$cat_text,
           $cdom,$cnum);
       if (ref($coursehash) eq 'HASH') {
           $cdom = $coursehash->{'domain'};
           $cnum = $coursehash->{'num'};
       } else {
            ($cdom,$cnum) = split(/_/,$cid);
       }
     if ($type eq 'Community') {      if ($type eq 'Community') {
         $ccrole = 'co';          $ccrole = 'co';
     } else {      } else {
Line 1571  sub print_footer { Line 1578  sub print_footer {
 }  }
   
 sub check_course {  sub check_course {
     my ($r,$dom,$domdesc) = @_;      my ($dom,$domdesc) = @_;
     my ($ok_course,$description,$instcode,$owner);      my ($ok_course,$description,$instcode);
     my %args = (      my %coursehash;
                  one_time => 1,      if ($env{'form.pickedcourse'} =~ /^$match_domain\_$match_courseid$/) {
                );          my %args;
     my %coursehash =           unless ($env{'course.'.$env{'form.pickedcourse'}.'.description'}) {
         &Apache::lonnet::coursedescription($env{'form.pickedcourse'},\%args);              %args = (
     my $cnum = $coursehash{'num'};                        'one_time'      => 1,
     my $cdom = $coursehash{'domain'};                        'freshen_cache' => 1,
     if ($cdom eq $dom) {                      );
         my $description;          }
         my %courseIDs = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',          %coursehash =
                                                       $cnum,undef,undef,'.');             &Apache::lonnet::coursedescription($env{'form.pickedcourse'},\%args);
         if (keys(%courseIDs) > 0) {          my $cnum = $coursehash{'num'};
             $ok_course = 'ok';          my $cdom = $coursehash{'domain'};
             my ($instcode,$owner);          $description = $coursehash{'description'};
             if (ref($courseIDs{$cdom.'_'.$cnum}) eq 'HASH') {          $instcode = $coursehash{'internal.coursecode'};
                 $description = $courseIDs{$cdom.'_'.$cnum}{'description'};          if ($instcode) {
                 $instcode = $courseIDs{$cdom.'_'.$cnum}{'inst_code'};              $description .= " ($instcode)";
                 $owner = $courseIDs{$cdom.'_'.$cnum}{'owner'};                    }
             } else {          if (($cdom eq $dom) && ($cnum =~ /^$match_courseid$/)) {
                 ($description,$instcode,$owner) =               my %courseIDs = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',
                                    split(/:/,$courseIDs{$cdom.'_'.$cnum});                                                            $cnum,undef,undef,'.');
             }              if ($courseIDs{$cdom.'_'.$cnum}) {
             $description = &unescape($description);                  $ok_course = 'ok';
             $instcode = &unescape($instcode);  
             if ($instcode) {  
                 $description .= " ($instcode)";  
             }              }
             return ($ok_course,$description);  
         }          }
     }      }
       return ($ok_course,$description,\%coursehash);
 }  }
   
 sub course_settings_descrip {  sub course_settings_descrip {
Line 1700  sub handler { Line 1704  sub handler {
             if ($phase eq 'courselist') {              if ($phase eq 'courselist') {
                 &print_course_selection_page($r,$dom,$domdesc);                  &print_course_selection_page($r,$dom,$domdesc);
             } else {              } else {
                 my ($checked,$cdesc) = &check_course($r,$dom,$domdesc);                  my ($checked,$cdesc,$coursehash) = &check_course($dom,$domdesc);
                 if ($checked eq 'ok') {                  if ($checked eq 'ok') {
                     my $enter_text;                      my $enter_text;
                     if ($type eq 'Community') {                      if ($type eq 'Community') {
Line 1712  sub handler { Line 1716  sub handler {
                         &Apache::lonhtmlcommon::add_breadcrumb                          &Apache::lonhtmlcommon::add_breadcrumb
                         ({href=>"javascript:changePage(document.$phase,'menu')",                          ({href=>"javascript:changePage(document.$phase,'menu')",
                           text=>"Pick action"});                            text=>"Pick action"});
                         &print_modification_menu($r,$cdesc,$domdesc,$dom,$type);                          &print_modification_menu($r,$cdesc,$domdesc,$dom,$type,
                                                    $env{'form.pickedcourse'},$coursehash);
                     } elsif ($phase eq 'ccrole') {                      } elsif ($phase eq 'ccrole') {
                         &Apache::lonhtmlcommon::add_breadcrumb                          &Apache::lonhtmlcommon::add_breadcrumb
                          ({href=>"javascript:changePage(document.$phase,'ccrole')",                           ({href=>"javascript:changePage(document.$phase,'ccrole')",

Removed from v.1.70  
changed lines
  Added in v.1.71


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