version 1.92, 2015/07/14 00:11:48
|
version 1.95.2.1, 2016/08/04 21:59:23
|
Line 3162 sub clone_form {
|
Line 3162 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 3667 sub process_request {
|
Line 3667 sub process_request {
|
} |
} |
$storeresult = 'notpermitted'; |
$storeresult = 'notpermitted'; |
} else { |
} else { |
my ($disposition,$message,$reqstatus,$coursedesc,%customvalidation); |
my ($disposition,$message,$reqstatus,$coursedesc,$accessstart,$accessend,%customvalidation); |
my %reqhash = ( |
my %reqhash = ( |
reqtime => $now, |
reqtime => $now, |
crstype => $crstype, |
crstype => $crstype, |
Line 3679 sub process_request {
|
Line 3679 sub process_request {
|
$env{'user.domain'}); |
$env{'user.domain'}); |
if (ref($details) eq 'HASH') { |
if (ref($details) eq 'HASH') { |
$coursedesc = $details->{'cdescr'}; |
$coursedesc = $details->{'cdescr'}; |
|
$accessstart = $details->{'accessstart'}; |
|
$accessend = $details->{'accessend'}; |
} |
} |
if ($val eq 'autolimit=') { |
if ($val eq 'autolimit=') { |
$disposition = 'process'; |
$disposition = 'process'; |
Line 3786 sub process_request {
|
Line 3788 sub process_request {
|
$customitems{'_LC_owneremail'} = $owneremail; |
$customitems{'_LC_owneremail'} = $owneremail; |
} |
} |
$customitems{'_LC_coursedomainname'} = &Apache::lonnet::domain($dom,'description'); |
$customitems{'_LC_coursedomainname'} = &Apache::lonnet::domain($dom,'description'); |
|
$customitems{'_LC_coursedescription'} = $coursedesc; |
|
$customitems{'_LC_coursestartdate'} = $accessstart; |
|
$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,\$newusermsg,\$addresult, |
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles, |
Line 4549 sub print_textbook_form {
|
Line 4554 sub print_textbook_form {
|
$cc_clone .= $cdom.':'.$cnum.'&'; |
$cc_clone .= $cdom.':'.$cnum.'&'; |
unless (exists($cloneable{$cdom.'_'.$cnum})) { |
unless (exists($cloneable{$cdom.'_'.$cnum})) { |
my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum,{'one_time' => 1}); |
my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum,{'one_time' => 1}); |
$cloneable{$cdom.'_'.$cnum} = \%courseinfo; |
$cloneable{$cdom.'_'.$cnum} = { |
|
context => $courseinfo{'internal.creationcontext'}, |
|
created => $courseinfo{'internal.created'}, |
|
creator => $courseinfo{'internal.creator'}, |
|
description => $courseinfo{'description'}, |
|
inst_code => $courseinfo{'coursecode'}, |
|
owner => $courseinfo{'internal.courseowner'}, |
|
releaserequired => $courseinfo{'internal.releaserequired'}, |
|
type => $courseinfo{'type'}, |
|
}; |
} |
} |
} |
} |
|
|
Line 4742 sub print_textbook_form {
|
Line 4756 sub print_textbook_form {
|
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). |
'<p><input type="radio" name="datemode" value="delete" /> '.$lt{'ncd'}. |
'<p><input type="radio" name="owndatemode" value="delete" /> '.$lt{'ncd'}. |
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="datemode" value="preserve" /> '.$lt{'prd'}. |
'<input type="radio" name="owndatemode" value="preserve" /> '.$lt{'prd'}. |
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="datemode" 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="dateshift" value="365" />'. |
'<input type="text" size="5" name="owndateshift" value="365" />'. |
'</div>'); |
'</div>'); |
} |
} |
# |
# |
Line 4757 sub print_textbook_form {
|
Line 4771 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). |
'<p><input type="radio" name="datemode" value="delete" /> '.$lt{'ncd'}. |
'<p><input type="radio" name="colldatemode" value="delete" /> '.$lt{'ncd'}. |
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="datemode" value="preserve" /> '.$lt{'prd'}. |
'<input type="radio" name="colldatemode" value="preserve" /> '.$lt{'prd'}. |
'</label><br /><label>'. |
'</label><br /><label>'. |
'<input type="radio" name="datemode" 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="dateshift" value="365" />'. |
'<input type="text" size="5" name="colldateshift" value="365" />'. |
'</div>'); |
'</div>'); |
} |
} |
|
|
Line 4845 sub clone_selection_table {
|
Line 4859 sub clone_selection_table {
|
$cleantitle=~s/'/\\'/g; |
$cleantitle=~s/'/\\'/g; |
$cleantitle =~ s/^\s+//; |
$cleantitle =~ s/^\s+//; |
my ($namestr,@owners,%ownernames); |
my ($namestr,@owners,%ownernames); |
my $singleowner = $cloneableref->{$cid}{'internal.courseowner'}; |
if ($cloneableref->{$cid}{'owner'} ne '') { |
push(@owners,$singleowner); |
push(@owners,$cloneableref->{$cid}{'owner'}); |
|
} |
if ($cloneableref->{$cid}{'co-owners'} ne '') { |
if ($cloneableref->{$cid}{'co-owners'} ne '') { |
foreach my $item (split(/,/,$cloneableref->{$cid}{'internal.co-owners'})) { |
foreach my $item (split(/,/,$cloneableref->{$cid}{'co-owners'})) { |
push(@owners,$item); |
if (($item ne '') && (!grep(/^\Q$item\E$/,@owners))) { |
|
push(@owners,$item); |
|
} |
} |
} |
} |
} |
foreach my $owner (@owners) { |
foreach my $owner (@owners) { |
Line 4983 sub process_textbook_request {
|
Line 5000 sub process_textbook_request {
|
accessend => $accessend, |
accessend => $accessend, |
personnel => {}, |
personnel => {}, |
}; |
}; |
if ($reqtype eq 'existing') { |
if (($clonecrs ne '') && ($clonedom ne '')) { |
$details->{datemode} = $env{'form.datemode'}; |
if ($reqtype eq 'existing') { |
$details->{dateshift} = $env{'form.dateshift'}; |
$details->{datemode} = $env{'form.owndatemode'}; |
|
if ($details->{datemode} eq 'shift') { |
|
$details->{dateshift} = $env{'form.owndateshift'}; |
|
} else { |
|
$details->{dateshift} = ''; |
|
} |
|
} elsif ($reqtype eq 'colleague') { |
|
$details->{datemode} = $env{'form.colldatemode'}; |
|
if ($details->{datemode} eq 'shift') { |
|
$details->{dateshift} = $env{'form.colldateshift'}; |
|
} else { |
|
$details->{dateshift} = ''; |
|
} |
|
} |
|
if ($details->{dateshift} ne '') { |
|
$details->{dateshift} =~ s/[^\d\.]+//g; |
|
} |
|
} else { |
|
$details->{datemode} = ''; |
|
$details->{dateshift} = ''; |
} |
} |
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
$r->rflush(); |
$r->rflush(); |