--- loncom/interface/lonrequestcourse.pm 2021/03/06 23:08:03 1.95.2.6 +++ loncom/interface/lonrequestcourse.pm 2025/01/10 22:45:55 1.118 @@ -1,7 +1,7 @@ # The LearningOnline Network # Request a course # -# $Id: lonrequestcourse.pm,v 1.95.2.6 2021/03/06 23:08:03 raeburn Exp $ +# $Id: lonrequestcourse.pm,v 1.118 2025/01/10 22:45:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -163,6 +163,23 @@ sub handler { } if ($canreq) { + if (($env{'form.crstype'} eq 'lti') && ($env{'request.lti.login'}) && + ($env{'form.lti.reqrole'} eq 'cc') && ($env{'form.lti.reqcrs'}) && + ($env{'form.lti.sourcecrs'} ne '')) { + if ($action eq 'process') { + if ($can_request{'lti'}) { + my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$dom); + &process_textbook_request($r,$dom,$action,\%domdefs,\%domconfig,\%can_request,'lti'); + } else { + $r->print(&header('Course Request','','','',{ 'only_body' => 1}). + '
'.&mt('You do not have privileges to request creation of LTI courses.').'
'. + ''.
''.&mt('Records/page:').' '. - &Apache::lonmeta::selectbox('show',$curr->{'show'},undef, + &Apache::lonmeta::selectbox('show',$curr->{'show'},'',undef, (&mt('all'),5,10,20,50,100,1000,10000)). ' | '; my $startform = @@ -2925,7 +2941,7 @@ sub print_review { $inst_values .= ' | '.$env{'form.coursecredits'}.' | '; } - my %ctxt = &clone_text(); + my %ctxt = &clone_text($env{'form.crstype'}); $inst_headers .= ''.&mt('Clone From').' | '; if (($env{'form.cloning'}) && ($env{'form.clonecrs'} =~ /^$match_name$/) && @@ -2937,7 +2953,8 @@ sub print_review { my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'}, $env{'form.clonecrs'},('description','internal.coursecode')); if (keys(%courseenv) > 0) { - $inst_headers .= ''.$ctxt{'dsh'}.' | '; + $inst_headers .= ''.$ctxt{'dsh'}.' | '. + ''.$ctxt{'dpl'}.' | '; $inst_values .= ''.$courseenv{'description'}.' '; my $cloneinst = $courseenv{'internal.coursecode'}; if ($cloneinst ne '') { @@ -2953,6 +2970,14 @@ sub print_review { } else { $inst_values .= $ctxt{'ncd'}; } + $inst_values .= ' | '; + if ($env{'form.tinyurls'} eq 'delete') { + $inst_values .= $ctxt{'nsl'}; + } elsif ($env{'form.tinyurls'} eq 'transfer') { + $inst_values .= $ctxt{'tsl'}; + } else { + $inst_values .= $ctxt{'csl'}; + } $inst_values .= ' | '; } else { $inst_values .= ''.&mt('Unknown').' | '; @@ -3101,6 +3126,7 @@ sub courseinfo_form { &js_escape(\%js_lt); $js_lt{'unofficial'} = $js_lt{'official'}; $js_lt{'textbook'} = $js_lt{'official'}; + $js_lt{'placement'} = $js_lt{'official'}; my $js_validate = <<"ENDJS"; +ENDCLOSE + my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble); + &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Processing ...')); $r->rflush(); if (ref($details) eq 'HASH') { if ($details->{'clonecrs'}) { @@ -3817,9 +3897,12 @@ sub process_request { $customitems{'_LC_coursestartdate'} = $accessstart; $customitems{'_LC_courseenddate'} = $accessend; my ($result,$postprocess) = &Apache::loncoursequeueadmin::course_creation($dom,$cnum, - 'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, - \$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, - \$code,\%customitems); + 'autocreate',$details,\$logmsg,$clonemsg,\$newusermsg, + \$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs, + \%longroles,\$code,\%customitems); + &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); + $r->print($closure); if (ref($postprocess) eq 'HASH') { $customized = $postprocess->{'createdcustomized'}; } @@ -3836,7 +3919,7 @@ sub process_request { if (($code) || ((ref($postprocess) eq 'HASH') && (($postprocess->{'createdweb'}) || ($postprocess->{'createdmsg'})))) { $output .= ¬ification_information($disposition,$env{'user.name'}.':'.$env{'user.domain'}, - $dom,$cnum,$now,$code,$postprocess); + $dom,$cnum,$now,$code,$postprocess,$crstype); } if ($code) { $reqhash{'code'} = $code; @@ -3853,6 +3936,20 @@ sub process_request { $output .= '
---|