version 1.109.2.2, 2010/01/05 22:08:48
|
version 1.113, 2010/01/19 18:02:20
|
Line 1185 sub default_role_selector {
|
Line 1185 sub default_role_selector {
|
'exs' => "Existing sections", |
'exs' => "Existing sections", |
'new' => "New section", |
'new' => "New section", |
); |
); |
$options = '<select name="defaultrole">'."\n"; |
$options = '<select name="defaultrole">'."\n". |
unless (($context eq 'course') && (&Apache::loncommon::needs_gci_custom())) { |
' <option value="">'.&mt('Please select').'</option>'."\n"; |
$options .= ' <option value="">'.&mt('Please select').'</option>'."\n"; |
|
} |
|
if ($context eq 'course') { |
if ($context eq 'course') { |
$options .= &default_course_roles($context,$checkpriv,$crstype,%customroles); |
$options .= &default_course_roles($context,$checkpriv,$crstype,%customroles); |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
Line 1450 sub print_userlist {
|
Line 1448 sub print_userlist {
|
} |
} |
if (!(($context eq 'domain') && |
if (!(($context eq 'domain') && |
(($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')))) { |
(($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')))) { |
$r->print(' '.&list_submit_button(&mt('Update Display')). |
$r->print( |
"\n</p>\n"); |
"\n</p>\n" |
|
.'<p>' |
|
.&list_submit_button(&mt('Update Display')) |
|
."</p>\n" |
|
); |
} |
} |
my ($indexhash,$keylist) = &make_keylist_array(); |
my ($indexhash,$keylist) = &make_keylist_array(); |
my (%userlist,%userinfo,$clearcoursepick); |
my (%userlist,%userinfo,$clearcoursepick); |
Line 1690 sub role_filter {
|
Line 1692 sub role_filter {
|
$role_select .= '</select>'; |
$role_select .= '</select>'; |
$output = '<label><span class="LC_nobreak">' |
$output = '<label><span class="LC_nobreak">' |
.&mt('Role: [_1]',$role_select) |
.&mt('Role: [_1]',$role_select) |
.'</span></label>'; |
.'</span></label> '; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 1730 sub section_group_filter {
|
Line 1732 sub section_group_filter {
|
} |
} |
if (@options > 0) { |
if (@options > 0) { |
my $currsel; |
my $currsel; |
$markup = '<select name="'.$name{$item}.'" />'."\n"; |
$markup = '<select name="'.$name{$item}.'">'."\n"; |
foreach my $option ('all','none',@options) { |
foreach my $option ('all','none',@options) { |
$currsel = ''; |
$currsel = ''; |
if ($env{'form.'.$name{$item}} eq $option) { |
if ($env{'form.'.$name{$item}} eq $option) { |
Line 1745 sub section_group_filter {
|
Line 1747 sub section_group_filter {
|
$markup .= '</option>'."\n"; |
$markup .= '</option>'."\n"; |
} |
} |
$markup .= '</select>'."\n"; |
$markup .= '</select>'."\n"; |
$output .= (' 'x3).'<label>'.$title{$item}.': '.$markup.'</label>'; |
$output .= (' 'x3).'<span class="LC_nobreak">' |
|
.'<label>'.$title{$item}.': '.$markup.'</label>' |
|
.'</span> '; |
} |
} |
} |
} |
return $output; |
return $output; |
Line 2399 END
|
Line 2403 END
|
if ($env{'form.userwin'}) { |
if ($env{'form.userwin'}) { |
$checkwin = ' checked="checked"'; |
$checkwin = ' checked="checked"'; |
} |
} |
$output .= '</td><td valign="top"><span class="LC_nobreak"><input type="checkbox" name="userwin" value="1"'.$checkwin.' />'.$lt{'owin'}.'</span></td></tr></table></fieldset></div>'; |
$output .= '</td><td valign="top" style="border-left: 1px solid;"><span class="LC_nobreak"><input type="checkbox" name="userwin" value="1"'.$checkwin.' />'.$lt{'owin'}.'</span></td></tr></table></fieldset></div>'; |
} |
} |
$output .= "\n".'<div class="LC_clear_float_footer"> </div>'."\n". |
$output .= "\n".'<div class="LC_clear_float_footer"> </div>'."\n". |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 2939 sub print_username_link {
|
Line 2943 sub print_username_link {
|
$output = $in->{'username'}; |
$output = $in->{'username'}; |
} else { |
} else { |
$output = '<a href="javascript:username_display_launch('. |
$output = '<a href="javascript:username_display_launch('. |
"'$in->{'username'}','$in->{'domain'}'".')" />'. |
"'$in->{'username'}','$in->{'domain'}'".')">'. |
$in->{'username'}.'</a>'; |
$in->{'username'}.'</a>'; |
} |
} |
return $output; |
return $output; |
Line 3657 sub print_first_users_upload_form {
|
Line 3661 sub print_first_users_upload_form {
|
$str .= '<input type="hidden" name="action" value="upload" />'; |
$str .= '<input type="hidden" name="action" value="upload" />'; |
$str .= '<input type="hidden" name="state" value="got_file" />'; |
$str .= '<input type="hidden" name="state" value="got_file" />'; |
|
|
$str .= '<h3>'.&mt('Upload a file containing information about users').'</h3>'."\n"; |
$str .= '<h2>'.&mt('Upload a file containing information about users').'</h2>'."\n"; |
|
|
# Excel and CSV Help |
# Excel and CSV Help |
$str .= '<div class="LC_left_float">' |
$str .= '<div class="LC_left_float">' |
Line 3668 sub print_first_users_upload_form {
|
Line 3672 sub print_first_users_upload_form {
|
&mt("How do I create a CSV file from a spreadsheet")) |
&mt("How do I create a CSV file from a spreadsheet")) |
.'</div><br clear="all" />'."\n"; |
.'</div><br clear="all" />'."\n"; |
$str .= &Apache::lonhtmlcommon::start_pick_box() |
$str .= &Apache::lonhtmlcommon::start_pick_box() |
.&Apache::lonhtmlcommon::row_title(&mt('File')) |
.&Apache::lonhtmlcommon::row_title(&mt('File')); |
.&Apache::loncommon::upfile_select_html() |
if (&Apache::lonlocal::current_language() ne 'en') { |
|
if ($context eq 'course') { |
|
$str .= '<p class="LC_info">'."\n" |
|
.&mt('Please upload an UTF8 encoded file to ensure a correct character encoding in your classlist.')."\n" |
|
.'</p>'."\n"; |
|
} |
|
} |
|
$str .= &Apache::loncommon::upfile_select_html() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_closure() |
.&Apache::lonhtmlcommon::row_title( |
.&Apache::lonhtmlcommon::row_title( |
'<label for="noFirstLine">' |
'<label for="noFirstLine">' |
Line 4822 sub setsections_javascript {
|
Line 4833 sub setsections_javascript {
|
plch => 'Please choose a different section name.', |
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.', |
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.', |
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"; |
$setsection_js .= <<"ENDSECCODE"; |
|
|
function setSections(formname,crstype) { |
function setSections(formname,crstype) { |
var re1 = /^currsec_/; |
var re1 = /^currsec_/; |
|
var re2 =/\\W/; |
var groups = new Array($groupslist); |
var groups = new Array($groupslist); |
for (var i=0;i<formname.elements.length;i++) { |
for (var i=0;i<formname.elements.length;i++) { |
var str = formname.elements[i].name; |
var str = formname.elements[i].name; |
Line 4870 function setSections(formname,crstype) {
|
Line 4883 function setSections(formname,crstype) {
|
} |
} |
var newsecs = formname.elements[i+1].value; |
var newsecs = formname.elements[i+1].value; |
var numsplit; |
var numsplit; |
|
var validsecs = new Array(); |
|
var badsecs = new Array(); |
if (newsecs != null && newsecs != "") { |
if (newsecs != null && newsecs != "") { |
numsplit = newsecs.split(/,/g); |
numsplit = newsecs.split(/,/g); |
numsec = numsec + numsplit.length; |
for (var i=0; i<numsplit.length; i++) { |
|
if (re2.test(numsplit[i]) == true) { |
|
badsecs.push(numsplit[i]); |
|
} else { |
|
validsecs.push(numsplit[i]); |
|
} |
|
} |
|
if (badsecs.length > 0) { |
|
alert("$alerts{'nonw'}\\n$alerts{'plch'}"); |
|
return; |
|
} |
|
numsec = numsec + validsecs.length; |
} |
} |
|
|
if ((role == 'st') && (numsec > 1)) { |
if ((role == 'st') && (numsec > 1)) { |
Line 5025 sub roles_by_context {
|
Line 5051 sub roles_by_context {
|
if ($env{'request.role'} =~ m{^dc\./}) { |
if ($env{'request.role'} =~ m{^dc\./}) { |
push(@allroles,'ad'); |
push(@allroles,'ad'); |
} |
} |
if (&Apache::loncommon::needs_gci_custom()) { |
push(@allroles,('ta','ep','in')); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
push(@allroles,'co'); |
push(@allroles,'co'); |
} else { |
|
push(@allroles,'cc'); |
|
} |
|
} else { |
} else { |
push(@allroles,('ta','ep','in')); |
push(@allroles,'cc'); |
if ($crstype eq 'Community') { |
} |
push(@allroles,'co'); |
if ($custom) { |
} else { |
push(@allroles,'cr'); |
push(@allroles,'cc'); |
|
} |
|
if ($custom) { |
|
push(@allroles,'cr'); |
|
} |
|
} |
} |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
@allroles = ('ca','aa'); |
@allroles = ('ca','aa'); |