version 1.95.2.8, 2024/07/03 22:34:22
|
version 1.96, 2016/04/02 04:30:21
|
Line 119 use Apache::loncoursequeueadmin;
|
Line 119 use Apache::loncoursequeueadmin;
|
use Apache::lonuserutils; |
use Apache::lonuserutils; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $registered_flush; |
|
my $registered_instcats; |
|
my $modified_dom; |
|
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 131 sub handler {
|
Line 127 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
$registered_flush = 0; |
|
$registered_instcats = 0; |
|
$modified_dom = ''; |
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','showdom','cnum','state','crstype','queue','tabs']); |
['action','showdom','cnum','state','crstype','queue','tabs']); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
Line 319 sub handler {
|
Line 311 sub handler {
|
$jscript = &Apache::lonhtmlcommon::set_form_elements($elementsref,\%stored); |
$jscript = &Apache::lonhtmlcommon::set_form_elements($elementsref,\%stored); |
if ($state eq 'courseinfo') { |
if ($state eq 'courseinfo') { |
$jscript .= &cloning_javascript(); |
$jscript .= &cloning_javascript(); |
|
} elsif ($state eq 'process') { |
|
$jscript .= &processing_javascript(); |
} |
} |
} |
} |
} |
} |
Line 430 function setCloneDisplay(courseForm) {
|
Line 424 function setCloneDisplay(courseForm) {
|
END |
END |
} |
} |
|
|
|
sub processing_javascript { |
|
return <<"END"; |
|
function hideProcessing() { |
|
if (document.getElementById('processing')) { |
|
document.getElementById('processing').style.display="none"; |
|
} |
|
} |
|
|
|
END |
|
} |
|
|
sub get_breadcrumbs { |
sub get_breadcrumbs { |
my ($dom,$action,$state,$states,$trail) = @_; |
my ($dom,$action,$state,$states,$trail) = @_; |
my ($crumb,$newinstcode,$codechk,$checkedcode,$numtitles,$description); |
my ($crumb,$newinstcode,$codechk,$checkedcode,$numtitles,$description); |
Line 707 sub onload_action {
|
Line 712 sub onload_action {
|
if ($state eq 'courseinfo') { |
if ($state eq 'courseinfo') { |
$loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);'; |
$loaditems{'onload'} .= 'javascript:setCloneDisplay(document.requestcrs);'; |
} |
} |
|
if ($state eq 'process') { |
|
$loaditems{'onload'} .= 'javascript:hideProcessing();'; |
|
} |
} |
} |
return \%loaditems; |
return \%loaditems; |
} |
} |
Line 752 function check_can_request(crschoice,act
|
Line 760 function check_can_request(crschoice,act
|
var unofficial = ''; |
var unofficial = ''; |
var community = ''; |
var community = ''; |
var textbook = ''; |
var textbook = ''; |
|
var placement = ''; |
END |
END |
if (ref($can_request) eq 'HASH') { |
if (ref($can_request) eq 'HASH') { |
foreach my $item (keys(%{$can_request})) { |
foreach my $item (keys(%{$can_request})) { |
Line 765 END
|
Line 774 END
|
unofficial => 'You are not permitted to request creation of an unofficial course in this domain.', |
unofficial => 'You are not permitted to request creation of an unofficial course in this domain.', |
community => 'You are not permitted to request creation of a community in this domain.', |
community => 'You are not permitted to request creation of a community in this domain.', |
textbook => 'You are not permitted to request creation of a textbook course in this domain', |
textbook => 'You are not permitted to request creation of a textbook course in this domain', |
|
placement => 'You are not permitted to request creation of a placement test in this domain', |
all => 'You must choose a specific course type when making a new course request.', |
all => 'You must choose a specific course type when making a new course request.', |
allt => '"All types" is not allowed.', |
allt => '"All types" is not allowed.', |
); |
); |
Line 794 END
|
Line 804 END
|
return false; |
return false; |
} |
} |
} else { |
} else { |
if (actionchoice == 'new') { |
if (crschoice == 'placement') { |
alert('$js_lt{'all'}'+'\\n'+'$js_lt{'allt'}'); |
if (placement != 1) { |
return false; |
alert("$js_lt{'placement'}"); |
|
return false; |
|
} |
|
} else { |
|
if (actionchoice == 'new') { |
|
alert('$js_lt{'all'}'+'\\n'+'$js_lt{'allt'}'); |
|
return false; |
|
} |
} |
} |
} |
} |
} |
} |
Line 807 END
|
Line 824 END
|
END |
END |
my ($pagetitle,$pageinfo,$domaintitle,$earlyout); |
my ($pagetitle,$pageinfo,$domaintitle,$earlyout); |
if (ref($can_request) eq 'HASH') { |
if (ref($can_request) eq 'HASH') { |
if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || $can_request->{'textbook'}) { |
if (($can_request->{'official'}) || ($can_request->{'unofficial'}) || ($can_request->{'textbook'}) || ($can_request->{'placement'})) { |
if ($can_request->{'community'}) { |
if ($can_request->{'community'}) { |
$pagetitle = 'Course/Community Requests'; |
$pagetitle = 'Course/Community Requests'; |
$pageinfo = &mt('Request creation of a new course or community, or review your pending requests.'); |
$pageinfo = &mt('Request creation of a new course or community, or review your pending requests.'); |
Line 984 END
|
Line 1001 END
|
$title = &mt('Pending requests for unofficial courses'); |
$title = &mt('Pending requests for unofficial courses'); |
} elsif ($env{'form.crstype'} eq 'textbook') { |
} elsif ($env{'form.crstype'} eq 'textbook') { |
$title = &mt('Pending requests for textbook courses'); |
$title = &mt('Pending requests for textbook courses'); |
|
} elsif ($env{'form.crstype'} eq 'textbook') { |
|
$title = &mt('Pending requests for placement tests'); |
} else { |
} else { |
$title = &mt('Pending course/community requests'); |
$title = &mt('Pending course/community requests'); |
} |
} |
Line 2085 sub print_personnel_menu {
|
Line 2104 sub print_personnel_menu {
|
official => 'Requestor is automatically assigned Course Coordinator role.', |
official => 'Requestor is automatically assigned Course Coordinator role.', |
); |
); |
$lt{'unofficial'} = $lt{'official'}; |
$lt{'unofficial'} = $lt{'official'}; |
$lt{'textbook'} = $lt{'textbook'}; |
$lt{'textbook'} = $lt{'official'}; |
|
$lt{'placement'} = $lt{'official'}; |
$output .= &Apache::lonhtmlcommon::row_headline(). |
$output .= &Apache::lonhtmlcommon::row_headline(). |
'<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').' '.$lt{$crstype}.' '.&mt('Include other personnel?').'</h3>'; |
'<h3>'.&Apache::loncommon::help_open_topic('Course_Request_Personnel').' '.$lt{$crstype}.' '.&mt('Include other personnel?').'</h3>'; |
} |
} |
my $cansearch = 1; |
|
my @alldoms = &Apache::lonnet::all_domains(); |
|
if (@alldoms == 1) { |
|
my %domsrch = &Apache::lonnet::get_dom('configuration', |
|
['directorysrch'],$alldoms[0]); |
|
if (ref($domsrch{'directorysrch'}) eq 'HASH') { |
|
if ((!$domsrch{'directorysrch'}{'available'}) && |
|
($domsrch{'directorysrch'}{'lcavailable'} eq '0')) { |
|
$cansearch = 0; |
|
} |
|
} |
|
} |
|
for (my $i=0; $i<$persontotal; $i++) { |
for (my $i=0; $i<$persontotal; $i++) { |
my @linkargs = map { 'person_'.$i.'_'.$_ } (@items); |
my @linkargs = map { 'person_'.$i.'_'.$_ } (@items); |
my $linkargstr = join("','",@linkargs); |
my $linkargstr = join("','",@linkargs); |
Line 2125 sub print_personnel_menu {
|
Line 2133 sub print_personnel_menu {
|
} |
} |
$sectionselector .= $newtitle. |
$sectionselector .= $newtitle. |
'<input type="text" name="person_'.$i.'_newsec" size="15" value="" />'."\n"; |
'<input type="text" name="person_'.$i.'_newsec" size="15" value="" />'."\n"; |
my $usersrchlink; |
my $usersrchlinktxt = &mt('Search for user'); |
if ($cansearch) { |
my $usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, |
my $usersrchlinktxt = &mt('Search for user'); |
$usersrchlinktxt); |
$usersrchlink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, |
|
$usersrchlinktxt); |
|
} else { |
|
$usersrchlink = ' '; |
|
} |
|
my $userchklinktxt = &mt('Check username'); |
my $userchklinktxt = &mt('Check username'); |
my $userchklink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, |
my $userchklink = &Apache::loncommon::selectuser_link($formname,@linkargs,$dom, |
$userchklinktxt,'checkusername'); |
$userchklinktxt,'checkusername'); |
Line 2379 sub print_cancel_request {
|
Line 2382 sub print_cancel_request {
|
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td>'.$history{details}{'cdescr'}.'</td><td>'. |
'<td>'.$history{details}{'cdescr'}.'</td><td>'. |
&Apache::lonlocal::locallocaltime($timestamp).'</td>'. |
&Apache::lonlocal::locallocaltime($timestamp).'</td>'. |
'<td>'.&mt($showtype).'</td>'. |
'<td>'.$showtype.'</td>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
'<br /><div class="LC_warning">'; |
'<br /><div class="LC_warning">'; |
Line 2513 sub print_request_logs {
|
Line 2516 sub print_request_logs {
|
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'uniquecode'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'uniquecode'}) eq 'HASH') { |
if ($curr{'crstype'} eq 'any') { |
if ($curr{'crstype'} eq 'any') { |
my @types = qw(official unofficial community textbook); |
my @types = qw(official unofficial community textbook placement); |
foreach my $type (@types) { |
foreach my $type (@types) { |
if ($domconfig{'requestcourses'}{'uniquecode'}{$type}) { |
if ($domconfig{'requestcourses'}{'uniquecode'}{$type}) { |
$showuniquecode = 1; |
$showuniquecode = 1; |
Line 2681 sub reqstatus_names {
|
Line 2684 sub reqstatus_names {
|
rejected => 'Request rejected', |
rejected => 'Request rejected', |
cancelled => 'Request cancelled', |
cancelled => 'Request cancelled', |
); |
); |
if (($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook')) { |
if (($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook') || ($crstype eq 'placement')) { |
$statusnames{'created'} = &mt('Course created'); |
$statusnames{'created'} = &mt('Course created'); |
} elsif ($crstype eq 'community') { |
} elsif ($crstype eq 'community') { |
$statusnames{'created'} = &mt('Community created'); |
$statusnames{'created'} = &mt('Community created'); |
Line 2733 sub requestlog_display_filter {
|
Line 2736 sub requestlog_display_filter {
|
$typename = $typenames->{$crstype}; |
$typename = $typenames->{$crstype}; |
} |
} |
} |
} |
$output .= '<option value="'.$crstype.'"'.$selstr.'>'.&mt($typename).'</option>'."\n"; |
$output .= '<option value="'.$crstype.'"'.$selstr.'>'.$typename.'</option>'."\n"; |
} |
} |
$output .= '</select></td>'; |
$output .= '</select></td>'; |
} |
} |
Line 3085 sub courseinfo_form {
|
Line 3088 sub courseinfo_form {
|
&js_escape(\%js_lt); |
&js_escape(\%js_lt); |
$js_lt{'unofficial'} = $js_lt{'official'}; |
$js_lt{'unofficial'} = $js_lt{'official'}; |
$js_lt{'textbook'} = $js_lt{'official'}; |
$js_lt{'textbook'} = $js_lt{'official'}; |
|
$js_lt{'placement'} = $js_lt{'official'}; |
my $js_validate = <<"ENDJS"; |
my $js_validate = <<"ENDJS"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[' |
// <![CDATA[' |
Line 3171 sub clone_form {
|
Line 3175 sub clone_form {
|
&Apache::loncommon::select_dom_form($dom,'clonedom').'</label>'. |
&Apache::loncommon::select_dom_form($dom,'clonedom').'</label>'. |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_title($lt{'cid'}).'<label>'. |
&Apache::lonhtmlcommon::row_title($lt{'cid'}).'<label>'. |
'<input type="text" size="25" name="clonecrs" value="" onfocus="this.blur();opencrsbrowser('."'$formname','clonecrs','clonedom','','','','$type'".')" />'. |
'<input type="text" size="25" name="clonecrs" value="" onfocus="this.blur();opencrsbrowser('."'$formname','clonecrs','clonedom','','','','','$type'".')" />'. |
'</label> '. |
'</label> '. |
&Apache::loncommon::selectcourse_link($formname,'clonecrs','clonedom','','','',$type). |
&Apache::loncommon::selectcourse_link($formname,'clonecrs','clonedom','','','',$type). |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_closure(1). |
Line 3182 sub clone_form {
|
Line 3186 sub clone_form {
|
'</label><br /><label>'. |
'</label><br /><label>'. |
'<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="365" />'. |
&Apache::lonhtmlcommon::row_closure(1); |
&Apache::lonhtmlcommon::row_closure(1); |
return $output; |
return $output; |
} |
} |
Line 3221 sub coursecode_form {
|
Line 3225 sub coursecode_form {
|
} |
} |
if (@{$codetitles} > 0) { |
if (@{$codetitles} > 0) { |
my $lastitem = pop(@{$codetitles}); |
my $lastitem = pop(@{$codetitles}); |
my $lastinput = '<input type="text" size="5" name="'.$sel.'_'.$lastitem.'" />'; |
my $lastinput = '<input type="text" size="5" name="'.$sel.'_'. $lastitem.'" />'; |
if (@{$codetitles} > 0) { |
if (@{$codetitles} > 0) { |
my $helplink; |
my $helplink; |
if (defined($helpitem{$context})) { |
if (defined($helpitem{$context})) { |
Line 3622 sub print_request_outcome {
|
Line 3626 sub print_request_outcome {
|
} |
} |
} |
} |
} |
} |
if ($env{'form.chome'} eq 'default') { |
|
my %servers = &Apache::lonnet::get_servers($dom,'library'); |
|
my $numlib = keys(%servers); |
|
if ($numlib) { |
|
my $loadm=10000000; |
|
my $chome; |
|
foreach my $tryserver (keys(%servers)) { |
|
($chome,$loadm) = |
|
&Apache::lonnet::compare_server_load($tryserver,$chome,$loadm); |
|
} |
|
$env{'form.chome'} = $chome; |
|
} |
|
} |
|
my $details = { |
my $details = { |
owner => $env{'user.name'}, |
owner => $env{'user.name'}, |
domain => $env{'user.domain'}, |
domain => $env{'user.domain'}, |
Line 3666 sub print_request_outcome {
|
Line 3657 sub print_request_outcome {
|
$instcode,$req_notifylist,\@instsections,\%domconfig); |
$instcode,$req_notifylist,\@instsections,\%domconfig); |
return ($result,$output,$customized); |
return ($result,$output,$customized); |
} |
} |
|
|
sub process_request { |
sub process_request { |
my ($r,$lonhost,$dom,$cnum,$crstype,$now,$details,$instcode,$req_notifylist,$instsections, |
my ($r,$lonhost,$dom,$cnum,$crstype,$now,$details,$instcode,$req_notifylist,$instsections, |
$domconfig) = @_; |
$domconfig) = @_; |
Line 3684 sub process_request {
|
Line 3675 sub process_request {
|
$output = &mt('You are not permitted to request creation of communities'); |
$output = &mt('You are not permitted to request creation of communities'); |
} elsif ($crstype eq 'textbook') { |
} elsif ($crstype eq 'textbook') { |
$output = &mt('You are not permitted to request creation of textbook courses'); |
$output = &mt('You are not permitted to request creation of textbook courses'); |
|
} elsif ($crstype eq 'placement') { |
|
$output = &mt('You are not permitted to request creation of placement tests'); |
} else { |
} else { |
$output = &mt('Unrecognized course type: [_1]',$crstype); |
$output = &mt('Unrecognized course type: [_1]',$crstype); |
} |
} |
Line 3790 sub process_request {
|
Line 3783 sub process_request {
|
foreach my $role (@roles) { |
foreach my $role (@roles) { |
$longroles{$role}=&Apache::lonnet::plaintext($role,$type); |
$longroles{$role}=&Apache::lonnet::plaintext($role,$type); |
} |
} |
my $preamble = '<div id="LC_update" class="LC_info">'. |
$r->print('<div id="processing" style="display:block;">'."\n". |
'<br />'. |
&mt('Your request is being processed; this page will update when processing is complete.'). |
&mt("Please be patient while your request is processed"). |
'</div>'); |
'<br /></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
|
my $closure = <<ENDCLOSE; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
\$("#LC_update").hide('slow'); |
|
// ]]> |
|
</script> |
|
ENDCLOSE |
|
my %prog_state = &Apache::lonhtmlcommon::Create_PrgWin($r,undef,$preamble); |
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Processing ...')); |
|
$r->rflush(); |
$r->rflush(); |
if (ref($details) eq 'HASH') { |
if (ref($details) eq 'HASH') { |
if ($details->{'clonecrs'}) { |
if ($details->{'clonecrs'}) { |
Line 3828 ENDCLOSE
|
Line 3810 ENDCLOSE
|
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, |
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$code,\%customitems); |
\$code,\%customitems); |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Finished!')); |
|
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
|
if (ref($postprocess) eq 'HASH') { |
if (ref($postprocess) eq 'HASH') { |
$customized = $postprocess->{'createdcustomized'}; |
$customized = $postprocess->{'createdcustomized'}; |
} |
} |
Line 3864 ENDCLOSE
|
Line 3844 ENDCLOSE
|
} |
} |
$output .= '</p>'; |
$output .= '</p>'; |
$creationresult = 'created'; |
$creationresult = 'created'; |
# Flush the course logs so reverse user roles immediately updated |
|
unless ($registered_flush) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\&Apache::lonnet::flushcourselogs,@{$handlers}]); |
|
$registered_flush=1; |
|
} |
|
if ($instcode ne '') { |
|
&Apache::lonnet::devalidate_cache_new('instcats',$dom); |
|
# Update cache of self-cataloging courses on institution's server(s). |
|
if (&Apache::lonnet::shared_institution($dom)) { |
|
unless ($registered_instcats) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\&devalidate_remote_instcats,@{$handlers}]); |
|
$registered_instcats=1; |
|
$modified_dom = $dom; |
|
} |
|
} |
|
} |
|
} else { |
} else { |
$output = '<span class="LC_error">'; |
$output = '<span class="LC_error">'; |
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
Line 3990 ENDCLOSE
|
Line 3952 ENDCLOSE
|
} elsif ($disposition eq 'pending') { |
} elsif ($disposition eq 'pending') { |
my $pendingform; |
my $pendingform; |
if ($crstype ne 'official') { |
if ($crstype ne 'official') { |
$pendingform = &pending_validation_form($r,$dom,$cnum,$crstype,$now,$token, |
$pendingform = &pending_validation_form($dom,$cnum,$crstype,$now,$token, |
$lonhost,$env{'form.cdescr'}); |
$lonhost,$env{'form.cdescr'}); |
} |
} |
if ($pendingform) { |
if ($pendingform) { |
Line 4017 ENDCLOSE
|
Line 3979 ENDCLOSE
|
} |
} |
} |
} |
|
|
sub devalidate_remote_instcats { |
|
if ($modified_dom ne '') { |
|
my %servers = &Apache::lonnet::internet_dom_servers($modified_dom); |
|
my %thismachine; |
|
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
|
if (keys(%servers)) { |
|
foreach my $server (keys(%servers)) { |
|
next if ($thismachine{$server}); |
|
&Apache::lonnet::remote_devalidate_cache($server,['instcats:'.$modified_dom]); |
|
} |
|
} |
|
$modified_dom = ''; |
|
} |
|
return; |
|
} |
|
|
|
sub custom_formitems { |
sub custom_formitems { |
my ($preprocess,$customhash) = @_; |
my ($preprocess,$customhash) = @_; |
return unless ((ref($preprocess) eq 'HASH') && (ref($customhash) eq 'HASH')); |
return unless ((ref($preprocess) eq 'HASH') && (ref($customhash) eq 'HASH')); |
Line 4308 sub notification_information {
|
Line 4254 sub notification_information {
|
} |
} |
|
|
sub pending_validation_form { |
sub pending_validation_form { |
my ($r,$cdom,$cnum,$crstype,$now,$token,$lonhost,$cdesc) = @_; |
my ($cdom,$cnum,$crstype,$now,$token,$lonhost,$cdesc) = @_; |
my $output; |
my $output; |
my %postvalues = ( |
my %postvalues = ( |
'owner' => $env{'user.name'}.':'.$env{'user.domain'}, |
'owner' => $env{'user.name'}.':'.$env{'user.domain'}, |
Line 4341 sub pending_validation_form {
|
Line 4287 sub pending_validation_form {
|
$buttontext = &mt('Create course'); |
$buttontext = &mt('Create course'); |
} |
} |
} |
} |
my $hostname = &Apache::lonnet::hostname($lonhost); |
|
my $protocol = $Apache::lonnet::protocol{$lonhost}; |
my $protocol = $Apache::lonnet::protocol{$lonhost}; |
$protocol = 'http' if ($protocol ne 'https'); |
$protocol = 'http' if ($protocol ne 'https'); |
my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost); |
my $crscreator = $protocol.'://'.&Apache::lonnet::hostname($lonhost).'/cgi-bin/createpending.pl'; |
$hostname = $alias if ($alias ne ''); |
|
my $crscreator = $protocol.'://'.$hostname.'/cgi-bin/createpending.pl'; |
|
$output .= '<input type="hidden" name="crscreator" value="'.$crscreator.'" />'."\n". |
$output .= '<input type="hidden" name="crscreator" value="'.$crscreator.'" />'."\n". |
'<input type="hidden" name="token" value="'.$token.'" />'."\n". |
'<input type="hidden" name="token" value="'.$token.'" />'."\n". |
'<input type="submit" name="validate" value="'.$buttontext.'" />'."\n". |
'<input type="submit" name="validate" value="'.$buttontext.'" />'."\n". |
Line 4371 sub check_autolimit {
|
Line 4314 sub check_autolimit {
|
if (($crstype eq 'community') && |
if (($crstype eq 'community') && |
(exists($crsroles{$cnum.':'.$cdom.':co'}))) { |
(exists($crsroles{$cnum.':'.$cdom.':co'}))) { |
$count ++; |
$count ++; |
} elsif ((($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook')) && |
} elsif ((($crstype eq 'official') || ($crstype eq 'unofficial') || ($crstype eq 'textbook') || ($crstype eq 'placement')) && |
(exists($crsroles{$cnum.':'.$cdom.':cc'}))) { |
(exists($crsroles{$cnum.':'.$cdom.':cc'}))) { |
$count ++; |
$count ++; |
} |
} |
Line 4834 sub print_textbook_form {
|
Line 4777 sub print_textbook_form {
|
'</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="365" />'. |
'</div>'); |
'</div>'); |
} |
} |
# |
# |
Line 4849 sub print_textbook_form {
|
Line 4792 sub print_textbook_form {
|
'</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="365" />'. |
'</div>'); |
'</div>'); |
} |
} |
|
|
Line 5034 sub process_textbook_request {
|
Line 4977 sub process_textbook_request {
|
undef($clonedom); |
undef($clonedom); |
} |
} |
} |
} |
$r->print(&header('Course Creation')); |
my $js = &processing_javascript(); |
|
my $loaditems = { |
|
onload => 'javascript:hideProcessing();', |
|
}; |
|
$r->print(&header('Course Creation',$js,$loaditems)); |
|
|
if (ref($can_request) eq 'HASH') { |
if (ref($can_request) eq 'HASH') { |
unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) { |
unless ((scalar(keys(%{$can_request})) == 1) && ($can_request->{'textbook'})) { |
Line 5083 sub process_textbook_request {
|
Line 5030 sub process_textbook_request {
|
} else { |
} else { |
$details->{dateshift} = ''; |
$details->{dateshift} = ''; |
} |
} |
} elsif (($reqtype eq 'textbook') || ($reqtype eq 'template')) { |
|
$details->{datemode} = 'delete'; |
|
$details->{dateshift} = ''; |
|
} |
} |
if ($details->{dateshift} ne '') { |
if ($details->{dateshift} ne '') { |
$details->{dateshift} =~ s/[^\d\.]+//g; |
$details->{dateshift} =~ s/[^\d\.]+//g; |