version 1.39, 2013/12/25 09:52:42
|
version 1.42, 2014/01/08 17:18:11
|
Line 116 sub send_selfserve_notification {
|
Line 116 sub send_selfserve_notification {
|
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
} |
} |
} elsif ($context eq 'authormanagers') { |
} elsif ($context eq 'authormanagers') { |
$rawsubj = 'Authoring space requests reviewed'; |
$rawsubj = 'Authoring Space requests reviewed'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Authoring requests in the following domain: "[_1]" have been reviewed.', |
mt => 'Authoring requests in the following domain: "[_1]" have been reviewed.', |
args => ["\n$contextdesc"], |
args => ["\n$contextdesc"], |
Line 203 sub send_selfserve_notification {
|
Line 203 sub send_selfserve_notification {
|
args => [" \n\n","\n"], |
args => [" \n\n","\n"], |
}); |
}); |
} elsif ($context eq 'authorreq') { |
} elsif ($context eq 'authorreq') { |
$rawsubj = 'Authoring space request to review'; |
$rawsubj = 'Authoring Space request to review'; |
$msgtxt = 'Assignment of an author role in the [_1] domain[_2]was requested by [_3] on [_4].'; |
$msgtxt = 'Assignment of an author role in the [_1] domain[_2]was requested by [_3] on [_4].'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => $msgtxt, |
mt => $msgtxt, |
args => [$contextdesc,"\n",$textstr,$timestamp], |
args => [$contextdesc,"\n",$textstr,$timestamp], |
}, |
}, |
{ |
{ |
mt =>'[_1]As Domain Coordinator, use: [_2]Main Menu -> Create users or modify the roles and privileges of users -> Authoring space reqests[_3]to display a list of pending requests, which you can either approve or reject.', |
mt =>'[_1]As Domain Coordinator, use: [_2]Main Menu -> Create users or modify the roles and privileges of users -> Authoring Space requests[_3]to display a list of pending requests, which you can either approve or reject.', |
args => ["\n","\n\n ","\n\n"], |
args => ["\n","\n\n ","\n\n"], |
}); |
}); |
|
|
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$rawsubj = 'Authoring space request'; |
$rawsubj = 'Authoring Space request'; |
$msgtxt = 'Your request for an authoring space requested on [_1]has been reviewed by a Domain Coordinator.'; |
$msgtxt = 'Your request for an Authoring Space requested on [_1]has been reviewed by a Domain Coordinator.'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => $msgtxt, |
mt => $msgtxt, |
args => [$timestamp."\n"], |
args => [$timestamp."\n"], |
Line 229 sub send_selfserve_notification {
|
Line 228 sub send_selfserve_notification {
|
if (ref($textstr) eq 'ARRAY') { |
if (ref($textstr) eq 'ARRAY') { |
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
} |
} |
|
} elsif ($context eq 'queuedcrsreq') { |
|
$rawsubj = 'Course Request Queued'; |
|
if (ref($textstr) eq 'ARRAY') { |
|
push(@rawmsg,@{$textstr}); |
|
} |
|
} elsif ($context eq 'createdcrsreq') { |
|
$rawsubj = 'Course Creation Information'; |
|
if (ref($textstr) eq 'ARRAY') { |
|
push(@rawmsg,@{$textstr}); |
|
} |
} |
} |
my @to_notify = split(/,/,$notifylist); |
my @to_notify = split(/,/,$notifylist); |
my $numsent = 0; |
my $numsent = 0; |
Line 375 sub display_queued_requests {
|
Line 384 sub display_queued_requests {
|
'<p>'.&mt('Requests are validated against institutional data to confirm that the requestor is an instructor of record.').'<br />'. |
'<p>'.&mt('Requests are validated against institutional data to confirm that the requestor is an instructor of record.').'<br />'. |
&mt('Validation is attempted when the request is submitted.').' '.&mt('If unvalidated, the request will be held in a queue.').' '.&mt('Validation of pending requests is automatically repeated daily.').'</p>'; |
&mt('Validation is attempted when the request is submitted.').' '.&mt('If unvalidated, the request will be held in a queue.').' '.&mt('Validation of pending requests is automatically repeated daily.').'</p>'; |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$output .= '<h3>'.&mt('Requests for authoring space queued pending approval by a Domain Coordinator').'</h3>'; |
$output .= '<h3>'.&mt('Requests for Authoring Space queued pending approval by a Domain Coordinator').'</h3>'; |
} else { |
} else { |
$output .= '<h3>'.&mt('Course/Community requests queued pending approval by a Domain Coordinator').'</h3>'; |
$output .= '<h3>'.&mt('Course/Community requests queued pending approval by a Domain Coordinator').'</h3>'; |
} |
} |
Line 388 sub display_queued_requests {
|
Line 397 sub display_queued_requests {
|
} elsif ($context eq 'pending') { |
} elsif ($context eq 'pending') { |
$output .= &mt('There are currently no requests for official courses awaiting validation.'); |
$output .= &mt('There are currently no requests for official courses awaiting validation.'); |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$output .= &mt('There are currently no requests for authoring space awaiting approval.'); |
$output .= &mt('There are currently no requests for Authoring Space awaiting approval.'); |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
$output .= &mt('There are currently no course or community requests awaiting approval.'); |
$output .= &mt('There are currently no course or community requests awaiting approval.'); |
} |
} |
Line 590 sub update_request_queue {
|
Line 599 sub update_request_queue {
|
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($cdom); |
$firsturl = &course_portal_url($domconfiguser,$cdom); |
$firsturl = &course_portal_url($domconfiguser,$cdom); |
$approvedmsg = [{ |
$approvedmsg = [{ |
mt => 'Your request for authoring space has been approved.', |
mt => 'Your request for Authoring Space has been approved.', |
}, |
}, |
{ |
{ |
mt => 'Visit [_1] to log-in and select your author role', |
mt => 'Visit [_1] to log-in and select your author role', |
args => [$firsturl], |
args => [$firsturl], |
}]; |
}]; |
$rejectedmsg = [{ |
$rejectedmsg = [{ |
mt => 'Your request for authoring space has not been approved.', |
mt => 'Your request for Authoring Space has not been approved.', |
}]; |
}]; |
$domdesc = &Apache::lonnet::domain($cdom); |
$domdesc = &Apache::lonnet::domain($cdom); |
} else { |
} else { |
Line 614 sub update_request_queue {
|
Line 623 sub update_request_queue {
|
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
$notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'}; |
$notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'}; |
} |
} |
if ($domconfig{'requestcourses'}{'uniquecode'}) { |
|
$uniquecode = 1; |
|
} |
|
} |
} |
$approvalmsg{'course'} = |
$approvalmsg{'course'} = |
[{ |
[{ |
Line 792 sub update_request_queue {
|
Line 798 sub update_request_queue {
|
$ownerdom,$ownername); |
$ownerdom,$ownername); |
if ((ref($history{'details'}) eq 'HASH') && |
if ((ref($history{'details'}) eq 'HASH') && |
($history{'disposition'} eq $queue)) { |
($history{'disposition'} eq $queue)) { |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code); |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code,%customitems); |
my $result = &course_creation($cdom,$cnum,$context,$history{'details'},\$logmsg, |
my $fullname = ''; |
\$newusermsg,\$addresult,\$enrollcount, |
my $inprocess = &Apache::lonnet::auto_crsreq_update($cdom,$cnum,$crstype,'process',$ownername, |
\$response,\$keysmsg,\%domdefs,$longroles,\$code); |
$ownerdom,$fullname,$coursedesc); |
|
if (ref($inprocess) eq 'HASH') { |
|
foreach my $key (keys(%{$inprocess})) { |
|
if (exists($history{'details'}{$key})) { |
|
$customitems{$key} = $history{'details'}{$key}; |
|
} |
|
} |
|
} |
|
my ($result,$postprocess) = &course_creation($cdom,$cnum,$context,$history{'details'},\$logmsg, |
|
\$newusermsg,\$addresult,\$enrollcount, |
|
\$response,\$keysmsg,\%domdefs,$longroles,\$code,\%customitems); |
if ($result eq 'created') { |
if ($result eq 'created') { |
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
$approvedmsg = $approvalmsg{'community'}; |
$approvedmsg = $approvalmsg{'community'}; |
Line 815 sub update_request_queue {
|
Line 831 sub update_request_queue {
|
}); |
}); |
$codes{$cnum} = $code; |
$codes{$cnum} = $code; |
} |
} |
|
if (ref($postprocess) eq 'HASH') { |
|
if (ref($postprocess->{'createdmsg'}) eq 'ARRAY') { |
|
foreach my $item (@{$postprocess->{'createdmsg'}}) { |
|
if (ref($item) eq 'HASH') { |
|
if ($item->{'mt'} ne '') { |
|
push(@{$approvedmsg},$item); |
|
} |
|
} |
|
} |
|
} |
|
} |
} |
} |
push(@completed,$cnum); |
push(@completed,$cnum); |
|
|
Line 1023 sub update_request_queue {
|
Line 1050 sub update_request_queue {
|
$approvedlist,$rejectedlist,$crstype); |
$approvedlist,$rejectedlist,$crstype); |
} |
} |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$chgmsg = "'Action was taken on the following authoring space requests by [_1].',$namelink"; |
$chgmsg = "'Action was taken on the following Authoring Space requests by [_1].',$namelink"; |
if (@completed) { |
if (@completed) { |
$approvedlist = join("\n",@completed); |
$approvedlist = join("\n",@completed); |
$output .= '<p>'.&mt('The following requests were approved:').'<ul>'; |
$output .= '<p>'.&mt('The following requests were approved:').'<ul>'; |
Line 1064 sub update_request_queue {
|
Line 1091 sub update_request_queue {
|
} |
} |
my $syllabuslink = |
my $syllabuslink = |
&Apache::loncommon::syllabuswrapper($showcourse,$cnum,$cdom); |
&Apache::loncommon::syllabuswrapper($showcourse,$cnum,$cdom); |
if ($uniquecode && $codes{$cnum}) { |
if ($codes{$cnum}) { |
$syllabuslink .= &mt('Unique code: [_1]',$codes{$cnum}); |
$syllabuslink .= &mt('Unique code: [_1]',$codes{$cnum}); |
} |
} |
$output .= '<li>'.$syllabuslink.'</li>'; |
$output .= '<li>'.$syllabuslink.'</li>'; |
Line 1101 sub update_request_queue {
|
Line 1128 sub update_request_queue {
|
} |
} |
$output .= '</ul></p>'; |
$output .= '</ul></p>'; |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$output .= '<p>'.&mt('Authoring space requests from the following users were deleted because one already exists:').'<ul>'; |
$output .= '<p>'.&mt('Authoring Space requests from the following users were deleted because one already exists:').'<ul>'; |
foreach my $uname (@existing) { |
foreach my $uname (@existing) { |
my $userlink = |
my $userlink = |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$cdom),$uname,$cdom); |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$cdom),$uname,$cdom); |
Line 1154 sub update_request_queue {
|
Line 1181 sub update_request_queue {
|
} |
} |
$output .= '</ul></p>'; |
$output .= '</ul></p>'; |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$output .= '<p>'.&mt('The following authoring space requests were deleted because the requestor does not have a LON-CAPA account:').'<ul>'; |
$output .= '<p>'.&mt('The following Authoring Space requests were deleted because the requestor does not have a LON-CAPA account:').'<ul>'; |
foreach my $uname (@invalidusers) { |
foreach my $uname (@invalidusers) { |
my $userlink = |
my $userlink = |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$cdom),$uname,$cdom); |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$cdom),$uname,$cdom); |
Line 1186 sub update_request_queue {
|
Line 1213 sub update_request_queue {
|
} |
} |
$output .= '</ul></p>'; |
$output .= '</ul></p>'; |
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
$output .= '<p>'.&mt('The following requests could not be processed because the requestor does not have rights to request an authoring space:').'<ul>'; |
$output .= '<p>'.&mt('The following requests could not be processed because the requestor does not have rights to request an Authoring Space:').'<ul>'; |
foreach my $uname (@nopermissions) { |
foreach my $uname (@nopermissions) { |
my $userlink = |
my $userlink = |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$cdom),$uname,$cdom); |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$cdom),$uname,$cdom); |
Line 1328 sub get_student_counts {
|
Line 1355 sub get_student_counts {
|
|
|
sub course_creation { |
sub course_creation { |
my ($dom,$cnum,$context,$details,$logmsg,$newusermsg,$addresult,$enrollcount,$output, |
my ($dom,$cnum,$context,$details,$logmsg,$newusermsg,$addresult,$enrollcount,$output, |
$keysmsg,$domdefs,$longroles,$coderef) = @_; |
$keysmsg,$domdefs,$longroles,$coderef,$customhash) = @_; |
unless ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH') && |
unless ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH') && |
(ref($longroles) eq 'HASH')) { |
(ref($longroles) eq 'HASH')) { |
return 'error: Invalid request'; |
return 'error: Invalid request'; |
} |
} |
my ($result,$ownername,$ownerdom); |
my ($result,$ownername,$ownerdom); |
my $crstype = $details->{'crstype'}; |
my $crstype = $details->{'crstype'}; |
|
my $coursedesc = $details->{'cdescr'}; |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestauthor'],$dom); |
|
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
|
if (ref($domconfig{'requestcourses'}{'uniquecode'}) eq 'HASH') { |
|
if ($domconfig{'requestcourses'}{'uniquecode'}{$crstype}) { |
|
$details->{'uniquecode'} = 1; |
|
} |
|
} |
|
} |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$ownername = $details->{'owner'}; |
$ownername = $details->{'owner'}; |
$ownerdom = $details->{'domain'}; |
$ownerdom = $details->{'domain'}; |
Line 1342 sub course_creation {
|
Line 1378 sub course_creation {
|
$ownername = $env{'user.name'}; |
$ownername = $env{'user.name'}; |
$ownerdom = $env{'user.domain'}; |
$ownerdom = $env{'user.domain'}; |
} |
} |
|
my $fullname = &Apache::loncommon::plainname($ownername,$ownerdom); |
my $owneremail; |
my $owneremail; |
my %emails = &Apache::loncommon::getemails($ownername,$ownerdom); |
my %emails = &Apache::loncommon::getemails($ownername,$ownerdom); |
foreach my $email ('permanentemail','critnotification','notification') { |
foreach my $email ('permanentemail','critnotification','notification') { |
Line 1352 sub course_creation {
|
Line 1389 sub course_creation {
|
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
my $cid = &LONCAPA::batchcreatecourse::build_course($dom,$cnum,'requestcourses', |
\%reqdetails,$longroles,$logmsg,$newusermsg,$addresult, |
\%reqdetails,$longroles,$logmsg,$newusermsg,$addresult, |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype,$coderef); |
$enrollcount,$output,$keysmsg,$ownerdom,$ownername,$cnum,$crstype,$coderef); |
|
my $postprocess; |
if ($cid eq "/$dom/$cnum") { |
if ($cid eq "/$dom/$cnum") { |
$result = 'created'; |
$result = 'created'; |
|
my $code; |
|
if (ref($coderef)) { |
|
$code = $$coderef; |
|
} |
|
$postprocess = &Apache::lonnet::auto_crsreq_update($dom,$cnum,$crstype,$result,$ownername, |
|
$ownerdom,$fullname,$coursedesc,$code,$customhash); |
} else { |
} else { |
$result = 'error: '.$cid; |
$result = 'error: '.$cid; |
} |
} |
return $result; |
return ($result,$postprocess); |
} |
} |
|
|
sub build_batchcreatehash { |
sub build_batchcreatehash { |
Line 1383 sub build_batchcreatehash {
|
Line 1427 sub build_batchcreatehash {
|
if ($details->{'crstype'} eq 'community') { |
if ($details->{'crstype'} eq 'community') { |
$batchhash{'crstype'} = 'Community'; |
$batchhash{'crstype'} = 'Community'; |
} else { |
} else { |
|
if ($details->{'crstype'} eq 'textbook') { |
|
if ($details->{'clonecrs'} && $details->{'clonedom'}) { |
|
my %clonedfrom = &Apache::lonnet::coursedescription($details->{'clonedom'}.'_'.$details->{'clonecrs'}); |
|
$batchhash{'textbook'} = $clonedfrom{'description'}; |
|
} |
|
} |
$batchhash{'crstype'} = 'Course'; |
$batchhash{'crstype'} = 'Course'; |
} |
} |
my ($owner_firstname,$owner_lastname); |
my ($owner_firstname,$owner_lastname); |
Line 1720 sub process_official_reqs {
|
Line 1770 sub process_official_reqs {
|
$reqstatus = $disposition; |
$reqstatus = $disposition; |
if ($disposition eq 'process') { |
if ($disposition eq 'process') { |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code); |
my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,$code); |
my $result = &course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,\$newusermsg,\$addresult,\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles,\$code); |
my %customitems; |
|
my $fullname = &Apache::loncommon::plainname($ownername,$ownerdom); |
|
my $inprocess = &Apache::lonnet::auto_crsreq_update($dom,$cnum,$crstype,'process',$ownername, |
|
$ownerdom,$fullname,$cdescr); |
|
if (ref($inprocess) eq 'HASH') { |
|
foreach my $key (keys(%{$inprocess})) { |
|
if (exists($history{'details'}{$key})) { |
|
$customitems{$key} = $history{'details'}{$key}; |
|
} |
|
} |
|
} |
|
my ($result,$postprocess) = |
|
&course_creation($dom,$cnum,'domain',$history{'details'},\$logmsg,\$newusermsg,\$addresult, |
|
\$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles,\$code,\%customitems); |
if ($result eq 'created') { |
if ($result eq 'created') { |
$disposition = 'created'; |
$disposition = 'created'; |
$reqstatus = 'created'; |
$reqstatus = 'created'; |
Line 1744 sub process_official_reqs {
|
Line 1807 sub process_official_reqs {
|
mt => 'If currently logged-in to LON-CAPA, log-out and log-in again to select your new course role.' |
mt => 'If currently logged-in to LON-CAPA, log-out and log-in again to select your new course role.' |
}]; |
}]; |
my $sender = $dcname.':'.$dcdom; |
my $sender = $dcname.':'.$dcdom; |
|
if (ref($postprocess) eq 'HASH') { |
|
if (ref($postprocess->{'createdmsg'}) eq 'ARRAY') { |
|
foreach my $item (@{$postprocess->{'createdmsg'}}) { |
|
if (ref($item) eq 'HASH') { |
|
if ($item->{'mt'} ne '') { |
|
push(@{$approvedmsg},$item); |
|
} |
|
} |
|
} |
|
} |
|
} |
&send_selfserve_notification($owner,$approvedmsg, |
&send_selfserve_notification($owner,$approvedmsg, |
$cid,$cdescr,$now, |
$cid,$cdescr,$now, |
$beneficiary,$sender, |
$beneficiary,$sender, |
Line 1856 sub process_reqauthor {
|
Line 1930 sub process_reqauthor {
|
my ($dispositionref,$updateref) = @_; |
my ($dispositionref,$updateref) = @_; |
if (&is_active_author()) { |
if (&is_active_author()) { |
return '<span class="LC_warning">'. |
return '<span class="LC_warning">'. |
&mt('An authoring space has already been assigned to you.').'<br />'. |
&mt('An Authoring Space has already been assigned to you.').'<br />'. |
&mt('Please select the Author role from your [_1]roles page[_2].','<a href="/adm/roles">', |
&mt('Please select the Author role from your [_1]roles page[_2].','<a href="/adm/roles">', |
'</a>').'</span>'; |
'</a>').'</span>'; |
} |
} |
unless ($env{'environment.canrequest.author'}) { |
unless ($env{'environment.canrequest.author'}) { |
return '<span class="LC_warning">'. |
return '<span class="LC_warning">'. |
&mt('You do not currently have rights to request an authoring space.').'<br />'. |
&mt('You do not currently have rights to request an Authoring Space.').'<br />'. |
&mt('Please contact the [_1]helpdesk[_2] for assistance.','<a href="/adm/helpdesk">', |
&mt('Please contact the [_1]helpdesk[_2] for assistance.','<a href="/adm/helpdesk">', |
'</a>').'</span>'; |
'</a>').'</span>'; |
} |
} |
Line 1870 sub process_reqauthor {
|
Line 1944 sub process_reqauthor {
|
if ($queued =~ /^approval:(\d+)$/) { |
if ($queued =~ /^approval:(\d+)$/) { |
my $timestamp = $1; |
my $timestamp = $1; |
return '<span class="LC_info">'. |
return '<span class="LC_info">'. |
&mt('A request for authoring space submitted on [_1] is awaiting approval', |
&mt('A request for Authoring Space submitted on [_1] is awaiting approval', |
&Apache::lonlocal::locallocaltime($timestamp)). |
&Apache::lonlocal::locallocaltime($timestamp)). |
'</span>'; |
'</span>'; |
} elsif ($queued =~ /^approved:(\d+)$/) { |
} elsif ($queued =~ /^approved:(\d+)$/) { |
Line 1879 sub process_reqauthor {
|
Line 1953 sub process_reqauthor {
|
['active'],['au'],[$env{'user.domain'}]); |
['active'],['au'],[$env{'user.domain'}]); |
if (keys(%roleshash) > 0) { |
if (keys(%roleshash) > 0) { |
return '<span class="LC_info">'. |
return '<span class="LC_info">'. |
&mt('A request for authoring space submitted on [_1] has been approved.', |
&mt('A request for Authoring Space submitted on [_1] has been approved.', |
&Apache::lonlocal::locallocaltime($timestamp)). |
&Apache::lonlocal::locallocaltime($timestamp)). |
'</span>'; |
'</span>'; |
} |
} |
Line 1896 sub process_reqauthor {
|
Line 1970 sub process_reqauthor {
|
if (&Apache::lonnet::assignrole($env{'user.domain'},$env{'user.name'},'/'.$env{'user.domain'}.'/', |
if (&Apache::lonnet::assignrole($env{'user.domain'},$env{'user.name'},'/'.$env{'user.domain'}.'/', |
'au',undef,$start,undef,undef,'requestauthor') eq 'ok') { |
'au',undef,$start,undef,undef,'requestauthor') eq 'ok') { |
$output = '<span class="LC_info">'. |
$output = '<span class="LC_info">'. |
&mt('Access to authoring space has been activated').'</span><br />'; |
&mt('Access to Authoring Space has been activated').'</span><br />'; |
&Apache::lonroles::update_session_roles(); |
&Apache::lonroles::update_session_roles(); |
&Apache::lonnet::appenv({'user.update.time' => $now}); |
&Apache::lonnet::appenv({'user.update.time' => $now}); |
if (ref($updateref)) { |
if (ref($updateref)) { |
Line 1907 sub process_reqauthor {
|
Line 1981 sub process_reqauthor {
|
} |
} |
} else { |
} else { |
$output = '<span class="LC_info">'. |
$output = '<span class="LC_info">'. |
&mt('An error occurred while activating your access to authoring space'); |
&mt('An error occurred while activating your access to Authoring Space'); |
} |
} |
} elsif ($val eq 'approval') { |
} elsif ($val eq 'approval') { |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($env{'user.domain'}); |
my $domconfiguser = &Apache::lonnet::get_domainconfiguser($env{'user.domain'}); |
Line 1938 sub process_reqauthor {
|
Line 2012 sub process_reqauthor {
|
my $userresult = |
my $userresult = |
&Apache::lonnet::put('requestauthor',\%userrequest,$env{'user.domain'},$env{'user.name'}); |
&Apache::lonnet::put('requestauthor',\%userrequest,$env{'user.domain'},$env{'user.name'}); |
$output = '<span class="LC_info">'. |
$output = '<span class="LC_info">'. |
&mt('Your request for authoring space has been submitted for approval.'). |
&mt('Your request for Authoring Space has been submitted for approval.'). |
'</span>'; |
'</span>'; |
&Apache::lonnet::appenv({'environment.requestauthorqueued' => $val.':'.$now}); |
&Apache::lonnet::appenv({'environment.requestauthorqueued' => $val.':'.$now}); |
} else { |
} else { |
$output = '<span class="LC_info">'. |
$output = '<span class="LC_info">'. |
&mt('An error occurred saving your request for authoring space.'). |
&mt('An error occurred saving your request for Authoring Space.'). |
'</span>'; |
'</span>'; |
} |
} |
} |
} |