--- loncom/interface/lonrequestcourse.pm 2023/03/11 04:54:24 1.95.2.7.2.3
+++ loncom/interface/lonrequestcourse.pm 2024/07/03 22:34:22 1.95.2.8
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Request a course
#
-# $Id: lonrequestcourse.pm,v 1.95.2.7.2.3 2023/03/11 04:54:24 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.95.2.8 2024/07/03 22:34:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -546,7 +546,6 @@ sub form_elements {
clonedom => 'selectbox',
datemode => 'radio',
dateshift => 'text',
- tinyurls => 'radio',
},
enrollment => {
accessstart_month => 'selectbox',
@@ -2910,7 +2909,7 @@ sub print_review {
$inst_values .= '
'.$env{'form.coursecredits'}.' | ';
}
- my %ctxt = &clone_text($env{'form.crstype'});
+ my %ctxt = &clone_text();
$inst_headers .= ''.&mt('Clone From').' | ';
if (($env{'form.cloning'}) &&
($env{'form.clonecrs'} =~ /^$match_name$/) &&
@@ -2922,8 +2921,7 @@ 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'}.' | '.
- ''.$ctxt{'dpl'}.' | ';
+ $inst_headers .= ''.$ctxt{'dsh'}.' | ';
$inst_values .= ''.$courseenv{'description'}.' ';
my $cloneinst = $courseenv{'internal.coursecode'};
if ($cloneinst ne '') {
@@ -2939,14 +2937,6 @@ 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').' | ';
@@ -3175,7 +3165,7 @@ sub clone_form {
if ($crstype eq 'community') {
$type = 'Community';
}
- my %lt = &clone_text($crstype);
+ my %lt = &clone_text();
my $output .=
&Apache::lonhtmlcommon::row_title($lt{'dmn'}).''.
@@ -3193,37 +3183,19 @@ sub clone_form {
' '.
$lt{'shd'}.''.
''.
- &Apache::lonhtmlcommon::row_closure(1).
- &Apache::lonhtmlcommon::row_title($lt{'dpl'}).'
'.
&Apache::lonhtmlcommon::row_closure(1);
return $output;
}
sub clone_text {
- my ($crstype) = @_;
- my %lt = &Apache::lonlocal::texthash(
+ return &Apache::lonlocal::texthash(
'cid' => 'Course ID',
'dmn' => 'Domain',
'dsh' => 'Date Shift',
'ncd' => 'Do not clone date parameters',
'prd' => 'Clone date parameters as-is',
'shd' => 'Shift date parameters by number of days',
- 'dpl' => 'URL shortcuts (for deep linking)',
- 'nsl' => 'Do not clone URL shortcuts',
- 'tsl' => 'Transfer URL shortcuts from existing course to new course',
- 'csl' => 'Create new URL shortcuts in new course',
- );
- if ($crstype eq 'Community') {
- $lt{'tsl'} = &mt('Transfer URL shortcuts from existing course to new community');
- $lt{'csl'} = &mt('Create new URL shortcuts in new course');
- }
- return %lt;
+ );
}
sub coursecode_form {
@@ -3678,7 +3650,6 @@ sub print_request_outcome {
clonecrs => $clonecrs,
datemode => $env{'form.datemode'},
dateshift => $env{'form.dateshift'},
- tinyurls => $env{'form.tinyurls'},
sectotal => $sectotal,
sections => \%sections,
crosslisttotal => $crosslisttotal,
@@ -3810,9 +3781,7 @@ sub process_request {
$storeresult = 'rejected';
} elsif ($disposition eq 'process') {
my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
- my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,
- $keysmsg,%longroles,$code);
- my $clonemsg = [];
+ my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,%longroles,$code);
my $type = 'Course';
if ($crstype eq 'community') {
$type = 'Community';
@@ -3856,12 +3825,11 @@ ENDCLOSE
$customitems{'_LC_coursestartdate'} = $accessstart;
$customitems{'_LC_courseenddate'} = $accessend;
my ($result,$postprocess) = &Apache::loncoursequeueadmin::course_creation($dom,$cnum,
- 'autocreate',$details,\$logmsg,$clonemsg,\$newusermsg,
- \$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,
- \%longroles,\$code,\%customitems);
+ 'autocreate',$details,\$logmsg,\$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'};
}
@@ -3895,20 +3863,6 @@ ENDCLOSE
$output .= '
'.$role_result;
}
$output .= '';
- if ($logmsg) {
- $output .= ''.$logmsg.'
';
- }
- if ((ref($clonemsg) eq 'ARRAY') && (@{$clonemsg})) {
- $output .= '';
- my $user_lh = &Apache::loncommon::user_lang($env{'user.name'},$env{'user.domain'});
- foreach my $item (@{$clonemsg}) {
- if (ref($item) eq 'HASH') {
- $output .= &mt_user($user_lh,$item->{mt},
- @{$item->{args}}).'
'."\n";
- }
- }
- $output .= '
'."\n";
- }
$creationresult = 'created';
# Flush the course logs so reverse user roles immediately updated
unless ($registered_flush) {
@@ -4468,7 +4422,6 @@ sub retrieve_settings {
}
$env{'form.datemode'} = $reqinfo{'datemode'};
$env{'form.dateshift'} = $reqinfo{'dateshift'};
- $env{'form.tinyurls'} = $reqinfo{'tinyurls'};
if ($reqinfo{'crstype'} eq 'official') {
$env{'form.autoadds'} = $reqinfo{'autoadds'};
$env{'form.autodrops'} = $reqinfo{'autodrops'};
@@ -4871,26 +4824,17 @@ sub print_textbook_form {
#
# Table of user's current courses (owner and/or course coordinator)
#
- my %lt = &clone_text('Course');
+ my %lt = &clone_text();
if (keys(%cloneable)) {
$r->print('');
}
#
@@ -4899,20 +4843,13 @@ sub print_textbook_form {
if (keys(%domcloneable)) {
$r->print('');
}
@@ -5139,7 +5076,6 @@ sub process_textbook_request {
} else {
$details->{dateshift} = '';
}
- $details->{tinyurls} = $env{'form.owntinyurls'};
} elsif ($reqtype eq 'colleague') {
$details->{datemode} = $env{'form.colldatemode'};
if ($details->{datemode} eq 'shift') {
@@ -5147,11 +5083,9 @@ sub process_textbook_request {
} else {
$details->{dateshift} = '';
}
- $details->{tinyurls} = $env{'form.colltinyurls'};
} elsif (($reqtype eq 'textbook') || ($reqtype eq 'template')) {
$details->{datemode} = 'delete';
$details->{dateshift} = '';
- $details->{tinyurls} = '';
}
if ($details->{dateshift} ne '') {
$details->{dateshift} =~ s/[^\d\.]+//g;
@@ -5159,7 +5093,6 @@ sub process_textbook_request {
} else {
$details->{datemode} = '';
$details->{dateshift} = '';
- $details->{tinyurls} = '';
}
my $lonhost = $r->dir_config('lonHostID');
$r->rflush();