--- loncom/interface/lonrequestcourse.pm 2014/04/09 10:50:07 1.77 +++ loncom/interface/lonrequestcourse.pm 2014/05/14 18:20:09 1.83 @@ -1,7 +1,7 @@ # The LearningOnline Network # Request a course # -# $Id: lonrequestcourse.pm,v 1.77 2014/04/09 10:50:07 raeburn Exp $ +# $Id: lonrequestcourse.pm,v 1.83 2014/05/14 18:20:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -174,6 +174,22 @@ sub handler { } else { &textbook_request_disabled($r,$dom,\%can_request); } + } elsif ($action eq 'display') { + my ($uname,$udom,$result,$warning) = &domcoord_display($dom); + if ($warning ne '') { + my $args = { only_body => 1 }; + $r->print(&header('Course/Community Requests','','' ,'',$args). + '
'.&mt('Your community request has been updated').'
'; - } else { - $output .= ''.&mt('Your course request has been updated').'
'; - } - $output .= ¬ification_information($disposition,$req_notifylist,$dom,$cnum,$now); - if ($disposition eq 'approval') { + if ($storeresult eq 'ok') { + my $postprocess; + if (($disposition eq 'approval') || ($disposition eq 'pending')) { + my $updateaction = $disposition; + if ($disposition eq 'approval') { + $updateaction = 'queued'; + } my $fullname = &Apache::loncommon::plainname($env{'user.name'}, $env{'user.domain'}); - my $postprocess = - &Apache::lonnet::auto_crsreq_update($dom,$cnum,$crstype,'queued',$env{'user.name'}, + $postprocess = + &Apache::lonnet::auto_crsreq_update($dom,$cnum,$crstype,$updateaction,$env{'user.name'}, $env{'user.domain'},$fullname,$env{'form.cdescr'}); + } + if ($modified && $queued) { + if ($crstype eq 'community') { + $output .= ''.&mt('Your community request has been updated').'
'; + } else { + $output .= ''.&mt('Your course request has been updated').'
'; + } + if ($disposition eq 'approval') { + $output .= ¬ification_information($disposition,$req_notifylist,$dom,$cnum,$now); + } + } + if ($disposition eq 'approval') { if ((ref($postprocess) eq 'HASH') && ((ref($postprocess->{'queuedmsg'}) eq 'HASH') || ($postprocess->{'queuedweb'}))) { ¬ification_information($disposition,undef,$dom,$cnum,$now,undef,$postprocess); } + } elsif ($disposition eq 'pending') { + my $pendingform; + if ($crstype ne 'official') { + $pendingform = &pending_validation_form($dom,$cnum,$crstype,$now,$token, + $lonhost,$env{'form.cdescr'}); + } + if ($pendingform) { + $output .= $pendingform; + } else { + $output .= ¬ification_information($disposition,undef,$dom,$cnum,$now,undef,$postprocess); + } } } if ($validationerror ne '') { @@ -4002,11 +4087,20 @@ sub notification_information { } } } elsif ($disposition eq 'pending') { - $output .= '