Diff for /loncom/interface/lonrequestcourse.pm between versions 1.88 and 1.89

version 1.88, 2015/06/08 22:06:52 version 1.89, 2015/06/09 21:22:57
Line 768  END Line 768  END
 ";  ";
         }          }
     }      }
     my %lt = &Apache::lonlocal::texthash(      my %js_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 in this domain.',          community => 'You are not permitted to request creation of a community in this domain.',
Line 776  END Line 776  END
         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.',
     );       ); 
       &js_escape(\%js_lt);
     $js .= <<END;      $js .= <<END;
     if (crschoice == 'official') {      if (crschoice == 'official') {
         if (official != 1) {          if (official != 1) {
             alert("$lt{'official'}");              alert("$js_lt{'official'}");
             return false;              return false;
         }          }
     } else {      } else {
         if (crschoice == 'unofficial') {          if (crschoice == 'unofficial') {
             if (unofficial != 1) {              if (unofficial != 1) {
                 alert("$lt{'unofficial'}");                  alert("$js_lt{'unofficial'}");
                 return false;                  return false;
             }              }
         } else {          } else {
             if (crschoice == 'community') {              if (crschoice == 'community') {
                 if (community != 1) {                  if (community != 1) {
                     alert("$lt{'community'}");                      alert("$js_lt{'community'}");
                     return false;                      return false;
                 }                  }
             } else {              } else {
                 if (crschoice == 'textbook') {                  if (crschoice == 'textbook') {
                     if (textbook != 1) {                      if (textbook != 1) {
                         alert("$lt{'community'}");                          alert("$js_lt{'textbook'}");
                         return false;                          return false;
                     }                      }
                 } else {                  } else {
                     if (actionchoice == 'new') {                      if (actionchoice == 'new') {
                         alert('$lt{'all'}'+'\\n'+'$lt{'allt'}');                          alert('$js_lt{'all'}'+'\\n'+'$js_lt{'allt'}');
                         return false;                          return false;
                     }                      }
                 }                  }
Line 1175  sub enrollment_lcsec_js { Line 1176  sub enrollment_lcsec_js {
     my %alerts = &section_check_alerts();      my %alerts = &section_check_alerts();
     my $secname = $alerts{'badsec'};      my $secname = $alerts{'badsec'};
     my $secnone = $alerts{'reserved'};      my $secnone = $alerts{'reserved'};
       &js_escape(\$secname);
       &js_escape(\$secnone);
     my $output = '      my $output = '
 function validateEnrollSections(formname,nextstate) {  function validateEnrollSections(formname,nextstate) {
     var badsectotal = 0;      var badsectotal = 0;
Line 1232  function validateEnrollSections(formname Line 1235  function validateEnrollSections(formname
   
 sub personnel_lcsec_js {  sub personnel_lcsec_js {
     my %alerts = &section_check_alerts();      my %alerts = &section_check_alerts();
     my $secname = $alerts{'badsec'}.'\\n'.$alerts{'separate'};      my $secname = $alerts{'badsec'}."\n".$alerts{'separate'};
     my $secnone = $alerts{'reserved'};      my $secnone = $alerts{'reserved'};
       &js_escape(\$secname);
       &js_escape(\$secnone);
     my $output = '      my $output = '
 function validatePersonnelSections(formname,nextstate) {  function validatePersonnelSections(formname,nextstate) {
     var badsectotal = 0;      var badsectotal = 0;
Line 2416  ENDJS Line 2421  ENDJS
 }  }
   
 sub viewcancel_javascript {  sub viewcancel_javascript {
     my $alert = &mt('Are you sure you want to cancel this request?').'\\n'.      my $alert = &mt('Are you sure you want to cancel this request?')."\n".
                 &mt('Your request will be removed.');                  &mt('Your request will be removed.');
       &js_escape(\$alert);
     return << "ENDJS";      return << "ENDJS";
 function nextPage(formname,nextstate) {  function nextPage(formname,nextstate) {
     if (confirm('$alert')) {      if (confirm('$alert')) {
Line 3059  sub dates_from_form { Line 3065  sub dates_from_form {
   
 sub courseinfo_form {  sub courseinfo_form {
     my ($dom,$formname,$crstype,$next,$description) = @_;      my ($dom,$formname,$crstype,$next,$description) = @_;
     my %lt = &Apache::lonlocal::texthash(      my %js_lt = &Apache::lonlocal::texthash(
                 official => 'You must provide a (brief) course description.',                  official => 'You must provide a (brief) course description.',
                 community => 'You must provide a (brief) community description.'                  community => 'You must provide a (brief) community description.'
              );               );
     $lt{'unofficial'} = $lt{'official'};      &js_escape(\%js_lt);
     $lt{'textbook'} = $lt{'official'};      $js_lt{'unofficial'} = $js_lt{'official'};
       $js_lt{'textbook'} = $js_lt{'official'};
     my $js_validate = <<"ENDJS";      my $js_validate = <<"ENDJS";
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA['  // <![CDATA['
   
 function validateForm() {  function validateForm() {
     if ((document.$formname.cdescr.value == "")  || (document.$formname.cdescr.value == "undefined")) {      if ((document.$formname.cdescr.value == "")  || (document.$formname.cdescr.value == "undefined")) {
         alert('$lt{$crstype}');          alert('$js_lt{$crstype}');
         return;          return;
     }      }
     nextPage(document.$formname,'$next');      nextPage(document.$formname,'$next');
Line 4881  sub textbook_request_javascript { Line 4888  sub textbook_request_javascript {
     my ($numprefab,$numcurrent) = @_;      my ($numprefab,$numcurrent) = @_;
     return unless (ref($numprefab) eq 'HASH');      return unless (ref($numprefab) eq 'HASH');
     return if (!$numprefab->{'textbooks'} && !$numprefab->{'templates'} && !$numcurrent);      return if (!$numprefab->{'textbooks'} && !$numprefab->{'templates'} && !$numcurrent);
     my %lt = &Apache::lonlocal::texthash(      my %js_lt = &Apache::lonlocal::texthash(
                  choose   => 'Please select a content option.',                   choose   => 'Please select a content option.',
                  textbook => 'Please select a textbook, or choose a different option.',                   textbook => 'Please select a textbook, or choose a different option.',
                  template => 'Please select a template, or choose a different option.',                           template => 'Please select a template, or choose a different option.',        
                  existing => 'Please select one of your existing courses to copy, or choose a different option.',                   existing => 'Please select one of your existing courses to copy, or choose a different option.',
                  title    => 'Please enter a course title.',                   title    => 'Please enter a course title.',
              );               );
       &js_escape(\%js_lt);
     return <<"ENDSCRIPT";      return <<"ENDSCRIPT";
 function cloneChoice() {  function cloneChoice() {
     if (document.requestcourse.cloning) {      if (document.requestcourse.cloning) {
Line 4965  function validTextbookReq() { Line 4973  function validTextbookReq() {
         var radioLength = document.requestcourse.cloning.length;          var radioLength = document.requestcourse.cloning.length;
         if (radioLength == undefined) {          if (radioLength == undefined) {
             if (document.requestcourse.cloning.checked == false) {              if (document.requestcourse.cloning.checked == false) {
                 alert("$lt{'choose'}");                  alert("$js_lt{'choose'}");
                 return false;                  return false;
             } else {              } else {
                 cloneChoice = document.requestcourse.cloning.value;                  cloneChoice = document.requestcourse.cloning.value;
Line 4978  function validTextbookReq() { Line 4986  function validTextbookReq() {
                 }                  }
             }              }
             if (cloneChoice == 0) {              if (cloneChoice == 0) {
                 alert("$lt{'choose'}");                  alert("$js_lt{'choose'}");
                 return false;                  return false;
             }              }
         }          }
Line 5010  function validTextbookReq() { Line 5018  function validTextbookReq() {
            }             }
            if (chosen == 0) {             if (chosen == 0) {
                if (cloneChoice == 'textbook') {                 if (cloneChoice == 'textbook') {
                    alert("$lt{'textbook'}");                     alert("$js_lt{'textbook'}");
                } else {                 } else {
                    if (cloneChoice == 'template') {                     if (cloneChoice == 'template') {
                        alert("$lt{'template'}");                         alert("$js_lt{'template'}");
                    } else {                     } else {
                        alert("$lt{'existing'}");                         alert("$js_lt{'existing'}");
                    }                     }
                }                 }
                return false;                 return false;
Line 5023  function validTextbookReq() { Line 5031  function validTextbookReq() {
         }          }
     }      }
     if (document.requestcourse.cdescr.value == '') {      if (document.requestcourse.cdescr.value == '') {
         alert("$lt{'title'}");          alert("$js_lt{'title'}");
         return false;          return false;
     }      }
     return true;      return true;

Removed from v.1.88  
changed lines
  Added in v.1.89


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