version 1.329.2.2, 2010/03/11 15:48:33
|
version 1.330, 2009/12/15 16:40:31
|
Line 935 sub print_user_modification_page {
|
Line 935 sub print_user_modification_page {
|
); |
); |
my $response; |
my $response; |
if ($env{'form.origform'} eq 'crtusername') { |
if ($env{'form.origform'} eq 'crtusername') { |
$response = '<span class="LC_warning">'.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain). |
$response = '<span class="LC_warning">'.&mt('No match found for the username [_1] in LON-CAPA domain: [_2]','<b>'.$ccuname.'</b>',$ccdomain). |
'</span><br />'; |
'</span><br />'; |
} |
} |
$response .= '<p class="LC_warning">' |
$response .= '<p class="LC_warning">' |
Line 4318 END
|
Line 4318 END
|
# Menu Phase One |
# Menu Phase One |
sub print_main_menu { |
sub print_main_menu { |
my ($permission,$context,$crstype) = @_; |
my ($permission,$context,$crstype) = @_; |
if (($context eq 'course') && (&Apache::loncommon::needs_gci_custom())) { |
|
return &print_gci_main_menu($permission,$context,$crstype) |
|
} |
|
my $linkcontext = $context; |
my $linkcontext = $context; |
my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype)); |
my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype)); |
if (($context eq 'course') && ($crstype eq 'Community')) { |
if (($context eq 'course') && ($crstype eq 'Community')) { |
Line 4542 return Apache::lonhtmlcommon::generate_m
|
Line 4539 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 => 'Manage Course Users', |
|
}, |
|
); |
|
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 { |
sub restore_prev_selections { |
my %saveable_parameters = ('srchby' => 'scalar', |
my %saveable_parameters = ('srchby' => 'scalar', |
'srchin' => 'scalar', |
'srchin' => 'scalar', |
Line 5582 sub role_display_filter {
|
Line 5503 sub role_display_filter {
|
# Update Display button |
# Update Display button |
$output .= '<p>' |
$output .= '<p>' |
.'<input type="submit" value="'.&mt('Update Display').'" />' |
.'<input type="submit" value="'.&mt('Update Display').'" />' |
.'</p><hr />'; |
.'</p>'; |
|
|
|
# Server version info |
|
$output .= '<p class="LC_info">' |
|
.&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 .= '</p><hr />'; |
return $output; |
return $output; |
} |
} |
|
|
Line 5931 sub build_search_response {
|
Line 5861 sub build_search_response {
|
my ($context,$srch,%srch_results) = @_; |
my ($context,$srch,%srch_results) = @_; |
my ($currstate,$response,$forcenewuser); |
my ($currstate,$response,$forcenewuser); |
my %names = ( |
my %names = ( |
'uname' => 'username', |
'uname' => 'username', |
'lastname' => 'last name', |
'lastname' => 'last name', |
'lastfirst' => 'last name, first name', |
'lastfirst' => 'last name, first name', |
'crs' => 'this course', |
'crs' => 'this course', |
'dom' => 'LON-CAPA domain: ', |
'dom' => 'LON-CAPA domain', |
'instd' => 'the institutional directory for domain: ', |
'instd' => 'the institutional directory for domain', |
); |
); |
|
|
my %single = ( |
my %single = ( |
Line 5956 sub build_search_response {
|
Line 5886 sub build_search_response {
|
$currstate = 'modify'; |
$currstate = 'modify'; |
$response = &mt("$single{$srch->{'srchtype'}} was found for the $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); |
$response = &mt("$single{$srch->{'srchtype'}} was found for the $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); |
if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') { |
if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') { |
$response .= &display_domain_info($srch->{'srchdomain'}); |
$response .= ': '.&display_domain_info($srch->{'srchdomain'}); |
} |
} |
} else { |
} else { # Search has nothing found. Prepare message to user. |
$response = '<span class="LC_warning">'.&mt("$nomatch{$srch->{'srchtype'}} found for the $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}",$srch->{'srchterm'}); |
$response = '<span class="LC_warning">'; |
if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') { |
if ($srch->{'srchin'} eq 'dom' || $srch->{'srchin'} eq 'instd') { |
$response .= &display_domain_info($srch->{'srchdomain'}); |
$response .= &mt("$nomatch{$srch->{'srchtype'}} found for the $names{$srch->{'srchby'}} [_1] in $names{$srch->{'srchin'}}: [_2]", |
|
'<b>'.$srch->{'srchterm'}.'</b>', |
|
&display_domain_info($srch->{'srchdomain'})); |
|
} else { |
|
$response .= &mt("$nomatch{$srch->{'srchtype'}} found for the $names{$srch->{'srchby'}} [_1] in $names{$srch->{'srchin'}}.", |
|
'<b>'.$srch->{'srchterm'}.'</b>'); |
} |
} |
$response .= '</span>'; |
$response .= '</span>'; |
|
|
if ($srch->{'srchin'} ne 'alc') { |
if ($srch->{'srchin'} ne 'alc') { |
$forcenewuser = 1; |
$forcenewuser = 1; |
my $cansrchinst = 0; |
my $cansrchinst = 0; |