version 1.41, 2014/01/03 18:39:51
|
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 384 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 397 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 599 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 1050 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 1128 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 1181 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 1213 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 1930 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 1944 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 1953 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 1970 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 1981 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 2012 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>'; |
} |
} |
} |
} |