version 1.67, 2014/02/27 11:44:40
|
version 1.69, 2014/03/13 14:46:46
|
Line 153 sub print_course_search_page {
|
Line 153 sub print_course_search_page {
|
$type = 'Course'; |
$type = 'Course'; |
} |
} |
&print_header($r,$type); |
&print_header($r,$type); |
my $filterlist = ['descriptfilter', |
my ($filterlist,$filter) = &get_filters(); |
'instcodefilter','ownerfilter', |
|
'coursefilter']; |
|
my $filter = {}; |
|
my ($numtitles,$cctitle,$dctitle,@codetitles); |
my ($numtitles,$cctitle,$dctitle,@codetitles); |
my $ccrole = 'cc'; |
my $ccrole = 'cc'; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
Line 169 sub print_course_search_page {
|
Line 166 sub print_course_search_page {
|
$r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>'); |
$r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>'); |
} else { |
} else { |
$r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'); |
$r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'); |
} |
} |
$r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, |
$r->print(&Apache::loncommon::build_filters($filterlist,$type,undef,undef,$filter,$action, |
undef,undef,$filter,$action,\$numtitles,'modifycourse', |
\$numtitles,'modifycourse',undef,undef,undef, |
undef,undef,undef,\@codetitles)); |
\@codetitles,$filter->{'domainfilter'})); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt('Actions available after searching for a community:').'<ul>'. |
$r->print(&mt('Actions available after searching for a community:').'<ul>'. |
'<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n". |
'<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n". |
Line 184 sub print_course_search_page {
|
Line 181 sub print_course_search_page {
|
'<li>'.&mt('View or modify course settings which only a [_1] may modify.',$dctitle). |
'<li>'.&mt('View or modify course settings which only a [_1] may modify.',$dctitle). |
'</li>'."\n".'</ul>'); |
'</li>'."\n".'</ul>'); |
} |
} |
|
return; |
} |
} |
|
|
sub print_course_selection_page { |
sub print_course_selection_page { |
Line 195 sub print_course_selection_page {
|
Line 193 sub print_course_selection_page {
|
&print_header($r,$type); |
&print_header($r,$type); |
|
|
# Criteria for course search |
# Criteria for course search |
my $filterlist = ['descriptfilter', |
my ($filterlist,$filter) = &get_filters(); |
'instcodefilter','ownerfilter', |
|
'ownerdomfilter','coursefilter']; |
|
my %filter; |
|
my $action = '/adm/modifycourse'; |
my $action = '/adm/modifycourse'; |
my $dctitle = &Apache::lonnet::plaintext('dc'); |
my $dctitle = &Apache::lonnet::plaintext('dc'); |
my ($numtitles,@codetitles); |
my ($numtitles,@codetitles); |
$r->print(&Apache::lonpickcourse::js_changer()); |
$r->print(&Apache::lonpickcourse::js_changer()); |
$r->print(&mt('Revise your search criteria for this domain').' ('.$domdesc.').<br />'); |
$r->print(&mt('Revise your search criteria for this domain').' ('.$domdesc.').<br />'); |
$r->print(&Apache::lonpickcourse::build_filters($filterlist,$type, |
$r->print(&Apache::loncommon::build_filters($filterlist,$type,undef,undef,$filter,$action, |
undef,undef,\%filter,$action,\$numtitles, |
\$numtitles,'modifycourse',undef,undef,undef, |
undef,undef,undef,undef,\@codetitles)); |
\@codetitles,$filter->{'domainfilter'}, |
$filter{'domainfilter'} = $dom; |
$env{'form.form'})); |
my %courses = &Apache::lonpickcourse::search_courses($r,$type,0, |
if (ref($filter) eq 'HASH') { |
\%filter,$numtitles,undef, |
$filter->{'domainfilter'} = $dom; |
undef,undef,\@codetitles); |
} |
|
my %courses = &Apache::lonpickcourse::search_courses($r,$type,0,$filter,$numtitles, |
|
undef,undef,undef,\@codetitles); |
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef, |
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef, |
%courses); |
%courses); |
return; |
return; |
} |
} |
|
|
|
sub get_filters { |
|
my @filterlist = ('descriptfilter','instcodefilter','ownerfilter', |
|
'ownerdomfilter','coursefilter','sincefilter'); |
|
# created filter |
|
my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'form.domainfilter'}); |
|
if ($loncaparev ne 'unknown_cmd') { |
|
push(@filterlist,'createdfilter'); |
|
} |
|
my %filter; |
|
foreach my $item (@filterlist) { |
|
$filter{$item} = $env{'form.'.$item}; |
|
} |
|
return (\@filterlist,\%filter); |
|
} |
|
|
sub print_modification_menu { |
sub print_modification_menu { |
my ($r,$cdesc,$domdesc,$dom,$type) = @_; |
my ($r,$cdesc,$domdesc,$dom,$type) = @_; |
&print_header($r,$type); |
&print_header($r,$type); |
Line 436 sub print_setquota {
|
Line 448 sub print_setquota {
|
coursequota => 20, |
coursequota => 20, |
uploadquota => 500, |
uploadquota => 500, |
); |
); |
my %settings = &Apache::lonnet::get('environment',['internal.coursequota','internal.uploadquota','internal.instcode'], |
my %settings = &Apache::lonnet::get('environment',['internal.coursequota','internal.uploadquota','internal.coursecode'], |
$cdom,$cnum); |
$cdom,$cnum); |
my $coursequota = $settings{'internal.coursequota'}; |
my $coursequota = $settings{'internal.coursequota'}; |
my $uploadquota = $settings{'internal.uploadquota'}; |
my $uploadquota = $settings{'internal.uploadquota'}; |
Line 447 sub print_setquota {
|
Line 459 sub print_setquota {
|
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$uploadquota = $domdefs{$lctype.'quota'}; |
$uploadquota = $domdefs{$lctype.'quota'}; |
} elsif ($settings{'internal.instcode'}) { |
} elsif ($settings{'internal.coursecode'}) { |
$uploadquota = $domdefs{'officialquota'}; |
$uploadquota = $domdefs{'officialquota'}; |
} elsif ($settings{'internal.textbook'}) { |
} elsif ($settings{'internal.textbook'}) { |
$uploadquota = $domdefs{'textbookquota'}; |
$uploadquota = $domdefs{'textbookquota'}; |