version 1.69, 2014/03/13 14:46:46
|
version 1.71, 2014/03/31 01:37:28
|
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,$filter) = &get_filters(); |
my ($filterlist,$filter) = &get_filters($dom); |
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 161 sub print_course_search_page {
|
Line 161 sub print_course_search_page {
|
} |
} |
$cctitle = &Apache::lonnet::plaintext($ccrole,$type); |
$cctitle = &Apache::lonnet::plaintext($ccrole,$type); |
$dctitle = &Apache::lonnet::plaintext('dc'); |
$dctitle = &Apache::lonnet::plaintext('dc'); |
$r->print(&Apache::lonpickcourse::js_changer()); |
$r->print(&Apache::loncommon::js_changer()); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$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 { |
Line 169 sub print_course_search_page {
|
Line 169 sub print_course_search_page {
|
} |
} |
$r->print(&Apache::loncommon::build_filters($filterlist,$type,undef,undef,$filter,$action, |
$r->print(&Apache::loncommon::build_filters($filterlist,$type,undef,undef,$filter,$action, |
\$numtitles,'modifycourse',undef,undef,undef, |
\$numtitles,'modifycourse',undef,undef,undef, |
\@codetitles,$filter->{'domainfilter'})); |
\@codetitles,$dom)); |
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 197 sub print_course_selection_page {
|
Line 197 sub print_course_selection_page {
|
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::loncommon::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::loncommon::build_filters($filterlist,$type,undef,undef,$filter,$action, |
$r->print(&Apache::loncommon::build_filters($filterlist,$type,undef,undef,$filter,$action, |
\$numtitles,'modifycourse',undef,undef,undef, |
\$numtitles,'modifycourse',undef,undef,undef, |
\@codetitles,$filter->{'domainfilter'}, |
\@codetitles,$dom,$env{'form.form'})); |
$env{'form.form'})); |
my %courses = &Apache::loncommon::search_courses($dom,$type,$filter,$numtitles, |
if (ref($filter) eq 'HASH') { |
undef,undef,undef,\@codetitles); |
$filter->{'domainfilter'} = $dom; |
|
} |
|
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 { |
sub get_filters { |
|
my ($dom) = @_; |
my @filterlist = ('descriptfilter','instcodefilter','ownerfilter', |
my @filterlist = ('descriptfilter','instcodefilter','ownerfilter', |
'ownerdomfilter','coursefilter','sincefilter'); |
'ownerdomfilter','coursefilter','sincefilter'); |
# created filter |
# created filter |
my $loncaparev = &Apache::lonnet::get_server_loncaparev($env{'form.domainfilter'}); |
my $loncaparev = &Apache::lonnet::get_server_loncaparev($dom); |
if ($loncaparev ne 'unknown_cmd') { |
if ($loncaparev ne 'unknown_cmd') { |
push(@filterlist,'createdfilter'); |
push(@filterlist,'createdfilter'); |
} |
} |
Line 229 sub get_filters {
|
Line 226 sub get_filters {
|
} |
} |
|
|
sub print_modification_menu { |
sub print_modification_menu { |
my ($r,$cdesc,$domdesc,$dom,$type) = @_; |
my ($r,$cdesc,$domdesc,$dom,$type,$cid,$coursehash) = @_; |
&print_header($r,$type); |
&print_header($r,$type); |
my ($ccrole,$categorytitle,$setquota_text,$setuploadquota_text,$setparams_text,$cat_text); |
my ($ccrole,$categorytitle,$setquota_text,$setuploadquota_text,$setparams_text,$cat_text, |
|
$cdom,$cnum); |
|
if (ref($coursehash) eq 'HASH') { |
|
$cdom = $coursehash->{'domain'}; |
|
$cnum = $coursehash->{'num'}; |
|
} else { |
|
($cdom,$cnum) = split(/_/,$cid); |
|
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$ccrole = 'co'; |
$ccrole = 'co'; |
} else { |
} else { |
Line 1574 sub print_footer {
|
Line 1578 sub print_footer {
|
} |
} |
|
|
sub check_course { |
sub check_course { |
my ($r,$dom,$domdesc) = @_; |
my ($dom,$domdesc) = @_; |
my ($ok_course,$description,$instcode,$owner); |
my ($ok_course,$description,$instcode); |
my %args = ( |
my %coursehash; |
one_time => 1, |
if ($env{'form.pickedcourse'} =~ /^$match_domain\_$match_courseid$/) { |
); |
my %args; |
my %coursehash = |
unless ($env{'course.'.$env{'form.pickedcourse'}.'.description'}) { |
&Apache::lonnet::coursedescription($env{'form.pickedcourse'},\%args); |
%args = ( |
my $cnum = $coursehash{'num'}; |
'one_time' => 1, |
my $cdom = $coursehash{'domain'}; |
'freshen_cache' => 1, |
if ($cdom eq $dom) { |
); |
my $description; |
} |
my %courseIDs = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.', |
%coursehash = |
$cnum,undef,undef,'.'); |
&Apache::lonnet::coursedescription($env{'form.pickedcourse'},\%args); |
if (keys(%courseIDs) > 0) { |
my $cnum = $coursehash{'num'}; |
$ok_course = 'ok'; |
my $cdom = $coursehash{'domain'}; |
my ($instcode,$owner); |
$description = $coursehash{'description'}; |
if (ref($courseIDs{$cdom.'_'.$cnum}) eq 'HASH') { |
$instcode = $coursehash{'internal.coursecode'}; |
$description = $courseIDs{$cdom.'_'.$cnum}{'description'}; |
if ($instcode) { |
$instcode = $courseIDs{$cdom.'_'.$cnum}{'inst_code'}; |
$description .= " ($instcode)"; |
$owner = $courseIDs{$cdom.'_'.$cnum}{'owner'}; |
} |
} else { |
if (($cdom eq $dom) && ($cnum =~ /^$match_courseid$/)) { |
($description,$instcode,$owner) = |
my %courseIDs = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.', |
split(/:/,$courseIDs{$cdom.'_'.$cnum}); |
$cnum,undef,undef,'.'); |
} |
if ($courseIDs{$cdom.'_'.$cnum}) { |
$description = &unescape($description); |
$ok_course = 'ok'; |
$instcode = &unescape($instcode); |
|
if ($instcode) { |
|
$description .= " ($instcode)"; |
|
} |
} |
return ($ok_course,$description); |
|
} |
} |
} |
} |
|
return ($ok_course,$description,\%coursehash); |
} |
} |
|
|
sub course_settings_descrip { |
sub course_settings_descrip { |
Line 1703 sub handler {
|
Line 1704 sub handler {
|
if ($phase eq 'courselist') { |
if ($phase eq 'courselist') { |
&print_course_selection_page($r,$dom,$domdesc); |
&print_course_selection_page($r,$dom,$domdesc); |
} else { |
} else { |
my ($checked,$cdesc) = &check_course($r,$dom,$domdesc); |
my ($checked,$cdesc,$coursehash) = &check_course($dom,$domdesc); |
if ($checked eq 'ok') { |
if ($checked eq 'ok') { |
my $enter_text; |
my $enter_text; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
Line 1715 sub handler {
|
Line 1716 sub handler {
|
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'menu')", |
({href=>"javascript:changePage(document.$phase,'menu')", |
text=>"Pick action"}); |
text=>"Pick action"}); |
&print_modification_menu($r,$cdesc,$domdesc,$dom,$type); |
&print_modification_menu($r,$cdesc,$domdesc,$dom,$type, |
|
$env{'form.pickedcourse'},$coursehash); |
} elsif ($phase eq 'ccrole') { |
} elsif ($phase eq 'ccrole') { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'ccrole')", |
({href=>"javascript:changePage(document.$phase,'ccrole')", |