--- loncom/interface/lonmodifycourse.pm 2023/07/05 18:57:55 1.79.2.9.2.3 +++ loncom/interface/lonmodifycourse.pm 2023/09/04 20:46:02 1.79.2.9.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.79.2.9.2.3 2023/07/05 18:57:55 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.79.2.9.2.4 2023/09/04 20:46:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -775,15 +775,20 @@ sub print_setquota { $cdom,$cnum); my $coursequota = $settings{'internal.coursequota'}; my $uploadquota = $settings{'internal.uploadquota'}; - if ($coursequota eq '') { - $coursequota = $staticdefaults{'coursequota'}; - } - if ($uploadquota eq '') { + if (($uploadquota eq '') || ($coursequota eq '')) { my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); my $quotatype = &Apache::lonuserutils::get_extended_type($cdom,$cnum,$type,\%settings); - $uploadquota = $domdefs{$quotatype.'quota'}; if ($uploadquota eq '') { - $uploadquota = $staticdefaults{'uploadquota'}; + $uploadquota = $domdefs{$quotatype.'quota'}; + if ($uploadquota eq '') { + $uploadquota = $staticdefaults{'uploadquota'}; + } + } + if ($coursequota eq '') { + $coursequota = $domdefs{$quotatype.'coursequota'}; + if ($coursequota eq '') { + $coursequota = $staticdefaults{'coursequota'}; + } } } &print_header($r,$type); @@ -2710,9 +2715,10 @@ ENDJS $js .= <<"ENDSCRIPT"; function verify_quota() { - var newquota = document.setquota.coursequota.value; + var newcoursequota = document.setquota.coursequota.value; + var newuploadquota = document.setquota.uploadquota.value; var num_reg = $regexp; - if (num_reg.test(newquota)) { + if ((num_reg.test(newcoursequota)) && (num_reg.test(newuploadquota))) { changePage(document.setquota,'processquota'); } else { alert("$invalid\\n$alert");