');
+ }
}
#
@@ -4948,15 +5008,24 @@ sub print_textbook_form {
#
# Submit button
#
- $r->print('
'.
+ $r->print('
'.
'
'.
'
');
#
# End request form
#
+
+ if (($crstype eq 'lti') && (ref($formhash) eq 'HASH')) {
+ foreach my $item (keys(%{$formhash})) {
+ $r->print('
'."\n");
+ }
+ }
+
$r->print('');
- &endContentScreen($r).
+ unless ($crstype eq 'lti') {
+ &endContentScreen($r);
+ }
$r->print(&Apache::loncommon::end_page());
return;
}
@@ -5043,9 +5112,11 @@ sub clone_selection_table {
}
sub process_textbook_request {
- my ($r,$dom,$action,$domdefs,$domconfig,$can_request) = @_;
+ my ($r,$dom,$action,$domdefs,$domconfig,$can_request,$crstype) = @_;
my ($uniquecode,$req_notifylist);
- my $crstype = 'textbook';
+ if ($crstype eq '') {
+ $crstype = 'textbook';
+ }
if (ref($domconfig) eq 'HASH') {
if (ref($domconfig->{'requestcourses'}) eq 'HASH') {
if (ref($domconfig->{'requestcourses'}{'notify'}) eq 'HASH') {
@@ -5086,28 +5157,30 @@ sub process_textbook_request {
undef($clonedom);
}
}
- my $js = &processing_javascript();
- my $loaditems = {
- onload => 'javascript:hideProcessing();',
- };
- $r->print(&header('Course Creation',$js,$loaditems));
-
- if (ref($can_request) eq 'HASH') {
- unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) {
- &Apache::lonhtmlcommon::add_breadcrumb(
- { href => '/adm/requestcourse',
- text => 'Pick action',
- });
+ my $args;
+ if ($crstype eq 'lti') {
+ $args = { 'only_body' => 1};
+ }
+ $r->print(&header('Course Creation','','',undef,$args));
+
+ unless ($crstype eq 'lti') {
+ if (ref($can_request) eq 'HASH') {
+ unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) {
+ &Apache::lonhtmlcommon::add_breadcrumb(
+ { href => '/adm/requestcourse',
+ text => 'Pick action',
+ });
+ }
}
+ &Apache::lonhtmlcommon::add_breadcrumb(
+ { href => '/adm/requestcourse',
+ text => "Create Course",
+ }
+ );
+ &Apache::lonhtmlcommon::add_breadcrumb({text=>'Request Processed'});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Requests','Course_Requests'));
+ &startContentScreen($r,'textbookrequests');
}
- &Apache::lonhtmlcommon::add_breadcrumb(
- { href => '/adm/requestcourse',
- text => "Create Course",
- }
- );
- &Apache::lonhtmlcommon::add_breadcrumb({text=>'Request Processed'});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Requests','Course_Requests'));
- &startContentScreen($r,'textbookrequests');
my $details = {
owner => $env{'user.name'},
@@ -5159,7 +5232,21 @@ sub process_textbook_request {
my ($result,$output,$customized) = &process_request($r,$lonhost,$dom,$cnum,$crstype,$now,$details,
'',$req_notifylist,[],$domconfig);
$r->print($output);
- if (&Apache::loncoursequeueadmin::author_prompt()) {
+ if ($crstype eq 'lti') {
+ my $storecrs;
+ if ($env{'request.lti.login'}) {
+ my %lti = &Apache::lonnet::get_domain_lti($dom,'provider');
+ if (ref($lti{$env{'request.lti.login'}}) eq 'HASH') {
+ $storecrs = $lti{$env{'request.lti.login'}}{'storecrs'};
+ }
+ if ($storecrs) {
+ my %consumers = &Apache::lonnet::get_dom('lticonsumers',[$env{'form.sourcecrs'}],$dom);
+ if (($env{'form.lti.sourcecrs'} ne '') && ($consumers{$env{'form.lti.sourcecrs'}} eq '') && ($cnum ne '')) {
+ &Apache::lonnet::put_dom('lticonsumers',{ $env{'form.lti.sourcecrs'} => $env{'request.lti.login'}.':'.$cnum },$dom);
+ }
+ }
+ }
+ } elsif (&Apache::loncoursequeueadmin::author_prompt()) {
unless ($customized) {
&print_author_prompt($r,$action,$cnum,$dom,$crstype,$result);
}
@@ -5168,7 +5255,9 @@ sub process_textbook_request {
$r->print('
'.&mt('Create another course').'
');
}
}
- &endContentScreen($r);
+ unless ($crstype eq 'lti') {
+ &endContentScreen($r);
+ }
$r->print(&Apache::loncommon::end_page());
}