Diff for /loncom/interface/lonmodifycourse.pm between versions 1.80 and 1.81

version 1.80, 2016/04/02 04:30:21 version 1.81, 2016/04/04 01:09:48
Line 41  use LONCAPA qw(:DEFAULT :match); Line 41  use LONCAPA qw(:DEFAULT :match);
   
 sub get_dc_settable {  sub get_dc_settable {
     my ($type,$cdom) = @_;      my ($type,$cdom) = @_;
     if ($type eq 'Community') {      if (($type eq 'Community') || ($type eq 'Placement')) {
         return ('courseowner','selfenrollmgrdc','selfenrollmgrcc');          return ('courseowner','selfenrollmgrdc','selfenrollmgrcc');
     } else {      } else {
         my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc');          my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc');
Line 71  sub catalog_settable { Line 71  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 167  sub print_course_search_page { Line 174  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 178  sub print_course_search_page { Line 187  sub print_course_search_page {
                   '<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n".                    '<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n".
                   '<li>'.&mt('View or modify community settings which only a [_1] may modify.',$dctitle).                    '<li>'.&mt('View or modify community settings which only a [_1] may modify.',$dctitle).
                   '</li>'."\n".'</ul>');                    '</li>'."\n".'</ul>');
       } elsif ($type eq 'Placement') {
           $r->print(&mt('Actions available after searching for a placement test:').'<ul>'.
                     '<li>'.&mt('Enter the placement test with the role of [_1]',$cctitle).'</li>'."\n".
                     '<li>'.&mt('View or modify placement test settings which only a [_1] may modify.',$dctitle).
                     '</li>'."\n".'</ul>');
     } else {      } else {
         $r->print(&mt('Actions available after searching for a course:').'<ul>'.          $r->print(&mt('Actions available after searching for a course:').'<ul>'.
                   '<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n".                    '<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n".
Line 254  sub print_modification_menu { Line 268  sub print_modification_menu {
         $categorytitle = 'View/Modify Course Settings';          $categorytitle = 'View/Modify Course Settings';
         $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');          $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');
         $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.');          $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.');
         if (&showcredits($dom)) {          if ($type eq 'Placement') {
               $setparams_text = 'View/Modify course owner and self-enrollment';
           } elsif (&showcredits($dom)) {
             $setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, and self-enrollment';              $setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, and self-enrollment';
         } else {          } else {
             $setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment';              $setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment';
Line 320  sub print_modification_menu { Line 336  sub print_modification_menu {
             {              {
                 linktext => 'Display current settings for automated enrollment',                  linktext => 'Display current settings for automated enrollment',
                 url => &phaseurl('viewparms'),                  url => &phaseurl('viewparms'),
                 permission => ($type ne 'Community'),                  permission => (($type ne 'Community') && ($type ne 'Placement')),
                 #help => '',                  #help => '',
                 icon => 'roles.png',                  icon => 'roles.png',
                 linktitle => ''                  linktitle => ''
Line 359  sub print_modification_menu { Line 375  sub print_modification_menu {
     if ($type eq 'Community') {      if ($type eq 'Community') {
         $menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'."\n".          $menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'."\n".
                       '<li>'.&mt('Override defaults for who configures self-enrollment for this specific community').'</li>'."\n";                        '<li>'.&mt('Override defaults for who configures self-enrollment for this specific community').'</li>'."\n";
       } elsif ($type eq 'Placement') {
           $menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".
                         '<li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n";
   
     } else {      } else {
         $menu_html .=  '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".          $menu_html .=  '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".
                        '<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>'."\n";                         '<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>'."\n";
         if (&showcredits($dom)) {          if (($type ne 'Placement') && &showcredits($dom)) {
             $menu_html .= '<li>'.&mt('Default credits earned by student on course completion.').'</li>'."\n";              $menu_html .= '<li>'.&mt('Default credits earned by student on course completion.').'</li>'."\n";
         }          }
         $menu_html .= ' <li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n";          $menu_html .= ' <li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n";
Line 693  sub print_catsettings { Line 713  sub print_catsettings {
                       '&nbsp;<label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.' />'.&mt('Yes').'</label>&nbsp;&nbsp;&nbsp;<label><input name="hidefromcat" type="radio" value="" '.$excludeoff.' />'.&mt('No').'</label><br /><p>');                        '&nbsp;<label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.' />'.&mt('Yes').'</label>&nbsp;&nbsp;&nbsp;<label><input name="hidefromcat" type="radio" value="" '.$excludeoff.' />'.&mt('No').'</label><br /><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."));                  $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."));
               } 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."));
             } 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").':<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").':<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 714  sub print_catsettings { Line 736  sub print_catsettings {
             } else {              } else {
                 $r->print(&mt('No categories defined for this domain'));                  $r->print(&mt('No categories defined for this domain'));
             }              }
             unless ($type eq 'Community') {               unless (($type eq 'Community') || ($type eq 'Placement')) { 
                 $r->print('<p>'.&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, in addition to receiving a listing under any manually assigned categor(ies).').'</p>');                  $r->print('<p>'.&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, in addition to receiving a listing under any manually assigned categor(ies).').'</p>');
             }              }
         }          }
Line 831  sub print_course_modification_page { Line 853  sub print_course_modification_page {
         $r->print(&Apache::lonhtmlcommon::row_title(          $r->print(&Apache::lonhtmlcommon::row_title(
                   &Apache::loncommon::help_open_topic('Modify_Community_Owner').                    &Apache::loncommon::help_open_topic('Modify_Community_Owner').
                   '&nbsp;'.&mt('Community Owner'))."\n");                    '&nbsp;'.&mt('Community Owner'))."\n");
       } elsif ($crstype eq 'Placement') {
            $r->print(&Apache::lonhtmlcommon::row_title(
                      &Apache::loncommon::help_open_topic('Modify_Course_Owner').
                         '&nbsp;'.&mt('Course Owner'))."\n");
     } else {      } else {
         $r->print(&Apache::lonhtmlcommon::row_title(          $r->print(&Apache::lonhtmlcommon::row_title(
                       &Apache::loncommon::help_open_topic('Modify_Course_Instcode').                        &Apache::loncommon::help_open_topic('Modify_Course_Instcode').
Line 905  sub print_course_modification_page { Line 931  sub print_course_modification_page {
               '<br />'.&Apache::lonhtmlcommon::row_closure(1).                '<br />'.&Apache::lonhtmlcommon::row_closure(1).
               &Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements.                &Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements.
               '<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');');                '<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');');
     if ($crstype eq 'Community') {      if (($crstype eq 'Community') || ($crstype eq 'Placement')) {
         $r->print('this.form.submit();"');          $r->print('this.form.submit();"');
     } else {      } else {
         $r->print('javascript:verify_message(this.form);"');          $r->print('javascript:verify_message(this.form);"');
Line 1026  sub modify_course { Line 1052  sub modify_course {
                  'internal.pendingco-owners','internal.selfenrollmgrdc',                   'internal.pendingco-owners','internal.selfenrollmgrdc',
                  'internal.selfenrollmgrcc');                   'internal.selfenrollmgrcc');
     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 1044  sub modify_course { Line 1070  sub modify_course {
     if ($type eq 'Community') {      if ($type eq 'Community') {
         %changed = ( owner  => 0 );          %changed = ( owner  => 0 );
         $ccrole = 'co';          $ccrole = 'co';
       } elsif ($type eq 'Placement') {
           %changed = ( owner  => 0 );
           $ccrole = 'cc';
     } else {      } else {
         %changed = ( code  => 0,          %changed = ( code  => 0,
                      owner => 0,                       owner => 0,
Line 1204  sub modify_course { Line 1233  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 2041  ENDSCRIPT Line 2070  ENDSCRIPT
     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 2174  sub handler { Line 2205  sub handler {
             }              }
             my $choose_text;              my $choose_text;
             my $type = $env{'form.type'};              my $type = $env{'form.type'};
   print STDERR "type is ||$type||\n";
             if ($type eq '') {              if ($type eq '') {
                 $type = 'Course';                  $type = 'Course';
             }              }
             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 2195  sub handler { Line 2229  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 2299  sub handler { Line 2335  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.80  
changed lines
  Added in v.1.81


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