version 1.104, 2009/11/12 15:58:22
|
version 1.110, 2010/01/14 17:02:49
|
Line 386 sub javascript_validations {
|
Line 386 sub javascript_validations {
|
if (($context eq 'course') || ($context eq 'domain')) { |
if (($context eq 'course') || ($context eq 'domain')) { |
if ($context eq 'course') { |
if ($context eq 'course') { |
if ($env{'request.course.sec'} eq '') { |
if ($env{'request.course.sec'} eq '') { |
$setsection_call = 'setSections(document.'.$param{'formname'}."'$crstype'".');'; |
$setsection_call = 'setSections(document.'.$param{'formname'}.",'$crstype'".');'; |
$setsections_js = |
$setsections_js = |
&setsections_javascript($param{'formname'},$groupslist, |
&setsections_javascript($param{'formname'},$groupslist, |
$mode,'',$crstype); |
$mode,'',$crstype); |
Line 1446 sub print_userlist {
|
Line 1446 sub print_userlist {
|
'<input type="hidden" name="phase" value="" /></form>'); |
'<input type="hidden" name="phase" value="" /></form>'); |
return; |
return; |
} |
} |
if (!(($context eq 'domain') && ($env{'form.roletype'} eq 'course'))) { |
if (!(($context eq 'domain') && |
|
(($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')))) { |
$r->print(' '.&list_submit_button(&mt('Update Display')). |
$r->print(' '.&list_submit_button(&mt('Update Display')). |
"\n</p>\n"); |
"\n</p>\n"); |
} |
} |
my ($indexhash,$keylist) = &make_keylist_array(); |
my ($indexhash,$keylist) = &make_keylist_array(); |
my (%userlist,%userinfo); |
my (%userlist,%userinfo,$clearcoursepick); |
if (($context eq 'domain') && |
if (($context eq 'domain') && |
($env{'form.roletype'} eq 'course') || |
($env{'form.roletype'} eq 'course') || |
($env{'form.roletype'} eq 'community')) { |
($env{'form.roletype'} eq 'community')) { |
Line 1476 sub print_userlist {
|
Line 1477 sub print_userlist {
|
$courseform."\n". |
$courseform."\n". |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::end_pick_box().'</p>'. |
&Apache::lonhtmlcommon::end_pick_box().'</p>'. |
'<p>'.&list_submit_button(&mt('Update Display')). |
'<p><input type="hidden" name="origroletype" value="'.$env{'form.roletype'}.'" />'. |
|
&list_submit_button(&mt('Update Display')). |
"\n".'</p><span class="LC_warning">'.$warning.'</span>'."\n"); |
"\n".'</p><span class="LC_warning">'.$warning.'</span>'."\n"); |
if ($env{'form.coursepick'}) { |
$clearcoursepick = 0; |
|
if (($env{'form.origroletype'} ne '') && |
|
($env{'form.origroletype'} ne $env{'form.roletype'})) { |
|
$clearcoursepick = 1; |
|
} |
|
if (($env{'form.coursepick'}) && (!$clearcoursepick)) { |
$r->print('<hr />'.&mt('Searching').' ...<br /> <br />'); |
$r->print('<hr />'.&mt('Searching').' ...<br /> <br />'); |
} |
} |
} else { |
} else { |
Line 1553 sub print_userlist {
|
Line 1560 sub print_userlist {
|
} |
} |
} elsif (($env{'form.roletype'} eq 'course') || |
} elsif (($env{'form.roletype'} eq 'course') || |
($env{'form.roletype'} eq 'community')) { |
($env{'form.roletype'} eq 'community')) { |
if ($env{'form.coursepick'}) { |
if (($env{'form.coursepick'}) && (!$clearcoursepick)) { |
my %courses = &process_coursepick(); |
my %courses = &process_coursepick(); |
my %allusers; |
my %allusers; |
my $hidepriv = 1; |
my $hidepriv = 1; |
Line 1956 sub process_coursepick {
|
Line 1963 sub process_coursepick {
|
my $coursefilter = $env{'form.coursepick'}; |
my $coursefilter = $env{'form.coursepick'}; |
my $cdom = $env{'request.role.domain'}; |
my $cdom = $env{'request.role.domain'}; |
my %courses; |
my %courses; |
|
my $crssrch = 'Course'; |
|
if ($env{'form.roletype'} eq 'community') { |
|
$crssrch = 'Community'; |
|
} |
if ($coursefilter eq 'all') { |
if ($coursefilter eq 'all') { |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.', |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.', |
undef,undef,'Course'); |
undef,undef,$crssrch); |
} elsif ($coursefilter eq 'category') { |
} elsif ($coursefilter eq 'category') { |
my $instcode = &instcode_from_coursefilter(); |
my $instcode = &instcode_from_coursefilter(); |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.', |
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.', |
undef,undef,'Course'); |
undef,undef,$crssrch); |
} elsif ($coursefilter eq 'specific') { |
} elsif ($coursefilter eq 'specific') { |
if ($env{'form.coursetotal'} > 1) { |
if ($env{'form.coursetotal'} > 1) { |
my @course_ids = split(/&&/,$env{'form.courselist'}); |
my @course_ids = split(/&&/,$env{'form.courselist'}); |
Line 2147 END
|
Line 2158 END
|
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
if ($setting eq 'community') { |
if ($setting eq 'community') { |
$crstype = 'Community'; |
$crstype = 'Community'; |
} elsif ($crstype eq 'course') { |
} elsif ($setting eq 'course') { |
$crstype = 'Course'; |
$crstype = 'Course'; |
} |
} |
} |
} |
Line 2298 END
|
Line 2309 END
|
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll' || $mode eq 'pickauthor') { |
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll' || $mode eq 'pickauthor') { |
if ($mode ne 'autoenroll' && $mode ne 'pickauthor') { |
if ($mode ne 'autoenroll' && $mode ne 'pickauthor') { |
if ($permission->{'cusr'}) { |
if ($permission->{'cusr'}) { |
$actionselect = &select_actions($context,$setting,$statusmode,$formname); |
unless (($context eq 'domain') && |
|
(($setting eq 'course') || ($setting eq 'community'))) { |
|
$actionselect = |
|
&select_actions($context,$setting,$statusmode,$formname); |
|
} |
} |
} |
$r->print(<<END); |
$r->print(<<END); |
<input type="hidden" name="srchby" value="uname" /> |
<input type="hidden" name="srchby" value="uname" /> |
Line 2382 END
|
Line 2397 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 2392 END
|
Line 2407 END
|
<th><a href=\"javascript:document.$formname.sortby.value='type';document.$formname.submit();\">$lt{'type'}</a></th> |
<th><a href=\"javascript:document.$formname.sortby.value='type';document.$formname.submit();\">$lt{'type'}</a></th> |
"; |
"; |
} else { |
} else { |
if ($mode eq 'pickauthor') { |
$output .= "\n".'<th> </th>'."\n"; |
$output .= "\n".'<th> </th>'."\n"; |
|
} else { |
|
$output .= "\n".'<th>'.&mt('Count').'</th>'."\n"; |
|
} |
|
if ($actionselect) { |
if ($actionselect) { |
$output .= '<th>'.&mt('Select').'</th>'."\n"; |
$output .= '<th>'.&mt('Select').'</th>'."\n"; |
} |
} |
Line 2451 END
|
Line 2462 END
|
time.'_'.rand(1000000000).'.csv'; |
time.'_'.rand(1000000000).'.csv'; |
unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) { |
unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) { |
$r->log_error("Couldn't open $CSVfilename for output $!"); |
$r->log_error("Couldn't open $CSVfilename for output $!"); |
$r->print(&mt('Problems occurred in writing the CSV file. ' |
$r->print( |
.'This error has been logged. ' |
'<p class="LC_error">' |
.'Please alert your LON-CAPA administrator.')); |
.&mt('Problems occurred in writing the CSV file.') |
|
.' '.&mt('This error has been logged.') |
|
.' '.&mt('Please alert your LON-CAPA administrator.') |
|
.'</p>' |
|
); |
$CSVfile = undef; |
$CSVfile = undef; |
} |
} |
# |
# |
Line 3643 sub print_first_users_upload_form {
|
Line 3658 sub print_first_users_upload_form {
|
$str .= '<h2>'.&mt('Upload a file containing information about users').'</h2>'."\n"; |
$str .= '<h2>'.&mt('Upload a file containing information about users').'</h2>'."\n"; |
|
|
# Excel and CSV Help |
# Excel and CSV Help |
$str .= '<p>' |
$str .= '<div class="LC_left_float">' |
.&Apache::loncommon::help_open_topic("Course_Create_Class_List", |
.&Apache::loncommon::help_open_topic("Course_Create_Class_List", |
&mt("How do I create a users list from a spreadsheet")) |
&mt("How do I create a users list from a spreadsheet")) |
."<br />\n" |
.'</div><div class="LC_left_float">'."\n" |
.&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
.&Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
&mt("How do I create a CSV file from a spreadsheet")) |
&mt("How do I create a CSV file from a spreadsheet")) |
."</p>\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')); |
if (&Apache::lonlocal::current_language() ne 'en') { |
if (&Apache::lonlocal::current_language() ne 'en') { |
Line 3674 sub print_first_users_upload_form {
|
Line 3688 sub print_first_users_upload_form {
|
.'<input type="submit" name="fileupload" value="'.&mt('Next').'" />' |
.'<input type="submit" name="fileupload" value="'.&mt('Next').'" />' |
.'</p>'; |
.'</p>'; |
|
|
$str .= &Apache::loncommon::end_page(); |
|
|
|
$r->print($str); |
$r->print($str); |
return; |
return; |
} |
} |