version 1.95.2.7.2.3, 2023/03/11 04:54:24
|
version 1.95.2.8, 2024/07/03 22:34:22
|
Line 546 sub form_elements {
|
Line 546 sub form_elements {
|
clonedom => 'selectbox', |
clonedom => 'selectbox', |
datemode => 'radio', |
datemode => 'radio', |
dateshift => 'text', |
dateshift => 'text', |
tinyurls => 'radio', |
|
}, |
}, |
enrollment => { |
enrollment => { |
accessstart_month => 'selectbox', |
accessstart_month => 'selectbox', |
Line 2910 sub print_review {
|
Line 2909 sub print_review {
|
$inst_values .= '<td>'.$env{'form.coursecredits'}.'</td>'; |
$inst_values .= '<td>'.$env{'form.coursecredits'}.'</td>'; |
} |
} |
|
|
my %ctxt = &clone_text($env{'form.crstype'}); |
my %ctxt = &clone_text(); |
$inst_headers .= '<th>'.&mt('Clone From').'</th>'; |
$inst_headers .= '<th>'.&mt('Clone From').'</th>'; |
if (($env{'form.cloning'}) && |
if (($env{'form.cloning'}) && |
($env{'form.clonecrs'} =~ /^$match_name$/) && |
($env{'form.clonecrs'} =~ /^$match_name$/) && |
Line 2922 sub print_review {
|
Line 2921 sub print_review {
|
my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'}, |
my %courseenv = &Apache::lonnet::userenvironment($env{'form.clonedom'}, |
$env{'form.clonecrs'},('description','internal.coursecode')); |
$env{'form.clonecrs'},('description','internal.coursecode')); |
if (keys(%courseenv) > 0) { |
if (keys(%courseenv) > 0) { |
$inst_headers .= '<th>'.$ctxt{'dsh'}.'</th>'. |
$inst_headers .= '<th>'.$ctxt{'dsh'}.'</th>'; |
'<th>'.$ctxt{'dpl'}.'</th>'; |
|
$inst_values .= '<td>'.$courseenv{'description'}.' '; |
$inst_values .= '<td>'.$courseenv{'description'}.' '; |
my $cloneinst = $courseenv{'internal.coursecode'}; |
my $cloneinst = $courseenv{'internal.coursecode'}; |
if ($cloneinst ne '') { |
if ($cloneinst ne '') { |
Line 2939 sub print_review {
|
Line 2937 sub print_review {
|
} else { |
} else { |
$inst_values .= $ctxt{'ncd'}; |
$inst_values .= $ctxt{'ncd'}; |
} |
} |
$inst_values .= '</td><td>'; |
|
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 .= '</td>'; |
$inst_values .= '</td>'; |
} else { |
} else { |
$inst_values .= '<td>'.&mt('Unknown').'</td>'; |
$inst_values .= '<td>'.&mt('Unknown').'</td>'; |
Line 3175 sub clone_form {
|
Line 3165 sub clone_form {
|
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
$type = 'Community'; |
$type = 'Community'; |
} |
} |
my %lt = &clone_text($crstype); |
my %lt = &clone_text(); |
my $output .= |
my $output .= |
&Apache::lonhtmlcommon::row_title($lt{'dmn'}).'<label>'. |
&Apache::lonhtmlcommon::row_title($lt{'dmn'}).'<label>'. |
&Apache::loncommon::select_dom_form($dom,'clonedom').'</label>'. |
&Apache::loncommon::select_dom_form($dom,'clonedom').'</label>'. |
Line 3193 sub clone_form {
|
Line 3183 sub clone_form {
|
'<input type="radio" name="datemode" value="shift" checked="checked" /> '. |
'<input type="radio" name="datemode" value="shift" checked="checked" /> '. |
$lt{'shd'}.'</label>'. |
$lt{'shd'}.'</label>'. |
'<input type="text" size="5" name="dateshift" value="364" />'. |
'<input type="text" size="5" name="dateshift" value="364" />'. |
&Apache::lonhtmlcommon::row_closure(1). |
|
&Apache::lonhtmlcommon::row_title($lt{'dpl'}).'<label>'. |
|
'<input type="radio" name="tinyurls" value="delete" /> '.$lt{'nsl'}. |
|
'</label><br /><label>'. |
|
'<input type="radio" name="tinyurls" value="transfer" /> '.$lt{'tsl'}. |
|
'</label><br /><label>'. |
|
'<input type="radio" name="tinyurls" value="create" checked="checked" /> '.$lt{'csl'}. |
|
'</label>'. |
|
&Apache::lonhtmlcommon::row_closure(1); |
&Apache::lonhtmlcommon::row_closure(1); |
return $output; |
return $output; |
} |
} |
|
|
sub clone_text { |
sub clone_text { |
my ($crstype) = @_; |
return &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
|
'cid' => 'Course ID', |
'cid' => 'Course ID', |
'dmn' => 'Domain', |
'dmn' => 'Domain', |
'dsh' => 'Date Shift', |
'dsh' => 'Date Shift', |
'ncd' => 'Do not clone date parameters', |
'ncd' => 'Do not clone date parameters', |
'prd' => 'Clone date parameters as-is', |
'prd' => 'Clone date parameters as-is', |
'shd' => 'Shift date parameters by number of days', |
'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 { |
sub coursecode_form { |
Line 3678 sub print_request_outcome {
|
Line 3650 sub print_request_outcome {
|
clonecrs => $clonecrs, |
clonecrs => $clonecrs, |
datemode => $env{'form.datemode'}, |
datemode => $env{'form.datemode'}, |
dateshift => $env{'form.dateshift'}, |
dateshift => $env{'form.dateshift'}, |
tinyurls => $env{'form.tinyurls'}, |
|
sectotal => $sectotal, |
sectotal => $sectotal, |
sections => \%sections, |
sections => \%sections, |
crosslisttotal => $crosslisttotal, |
crosslisttotal => $crosslisttotal, |
Line 3810 sub process_request {
|
Line 3781 sub process_request {
|
$storeresult = 'rejected'; |
$storeresult = 'rejected'; |
} elsif ($disposition eq 'process') { |
} elsif ($disposition eq 'process') { |
my %domdefs = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefs = &Apache::lonnet::get_domain_defaults($dom); |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response, |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,%longroles,$code); |
$keysmsg,%longroles,$code); |
|
my $clonemsg = []; |
|
my $type = 'Course'; |
my $type = 'Course'; |
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
$type = 'Community'; |
$type = 'Community'; |
Line 3856 ENDCLOSE
|
Line 3825 ENDCLOSE
|
$customitems{'_LC_coursestartdate'} = $accessstart; |
$customitems{'_LC_coursestartdate'} = $accessstart; |
$customitems{'_LC_courseenddate'} = $accessend; |
$customitems{'_LC_courseenddate'} = $accessend; |
my ($result,$postprocess) = &Apache::loncoursequeueadmin::course_creation($dom,$cnum, |
my ($result,$postprocess) = &Apache::loncoursequeueadmin::course_creation($dom,$cnum, |
'autocreate',$details,\$logmsg,$clonemsg,\$newusermsg, |
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, |
\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\%longroles,\$code,\%customitems); |
\$code,\%customitems); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
$r->print($closure); |
|
if (ref($postprocess) eq 'HASH') { |
if (ref($postprocess) eq 'HASH') { |
$customized = $postprocess->{'createdcustomized'}; |
$customized = $postprocess->{'createdcustomized'}; |
} |
} |
Line 3895 ENDCLOSE
|
Line 3863 ENDCLOSE
|
$output .= '<br />'.$role_result; |
$output .= '<br />'.$role_result; |
} |
} |
$output .= '</p>'; |
$output .= '</p>'; |
if ($logmsg) { |
|
$output .= '<p>'.$logmsg.'</p>'; |
|
} |
|
if ((ref($clonemsg) eq 'ARRAY') && (@{$clonemsg})) { |
|
$output .= '<p class="LC_info">'; |
|
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}}).'<br />'."\n"; |
|
} |
|
} |
|
$output .= '</p>'."\n"; |
|
} |
|
$creationresult = 'created'; |
$creationresult = 'created'; |
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
unless ($registered_flush) { |
unless ($registered_flush) { |
Line 4468 sub retrieve_settings {
|
Line 4422 sub retrieve_settings {
|
} |
} |
$env{'form.datemode'} = $reqinfo{'datemode'}; |
$env{'form.datemode'} = $reqinfo{'datemode'}; |
$env{'form.dateshift'} = $reqinfo{'dateshift'}; |
$env{'form.dateshift'} = $reqinfo{'dateshift'}; |
$env{'form.tinyurls'} = $reqinfo{'tinyurls'}; |
|
if ($reqinfo{'crstype'} eq 'official') { |
if ($reqinfo{'crstype'} eq 'official') { |
$env{'form.autoadds'} = $reqinfo{'autoadds'}; |
$env{'form.autoadds'} = $reqinfo{'autoadds'}; |
$env{'form.autodrops'} = $reqinfo{'autodrops'}; |
$env{'form.autodrops'} = $reqinfo{'autodrops'}; |
Line 4871 sub print_textbook_form {
|
Line 4824 sub print_textbook_form {
|
# |
# |
# Table of user's current courses (owner and/or course coordinator) |
# Table of user's current courses (owner and/or course coordinator) |
# |
# |
my %lt = &clone_text('Course'); |
my %lt = &clone_text(); |
if (keys(%cloneable)) { |
if (keys(%cloneable)) { |
$r->print('<div id="showexisting" style="display:none">'. |
$r->print('<div id="showexisting" style="display:none">'. |
&clone_selection_table($dom,'owned',\%cloneable). |
&clone_selection_table($dom,'owned',\%cloneable). |
'<fieldset style="display:inline-block"><legend>'.$lt{'dsh'}.'</legend><label>'. |
'<p><input type="radio" name="owndatemode" value="delete" /> '.$lt{'ncd'}. |
'<input type="radio" name="owndatemode" value="delete" /> '.$lt{'ncd'}. |
|
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="owndatemode" value="preserve" /> '.$lt{'prd'}. |
'<input type="radio" name="owndatemode" value="preserve" /> '.$lt{'prd'}. |
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="owndatemode" value="shift" checked="checked" /> '. |
'<input type="radio" name="owndatemode" value="shift" checked="checked" /> '. |
$lt{'shd'}.'</label>'. |
$lt{'shd'}.'</label>'. |
'<input type="text" size="5" name="owndateshift" value="364" />'. |
'<input type="text" size="5" name="owndateshift" value="364" />'. |
'</fieldset><fieldset style="display:inline-block">'. |
|
'<legend>'.$lt{'dpl'}.'</legend><label>'. |
|
'<input type="radio" name="owntinyurls" value="delete" />'.$lt{'nsl'}. |
|
'</label><br /><label>'. |
|
'<input type="radio" name="owntinyurls" value="transfer" />'.$lt{'tsl'}. |
|
'</label><br /><label>'. |
|
'<input type="radio" name="owntinyurls" value="create" checked="checked" />'.$lt{'csl'}. |
|
'</label></fieldset>'. |
|
'</div>'); |
'</div>'); |
} |
} |
# |
# |
Line 4899 sub print_textbook_form {
|
Line 4843 sub print_textbook_form {
|
if (keys(%domcloneable)) { |
if (keys(%domcloneable)) { |
$r->print('<div id="showcolleague" style="display:none">'. |
$r->print('<div id="showcolleague" style="display:none">'. |
&clone_selection_table($dom,'colleague',\%domcloneable). |
&clone_selection_table($dom,'colleague',\%domcloneable). |
'<fieldset style="display:inline-block"><legend>'.$lt{'dsh'}.'</legend><label>'. |
'<p><input type="radio" name="colldatemode" value="delete" /> '.$lt{'ncd'}. |
'<input type="radio" name="colldatemode" value="delete" /> '.$lt{'ncd'}. |
|
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="colldatemode" value="preserve" /> '.$lt{'prd'}. |
'<input type="radio" name="colldatemode" value="preserve" /> '.$lt{'prd'}. |
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="colldatemode" value="shift" checked="checked" /> '. |
'<input type="radio" name="colldatemode" value="shift" checked="checked" /> '. |
$lt{'shd'}.'</label>'. |
$lt{'shd'}.'</label>'. |
'<input type="text" size="5" name="colldateshift" value="364" />'. |
'<input type="text" size="5" name="colldateshift" value="364" />'. |
'</fieldset><fieldset style="display:inline-block">'. |
|
'<legend>'.$lt{'dpl'}.'</legend><label>'. |
|
'<input type="radio" name="colltinyurls" value="delete" />'.$lt{'nsl'}. |
|
'</label><br /><label>'. |
|
'<input type="radio" name="colltinyurls" value="create" checked="checked" />'.$lt{'csl'}. |
|
'</label></fieldset>'. |
|
'</div>'); |
'</div>'); |
} |
} |
|
|
Line 5139 sub process_textbook_request {
|
Line 5076 sub process_textbook_request {
|
} else { |
} else { |
$details->{dateshift} = ''; |
$details->{dateshift} = ''; |
} |
} |
$details->{tinyurls} = $env{'form.owntinyurls'}; |
|
} elsif ($reqtype eq 'colleague') { |
} elsif ($reqtype eq 'colleague') { |
$details->{datemode} = $env{'form.colldatemode'}; |
$details->{datemode} = $env{'form.colldatemode'}; |
if ($details->{datemode} eq 'shift') { |
if ($details->{datemode} eq 'shift') { |
Line 5147 sub process_textbook_request {
|
Line 5083 sub process_textbook_request {
|
} else { |
} else { |
$details->{dateshift} = ''; |
$details->{dateshift} = ''; |
} |
} |
$details->{tinyurls} = $env{'form.colltinyurls'}; |
|
} elsif (($reqtype eq 'textbook') || ($reqtype eq 'template')) { |
} elsif (($reqtype eq 'textbook') || ($reqtype eq 'template')) { |
$details->{datemode} = 'delete'; |
$details->{datemode} = 'delete'; |
$details->{dateshift} = ''; |
$details->{dateshift} = ''; |
$details->{tinyurls} = ''; |
|
} |
} |
if ($details->{dateshift} ne '') { |
if ($details->{dateshift} ne '') { |
$details->{dateshift} =~ s/[^\d\.]+//g; |
$details->{dateshift} =~ s/[^\d\.]+//g; |
Line 5159 sub process_textbook_request {
|
Line 5093 sub process_textbook_request {
|
} else { |
} else { |
$details->{datemode} = ''; |
$details->{datemode} = ''; |
$details->{dateshift} = ''; |
$details->{dateshift} = ''; |
$details->{tinyurls} = ''; |
|
} |
} |
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
$r->rflush(); |
$r->rflush(); |