[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 04 Jul 2008 14:19:17 -0000
raeburn Fri Jul 4 10:19:17 2008 EDT
Modified files:
/loncom/auth lonroles.pm
Log:
- Display a course catalog link at the top of the roles screen, with advice on self-enrollment, for users without advanced roles, and at least one active role.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.195 loncom/auth/lonroles.pm:1.196
--- loncom/auth/lonroles.pm:1.195 Wed Jun 4 15:14:20 2008
+++ loncom/auth/lonroles.pm Fri Jul 4 10:19:16 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.195 2008/06/04 19:14:20 bisitz Exp $
+# $Id: lonroles.pm,v 1.196 2008/07/04 14:19:16 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -501,13 +501,6 @@
$r->print('<input type="hidden" name="selectrole" value="1" />');
$r->print('<input type="hidden" name="newrole" value="" />');
}
- if ($env{'user.adv'}) {
- $r->print(
- '<br /><span class="LC_rolesinfo"><label>'.&mt('Show all roles').': <input type="checkbox" name="showall"');
- if ($env{'form.showall'}) { $r->print(' checked="checked" '); }
- $r->print(' /></label><input type="submit" value="'.&mt('Display').'" /></span>');
- }
-
my (%roletext,%sortrole,%roleclass);
my $countactive=0;
my $countfuture=0;
@@ -674,6 +667,18 @@
}
}
}
+ if ($env{'user.adv'}) {
+ $r->print(
+ '<br /><span class="LC_rolesinfo"><label>'.&mt('Show all roles').': <input type="checkbox" name="showall"');
+ if ($env{'form.showall'}) { $r->print(' checked="checked" '); }
+ $r->print(' /></label><input type="submit" value="'.&mt('Display').'" /></span>');
+ } else {
+ if ($countactive > 0) {
+ my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
+ $r->print('<p>'.&mt('[_1]Visit the [_2]Course Catalog[_3] to view all [_4] LON-CAPA courses.','<b>','<a href="/adm/coursecatalog">','</a></b>',$domdesc).'<br />'.&mt('If a course is [_1]not[_2] in your list of current courses below, you may be able to enroll if self-enrollment is permitted.','<b>','</b>').'</p>');
+ }
+ }
+
# No active roles
if ($countactive==0) {
if ($inrole) {