'."\n";
}
@@ -2447,9 +2468,13 @@ END
time.'_'.rand(1000000000).'.csv';
unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) {
$r->log_error("Couldn't open $CSVfilename for output $!");
- $r->print(&mt('Problems occurred 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.')
+ .' '.&mt('This error has been logged.')
+ .' '.&mt('Please alert your LON-CAPA administrator.')
+ .'
'
+ );
$CSVfile = undef;
}
#
@@ -2918,7 +2943,7 @@ sub print_username_link {
$output = $in->{'username'};
} else {
$output = '{'username'}','$in->{'domain'}'".')" />'.
+ "'$in->{'username'}','$in->{'domain'}'".')">'.
$in->{'username'}.'';
}
return $output;
@@ -3172,7 +3197,6 @@ ENDJS
$date_items;
if ($context eq 'course' && $env{'form.bulkaction'} eq 'chgsec') {
my ($cnum,$cdom) = &get_course_identity();
- my $crstype = &Apache::loncommon::course_type();
if ($crstype eq 'Community') {
$lt{'fors'} = &mt('For member roles changing the section, will result in a section switch as members may only be in one section of a community at a time.');
$lt{'forn'} = &mt('For a role in a community that is not a member role, a user may have roles in more than one section of a community at a time.');
@@ -3639,14 +3663,13 @@ sub print_first_users_upload_form {
$str .= '
'.&mt('Upload a file containing information about users').'
'."\n";
# Excel and CSV Help
- $str .= '
'
+ $str .= '
'
.&Apache::loncommon::help_open_topic("Course_Create_Class_List",
&mt("How do I create a users list from a spreadsheet"))
- ." \n"
+ .'
'."\n"
.&Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
&mt("How do I create a CSV file from a spreadsheet"))
- ."\n";
-
+ .'
'."\n";
$str .= &Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_title(&mt('File'));
if (&Apache::lonlocal::current_language() ne 'en') {
@@ -3670,8 +3693,6 @@ sub print_first_users_upload_form {
.''
.'';
- $str .= &Apache::loncommon::end_page();
-
$r->print($str);
return;
}
@@ -3900,7 +3921,7 @@ sub upfile_drop_add {
}
}
my (%curr_rules,%got_rules,%alerts);
- my %customroles = &my_custom_roles();
+ my %customroles = &my_custom_roles($crstype);
my @permitted_roles =
&roles_on_upload($context,$setting,$crstype,%customroles);
# Get new users list
@@ -4811,11 +4832,13 @@ sub setsections_javascript {
plch => 'Please choose a different section name.',
mnot => 'may not be used as a section name, as it is the name of a course group.',
secn => 'Section names and group names must be distinct. Please choose a different section name.',
+ nonw => 'Section names may only contain letters or numbers.',
);
$setsection_js .= <<"ENDSECCODE";
function setSections(formname,crstype) {
var re1 = /^currsec_/;
+ var re2 =/\\W/;
var groups = new Array($groupslist);
for (var i=0;i 0) {
+ alert("$alerts{'nonw'}\\n$alerts{'plch'}");
+ return;
+ }
+ numsec = numsec + validsecs.length;
}
if ((role == 'st') && (numsec > 1)) {