\n".
'');
@@ -558,7 +580,7 @@ function verify(vf,sec_caller) {
if (tw==11) { foundrole=1; }
if (tw==12) { founddomain=1; }
}
- verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail,foundrole,founddom);
+ verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail,foundrole,founddomain);
}
//
@@ -721,7 +743,7 @@ sub print_upload_manager_footer {
$Str .= '
'.&mt('Change authentication for existing users in domain "[_1]" to these settings?',$defdom).'
';
} else {
$Str .= "
\n".
- &mt('Note: this will not take effect if the user already exists').
+ &mt('Note: This will not take effect if the user already exists.').
&Apache::loncommon::help_open_topic('Auth_Options').
"
';
+ $Str .= '';
$r->print($Str);
return;
}
@@ -790,15 +815,15 @@ sub print_upload_manager_footer {
sub forceid_change {
my ($context) = @_;
my $output =
- "
".&mt('ID/Student Number')."
\n".
+ "
".&mt('Student/Employee ID')."
\n".
"
\n".' '."\n".
+ &mt('Disable Student/Employee ID Safeguard and force change of conflicting IDs').
+ ' '."\n".
&mt('(only do if you know what you are doing.)')."\n";
if ($context eq 'domain') {
$output .= ' '."\n";
}
$output .= '
';
@@ -865,7 +890,7 @@ sub print_upload_manager_form {
['mname',&mt('Middle Names/Initials'),$env{'form.mname_choice'}],
['lname',&mt('Last Name'), $env{'form.lname_choice'}],
['gen', &mt('Generation'), $env{'form.gen_choice'}],
- ['id', &mt('ID/Student Number'),$env{'form.id_choice'}],
+ ['id', &mt('Student/Employee ID'),$env{'form.id_choice'}],
['sec', &mt('Section'), $env{'form.sec_choice'}],
['ipwd', &mt('Initial Password'),$env{'form.ipwd_choice'}],
['email',&mt('E-mail Address'), $env{'form.email_choice'}],
@@ -988,7 +1013,7 @@ sub date_setting_table {
}
my $perpetual = '';
if ($mode eq 'create_enrolldates') {
@@ -1274,9 +1299,13 @@ sub print_userlist {
$output_selector .= "\n".$option;
}
$output_selector .= '';
- $r->print(''.(' 'x3));
- }
- $r->print(''.(' 'x3)."\n");
+ $r->print(''.(' 'x3));
+ }
+ $r->print(''.(' 'x3)."\n");
my $roleselected = '';
if ($env{'form.showrole'} eq 'Any') {
$roleselected = ' selected="selected" ';
@@ -1316,7 +1345,9 @@ sub print_userlist {
if ($context eq 'course') {
if (($env{'form.showrole'} eq 'st') || ($env{'form.showrole'} eq 'Any')) {
my $classlist = &Apache::loncoursedata::get_classlist();
- %userlist = %{$classlist};
+ if (ref($classlist) eq 'HASH') {
+ %userlist = %{$classlist};
+ }
}
if ($env{'form.showrole'} ne 'st') {
my $showroles;
@@ -1450,7 +1481,10 @@ sub print_userlist {
$permission,$env{'form.Status'},\%userlist,$keylist);
}
if (!$usercount) {
- $r->print(' '.&mt('There are no users matching the search criteria.'));
+ $r->print(' '
+ .&mt('There are no users matching the search criteria.')
+ .''
+ );
}
}
$r->print(''
+ .&mt('Role Type: [_1]',$role_select)
+ .'';
} else {
$role_select = '';
- $output = '';
+ $output = '';
}
return $output;
}
@@ -1870,15 +1908,15 @@ sub aggregate_user_info {
sub process_date_info {
my ($userdata) = @_;
my $now = time;
- $userdata->{'status'} = 'Active';
+ $userdata->{'status'} = &mt('Active');
if ($userdata->{'start'} > 0) {
if ($now < $userdata->{'start'}) {
- $userdata->{'status'} = 'Future';
+ $userdata->{'status'} = &mt('Future');
}
}
if ($userdata->{'end'} > 0) {
if ($now > $userdata->{'end'}) {
- $userdata->{'status'} = 'Expired';
+ $userdata->{'status'} = &mt('Expired');
}
}
return;
@@ -2023,6 +2061,7 @@ END
'aboutme' => "Display a user's personal page",
'owin' => "Open in a new window",
'modify' => "Modify a user's information",
+ 'clicker' => "Clicker-ID",
);
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
$lt{'extent'} = &mt('Course(s): description, section(s), status');
@@ -2220,18 +2259,20 @@ END
time.'_'.rand(1000000000).'.csv';
unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) {
$r->log_error("Couldn't open $CSVfilename for output $!");
- $r->print("Problems occured in writing the csv file. ".
- "This error has been logged. ".
- "Please alert your LON-CAPA administrator.");
+ $r->print(&mt('Problems occurred in writing the CSV file. '
+ .'This error has been logged. '
+ .'Please alert your LON-CAPA administrator.'));
$CSVfile = undef;
}
#
+ push @cols,'clicker';
# Write headers and data to file
print $CSVfile '"'.$results_description.'"'."\n";
print $CSVfile '"'.join('","',map {
&Apache::loncommon::csv_translate($lt{$_})
- } (@cols)).'"'."\n";
+ } (@cols))."\"\n";
} elsif ($mode eq 'excel') {
+ push @cols,'clicker';
# Create the excel spreadsheet
($excel_workbook,$excel_filename,$format) =
&Apache::loncommon::create_workbook($r);
@@ -2240,6 +2281,7 @@ END
$excel_sheet->write($row++,0,$results_description,$format->{'h2'});
#
my @colnames = map {$lt{$_}} (@cols);
+
$excel_sheet->write($row++,0,\@colnames,$format->{'bold'});
}
@@ -2391,7 +2433,10 @@ END
foreach my $item (@{$keylist}) {
$in{$item} = $sdata->[$index{$item}];
}
- my $role = $in{'role'};
+ my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1];
+ if ($clickers!~/\w/) { $clickers='-'; }
+ $in{'clicker'} = $clickers;
+ my $role = $in{'role'};
$in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}]);
if (! defined($in{'start'}) || $in{'start'} == 0) {
$in{'start'} = &mt('none');
@@ -2511,7 +2556,7 @@ END
foreach my $item (@cols) {
push @line,&Apache::loncommon::csv_translate($in{$item});
}
- print $CSVfile '"'.join('","',@line).'"'."\n";
+ print $CSVfile '"'.join('","',@line)."\"\n";
} elsif ($mode eq 'excel') {
my $col = 0;
foreach my $item (@cols) {
@@ -2534,13 +2579,10 @@ END
$r->print(&Apache::loncommon::end_data_table().' ');
} elsif ($mode eq 'excel') {
$excel_workbook->close();
- $r->print('
';
$str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List",
&mt("How do I create a users list from a spreadsheet")).
" \n";
$str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
- &mt("How do I create a CSV file from a spreadsheet")).
- " \n";
+ &mt("How do I create a CSV file from a spreadsheet"));
+ $str .= "
\n";
+ $str .= "
\n";
+ $str .= '
\n";
+ $str .= ''." \n";
$str .= &Apache::loncommon::end_page();
$r->print($str);
return;
@@ -3487,7 +3533,9 @@ sub upfile_drop_add {
if ($context eq 'course') {
my ($cnum,$cdom) = &get_course_identity();
my $roster = &Apache::loncoursedata::get_classlist();
- %userlist = %{$roster};
+ if (ref($roster) eq 'HASH') {
+ %userlist = %{$roster};
+ }
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,
\@statuses,\@poss_roles);
&gather_userinfo($context,'view',\%userlist,$indexhash,\%info,
@@ -3589,22 +3637,13 @@ sub upfile_drop_add {
ne &LONCAPA::clean_username($entries{$fields{'username'}})) {
$r->print(' '.
&mt('[_1]: Unacceptable username for user [_2] [_3] [_4] [_5]',
- $entries{$fields{'username'}},$fname,$mname,$lname,$gen).
- '');
+ $entries{$fields{'username'}},$fname,$mname,$lname,$gen));
next;
} else {
- my $baddom = 0;
- if ($entries{$fields{'dom'}}
+ if ($entries{$fields{'domain'}}
ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) {
- $baddom = 1;
- } else {
- if (&Apache::lonnet::domain($entries{$fields{'domain'}}) eq '') {
- $baddom = 1;
- }
- }
- if ($baddom) {
$r->print(' '. ''.$entries{$fields{'domain'}}.
- ': '.&mt('Unacceptable domain for user [_2] [_3] [_4] [_5]',$fname,$mname,$lname,$gen).'');
+ ': '.&mt('Unacceptable domain for user [_2] [_3] [_4] [_5]',$fname,$mname,$lname,$gen));
next;
}
my $username = $entries{$fields{'username'}};
@@ -3886,7 +3925,7 @@ sub upfile_drop_add {
''.
&mt('There are no students with current/future access to the course.').
''."\n");
- } else {
+ } elsif (ref($classlist) eq 'HASH') {
# Remove the students we just added from the list of students.
foreach my $line (@userdata) {
my %entries=&Apache::loncommon::record_sep($line);
@@ -4265,11 +4304,9 @@ sub classlist_drop {
my ($scope,$uname,$udom,$now) = @_;
my ($cdom,$cnum) = ($scope=~m{^/($match_domain)/($match_courseid)});
if (&Apache::lonnet::is_course($cdom,$cnum)) {
- my $user = $uname.':'.$udom;
if (!&active_student_roles($cnum,$cdom,$uname,$udom)) {
- my $result =
- &Apache::lonnet::cput('classlist',
- { $user => $now },$cdom,$cnum);
+ my %user;
+ my $result = &update_classlist($cdom,$cnum,$udom,$uname,\%user,$now);
return &mt('Drop from classlist: [_1]',
''.$result.'').' ';
}
@@ -4573,10 +4610,14 @@ sub can_modify_userinfo {
if (ref($userroles) eq 'ARRAY') {
foreach my $role (@{$userroles}) {
my $testrole;
- if ($role =~ /^cr\//) {
- $testrole = 'cr';
- } else {
+ if ($context eq 'selfcreate') {
$testrole = $role;
+ } else {
+ if ($role =~ /^cr\//) {
+ $testrole = 'cr';
+ } else {
+ $testrole = $role;
+ }
}
if (ref($domconfig{'usermodification'}{$context}{$testrole}) eq 'HASH') {
if ($domconfig{'usermodification'}{$context}{$testrole}{$field}) {