Diff for /loncom/interface/courseprefs.pm between versions 1.82 and 1.86

version 1.82, 2016/10/24 18:08:55 version 1.86, 2018/01/03 04:20:54
Line 1978  sub print_courseinfo { Line 1978  sub print_courseinfo {
     unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) {      unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) {
         return;          return;
     }      }
     my ($cathash,$categoriesform,$autocoowner,$clonedefaults);      my ($cathash,$categoriesform,$autocoowner,$clonedefaults,$disabled);
       if ($noedit) {
           $disabled = ' disabled="disabled"';
       }
     my %domconf =       my %domconf = 
         &Apache::lonnet::get_dom('configuration',          &Apache::lonnet::get_dom('configuration',
                                  ['coursecategories','autoenroll','coursedefaults'],$cdom);                                   ['coursecategories','autoenroll','coursedefaults'],$cdom);
Line 1987  sub print_courseinfo { Line 1990  sub print_courseinfo {
         if (ref($cathash) eq 'HASH') {          if (ref($cathash) eq 'HASH') {
             $categoriesform =               $categoriesform = 
                 &Apache::loncommon::assign_categories_table($cathash,                  &Apache::loncommon::assign_categories_table($cathash,
                                                 $settings->{'categories'},$crstype)."\n";                                                  $settings->{'categories'},$crstype,$disabled)."\n";
         }          }
     }      }
     if (ref($domconf{'autoenroll'}) eq 'HASH') {      if (ref($domconf{'autoenroll'}) eq 'HASH') {
Line 2054  sub print_courseinfo { Line 2057  sub print_courseinfo {
     } else {      } else {
         $replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank');          $replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank');
     }      }
       my ($editmap,$editsyllabus);
       unless ($noedit) {
           $editmap = (' 'x2).
                      '<a href="javascript:openbrowser'.
                      "('display','url','sequence')\">".
                      &mt('Select Map').'</a><br /><span class="LC_warning"> '.
                      &mt('Modification may make assessment data inaccessible!').
                      '</span>';
           $editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">',
                               '</a>');  
       }
     my %items = (      my %items = (
         'url' => {          'url' => {
                    text => '<b>'.&mt($itemtext->{'url'}).'</b>'.('&nbsp;'x2).                     text => '<b>'.&mt($itemtext->{'url'}).'</b>'.$editmap,
                            '<a href="javascript:openbrowser'.  
                            "('display','url','sequence')\">".  
                            &mt('Select Map').'</a><br /><span class="LC_warning"> '.  
                            &mt('Modification may make assessment data inaccessible!').  
                            '</span>',  
                    input => 'textbox',                     input => 'textbox',
                    size  => '55',                     size  => '55',
                    advanced => 1                     advanced => 1
Line 2106  sub print_courseinfo { Line 2115  sub print_courseinfo {
         'externalsyllabus' => {          'externalsyllabus' => {
                    text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />'.                     text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />'.
                            &mt('(Syllabus type in use)').('&nbsp;' x2).                             &mt('(Syllabus type in use)').('&nbsp;' x2).
                            &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">',                             $editsyllabus,
                                '</a>'),  
                         },                          },
         'hidefromcat' => {          'hidefromcat' => {
                    text => '<b>'.&mt($itemtext->{'hidefromcat'}).'</b><br />'.                     text => '<b>'.&mt($itemtext->{'hidefromcat'}).'</b><br />'.
Line 2129  sub print_courseinfo { Line 2137  sub print_courseinfo {
     );      );
     my $datatable;      my $datatable;
     my $count = 0;      my $count = 0;
     my $disabled;  
     if ($noedit) {  
         $disabled = ' disabled="disabled"';  
     }  
     foreach my $item (@{$ordered}) {      foreach my $item (@{$ordered}) {
         my $colspan;          my $colspan;
         if ($item eq 'hidefromcat') {          if ($item eq 'hidefromcat') {
Line 2576  sub display_loncaparev_constraints { Line 2580  sub display_loncaparev_constraints {
                               $Apache::lonrelrequtils::checkcrstypes{$crstype}).'</h4>';                                $Apache::lonrelrequtils::checkcrstypes{$crstype}).'</h4>';
     }      }
     my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps,      my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps,
         %byresponsetype,%bysubmission,%fromblocks);          %byresponsetype,%bysubmission,%fromblocks,%bycrsrestype);
     @scopeorder = ('all','section/group','user');      @scopeorder = ('all','section/group','user');
     my $now = time;      my $now = time;
     my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom);      my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom);
Line 2850  sub display_loncaparev_constraints { Line 2854  sub display_loncaparev_constraints {
         my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey::'};          my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey::'};
         my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum);          my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum);
         my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry::'};          my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry::'};
           my $rev_exttool=$Apache::lonnet::needsrelease{'course:courserestype:exttool'};
         my $stdtype=&Apache::lonparmset::standard_parameter_types('type');          my $stdtype=&Apache::lonparmset::standard_parameter_types('type');
         my $stdname=&Apache::lonparmset::standard_parameter_names('type');          my $stdname=&Apache::lonparmset::standard_parameter_names('type');
         my $valanon=&get_param_description($stdtype,'anonsurvey');          my $valanon=&get_param_description($stdtype,'anonsurvey');
         my $valrandtry=&get_param_description($stdtype,'randomizetry');          my $valrandtry=&get_param_description($stdtype,'randomizetry');
         my %checkedrev;          my %checkedrev;
         foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) {          foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() || $_[0]->is_tool() },1,0)) {
             my @parts = @{$res->parts()};              my @parts = @{$res->parts()};
             my $symb = $res->symb();              my $symb = $res->symb();
             my $enclosing_map = &Apache::lonnet::declutter($res->enclosing_map_src());              my $enclosing_map = &Apache::lonnet::declutter($res->enclosing_map_src());
               if ($res->is_tool()) {
                   my $rev = $rev_exttool;
                   $bycrsrestype{$symb}{$rev} = &mt('External Tool');
                   $allmaps{$enclosing_map} = 1;
                   next;
               }
             foreach my $part (@parts) {              foreach my $part (@parts) {
                 if (exists($anonsubms{$symb."\0".$part})) {                  if (exists($anonsubms{$symb."\0".$part})) {
                     my $rev = $rev_anonsurv;                      my $rev = $rev_anonsurv;
Line 2946  sub display_loncaparev_constraints { Line 2957  sub display_loncaparev_constraints {
             }              }
         }          }
     }      }
       my $suppmap = 'supplemental.sequence';
       my ($suppcount,$supptools,$errors) = (0,0,0);
       ($suppcount,$supptools,$errors) = &Apache::loncommon::recurse_supplemental($cnum,$cdom,
                                                         $suppmap,$suppcount,$supptools,$errors);
     my $mapres_header = '<h4>'.      my $mapres_header = '<h4>'.
                         &mt('Requirements for specific folders or resources').                          &mt('Requirements for specific folders or resources').
                         '</h4>';                          '</h4>';
Line 2960  sub display_loncaparev_constraints { Line 2975  sub display_loncaparev_constraints {
     $r->print($start_page.$top_header);      $r->print($start_page.$top_header);
     if ($output) {      if ($output) {
         $r->print($output);          $r->print($output);
         if (defined($navmap)) {          if (defined($navmap) || $supptools) {
             &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,              &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,
                                 \%byresponsetype,\@scopeorder,\%lt);                                  \%byresponsetype,\%bycrsrestype,\@scopeorder,\%lt,$supptools);
         }          }
         $r->print('<br /><br />');           $r->print('<br /><br />'); 
     } else {      } else {
Line 2980  sub display_loncaparev_constraints { Line 2995  sub display_loncaparev_constraints {
   
 sub show_contents_view {  sub show_contents_view {
     my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,      my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,
         $scopeorder,$lt) = @_;          $bycrsrestype,$scopeorder,$lt,$supptools) = @_;
     if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) ||       my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
         (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {      my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';
         my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");      my $showmaincontent;
         my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';      if ((ref($navmap)) &&
         my $icon =  '<img src="'.$location.'/navmap.folder.open.gif" alt="" />';          ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) ||
            (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0) ||
            (keys(%{$bycrsrestype}) > 0))) {
           $showmaincontent = 1;
       }
       if ($showmaincontent || $supptools) {
           $r->print(&Apache::loncommon::start_data_table());
       }
       if ($showmaincontent) {
           my $icon = '<img src="'.$location.'/navmap.folder.open.gif" alt="" />';
         my $topmap = $env{'course.'.$cid.'.url'};          my $topmap = $env{'course.'.$cid.'.url'};
         $r->print(&Apache::loncommon::start_data_table().          $r->print(&Apache::loncommon::start_data_table_header_row().
                   &Apache::loncommon::start_data_table_header_row().  
                   '<th>'.&mt('Location').'</th><th>'.&mt('Release').'</th>'.                    '<th>'.&mt('Location').'</th><th>'.&mt('Release').'</th>'.
                   '<th>'.&mt('Attribute/Setting').'</th>'.                    '<th>'.&mt('Attribute/Setting').'</th>'.
                   &Apache::loncommon::end_data_table_header_row().                    &Apache::loncommon::end_data_table_header_row().
                   &Apache::loncommon::start_data_table_row().                    &Apache::loncommon::start_data_table_row().
                   '<td>&nbsp;'.$icon.'&nbsp;'.&mt('Main Content').'</td>');                    '<td>&nbsp;'.$icon.'&nbsp;'.&mt('Main Content').'</td>');
                   &releases_by_map($r,$bymap,$topmap,$scopeorder,$lt);          &releases_by_map($r,$bymap,$topmap,$scopeorder,$lt);
                   $r->print(&Apache::loncommon::end_data_table_row());          $r->print(&Apache::loncommon::end_data_table_row());
         my $it=$navmap->getIterator(undef,undef,undef,1,1,undef);          my $it=$navmap->getIterator(undef,undef,undef,1,1,undef);
         my $curRes;          my $curRes;
         my $depth = 0;          my $depth = 0;
Line 3046  sub show_contents_view { Line 3069  sub show_contents_view {
                     if (ref($byresponsetype->{$symb}) eq 'HASH') {                      if (ref($byresponsetype->{$symb}) eq 'HASH') {
                         $rowspan += scalar(keys(%{$byresponsetype->{$symb}}));                          $rowspan += scalar(keys(%{$byresponsetype->{$symb}}));
                     }                      }
                       if (ref($bycrsrestype->{$symb}) eq 'HASH') {
                           $rowspan += scalar(keys(%{$bycrsrestype->{$symb}}));
                       }
                     next if (!$rowspan);                      next if (!$rowspan);
                     $icon = '<img class="LC_contentImage" src="'.$location.'/problem.gif" alt="'.                      $icon = '<img class="LC_contentImage" src="'.$location.'/problem.gif" alt="'.
                             &mt('Problem').'" />';                              &mt('Problem').'" />';
Line 3110  sub show_contents_view { Line 3136  sub show_contents_view {
                             $r->print('</td>');                              $r->print('</td>');
                         }                          }
                         $r->print(&Apache::loncommon::end_data_table_row());                          $r->print(&Apache::loncommon::end_data_table_row());
                           $newrow = 1;
                       }
                       if (ref($bycrsrestype->{$symb}) eq 'HASH') {
                           foreach my $rev (sort(keys(%{$bycrsrestype->{$symb}}))) {
                               if ($newrow) {
                                   $r->print(&Apache::loncommon::continue_data_table_row());
                               }
                               $r->print('<td>'.$rev.'</td><td>'.$bycrsrestype->{$symb}{$rev}.'</td>');
                           }
                           $r->print(&Apache::loncommon::end_data_table_row());
                     }                      }
                 }                  }
             }              }
         }          }
       }
       if ($supptools) {
           my $icon = '<img src="'.$location.'/navmap.folder.open.gif" alt="" />';
           $r->print(&Apache::loncommon::start_data_table_header_row().
                     '<th>'.&mt('Location').'</th><th>'.&mt('Release').'</th>'.
                     '<th>'.&mt('Resource Type').'</th>'.
                     &Apache::loncommon::end_data_table_header_row().
                     &Apache::loncommon::start_data_table_row().
                     '<td>&nbsp;'.$icon.'&nbsp;'.&mt('Supplemental Content').'</td>'.
                     '<td valign="middle">'.
                     $Apache::lonrelrequtils::exttool{'major'}.'.'.
                     $Apache::lonrelrequtils::exttool{'minor'}.
                     '</td><td>'.&mt('[quant,_1,External Tool,External Tools]',
                                     $supptools).'</td>'.
                     &Apache::loncommon::end_data_table_row());
       }
       if ($showmaincontent || $supptools) {
         $r->print(&Apache::loncommon::end_data_table());          $r->print(&Apache::loncommon::end_data_table());
     }      }
     return;      return;

Removed from v.1.82  
changed lines
  Added in v.1.86


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