');
} elsif ($env{'form.action'} eq 'singlestudent') {
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
+ 'Course_Add_Student'));
$r->print($jscript."");
if ($crstype eq 'Community') {
$r->print($lt{'memsrch'});
@@ -915,7 +902,7 @@ ENDSCRIPT
}
sub print_user_query_page {
- my ($r,$caller,$brcrum) = @_;
+ my ($r,$caller) = @_;
# FIXME - this is for a network-wide name search (similar to catalog search)
# To use frames with similar behavior to catalog/portfolio search.
# To be implemented.
@@ -923,11 +910,11 @@ sub print_user_query_page {
}
sub print_user_modification_page {
- my ($r,$ccuname,$ccdomain,$srch,$response,$context,$permission,$crstype,$brcrum) = @_;
+ my ($r,$ccuname,$ccdomain,$srch,$response,$context,$permission,$crstype) = @_;
if (($ccuname eq '') || ($ccdomain eq '')) {
my $usermsg = &mt('No username and/or domain provided.');
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$usermsg,'','',$crstype,$brcrum);
+ &print_username_entry_form($r,$context,$usermsg,'','',$crstype);
return;
}
my ($form,$formname);
@@ -941,21 +928,12 @@ sub print_user_modification_page {
my %abv_auth = &auth_abbrev();
my (%rulematch,%inst_results,$newuser,%alerts,%curr_rules,%got_rules);
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if ($is_custom) {
- if ($uhome eq 'no_host') {
- my $lc_ccuname = lc($ccuname);
- if ($lc_ccuname ne $ccuname) {
- $uhome = &Apache::lonnet::homeserver($lc_ccuname,$ccdomain);
- $ccuname = $lc_ccuname;
- }
- }
- }
if ($uhome eq 'no_host') {
+ my $usertype;
my ($rules,$ruleorder) =
&Apache::lonnet::inst_userrules($ccdomain,'username');
- my $usertype =
- &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
+ $usertype =
+ &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
my $cancreate =
&Apache::lonuserutils::can_create_user($ccdomain,$context,
$usertype);
@@ -965,28 +943,19 @@ sub print_user_modification_page {
official => 'institutional',
unofficial => 'non-institutional',
);
- if ($ccdomain eq 'gci') {
- $usertypetext{'unofficial'} = 'institutional',
- }
my $response;
if ($env{'form.origform'} eq 'crtusername') {
- if ($is_custom) {
- $response = ''.&mt('Invalid format for username for new user: [_1]',''.$ccuname.'').
- ' ';
- } else {
- $response = ''.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).' ';
- }
+ $response = ''.&mt('No match found for the username [_1] in LON-CAPA domain: [_2]',''.$ccuname.'',$ccdomain).
+ ' ';
}
$response .= '
'
.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.")
- .' ';
- if ($ccdomain eq 'gcitest') {
- $response .= &mt('Enter a valid e-mail address as the username for the new user.').' '.&mt('Please contact the [_1]helpdesk[_2] for assistance.'
- ,'','')
- .'
';
- }
+ .' '
+ .&mt('Please contact the [_1]helpdesk[_2] for assistance.'
+ ,'','')
+ .' ';
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$response,undef,undef,$crstype,$brcrum);
+ &print_username_entry_form($r,$context,$response,undef,undef,$crstype);
return;
}
$newuser = 1;
@@ -1010,7 +979,7 @@ sub print_user_modification_page {
'username');
}
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$userchkmsg,undef,undef,$crstype,$brcrum);
+ &print_username_entry_form($r,$context,$userchkmsg,undef,undef,$crstype);
return;
}
}
@@ -1031,43 +1000,34 @@ sub print_user_modification_page {
my $js = &validation_javascript($context,$ccdomain,$pjump_def,
$groupslist,$newuser,$formname,\%loaditem);
- my $title = 'User Management';
- if ($context eq 'course') {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
+ my $args = {'add_entries' => \%loaditem};
+ if ($env{'form.popup'}) {
+ $args->{'no_nav_bar'} = 1;
}
+ my $start_page =
+ &Apache::loncommon::start_page('User Management',$js,$args);
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage($form)",
+ text=>$breadcrumb_text{'search'},
+ faq=>282,bug=>'Instructor Interface',});
+
+ if ($env{'form.phase'} eq 'userpicked') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage($form,'get_user_info','select')",
+ text=>$breadcrumb_text{'userpicked'},
+ faq=>282,bug=>'Instructor Interface',});
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage($form,'$env{'form.phase'}','modify')",
+ text=>$breadcrumb_text{'modify'},
+ faq=>282,bug=>'Instructor Interface',});
my $helpitem = 'Course_Change_Privileges';
if ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- push (@{$brcrum},
- {href => "javascript:backPage($form)",
- text => $breadcrumb_text{'search'},
- faq => 282,
- bug => 'Instructor Interface',});
- if ($env{'form.phase'} eq 'userpicked') {
- push(@{$brcrum},
- {href => "javascript:backPage($form,'get_user_info','select')",
- text => $breadcrumb_text{'userpicked'},
- faq => 282,
- bug => 'Instructor Interface',});
- }
- push(@{$brcrum},
- {href => "javascript:backPage($form,'$env{'form.phase'}','modify')",
- text => $breadcrumb_text{'modify'},
- faq => 282,
- bug => 'Instructor Interface',
- help => $helpitem});
- my $args = {'add_entries' => \%loaditem,
- 'bread_crumbs' => $brcrum,
- 'bread_crumbs_component' => 'User Management'};
- if ($env{'form.popup'}) {
- $args->{'no_nav_bar'} = 1;
- }
- my $start_page =
- &Apache::loncommon::start_page($title,$js,$args);
+ my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management',
+ $helpitem);
my $forminfo =<<"ENDFORMINFO";
');
+ $r->print('');
+ $r->print("".&Apache::loncommon::end_page());
return;
}
@@ -1492,11 +1455,14 @@ sub display_existing_roles {
$newkey .= '_'.$newrole;
if ($start ne '' && $end ne '') {
$newvalue .= '_'.$end.'_'.$start;
+ } elsif ($end ne '') {
+ $newvalue .= '_'.$end;
}
$rolesdump{$newkey} = $newvalue;
}
} else {
- %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname);
+ my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
+ %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname,'.',undef,$extra);
}
# Build up table of user roles to allow revocation and re-enabling of roles.
my ($tmp) = keys(%rolesdump);
@@ -1648,7 +1614,10 @@ sub display_existing_roles {
$plaintext=&Apache::lonnet::plaintext($role_code,$class)
} else {
$plaintext=
- "Customrole '$croletitle' defined by $croleuname\@$croleudom";
+ &mt('Customrole [_1][_2]defined by [_3]',
+ '"'.$croletitle.'"',
+ ' ',
+ $croleuname.':'.$croleudom);
}
$row.= '
'.$plaintext.
'
'.$area.
@@ -2100,9 +2069,22 @@ sub personal_data_display {
if ($canmodify_status{'inststatus'}) {
$shown = &pick_inst_statuses($userenv{'inststatus'},$usertypes,$types);
} else {
- $shown .= $userenv{'inststatus'};
if ($userenv{'inststatus'} eq '') {
$hiderow = 1;
+ } else {
+ my @showitems;
+ foreach my $item ( map { &unescape($_); } split(':',$userenv{'inststatus'})) {
+ if (exists($usertypes->{$item})) {
+ push(@showitems,$usertypes->{$item});
+ } else {
+ push(@showitems,$item);
+ }
+ }
+ if (@showitems) {
+ $shown = join(', ',@showitems);
+ } else {
+ $hiderow = 1;
+ }
}
}
if (!$hiderow) {
@@ -2198,8 +2180,7 @@ sub get_inststatuses {
# ================================================================= Phase Three
sub update_user_data {
- my ($r,$context,$crstype,$brcrum) = @_;
- my $is_custom = &Apache::loncommon::needs_gci_custom();
+ my ($r,$context,$crstype) = @_;
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
# Error messages
@@ -2224,33 +2205,36 @@ sub update_user_data {
'// ]]>'."\n".
''."\n";
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
- my $helpitem = 'Course_Change_Privileges';
- if ($env{'form.action'} eq 'singlestudent') {
- $helpitem = 'Course_Add_Student';
- }
- my $bread_crumbs_component = 'User Management';
- if ($context eq 'course') {
- if ($is_custom) {
- $bread_crumbs_component = 'Enrollment and Student Activity';
- }
- }
- push(@{$brcrum},
- {href => "javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
- text => $breadcrumb_text{'modify'},
- faq => 282,
- bug => 'Instructor Interface',},
- {href => "/adm/createuser",
- text => "Result",
- faq => 282,
- bug => 'Instructor Interface',
- help => $helpitem});
- my $args = {bread_crumbs => $brcrum,
- bread_crumbs_component => $bread_crumbs_component};
+ my $args;
if ($env{'form.popup'}) {
$args->{'no_nav_bar'} = 1;
+ } else {
+ $args = undef;
}
$r->print(&Apache::loncommon::start_page($title,$jscript,$args));
-
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.userupdate)",
+ text=>$breadcrumb_text{'search'},
+ faq=>282,bug=>'Instructor Interface',});
+ if ($env{'form.prevphase'} eq 'userpicked') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.userupdate,'get_user_info','select')",
+ text=>$breadcrumb_text{'userpicked'},
+ faq=>282,bug=>'Instructor Interface',});
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
+ text=>$breadcrumb_text{'modify'},
+ faq=>282,bug=>'Instructor Interface',},
+ {href=>"/adm/createuser",
+ text=>"Result",
+ faq=>282,bug=>'Instructor Interface',});
+ my $helpitem = 'Course_Change_Privileges';
+ if ($env{'form.action'} eq 'singlestudent') {
+ $helpitem = 'Course_Add_Student';
+ }
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
+ $helpitem));
$r->print(&update_result_form($uhome));
# Check Inputs
if (! $env{'form.ccuname'} ) {
@@ -2317,11 +2301,17 @@ sub update_user_data {
$r->print('
'.&mt('User [_1] in domain [_2]',
$env{'form.ccuname'}, $env{'form.ccdomain'}).'
');
+ $r->print('
'.&mt('Please be patient').'
');
+
my (%alerts,%rulematch,%inst_results,%curr_rules);
+ my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
my @usertools = ('aboutme','blog','portfolio');
my @requestcourses = ('official','unofficial','community');
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
+ my %canmodify_status =
+ &Apache::lonuserutils::can_modify_userinfo($context,$env{'form.ccdomain'},
+ ['inststatus']);
if ($env{'form.makeuser'}) {
$r->print('
'."\n");
$r->print(&Apache::loncoursequeueadmin::update_request_queue($context,
$cdom,$cnum,$coursedesc));
}
+ $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'changelogs') {
- push (@{$brcrum},
- {href => '/adm/createuser?action=changelogs',
- text => 'User Management Logs',
- help => 'Course_User_Logs'});
- $bread_crumbs_component = 'User Changes';
- $args = { bread_crumbs => $brcrum,
- bread_crumbs_component => $bread_crumbs_component};
- $r->print(&header(undef,$args));
- &print_userchangelogs_display($r,$context,$permission);
+ $r->print(&header());
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/createuser?action=changelogs',
+ text=>"User Management Logs"});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Changes',
+ 'Course_User_Logs'));
+ &print_userchangelogs_display($r,$context,$permission);
+ $r->print(&Apache::loncommon::end_page());
} else {
- $args = { bread_crumbs => $brcrum,
- bread_crumbs_component => $bread_crumbs_component};
- $r->print(&header(undef,$args));
+ $r->print(&header());
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
$r->print(&print_main_menu($permission,$context,$crstype));
+ $r->print(&Apache::loncommon::end_page());
}
- $r->print(&Apache::loncommon::end_page());
return OK;
}
sub header {
- my ($jscript,$args) = @_;
- my $title = 'User Management';
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if ($env{'request.course.id'}) {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
- }
+ my ($jscript,$loaditems,$args) = @_;
my $start_page;
- if (ref($args) eq 'HASH') {
- $start_page=&Apache::loncommon::start_page($title,$jscript,$args);
+ if (ref($loaditems) eq 'HASH') {
+ $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems});
} else {
- $start_page=&Apache::loncommon::start_page($title,$jscript);
+ $start_page=&Apache::loncommon::start_page('User Management',$jscript,$args);
}
return $start_page;
}
@@ -4440,10 +4333,6 @@ END
# Menu Phase One
sub print_main_menu {
my ($permission,$context,$crstype) = @_;
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if (($context eq 'course') && ($is_custom)) {
- return &print_gci_main_menu($permission,$context,$crstype)
- }
my $linkcontext = $context;
my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
if (($context eq 'course') && ($crstype eq 'Community')) {
@@ -4508,7 +4397,7 @@ sub print_main_menu {
[
{
linktext => $links{$linkcontext}{'upload'},
- icon => 'sctr.png',
+ icon => 'uplusr.png',
#help => 'Course_Create_Class_List',
url => '/adm/createuser?action=upload',
permission => $permission->{'cusr'},
@@ -4516,7 +4405,7 @@ sub print_main_menu {
},
{
linktext => $links{$linkcontext}{'listusers'},
- icon => 'edit-find.png',
+ icon => 'mngcu.png',
#help => 'Course_View_Class_List',
url => '/adm/createuser?action=listusers',
permission => ($permission->{'view'} || $permission->{'cusr'}),
@@ -4603,7 +4492,7 @@ sub print_main_menu {
},
{
linktext => $linktext{$crstype}{'groups'},
- icon => 'conf.png',
+ icon => 'grps.png',
#help => 'Course_Manage_Group',
url => '/adm/coursegroups?refpage=cusr',
permission => $permission->{'grp_manage'},
@@ -4648,7 +4537,7 @@ sub print_main_menu {
push(@{ $menu[2]->{items} },
{
linktext => 'User Self-Enrollment',
- icon => 'cstr.png',
+ icon => 'self_enroll.png',
#help => 'Course_Self_Enrollment',
url => '/adm/createuser?action=selfenroll',
permission => $permission->{'cusr'},
@@ -4665,82 +4554,6 @@ return Apache::lonhtmlcommon::generate_m
# });
}
-sub print_gci_main_menu {
- my ($permission,$context,$crstype) = @_;
- my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
- my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
- my %links = (
- course => {
- single => 'Add/Modify a Student',
- drop => 'Drop Students',
- upload => 'Upload a File of Course Users',
- singleuser => 'Add/Modify a Course User',
- listusers => 'Concept Test Roster and Student Activity',
- },
- );
- my %linktitles = (
- course => {
- singleuser => 'Add a user with a certain role to this course.',
- listusers => 'Show and manage users in this course.',
- single => 'Add a user with the role of student to this course',
- drop => 'Remove a student from this course.',
- upload => 'Upload a CSV or a text file containing users.',
- },
- );
- my @menu = ( {categorytitle => 'Manage Users',
- items =>
- [
- {
- linktext => $links{$context}{'single'},
- #help => 'Course_Add_Student',
- icon => 'list-add.png',
- url => '/adm/createuser?action=singlestudent',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'single'},
-
- },
- {
- linktext => $links{$context}{'drop'},
- icon => 'edit-undo.png',
- #help => 'Course_Drop_Student',
- url => '/adm/createuser?action=drop',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'drop'},
- },
- {
- linktext => $links{$context}{'upload'},
- icon => 'sctr.png',
- #help => 'Course_Create_Class_List',
- url => '/adm/createuser?action=upload',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'upload'},
- },
- {
- linktext => $links{$context}{'listusers'},
- icon => 'edit-find.png',
- #help => 'Course_View_Class_List',
- url => '/adm/createuser?action=listusers',
- permission => ($permission->{'view'} || $permission->{'cusr'}),
- linktitle => $linktitles{$context}{'listusers'},
- },
- ]},
- {categorytitle => 'Administration',
- items => [ ]},
- );
-
- push(@{ $menu[1]->{items} }, #Category: Administration
- {
- linktext => 'Change Log',
- icon => 'document-properties.png',
- #help => 'Course_User_Logs',
- url => '/adm/createuser?action=changelogs',
- permission => $permission->{'cusr'},
- linktitle => 'View change log.',
- },
- );
- return Apache::lonhtmlcommon::generate_menu(@menu);
-}
-
sub restore_prev_selections {
my %saveable_parameters = ('srchby' => 'scalar',
'srchin' => 'scalar',
@@ -5150,7 +4963,7 @@ ENDSCRIPT
''.
&Apache::loncommon::plainname($ccuname,$ccudom).
'';
- $count;
+ $count ++;
}
my $rem = $count%$numcols;
if ($rem) {
@@ -5167,7 +4980,7 @@ ENDSCRIPT
my $cid = $env{'request.course.id'};
my $currlim = $env{'course.'.$cid.'.internal.selfenroll_limit'};
my $currcap = $env{'course.'.$cid.'.internal.selfenroll_cap'};
- my $nolimit = ' checked="checked" ';
+ $nolimit = ' checked="checked" ';
if ($currlim eq 'allstudents') {
$crslimit = ' checked="checked" ';
$selflimit = ' ';
@@ -5223,9 +5036,9 @@ sub visible_in_cat {
dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
);
- $visactions{'unhide'} = &mt('Use [_1]Set course environment[_2] to change the "Exclude from course catalog" setting.','"','"');
- $visactions{'chgcat'} = &mt('Use [_1]Set course environment[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"','"');
- $visactions{'addcat'} = &mt('Use [_1]Set course environment[_2] to assign a category to the course.','"','"');
+ $visactions{'unhide'} = &mt('Use [_1]Categorize course[_2] to change the "Exclude from course catalog" setting.','','"');
+ $visactions{'chgcat'} = &mt('Use [_1]Categorize course[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"','"');
+ $visactions{'addcat'} = &mt('Use [_1]Categorize course[_2] to assign a category to the course.','"','"');
if (ref($domconf{'coursecategories'}) eq 'HASH') {
if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') {
$settable{'togglecats'} = 1;
@@ -5705,7 +5518,16 @@ sub role_display_filter {
# Update Display button
$output .= '
'
.''
- .'
';
+ .'';
+
+ # Server version info
+ $output .= '
'
+ .&mt('Only changes made from servers running LON-CAPA [_1] or later are displayed.'
+ ,'2.6.99.0');
+ if ($version) {
+ $output .= ' '.&mt('This LON-CAPA server is version [_1]',$version);
+ }
+ $output .= '