--- loncom/auth/lonroles.pm 2014/03/25 09:29:43 1.300
+++ loncom/auth/lonroles.pm 2014/05/04 21:49:05 1.302
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.300 2014/03/25 09:29:43 raeburn Exp $
+# $Id: lonroles.pm,v 1.302 2014/05/04 21:49:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -746,7 +746,12 @@ ENDENTERKEY
my $swinfo=&Apache::lonmenu::rawconfig();
my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});
- my $funcs = &get_roles_functions($showcount);
+ my %domdefs=&Apache::lonnet::get_domain_defaults($env{'user.domain'});
+ my $cattype = 'std';
+ if ($domdefs{'catauth'}) {
+ $cattype = $domdefs{'catauth'};
+ }
+ my $funcs = &get_roles_functions($showcount,$cattype);
$standby=~s/\n/\\n/g;
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.').'
';
@@ -889,7 +894,7 @@ ENDHEADER
\%sortrole,\%roleclass,\%futureroles,\%timezones,$loncaparev);
$refresh = $now;
&Apache::lonnet::appenv({'user.refresh.time' => $refresh});
- unless ($env{'user.adv'}) {
+ if ((($cattype eq 'std') || ($cattype eq 'domonly')) && (!$env{'user.adv'})) {
if ($countactive > 0) {
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
@@ -918,8 +923,7 @@ ENDHEADER
} else {
$r->print('
'.&mt('Currently no active roles, courses or communities').'
');
}
- &findcourse_advice($r);
- &requestcourse_advice($r);
+ &requestcourse_advice($r,$cattype);
$r->print('');
if ($countfuture) {
$r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
@@ -1407,7 +1411,7 @@ sub print_rolerows {
}
sub findcourse_advice {
- my ($r) = @_;
+ my ($r,$cattype) = @_;
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'})) {
@@ -1422,15 +1426,17 @@ sub findcourse_advice {
} 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('Self-Enrollment').'
'.
- ''.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','','',$domdesc).'
');
- $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'
'.
- &Apache::loncoursequeueadmin::queued_selfenrollment());
+ if (($cattype eq 'std') || ($cattype eq 'domonly')) {
+ $r->print(''.&mt('Self-Enrollment').'
'.
+ ''.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','','',$domdesc).'
');
+ $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'
'.
+ &Apache::loncoursequeueadmin::queued_selfenrollment());
+ }
return;
}
sub requestcourse_advice {
- my ($r) = @_;
+ my ($r,$cattype) = @_;
my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
my (%can_request,%request_doms);
@@ -1478,6 +1484,8 @@ sub requestcourse_advice {
}
$r->print(''.&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.','','').'');
}
+ } elsif (!$env{'user.adv'}) {
+ &findcourse_advice($r,$cattype);
}
return;
}
@@ -1750,7 +1758,7 @@ sub check_release_required {
my $otherserver;
if (($major eq '' && $minor eq '') ||
(($reqdmajor > $major) || (($reqdmajor == $major) && ($reqdminor > $minor)))) {
- my ($userdomserver) = &Apache::lonnet::choose_server($env{'user.domain'});
+ my ($userdomserver) = &Apache::lonnet::choose_server($env{'user.domain'},undef,$required);
my $switchlcrev =
&Apache::lonnet::get_server_loncaparev($env{'user.domain'},
$userdomserver);
@@ -2704,7 +2712,7 @@ sub is_active_course {
}
sub get_roles_functions {
- my ($rolescount) = @_;
+ my ($rolescount,$cattype) = @_;
my @links;
push(@links,["javascript:rolesView('doupdate');",'start-here-22x22',&mt('Check for changes')]);
if ($env{'environment.canrequest.author'}) {
@@ -2730,7 +2738,7 @@ sub get_roles_functions {
push(@links,["javascript:rolesView('showall');",'edit-undo-22x22',&mt('Include expired')]);
}
}
- if (&Apache::loncommon::designparm('login.coursecatalog',$env{'user.domain'})) {
+ unless ($cattype eq 'none') {
push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]);
}
my $funcs = &Apache::lonhtmlcommon::start_funclist();