Diff for /loncom/interface/lonrequestcourse.pm between versions 1.68 and 1.69

version 1.68, 2013/07/22 18:06:51 version 1.69, 2013/12/24 19:15:11
Line 136  sub handler { Line 136  sub handler {
     my (%states,%stored);      my (%states,%stored);
     my ($jscript,$uname,$udom,$result,$warning,$showcredits,$instcredits);      my ($jscript,$uname,$udom,$result,$warning,$showcredits,$instcredits);
     my %domdefs = &Apache::lonnet::get_domain_defaults($dom);      my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
     if ($domdefs{'officialcredits'} || $domdefs{'unofficialcredits'}) {      if ($domdefs{'officialcredits'} || $domdefs{'unofficialcredits'} || $domdefs{'textbookcredits'}) {
         $showcredits = 1;          $showcredits = 1;
     }      }
   
Line 614  sub form_elements { Line 614  sub form_elements {
             if ($showcredits && $instcredits eq '') {              if ($showcredits && $instcredits eq '') {
                 $extras{'coursecredits'} = 'text';                  $extras{'coursecredits'} = 'text';
             }              }
         } elsif ($env{'form.crstype'} eq 'unofficial') {          } elsif (($env{'form.crstype'} eq 'unofficial') || ($env{'form.crstype'} eq 'textbook')) {
             if ($showcredits) {              if ($showcredits) {
                 $extras{'coursecredits'} = 'text';                  $extras{'coursecredits'} = 'text';
             }              }
Line 721  $nextstate_setter Line 721  $nextstate_setter
 function check_can_request(crschoice,actionchoice) {  function check_can_request(crschoice,actionchoice) {
     var official = '';      var official = '';
     var unofficial = '';      var unofficial = '';
     var community = '';          var community = '';
       var textbook = '';
 END  END
     if (ref($can_request) eq 'HASH') {      if (ref($can_request) eq 'HASH') {
         foreach my $item (keys(%{$can_request})) {          foreach my $item (keys(%{$can_request})) {
Line 733  END Line 734  END
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
         official => 'You are not permitted to request creation of an official course in this domain.',          official => 'You are not permitted to request creation of an official course in this domain.',
         unofficial => 'You are not permitted to request creation of an unofficial course in this domain.',          unofficial => 'You are not permitted to request creation of an unofficial course in this domain.',
         community => 'You are not permitted to request creation of a community this domain.',          community => 'You are not permitted to request creation of a community in this domain.',
           textbook => 'You are not permitted to request creation of a textbook course in this domain',
         all => 'You must choose a specific course type when making a new course request.',          all => 'You must choose a specific course type when making a new course request.',
         allt => '"All types" is not allowed.',          allt => '"All types" is not allowed.',
     );       ); 
Line 756  END Line 758  END
                     return false;                      return false;
                 }                  }
             } else {              } else {
                 if (actionchoice == 'new') {                  if (crschoice == 'textbook') {
                     alert('$lt{'all'}'+'\\n'+'$lt{'allt'}');                      if (textbook != 1) {
                     return false;                          alert("$lt{'community'}");
                 }                                         return false;
                       }
                   } else {
                       if (actionchoice == 'new') {
                           alert('$lt{'all'}'+'\\n'+'$lt{'allt'}');
                           return false;
                       }
                   }
             }              }
         }          }
     }      }
Line 768  END Line 777  END
 END  END
     my ($pagetitle,$pageinfo,$domaintitle);      my ($pagetitle,$pageinfo,$domaintitle);
     if (ref($can_request) eq 'HASH') {      if (ref($can_request) eq 'HASH') {
         if (($can_request->{'official'}) || ($can_request->{'unofficial'})) {          if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || $can_request->{'textbook'}) {
             if ($can_request->{'community'}) {              if ($can_request->{'community'}) {
                 $pagetitle = 'Course/Community Requests';                  $pagetitle = 'Course/Community Requests';
                 $pageinfo = &mt('Request creation of a new course or community, or review your pending requests.');                  $pageinfo = &mt('Request creation of a new course or community, or review your pending requests.');
Line 945  END Line 954  END
                 $title = &mt('Pending requests for official courses');                  $title = &mt('Pending requests for official courses');
             } elsif ($env{'form.crstype'} eq 'unofficial') {              } elsif ($env{'form.crstype'} eq 'unofficial') {
                 $title = &mt('Pending requests for unofficial courses');                  $title = &mt('Pending requests for unofficial courses');
               } elsif ($env{'form.crstype'} eq 'textbook') {
                   $title = &mt('Pending requests for textbook courses');
             } else {              } else {
                 $title = &mt('Pending course/community requests');                   $title = &mt('Pending course/community requests'); 
             }              }
Line 1771  sub print_enrollment_menu { Line 1782  sub print_enrollment_menu {
                 $hascredits = 1;                  $hascredits = 1;
             }              }
         }          }
     } elsif ($env{'form.crstype'} eq 'unofficial') {      } elsif (($env{'form.crstype'} eq 'unofficial') || ($env{'form.crstype'} eq 'textbook')) {
         if ($showcredits) {          if ($showcredits) {
             $creditsrow = '<span class="LC_nobreak">'.              $creditsrow = '<span class="LC_nobreak">'.
                           '<input type="text" size="3" name="coursecredits"'.                            '<input type="text" size="3" name="coursecredits"'.
Line 1976  sub print_personnel_menu { Line 1987  sub print_personnel_menu {
             official => 'Requestor is automatically assigned Course Coordinator role.',              official => 'Requestor is automatically assigned Course Coordinator role.',
         );          );
         $lt{'unofficial'} = $lt{'official'};          $lt{'unofficial'} = $lt{'official'};
           $lt{'textbook'} = $lt{'textbook'};
         $output .= &Apache::lonhtmlcommon::row_headline().          $output .= &Apache::lonhtmlcommon::row_headline().
                   '<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').'&nbsp;'.$lt{$crstype}.' '.&mt('Include other personnel?').'</h3>';                    '<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').'&nbsp;'.$lt{$crstype}.' '.&mt('Include other personnel?').'</h3>';
     }      }
Line 2514  sub reqstatus_names { Line 2526  sub reqstatus_names {
                         rejected  => 'Request rejected',                          rejected  => 'Request rejected',
                         cancelled => 'Request cancelled',                          cancelled => 'Request cancelled',
             );              );
     if (($crstype eq 'official') || ($crstype eq 'unofficial')) {      if (($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook')) {
         $statusnames{'created'} = &mt('Course created');          $statusnames{'created'} = &mt('Course created');
     } elsif ($crstype eq 'community') {      } elsif ($crstype eq 'community') {
         $statusnames{'created'} = &mt('Community created');          $statusnames{'created'} = &mt('Community created');
Line 2731  sub print_review { Line 2743  sub print_review {
             $section_values .= $xlistinfo;              $section_values .= $xlistinfo;
         }          }
         $section_values .= '</table></td>';          $section_values .= '</table></td>';
     } elsif ($env{'form.crstype'} eq 'unofficial') {      } elsif (($env{'form.crstype'} eq 'unofficial') || ($env{'form.crstype'} eq 'textbook')) {
         $inst_headers .= '<th>'.&mt('Credits').'</th>';          $inst_headers .= '<th>'.&mt('Credits').'</th>';
         $inst_values .= '<td>'.$env{'form.coursecredits'}.'</td>';          $inst_values .= '<td>'.$env{'form.coursecredits'}.'</td>';
     }      }
Line 2910  sub courseinfo_form { Line 2922  sub courseinfo_form {
                 community => 'You must provide a (brief) community description.'                  community => 'You must provide a (brief) community description.'
              );               );
     $lt{'unofficial'} = $lt{'official'};      $lt{'unofficial'} = $lt{'official'};
       $lt{'textbook'} = $lt{'official'};
     my $js_validate = <<"ENDJS";      my $js_validate = <<"ENDJS";
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA['  // <![CDATA['
Line 3482  sub print_request_outcome { Line 3495  sub print_request_outcome {
             $output = &mt('You are not permitted to request creation of unofficial courses.');              $output = &mt('You are not permitted to request creation of unofficial courses.');
         } elsif ($crstype eq 'community') {          } elsif ($crstype eq 'community') {
             $output = &mt('You are not permitted to request creation of communities');              $output = &mt('You are not permitted to request creation of communities');
           } elsif ($crstype eq 'textbook') {
               $output = &mt('You are not permitted to request creation of textbook courses');
         } else {          } else {
             $output = &mt('Unrecognized course type: [_1]',$crstype);              $output = &mt('Unrecognized course type: [_1]',$crstype);
         }          }
Line 3838  sub check_autolimit { Line 3853  sub check_autolimit {
             if (($crstype eq 'community') &&               if (($crstype eq 'community') && 
                 (exists($crsroles{$cnum.':'.$cdom.':co'}))) {                  (exists($crsroles{$cnum.':'.$cdom.':co'}))) {
                 $count ++;                  $count ++;
             } elsif ((($crstype eq 'official') || ($crstype eq 'unofficial')) &&              } elsif ((($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook')) &&
                      (exists($crsroles{$cnum.':'.$cdom.':cc'}))) {                       (exists($crsroles{$cnum.':'.$cdom.':cc'}))) {
                 $count ++;                  $count ++;
             }              }
Line 3907  sub retrieve_settings { Line 3922  sub retrieve_settings {
                         $env{'form.coursecredits'} = $reqinfo{'defaultcredits'};                          $env{'form.coursecredits'} = $reqinfo{'defaultcredits'};
                     }                      }
                 }                  }
             } elsif ($reqinfo{'crstype'} eq 'unofficial') {              } elsif (($reqinfo{'crstype'} eq 'unofficial') || ($reqinfo{'crstype'} eq 'textbook')) {
                 $env{'form.coursecredits'} = $reqinfo{'defaultcredits'};                  $env{'form.coursecredits'} = $reqinfo{'defaultcredits'};
             }              }
             my @currsec;              my @currsec;

Removed from v.1.68  
changed lines
  Added in v.1.69


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