[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonroles.pm
raeburn
raeburn at source.lon-capa.org
Mon Feb 3 20:55:50 EST 2020
raeburn Tue Feb 4 01:55:50 2020 EDT
Modified files: (Branch: version_2_11_X)
/loncom/auth lonroles.pm
Log:
- For 2.11
Backport 1.343
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.269.2.36 loncom/auth/lonroles.pm:1.269.2.37
--- loncom/auth/lonroles.pm:1.269.2.36 Sun Jul 28 13:57:36 2019
+++ loncom/auth/lonroles.pm Tue Feb 4 01:55:50 2020
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.269.2.36 2019/07/28 13:57:36 raeburn Exp $
+# $Id: lonroles.pm,v 1.269.2.37 2020/02/04 01:55:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1030,7 +1030,11 @@
# No active roles
if ($countactive==0) {
- &requestcourse_advice($r,$cattype,$inrole);
+ my $elapsed = 0;
+ if ($now && $update) {
+ $elapsed = $now - $update;
+ }
+ &requestcourse_advice($r,$cattype,$inrole,$elapsed);
$r->print('</form>');
if ($countfuture) {
$r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
@@ -1548,21 +1552,26 @@
}
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('<p>'.&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).'
<ul>
<li>'.&mt('The course has yet to be created.').'</li>
<li>'.&mt('Automatic enrollment of registered students has not been enabled for the course.').'</li>
<li>'.&mt('You are in a section of course for which automatic enrollment in the corresponding LON-CAPA course is not active.').'</li>
<li>'.&mt('The start date for automated enrollment has yet to be reached.').'</li>
<li>'.&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.').'</li>
- <li>'.&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.').'</li>
- </ul>');
+ <li>'.&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.').'</li>
+ </ul></p>');
} 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.').'<br />');
+ $r->print('<p>'.&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'</p>');
+ if ($elapsed > 600) {
+ $r->print('<p>'.&mt('You may also have been assigned to a course in the time since you last logged-in, or checked for changes.').
+ '<br />'.
+ &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.').'</p>');
+ }
}
if (($cattype eq 'std') || ($cattype eq 'domonly')) {
$r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.
@@ -1574,7 +1583,7 @@
}
sub requestcourse_advice {
- my ($r,$cattype,$inrole) = @_;
+ my ($r,$cattype,$inrole,$elapsed) = @_;
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
my (%can_request,%request_doms,$output);
@@ -1635,7 +1644,7 @@
} else {
$r->print('<h3>'.&mt('Currently no active roles, courses or communities').'</h3>');
}
- &findcourse_advice($r,$cattype);
+ &findcourse_advice($r,$cattype,$elapsed);
}
return;
}
More information about the LON-CAPA-cvs
mailing list