');
+ }
}
#
@@ -4863,15 +4890,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;
}
@@ -4958,9 +4994,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') {
@@ -5002,27 +5040,33 @@ sub process_textbook_request {
}
}
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 ($loaditems,$args);
+ $loaditems = {
+ onload => 'javascript:hideProcessing();',
+ };
+ if ($crstype eq 'lti') {
+ $args = { 'only_body' => 1};
+ }
+ $r->print(&header('Course Creation',$js,$loaditems,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'},
@@ -5054,6 +5098,9 @@ sub process_textbook_request {
} else {
$details->{dateshift} = '';
}
+ } elsif (($reqtype eq 'textbook') || ($reqtype eq 'template')) {
+ $details->{datemode} = 'delete';
+ $details->{dateshift} = '';
}
if ($details->{dateshift} ne '') {
$details->{dateshift} =~ s/[^\d\.]+//g;
@@ -5067,7 +5114,12 @@ 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 %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'} => $cnum },$dom);
+ }
+ } elsif (&Apache::loncoursequeueadmin::author_prompt()) {
unless ($customized) {
&print_author_prompt($r,$action,$cnum,$dom,$crstype,$result);
}
@@ -5076,7 +5128,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());
}