";
+ }
+ my $end_page = &Apache::loncommon::end_page();
# Note to style police:
# This must only replace the spaces, nothing else, or it bombs elsewhere.
$url=~s/ /\%20/g;
$r->print(<$msg
$end_page
ENDREDIR
return;
@@ -174,29 +249,22 @@ ENDREDIR
sub error_page {
my ($r,$error,$dest)=@_;
- &Apache::loncommon::content_type($r,'text/html');
- &Apache::loncommon::no_cache($r);
- $r->send_http_header;
- return OK if $r->header_only;
- # Breadcrumbs
- my $brcrum = [{'href' => $dest,
- 'text' => 'Problems during Course Initialization'},];
- $r->print(&Apache::loncommon::start_page('Problems during Course Initialization',
- undef,
- {'bread_crumbs' => $brcrum,})
- );
- $r->print(
- ''.
- '
'.
+ &Apache::loncommon::end_page());
+ }
} else {
+ &set_supplemental_access($cnum,$cdom);
+ if (($env{'request.lti.login'}) &&
+ ($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {
+ &process_lti($r,$cdom,$cnum);
+ }
+ if ($env{'request.deeplink.login'}) {
+ &set_deeplink_target($cnum,$cdom);
+ }
# Check to see if the user is a CC entering a course
# for the first time
if ((($role eq 'cc') || ($role eq 'co'))
@@ -676,9 +979,11 @@ ENDENTERKEY
my ($score,$incomplete) =
&Apache::lonplacementtest::check_completion(undef,undef,1);
if (($incomplete) && ($incomplete < 100)) {
- &redirect_user($r, &mt('Entering [_1]',
- $env{'course.'.$cdom.'_'.$cnum.'.description'}),
- '/adm/placement', $msg);
+ $msg = '
';
+ &finish_loading_course($r,$msg,$furl,$only_body);
}
- $msg = &mt('Entering [_1] ...',
- $env{'course.'.$cdom.'_'.$cnum.'.description'});
- &redirect_user($r, &mt('Entering [_1]',
- $env{'course.'.$cdom.'_'.$cnum.'.description'}),
- $furl, $msg);
}
+ $r->rflush();
return OK;
}
}
@@ -797,6 +1139,12 @@ ENDENTERKEY
$redirect_url .= $where;
}
$redirect_url .= '/';
+ if ($env{'form.orgurl'} =~ /^\Q$redirect_url\E/) {
+ my ($path) = ($env{'form.orgurl'} =~ m{^(.+)/[^/]+$});
+ if (($path ne '') && (-e $Apache::lonnet::perlvar{'lonDocRoot'}.$path)) {
+ $redirect_url = $env{'form.orgurl'};
+ }
+ }
&redirect_user($r,&mt('Entering Authoring Space'),
$redirect_url);
return OK;
@@ -847,7 +1195,11 @@ ENDENTERKEY
$crumbtext = 'Courses';
$pagetitle = 'My Courses';
$recent = &mt('Recent Courses');
- $standby = &mt('Course selected. Please stand by.');
+ $standby = &mt('Course selected. Please stand by.');
+ }
+ if (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) {
+ $crumbtext = 'Access Denied';
+ $pagetitle = 'Unauthorized';
}
my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}];
@@ -885,14 +1237,18 @@ ENDENTERKEY
$start_page=&Apache::loncommon::start_page($pagetitle,undef,
{bread_crumbs=>$brcrum,crstype=>'Placement'});
} else {
- $funcs = &get_roles_functions($showcount,$cattype);
- my $crumbsright;
- if ($env{'browser.mobile'}) {
- $crumbsright = $funcs;
- undef($funcs);
+ my ($crumbsright,$crumbs_style);
+ unless (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) {
+ $funcs = &get_roles_functions($showcount,$cattype,$domdefs{'userapprovals'});
+ if ($env{'browser.mobile'}) {
+ $crumbsright = $funcs;
+ undef($funcs);
+ $crumbs_style = 'overflow: visible;';
+ }
}
$start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum,
- bread_crumbs_component=>$crumbsright});
+ bread_crumbs_component=>$crumbsright,
+ bread_crumbs_style=>$crumbs_style,});
}
&js_escape(\$standby);
my $noscript=' '.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').' '.&mt('As this is not the case, most functionality in the system will be unavailable.').' ';
@@ -923,7 +1279,11 @@ function enterrole (thisform,rolecode,bu
}
function rolesView (caller) {
- if ((caller == 'showall') || (caller == 'noshowall')) {
+ if (caller == 'approvals') {
+ document.rolechoice.approvals.value = 'show';
+ } else if (caller == 'noapprovals') {
+ document.rolechoice.approvals.value = 'hide';
+ } else if ((caller == 'showall') || (caller == 'noshowall')) {
document.rolechoice.display.value = caller;
} else {
if ((caller == 'doupdate') || (caller == 'requestauthor') ||
@@ -997,8 +1357,16 @@ ENDHEADER
}
if ($nochoose) {
$r->print("
".&mt('Sorry ...')."
\n".
- &mt('This action is currently not authorized.').''.
- &Apache::loncommon::end_page());
+ &mt('This action is currently not authorized.').'');
+ if ($error && $norolelist) {
+ $r->print('
'.
+ &mt('As your session was launched from a web page external to LON-CAPA some course content may be unavailable, including the resource you were trying to access.').
+ '
'.
+ '
'.
+ &mt('You may need to login to LON-CAPA directly, or re-launch from a different external system.').
+ '
');
+ }
+ $r->print(&Apache::loncommon::end_page());
return OK;
} else {
if ($updateresult || $reqauthor || $hotlist) {
@@ -1011,22 +1379,41 @@ ENDHEADER
}
if ($hotlist) {
$showresult .= $hotlist;
- }
+ }
$showresult .= '';
$r->print($showresult);
} elsif ($env{'form.state'} eq 'queued') {
$r->print(&get_queued());
+ } elsif ($env{'form.approvals'} eq 'show') {
+ if ($env{'form.state'} eq 'done') {
+ $r->print($approvalresult).' ';
+ }
+ $r->print(' ');
}
if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {
$fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};
}
my $display = ($env{'form.display'} =~ /^(showall)$/);
+ my $approvals = ($env{'form.approvals'} =~ /^(show)$/);
$r->print('');
if ($countfuture) {
$r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
@@ -1334,8 +1745,8 @@ sub gather_roles {
if (!$allowed) {
$button=0;
unless ($trustchecked{$tdom}) {
- if ((&Apache::lonnet::will_trust('othcoau',$tdom,$env{'user.domain'})) &&
- (&Apache::lonnet::will_trust('coremau',$env{'user.domain'},$tdom))) {
+ if ((&Apache::lonnet::will_trust('othcoau',$env{'user.domain'},$tdom)) &&
+ (&Apache::lonnet::will_trust('coaurem',$tdom,$env{'user.domain'}))) {
$willtrust{$tdom} = 1;
$trustchecked{$tdom} = 1;
}
@@ -1392,9 +1803,9 @@ sub gather_roles {
foreach my $rolename (sort(keys(%{$domdef{'adhocroles'}}))) {
if (ref($domdef{'adhocroles'}{$rolename}) eq 'HASH') {
$adhocdesc{$tdom}{$rolename} = $domdef{'adhocroles'}{$rolename}{'desc'};
- $desc = $adhocdesc{$tdom}{$rolename};
}
}
+ $desc = $adhocdesc{$tdom}{$rolename};
}
}
if ($desc ne '') {
@@ -1624,20 +2035,26 @@ sub print_rolerows {
}
sub findcourse_advice {
- my ($r,$cattype) = @_;
+ my ($r,$cattype,$elapsed) = @_;
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
if (&Apache::lonnet::auto_run(undef,$env{'user.domain'})) {
- $r->print(&mt('If you were expecting to see an active role listed for a particular course in the [_1] domain, it may be missing for one of the following reasons:',$domdesc).'
+ $r->print('
'.&mt('If you were expecting to see an active role listed for a particular course in the [_1] domain, it may be missing for one of the following reasons:',$domdesc).'
'.&mt('The course has yet to be created.').'
'.&mt('Automatic enrollment of registered students has not been enabled for the course.').'
'.&mt('You are in a section of course for which automatic enrollment in the corresponding LON-CAPA course is not active.').'
'.&mt('The start date for automated enrollment has yet to be reached.').'
'.&mt('You registered for the course recently and there is a time lag between the time you register, and the time this information becomes available for the update of LON-CAPA course rosters.').'
-
');
+
'.&mt('Automated enrollment added you to the course in the time since you last logged-in.').' '.&mt('If that is the case you can use the "Check for changes" link in the gray Functions bar to update the list of your available course roles.').'
+ ');
} else {
- $r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').' ');
+ $r->print('
'.&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'
');
+ if ($elapsed > 600) {
+ $r->print('
'.&mt('You may also have been assigned to a course in the time since you last logged-in, or checked for changes.').
+ ' '.
+ &mt('If that is the case you can use the "Check for changes" link in the gray Functions bar to update the list of your available course roles.').'