Diff for /loncom/interface/lonmodifycourse.pm between versions 1.79.2.9.2.7 and 1.107

version 1.79.2.9.2.7, 2024/08/26 10:48:59 version 1.107, 2024/12/20 00:24:38
Line 79  sub catalog_settable { Line 79  sub catalog_settable {
             if ($confhash->{'categorizecomm'} ne 'comm') {              if ($confhash->{'categorizecomm'} ne 'comm') {
                 push(@settable,'categorize');                  push(@settable,'categorize');
             }              }
           } elsif ($type eq 'Placement') {
               if ($confhash->{'togglecatsplace'} ne 'place') {
                   push(@settable,'togglecats');
               }
               if ($confhash->{'categorizeplace'} ne 'place') {
                   push(@settable,'categorize');
               }
         } else {          } else {
             if ($confhash->{'togglecats'} ne 'crs') {              if ($confhash->{'togglecats'} ne 'crs') {
                 push(@settable,'togglecats');                  push(@settable,'togglecats');
Line 175  sub print_course_search_page { Line 182  sub print_course_search_page {
     $r->print(&Apache::loncommon::js_changer());      $r->print(&Apache::loncommon::js_changer());
     if ($type eq 'Community') {      if ($type eq 'Community') {
         $r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>');          $r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>');
       } elsif ($type eq 'Placement') {
           $r->print('<h3>'.&mt('Search for a placement test in the [_1] domain',$domdesc).'</h3>');
     } else {      } else {
         $r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>');          $r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>');
     }      }
Line 185  sub print_course_search_page { Line 194  sub print_course_search_page {
     my ($actiontext,$roleoption,$settingsoption);      my ($actiontext,$roleoption,$settingsoption);
     if ($type eq 'Community') {      if ($type eq 'Community') {
         $actiontext = &mt('Actions available after searching for a community:');          $actiontext = &mt('Actions available after searching for a community:');
       } elsif ($type eq 'Placement') {
           $actiontext = &mt('Actions available after searching for a placement test:')
     } else {      } else {
         $actiontext = &mt('Actions available after searching for a course:');          $actiontext = &mt('Actions available after searching for a course:');
     }      }
Line 192  sub print_course_search_page { Line 203  sub print_course_search_page {
        if ($type eq 'Community') {         if ($type eq 'Community') {
            $roleoption = &mt('Enter the community with the role of [_1]',$cctitle);             $roleoption = &mt('Enter the community with the role of [_1]',$cctitle);
            $settingsoption = &mt('View or modify community settings which only a [_1] may modify.',$dctitle);             $settingsoption = &mt('View or modify community settings which only a [_1] may modify.',$dctitle);
          } elsif ($type eq 'Placement') {
              $roleoption = &mt('Enter the placement test with the role of [_1]',$cctitle);
              $settingsoption = &mt('View or modify placement test settings which only a [_1] may modify.',$dctitle);
        } else {         } else {
            $roleoption = &mt('Enter the course with the role of [_1]',$cctitle);             $roleoption = &mt('Enter the course with the role of [_1]',$cctitle);
            $settingsoption = &mt('View or modify course settings which only a [_1] may modify.',$dctitle);             $settingsoption = &mt('View or modify course settings which only a [_1] may modify.',$dctitle);
Line 202  sub print_course_search_page { Line 216  sub print_course_search_page {
             if (@{$roles_by_num} > 1) {              if (@{$roles_by_num} > 1) {
                 if ($type eq 'Community') {                  if ($type eq 'Community') {
                     $roleoption = &mt('Enter the community with one of the available ad hoc roles');                      $roleoption = &mt('Enter the community with one of the available ad hoc roles');
                   } elsif ($type eq 'Placement') {
                       $roleoption = &mt('Enter the placement test with one of the available ad hoc roles.');
                 } else {                  } else {
                     $roleoption = &mt('Enter the course with one of the available ad hoc roles.');                      $roleoption = &mt('Enter the course with one of the available ad hoc roles.');
                 }                  }
Line 209  sub print_course_search_page { Line 225  sub print_course_search_page {
                 my $rolename = $description->{$roles_by_num->[0]};                  my $rolename = $description->{$roles_by_num->[0]};
                 if ($type eq 'Community') {                  if ($type eq 'Community') {
                     $roleoption = &mt('Enter the community with the ad hoc role of: [_1]',$rolename);                      $roleoption = &mt('Enter the community with the ad hoc role of: [_1]',$rolename);
                   } elsif ($type eq 'Placement') {
                       $roleoption = &mt('Enter the placement test with the ad hoc role of: [_1]',$rolename);
                 } else {                  } else {
                     $roleoption = &mt('Enter the course with the ad hoc role of: [_1]',$rolename);                      $roleoption = &mt('Enter the course with the ad hoc role of: [_1]',$rolename);
                 }                  }
Line 216  sub print_course_search_page { Line 234  sub print_course_search_page {
         }          }
         if ($type eq 'Community') {          if ($type eq 'Community') {
             $settingsoption = &mt('View community settings which only a [_1] may modify.',$dctitle);              $settingsoption = &mt('View community settings which only a [_1] may modify.',$dctitle);
           } elsif ($type eq 'Placement') {
               $settingsoption = &mt('View placement test settings which only a [_1] may modify.',$dctitle);
         } else {          } else {
             $settingsoption = &mt('View course settings which only a [_1] may modify.',$dctitle);              $settingsoption = &mt('View course settings which only a [_1] may modify.',$dctitle);
         }          }
Line 413  sub print_modification_menu { Line 433  sub print_modification_menu {
                       'setpostsubmit' => 'View/Modify submit button behavior, post-submission',                        'setpostsubmit' => 'View/Modify submit button behavior, post-submission',
                       'setltiauth'    => 'View/Modify re-authentication requirement for LTI launch of deep-linked item',                        'setltiauth'    => 'View/Modify re-authentication requirement for LTI launch of deep-linked item',
                       'setexttool'    => 'View/Modify External Tools permissions',                        'setexttool'    => 'View/Modify External Tools permissions',
                         'setcrsauthor'  => 'View/Modify In-course Authoring permissions',
                       'setcrseditors' => 'View/Modify permitted course resource editors',                        'setcrseditors' => 'View/Modify permitted course resource editors',
                     );                      );
     } else {      } else {
Line 423  sub print_modification_menu { Line 444  sub print_modification_menu {
                       'setpostsubmit' => 'View submit button behavior, post-submission',                        'setpostsubmit' => 'View submit button behavior, post-submission',
                       'setltiauth'    => 'View re-authentication requirement for LTI launch of deep-linked item',                        'setltiauth'    => 'View re-authentication requirement for LTI launch of deep-linked item',
                       'setexttool'    => 'View External Tools permissions',                        'setexttool'    => 'View External Tools permissions',
                         'setcrsauthor'  => 'View In-course Authoring permissions',
                       'setcrseditors' => 'View permitted course resource editors',                        'setcrseditors' => 'View permitted course resource editors',
                     );                      );
     }      }
Line 527  sub print_modification_menu { Line 549  sub print_modification_menu {
             {              {
                 linktext => $linktext{'viewparms'},                  linktext => $linktext{'viewparms'},
                 url => &phaseurl('viewparms'),                  url => &phaseurl('viewparms'),
                 permission => ($permission->{'viewparms'} && ($type ne 'Community')),                  permission => ($permission->{'viewparms'} && ($type ne 'Community') && ($type ne 'Placement')),
                 #help => '',                  #help => '',
                 icon => 'roles.png',                  icon => 'roles.png',
                 linktitle => ''                  linktitle => ''
Line 565  sub print_modification_menu { Line 587  sub print_modification_menu {
                 linktitle => '',                  linktitle => '',
             },              },
             {              {
                   linktext => $linktext{'setcrsauthor'},
                   icon => 'crsauthor.png',
                   #help => '',
                   url => &phaseurl('setcrsauthor'),
                   permission => $permission->{'setcrsauthor'},
                   linktitle => '',
               },
               {
                 linktext => $linktext{'setcrseditors'},                  linktext => $linktext{'setcrseditors'},
                 icon => 'crseditors.png',                  icon => 'crseditors.png',
                 #help => '',                  #help => '',
Line 943  sub domain_postsubtimeout { Line 973  sub domain_postsubtimeout {
 sub get_lctype {  sub get_lctype {
     my ($type,$settings) = @_;      my ($type,$settings) = @_;
     my $lctype = lc($type);      my $lctype = lc($type);
     unless ($type eq 'Community') {      unless (($type eq 'Community') || ($type eq 'Placement')) {
         $lctype = 'unofficial';          $lctype = 'unofficial';
         if (ref($settings) eq 'HASH') {          if (ref($settings) eq 'HASH') {
             if ($settings->{'internal.coursecode'}) {              if ($settings->{'internal.coursecode'}) {
Line 998  sub print_catsettings { Line 1028  sub print_catsettings {
                       '&nbsp;<label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.$disabled.' />'.&mt('Yes').'</label>&nbsp;&nbsp;&nbsp;<label><input name="hidefromcat" type="radio" value="" '.$excludeoff.$disabled.' />'.&mt('No').'</label></p><p>');                        '&nbsp;<label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.$disabled.' />'.&mt('Yes').'</label>&nbsp;&nbsp;&nbsp;<label><input name="hidefromcat" type="radio" value="" '.$excludeoff.$disabled.' />'.&mt('No').'</label></p><p>');
             if ($type eq 'Community') {              if ($type eq 'Community') {
                 $r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.").'</p>');                  $r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.").'</p>');
               } elsif ($type eq 'Placement') {
                   $r->print(&mt("If a placement test has been categorized using at least one of the categories defined for placement tests in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.").'</p>');
             } else {              } else {
                 $r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':</p><ul>'.                  $r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':</p><ul>'.
                           '<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'.                            '<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'.
Line 1030  sub print_catsettings { Line 1062  sub print_catsettings {
                           '<p>'.&mt('No categories defined for this domain.'));                            '<p>'.&mt('No categories defined for this domain.'));
                 $shownsave = 1;                  $shownsave = 1;
             }              }
             if ($type eq 'Community') {              if (($type eq 'Community') || ($type eq 'Placement')) {
                 $r->print('</p>');                  $r->print('</p>');
             } elsif ($shownsave) {              } elsif ($shownsave) {
                 $r->print('<br />'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses.').'</p>');                  $r->print('<br />'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses.').'</p>');
Line 1633  sub modify_course { Line 1665  sub modify_course {
                  'internal.pendingco-owners','internal.selfenrollmgrdc',                   'internal.pendingco-owners','internal.selfenrollmgrdc',
                  'internal.selfenrollmgrcc','internal.mysqltables');                   'internal.selfenrollmgrcc','internal.mysqltables');
     my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles();      my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles();
     unless ($type eq 'Community') {      unless (($type eq 'Community') || ($type eq 'Placement')) {
         push(@items,('internal.coursecode','internal.authtype','internal.autharg',          push(@items,('internal.coursecode','internal.authtype','internal.autharg',
                      'internal.sectionnums','internal.crosslistings'));                       'internal.sectionnums','internal.crosslistings'));
         if (&showcredits($cdom)) {          if (&showcredits($cdom)) {
Line 1868  sub modify_course { Line 1900  sub modify_course {
                     $nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>';                      $nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>';
                 }                  }
             }              }
             if (($type ne 'Community') && ($changed{'code'} || $changed{'owner'})) {              if (($type ne 'Community') && ($type ne 'Placement') && ($changed{'code'} || $changed{'owner'})) {
                 if ( $newattr{'courseowner'} eq '') {                  if ( $newattr{'courseowner'} eq '') {
             push(@warnings,&mt('There is no owner associated with this LON-CAPA course.').              push(@warnings,&mt('There is no owner associated with this LON-CAPA course.').
                                    '<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.'));                                     '<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.'));
Line 2813  function togglePostsubmit(caller) { Line 2845  function togglePostsubmit(caller) {
 ENDSCRIPT  ENDSCRIPT
   
     } elsif (($phase eq 'setltiauth') || ($phase eq 'setexttool') ||      } elsif (($phase eq 'setltiauth') || ($phase eq 'setexttool') ||
              ($phase eq 'setcrseditors')) {               ($phase eq 'setcrsauthor') || ($phase eq 'setcrseditors')) {
         $js .= <<"ENDJS";          $js .= <<"ENDJS";
 function toggleOptions(form,phase) {  function toggleOptions(form,phase) {
     var radioname;      var radioname;
Line 2865  ENDJS Line 2897  ENDJS
         $starthash = {          $starthash = {
            add_entries => {'onload' => "hide_searching(); courseSet(document.filterpicker.official, 'load');"},             add_entries => {'onload' => "hide_searching(); courseSet(document.filterpicker.official, 'load');"},
                      };                       };
     } elsif ($env{'form.phase'} =~ /^set(ltiauth|exttool|crseditors)$/) {      } elsif ($env{'form.phase'} =~ /^set(ltiauth|exttool|crsauthor|crseditors)$/) {
         $starthash = {          $starthash = {
            add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"},             add_entries => {'onload' => "toggleOptions(document.$env{'form.phase'},'$env{'form.phase'}');"},
                      };                       };
Line 2876  ENDJS Line 2908  ENDJS
     my $bread_text = "View/Modify Courses/Communities";      my $bread_text = "View/Modify Courses/Communities";
     if ($type eq 'Community') {      if ($type eq 'Community') {
         $bread_text = 'Community Settings';          $bread_text = 'Community Settings';
       } elsif ($type eq 'Placement') {
           $bread_text = 'Placement Test Settings';
     } else {      } else {
         $bread_text = 'Course Settings';          $bread_text = 'Course Settings';
     }      }
Line 2975  sub hidden_form_elements { Line 3009  sub hidden_form_elements {
           'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota',            'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota',
           'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st',            'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st',
           'sections','newsec','mysqltables','nopasswdchg','ltiauth','ltiauthset',            'sections','newsec','mysqltables','nopasswdchg','ltiauth','ltiauthset',
           'exttoolset','exttool','crseditorsset','crseditors'],            'exttoolset','exttool','crsauthorset','crsauthor','crseditorsset','crseditors'],
           ['^selfenrollmgr_','^selfenroll_'])."\n".            ['^selfenrollmgr_','^selfenroll_'])."\n".
           '<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />';            '<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />';
     return $hidden_elements;      return $hidden_elements;
Line 3013  sub get_permission { Line 3047  sub get_permission {
             processltiauth    => 'edit',              processltiauth    => 'edit',
             setexttool        => 'edit',              setexttool        => 'edit',
             processexttool    => 'edit',              processexttool    => 'edit',
               setcrsauthor      => 'edit',
               processcrsauthor  => 'edit',
             setcrseditors     => 'edit',              setcrseditors     => 'edit',
             processcrseditors => 'edit',              processcrseditors => 'edit',
         );          );
Line 3032  sub get_permission { Line 3068  sub get_permission {
             adhocrole     => 'custom',              adhocrole     => 'custom',
             setltiauth    => 'view',              setltiauth    => 'view',
             setexttool    => 'view',              setexttool    => 'view',
               setcrsauthor  => 'view',
             setcrseditors => 'view',              setcrseditors => 'view',
         );          );
         if ($passwdconf{'crsownerchg'}) {          if ($passwdconf{'crsownerchg'}) {
Line 3054  sub devalidate_remote_instcats { Line 3091  sub devalidate_remote_instcats {
         }          }
         $modified_dom = '';          $modified_dom = '';
     }      }
     return;      return OK;
 }  }
   
 sub handler {  sub handler {
Line 3098  sub handler { Line 3135  sub handler {
             }              }
             if ($type eq 'Community') {              if ($type eq 'Community') {
                 $choose_text = "Choose a community";                  $choose_text = "Choose a community";
               } elsif ($type eq 'Placement') {
                   $choose_text = "Choose a placement test";
             } else {              } else {
                 $choose_text = "Choose a course";                  $choose_text = "Choose a course";
             }              }
Line 3114  sub handler { Line 3153  sub handler {
                     my $enter_text;                      my $enter_text;
                     if ($type eq 'Community') {                      if ($type eq 'Community') {
                         $enter_text = 'Enter community';                          $enter_text = 'Enter community';
                       } elsif ($type eq 'Placement') {
                           $enter_text = 'Enter placement test';
                     } else {                      } else {
                         $enter_text = 'Enter course';                          $enter_text = 'Enter course';
                     }                      }
Line 3256  sub handler { Line 3297  sub handler {
                              {href=>"javascript:changePage(document.$phase,'$phase')",                               {href=>"javascript:changePage(document.$phase,'$phase')",
                               text=>"Result"});                                text=>"Result"});
                             &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'exttool');                              &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'exttool');
                           } elsif (($phase eq 'setcrsauthor') && ($permission->{'setcrsauthor'})) {
                               &Apache::lonhtmlcommon::add_breadcrumb
                               ({href=>"javascript:changePage(document.$phase,'$phase')",
                                 text=>"In-course authoring permission"});
                               &print_default_overrides($r,$cdom,$cnum,$cdesc,$type,$readonly,'crsauthor');
                           } elsif (($phase eq 'processcrsauthor') && ($permission->{'processcrsauthor'})) {
                               &Apache::lonhtmlcommon::add_breadcrumb
                               ({href=>"javascript:changePage(document.$phase,'setcrsauthor')",
                                 text=>"In-course authoring permission"},
                                {href=>"javascript:changePage(document.$phase,'$phase')",
                                 text=>"Result"});
                               &modify_default_overrides($r,$cdom,$cnum,$cdesc,$domdesc,$type,'crsauthor');
                         } elsif (($phase eq 'setcrseditors') && ($permission->{'setcrseditors'})) {                          } elsif (($phase eq 'setcrseditors') && ($permission->{'setcrseditors'})) {
                             &Apache::lonhtmlcommon::add_breadcrumb                              &Apache::lonhtmlcommon::add_breadcrumb
                             ({href=>"javascript:changePage(document.$phase,'$phase')",                              ({href=>"javascript:changePage(document.$phase,'$phase')",
Line 3274  sub handler { Line 3327  sub handler {
                     $r->print('<span class="LC_error">');                      $r->print('<span class="LC_error">');
                     if ($type eq 'Community') {                      if ($type eq 'Community') {
                         $r->print(&mt('The community you selected is not a valid community in this domain'));                          $r->print(&mt('The community you selected is not a valid community in this domain'));
                       } elsif ($type eq 'Placement') {
                           $r->print(&mt('The course you selected is not a valid placement test in this domain'));
                     } else {                      } else {
                         $r->print(&mt('The course you selected is not a valid course in this domain'));                          $r->print(&mt('The course you selected is not a valid course in this domain'));
                     }                      }

Removed from v.1.79.2.9.2.7  
changed lines
  Added in v.1.107


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