version 1.81, 2009/05/08 17:22:17
|
version 1.85, 2009/07/31 03:01:31
|
Line 36 use Apache::lonnet;
|
Line 36 use Apache::lonnet;
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::longroup; |
use Apache::longroup; |
use Apache::courseclassifier; |
use Apache::courseclassifier; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
Line 50 sub handler {
|
Line 50 sub handler {
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['domainfilter','form','cnumelement', |
($ENV{'QUERY_STRING'},['domainfilter','form','cnumelement', |
'cdomelement','cnameelement','roleelement', |
'cdomelement','cnameelement','roleelement', |
'multiple','type','setroles','fixeddom']); |
'multiple','type','setroles','fixeddom','cloner']); |
my ($type,$title,$jscript,$multelement,$multiple,$roleelement, |
my ($type,$title,$jscript,$multelement,$multiple,$roleelement, |
$lastaction,$autosubmit,$submitopener); |
$lastaction,$autosubmit,$submitopener,$cloneruname,$clonerudom); |
|
|
# Get course type - Course or Non-standard Course. |
# Get course type - Course or Community. |
$type = $env{'form.type'}; |
$type = $env{'form.type'}; |
if (!defined($env{'form.type'})) { |
if (!defined($env{'form.type'})) { |
$type = 'Course'; |
$type = 'Course'; |
} |
} |
$title = &mt('Selecting a [_1]',$type); |
$title = 'Selecting a '.$type; |
|
|
# Setup for multiple course selections, if flag for multiples set. |
# Setup for multiple course selections, if flag for multiples set. |
$multiple = $env{'form.multiple'}; |
$multiple = $env{'form.multiple'}; |
if ($multiple) { |
if ($multiple) { |
($jscript,$multelement) = &multiples_tag(); |
($jscript,$multelement) = &multiples_tag(); |
$title = &mt('Selecting [_1](s)',lc($type)); |
$title = 'Selecting '.$type.'(s)'; |
} |
} |
|
|
# if called when a DC is selecting a course |
# if called when a DC is selecting a course |
Line 76 sub handler {
|
Line 76 sub handler {
|
$autosubmit = 'process_pick("'.$roledom.'")'; |
$autosubmit = 'process_pick("'.$roledom.'")'; |
} |
} |
|
|
|
# if called when a DC is creating a course |
|
if ($env{'form.form'} eq 'ccrs') { |
|
($cloneruname,$clonerudom) = ($env{'form.cloner'} =~ /^($match_username):($match_domain)$/); |
|
} |
|
|
|
# if called when requesting a course |
|
if ($env{'form.form'} eq 'requestcrs') { |
|
$cloneruname = $env{'user.name'}; |
|
$clonerudom = $env{'user.domain'}; |
|
} |
|
|
my $onlyown = 0; |
my $onlyown = 0; |
# if called to assign course-based portfolio access control |
# if called to assign course-based portfolio access control |
if ((($env{'form.form'} eq 'portform') && (!$env{'user.adv'}))) { |
if ((($env{'form.form'} eq 'portform') && (!$env{'user.adv'}))) { |
Line 83 sub handler {
|
Line 94 sub handler {
|
} |
} |
|
|
my %loaditem; |
my %loaditem; |
if ($env{'form.numtitles'}) { |
if (($env{'form.type'} eq 'Course') && ($env{'form.numtitles'})) { |
$loaditem{'onload'} = 'setElements(); '; |
if (($env{'form.official'} eq 'on') && ($env{'form.state'} eq 'listing')) { |
|
$loaditem{'onload'} = 'setElements(document.filterpicker); '; |
|
} |
} |
} |
|
|
if ((($env{'form.form'} eq 'cu') || ($env{'form.form'} eq 'studentform')) && |
if ((($env{'form.form'} eq 'cu') || ($env{'form.form'} eq 'studentform')) && |
($env{'form.pickedcourse'})) { |
($env{'form.pickedcourse'})) { |
$loaditem{'onload'} .= 'setSections()'; |
$loaditem{'onload'} .= 'setSections()'; |
} |
} |
$r->print(&Apache::loncommon::start_page($title,undef, |
my $js = &js_changer(); |
|
$r->print(&Apache::loncommon::start_page($title,$js, |
{'add_entries' => \%loaditem, |
{'add_entries' => \%loaditem, |
'no_nav_bar' => 1, })); |
'no_nav_bar' => 1, })); |
|
|
Line 112 sub handler {
|
Line 126 sub handler {
|
} |
} |
|
|
# print javascript functions for choosing a course |
# print javascript functions for choosing a course |
if ($env{'form.gosearch'} || $onlyown) { |
if ((($env{'form.gosearch'}) && ($env{'form.updater'} eq '')) || |
|
$onlyown) { |
$r->print(&gochoose_javascript($type,$multiple,$autosubmit,$lastaction)); |
$r->print(&gochoose_javascript($type,$multiple,$autosubmit,$lastaction)); |
} |
} |
$r->print('<script type="text/javascript" language="Javascript">'.$jscript. |
$r->print('<script type="text/javascript" language="Javascript">'.$jscript. |
Line 144 sub handler {
|
Line 159 sub handler {
|
exists($env{'user.role.dc./'.$env{'form.domainfilter'}.'/'})) { |
exists($env{'user.role.dc./'.$env{'form.domainfilter'}.'/'})) { |
push(@{$filterlist},'coursefilter'); |
push(@{$filterlist},'coursefilter'); |
} |
} |
|
if ($cloneruname ne '' && $clonerudom ne '') { |
|
push(@{$filterlist},'cloneableonly'); |
|
} |
|
|
$r->print(&build_filters($filterlist,$type,$roleelement,$multelement, |
$r->print(&build_filters($filterlist,$type,$roleelement,$multelement, |
$filter,$action,\$numtitles)); |
$filter,$action,\$numtitles,undef,$cloneruname, |
|
$clonerudom)); |
} |
} |
|
|
# ---------------------------------------------------------------- Get the data |
# ---------------------------------------------------------------- Get the data |
if ($env{'form.gosearch'} || $onlyown) { |
if ((($env{'form.gosearch'}) && ($env{'form.updater'} eq '')) || |
my %courses = &search_courses($r,$type,$onlyown,$filter,$numtitles); |
$onlyown) { |
|
my %courses = &search_courses($r,$type,$onlyown,$filter,$numtitles, |
|
$cloneruname,$clonerudom); |
if ($nohost) { |
if ($nohost) { |
$r->print ('<span class="LC_warning">'. |
$r->print ('<span class="LC_warning">'. |
&mt('User does not exist - username: [_1], domain: [_2].', |
&mt('User does not exist - username: [_1], domain: [_2].', |
'<b>'.$filter->{'personfilter'}.'</b>', |
'<b>'.$filter->{'personfilter'}.'</b>', |
'<b>'.$filter->{'persondomfilter'}.'</b>').'</span>'); |
'<b>'.$filter->{'persondomfilter'}.'</b>').'</span>'); |
} else { |
} else { |
&display_matched_courses($r,$type,$multiple,$action,$showroles,%courses); |
&display_matched_courses($r,$type,$multiple,$action,$showroles,$cloneruname, |
|
$clonerudom,%courses); |
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|
|
sub js_changer { |
|
return <<"ENDJS"; |
|
<script type="text/javascript"> |
|
|
|
function updateFilters(caller) { |
|
if (typeof(caller) != "undefined") { |
|
document.filterpicker.updater.value = caller.name; |
|
} |
|
document.filterpicker.submit(); |
|
} |
|
|
|
</script> |
|
|
|
ENDJS |
|
|
|
} |
|
|
sub processpick { |
sub processpick { |
my $openerform = 'rolechoice'; |
my $openerform = 'rolechoice'; |
if ($env{'form.form'} eq 'studentform') { |
if ($env{'form.form'} eq 'studentform') { |
Line 236 function setSections() {
|
Line 276 function setSections() {
|
} |
} |
|
|
sub display_matched_courses { |
sub display_matched_courses { |
my ($r,$type,$multiple,$action,$showroles,%courses) = @_; |
my ($r,$type,$multiple,$action,$showroles,$cloneruname,$clonerudom,%courses) = @_; |
if ($env{'form.form'} eq 'portform') { |
if ($env{'form.form'} eq 'portform') { |
$action = '/adm/portfolio'; |
$action = '/adm/portfolio'; |
} |
} |
Line 313 sub display_matched_courses {
|
Line 353 sub display_matched_courses {
|
my $cleandesc=&HTML::Entities::encode($description,'<>&"'); |
my $cleandesc=&HTML::Entities::encode($description,'<>&"'); |
$cleandesc=~s/'/\\'/g; |
$cleandesc=~s/'/\\'/g; |
my ($cdom,$cnum)=split(/\_/,$course); |
my ($cdom,$cnum)=split(/\_/,$course); |
my ($descr,$instcode,$ttype,@owners); |
my ($descr,$instcode,$ttype,$canclone,@owners); |
if (ref($courses{$course}) eq 'HASH') { |
if (ref($courses{$course}) eq 'HASH') { |
$descr = $courses{$course}{'description'}; |
$descr = $courses{$course}{'description'}; |
$instcode = $courses{$course}{'inst_code'}; |
$instcode = $courses{$course}{'inst_code'}; |
$ttype = $courses{$course}{'type'}; |
$ttype = $courses{$course}{'type'}; |
|
if (($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) { |
|
my $cloners = $courses{$course}{'cloners'}; |
|
if ($cloners ne '') { |
|
my @cloneable = split(',',$cloners); |
|
if (grep(/^\*$/,@cloneable)) { |
|
$canclone = 1; |
|
} |
|
if (grep(/^\*:\Q$env{'form.clonerudom'}\E$/,@cloneable)) { |
|
$canclone = 1; |
|
} |
|
if (grep(/^\Q$cloneruname\E:\Q$clonerudom\E$/,@cloneable)) { |
|
$canclone = 1; |
|
} |
|
} |
|
} |
push(@owners,&unescape($courses{$course}{'owner'})); |
push(@owners,&unescape($courses{$course}{'owner'})); |
if (ref($courses{$course}{'co-owners'}) eq 'ARRAY') { |
if (ref($courses{$course}{'co-owners'}) eq 'ARRAY') { |
foreach my $item (@{$courses{$course}{'co-owners'}}) { |
foreach my $item (@{$courses{$course}{'co-owners'}}) { |
Line 330 sub display_matched_courses {
|
Line 385 sub display_matched_courses {
|
push(@owners,&unescape($singleowner)); |
push(@owners,&unescape($singleowner)); |
} |
} |
my $ownerstr = join(', ',@owners); |
my $ownerstr = join(', ',@owners); |
$r->print('<td>'.&course_chooser($multiple,$cdom,$cnum,$cleandesc).'</td>'); |
$r->print('<td>'.&course_chooser($multiple,$cdom,$cnum,$cleandesc,$canclone).'</td>'); |
$r->print('<td>'.$description.'</td>'); |
$r->print('<td>'.$description.'</td>'); |
$r->print('<td>'); |
$r->print('<td>'); |
$r->print(&Apache::lonnet::domain($cdom,'description')? |
$r->print(&Apache::lonnet::domain($cdom,'description')? |
Line 422 sub multiples_tag {
|
Line 477 sub multiples_tag {
|
|
|
sub build_filters { |
sub build_filters { |
my ($filterlist,$type,$roleelement,$multelement,$filter,$action, |
my ($filterlist,$type,$roleelement,$multelement,$filter,$action, |
$numtitlesref,$caller) = @_; |
$numtitlesref,$caller,$cloneruname,$clonerudom) = @_; |
my $list; |
my ($list,$formname,$fixeddom,$codedom,$jscript); |
my $formname; |
$codedom = $env{'request.role.domain'}; |
my ($fixeddom,$codedom,$jscript); |
|
if (defined($env{'form.form'})) { |
if (defined($env{'form.form'})) { |
$formname = $env{'form.form'}; |
$formname = $env{'form.form'}; |
} else { |
} else { |
$formname = $caller; |
$formname = $caller; |
} |
} |
|
my $onchange; |
|
unless ($env{'form.interface'} eq 'textual') { |
|
$onchange = 'javascript:updateFilters(this)'; |
|
} |
my ($domainselectform,$sincefilterform,$ownerdomselectform,$persondomselectform, |
my ($domainselectform,$sincefilterform,$ownerdomselectform,$persondomselectform, |
$instcodeform,$typeselectform,$instcodetitle); |
$instcodeform,$typeselectform,$instcodetitle); |
foreach my $item (@{$filterlist}) { |
foreach my $item (@{$filterlist}) { |
Line 486 sub build_filters {
|
Line 544 sub build_filters {
|
$domainselectform = |
$domainselectform = |
&Apache::loncommon::select_dom_form($filter->{$item}, |
&Apache::loncommon::select_dom_form($filter->{$item}, |
'domainfilter', |
'domainfilter', |
$allow_blank); |
$allow_blank,'',$onchange); |
$codedom = $filter->{'domainfilter'}; |
$codedom = $filter->{'domainfilter'}; |
} |
} |
} else { |
} else { |
Line 518 sub build_filters {
|
Line 576 sub build_filters {
|
'inc' => &mt('Institutional Categorization'), |
'inc' => &mt('Institutional Categorization'), |
'cow' => &mt("$type Owner/Co-owner"), |
'cow' => &mt("$type Owner/Co-owner"), |
'cop' => &mt("$type Personnel Includes"), |
'cop' => &mt("$type Personnel Includes"), |
'cog' => &mt('Course Type') |
'cog' => &mt('Type') |
); |
); |
|
|
$typeselectform = '<select name="type" size="1">'."\n"; |
$typeselectform = '<select name="type" size="1"'; |
my $officialjs; |
if ($onchange) { |
if ($type eq 'Course') { |
$typeselectform .= 'onchange="'.$onchange.'"'; |
if ($env{'form.fixeddom'}) { |
} |
$officialjs = 1; |
$typeselectform .= '>'."\n"; |
($instcodeform,$jscript,$$numtitlesref) = |
|
&instcode_selectors($codedom,'filterpicker',$officialjs); |
my ($cloneableonlyform,$cloneabletitle); |
} |
if (exists($filter->{'cloneableonly'})) { |
if ($instcodeform eq '') { |
my $cloneableon = ''; |
$instcodeform = |
my $cloneableoff = ' checked="checked"'; |
'<input type="text" name="instcodefilter" size="10" value="'. |
if ($filter->{'cloneableonly'}) { |
$list->{'instcodefilter'}.'" />'; |
$cloneableon = $cloneableoff; |
$instcodetitle = $lt{'ins'}; |
$cloneableoff = ''; |
|
} |
|
$cloneableonlyform = '<span class="LC_nobreak"><label><input type="radio" name="cloneableonly" value="1" '.$cloneableon.'/> '.&mt('Yes').'</label>'.(' 'x3).'<label><input type="radio" name="cloneableonly" value="" '.$cloneableoff.' /> '.&mt('No').'</label></span>'; |
|
if ($env{'form.form'} eq 'ccrs') { |
|
$cloneabletitle = &mt('Cloneable for').' '.$cloneruname.':'.$clonerudom; |
} else { |
} else { |
$instcodetitle = $lt{'inc'}; |
$cloneabletitle = &mt('Cloneable by you'); |
} |
} |
if ($env{'form.fixeddom'}) { |
} |
$instcodetitle .= '<br />('.$codedom.')'; |
my $officialjs; |
} |
if ($type eq 'Course') { |
if ($jscript ne '') { |
if (exists($filter->{'instcodefilter'})) { |
$jscript = '<script type="text/javascript" language="Javascript">'.$jscript. |
if (($env{'form.fixeddom'}) || ($formname eq 'requestcrs') |
'</script>'."\n"; |
|| ($formname eq 'modifycourse')) { |
|
$officialjs = 1; |
|
($instcodeform,$jscript,$$numtitlesref) = |
|
&instcode_selectors($codedom,'filterpicker',$officialjs); |
|
if ($jscript) { |
|
$jscript = '<script type="text/javascript" language="Javascript">'. |
|
$jscript.'</script>'."\n"; |
|
} |
|
} |
|
if ($instcodeform eq '') { |
|
$instcodeform = |
|
'<input type="text" name="instcodefilter" size="10" value="'. |
|
$list->{'instcodefilter'}.'" />'; |
|
$instcodetitle = $lt{'ins'}; |
|
} else { |
|
$instcodetitle = $lt{'inc'}; |
|
} |
|
if ($env{'form.fixeddom'}) { |
|
$instcodetitle .= '<br />('.$codedom.')'; |
|
} |
} |
} |
} |
} |
foreach my $posstype ('Course','Non-standard Course') { |
|
|
foreach my $posstype ('Course','Community') { |
$typeselectform.='<option value="'.$posstype.'"'. |
$typeselectform.='<option value="'.$posstype.'"'. |
($posstype eq $type ? ' selected="selected" ' : ''). ">".&mt($posstype)."</option>\n"; |
($posstype eq $type ? ' selected="selected" ' : ''). ">".&mt($posstype)."</option>\n"; |
} |
} |
Line 621 $multelement
|
Line 703 $multelement
|
.$list->{'coursefilter'}.'" />' |
.$list->{'coursefilter'}.'" />' |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
} |
} |
|
if ($cloneableonlyform) { |
|
$output .= &Apache::lonhtmlcommon::row_title($cloneabletitle). |
|
$cloneableonlyform.&Apache::lonhtmlcommon::row_closure(); |
|
} |
if (exists($filter->{'descriptfilter'})) { |
if (exists($filter->{'descriptfilter'})) { |
$output .= &Apache::lonhtmlcommon::row_title($lt{'cde'}) |
$output .= &Apache::lonhtmlcommon::row_title($lt{'cde'}) |
.'<input type="text" name="descriptfilter" size="40" value="' |
.'<input type="text" name="descriptfilter" size="40" value="' |
.$list->{'descriptfilter'}.'" />' |
.$list->{'descriptfilter'}.'" />' |
.&Apache::lonhtmlcommon::row_closure(1); |
.&Apache::lonhtmlcommon::row_closure(1); |
} |
} |
$output .= &Apache::lonhtmlcommon::end_pick_box(); |
$output .= &Apache::lonhtmlcommon::end_pick_box().'<p>'; |
$output .= '<p><input type="submit" name="gosearch" value="'. |
my $warning; |
|
if (($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) { |
|
my $cloneruhome=&Apache::lonnet::homeserver($cloneruname,$clonerudom); |
|
my $cc_clone; |
|
if ($cloneruhome eq 'no_host') { |
|
$warning = '<div class="LC_error">'.&mt('Intended course owner does not exist'). |
|
'</div>'; |
|
} else { |
|
if ($env{'form.form'} eq 'ccrs') { |
|
$output .= '<input type="hidden" name="cloner" value="'.$env{'form.cloner'}.'" />'."\n"; |
|
} |
|
my %ccroles = &Apache::lonnet::get_my_roles($cloneruname,$clonerudom, |
|
'userroles',['active'], ['cc']); |
|
foreach my $key (sort(keys(%ccroles))) { |
|
my ($cnum,$cdom,$role) = split(':',$key); |
|
$cc_clone .= $cdom.':'.$cnum.'&'; |
|
} |
|
$cc_clone =~ s/\&$//; |
|
} |
|
if ($cc_clone ne '') { |
|
$output .= '<input type="hidden" name="cc_clone" value="'.$cc_clone.'" />'; |
|
} |
|
} |
|
$output .= '<input type="hidden" name="updater" value="">'."\n". |
|
'<input type="submit" name="gosearch" value="'. |
&mt('Search').'" /></p>'."\n".'</form>'."\n".'<hr />'."\n"; |
&mt('Search').'" /></p>'."\n".'</form>'."\n".'<hr />'."\n"; |
return $jscript.$output; |
return $jscript.$warning.$output; |
} |
} |
|
|
sub instcode_selectors { |
sub instcode_selectors { |
Line 640 sub instcode_selectors {
|
Line 750 sub instcode_selectors {
|
&Apache::courseclassifier::instcode_selectors_data($codedom,$formname, |
&Apache::courseclassifier::instcode_selectors_data($codedom,$formname, |
\%cat_items,\@codetitles,\%cat_titles,\%cat_order,$officialjs); |
\%cat_items,\@codetitles,\%cat_titles,\%cat_order,$officialjs); |
if ($numtitles > 0) { |
if ($numtitles > 0) { |
my $unofficial = ' checked="checked" '; |
my $official = ' checked="checked" '; |
my $official = ''; |
my $unofficial = ''; |
if ($env{'form.official'}) { |
if ($env{'form.official'} eq 'off') { |
$official = $unofficial; |
$unofficial = $official; |
$unofficial = ''; |
$official = ''; |
} |
} |
$output .= '<span class="LC_nobreak">'.&mt('Official course:').' <label>'. |
$output .= '<span class="LC_nobreak">'.&mt('Official course:').' <label>'. |
'<input type="radio" name="official" value="1"'.$official.' />'. |
'<input type="radio" name="official" value="on"'.$official.' />'. |
&mt('Yes').'</label>'.(' 'x3).'<label>'. |
&mt('Yes').'</label>'.(' 'x3).'<label>'. |
'<input type="radio" name="official" value="0"'.$unofficial. |
'<input type="radio" name="official" value="off"'.$unofficial. |
' onclick="toggleOfficial();" />'.&mt('No').'</label></span><br />'. |
' onclick="toggleOfficial();" />'.&mt('No').'</label></span><br />'. |
&Apache::courseclassifier::build_instcode_selectors($numtitles, |
&Apache::courseclassifier::build_instcode_selectors($numtitles, |
$lasttitle,\%cat_items,\@codetitles,\%cat_titles,\%cat_order)."\n". |
$lasttitle,\%cat_items,\@codetitles,\%cat_titles,\%cat_order)."\n". |
Line 661 sub instcode_selectors {
|
Line 771 sub instcode_selectors {
|
} |
} |
|
|
sub search_courses { |
sub search_courses { |
my ($r,$type,$onlyown,$filter,$numtitles) = @_; |
my ($r,$type,$onlyown,$filter,$numtitles,$cloneruname,$clonerudom) = @_; |
my (%courses,%showcourses); |
my (%courses,%showcourses,$cloner); |
if (!$onlyown) { |
if (!$onlyown) { |
$r->print(&mt('Searching ...').'<br /> <br />'); |
$r->print(&mt('Searching ...').'<br /> <br />'); |
$r->rflush(); |
$r->rflush(); |
Line 680 sub search_courses {
|
Line 790 sub search_courses {
|
($filter->{'sincefilter'}==-1?1:time-$filter->{'sincefilter'}); |
($filter->{'sincefilter'}==-1?1:time-$filter->{'sincefilter'}); |
my ($instcodefilter,$regexpok); |
my ($instcodefilter,$regexpok); |
if ($numtitles) { |
if ($numtitles) { |
if ($env{'form.official'}) { |
if ($env{'form.official'} eq 'on') { |
$instcodefilter = |
$instcodefilter = |
&Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'}, |
&Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'},$numtitles); |
$numtitles); |
|
$regexpok = 1; |
$regexpok = 1; |
|
} elsif ($env{'form.official'} eq 'off') { |
|
$instcodefilter = &Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'},$numtitles); |
|
unless ($instcodefilter eq '') { |
|
$regexpok = -1; |
|
} |
} |
} |
} else { |
} else { |
$instcodefilter = $filter->{'instcodefilter'}; |
$instcodefilter = $filter->{'instcodefilter'}; |
} |
} |
if ($instcodefilter eq '') { $instcodefilter = '.'; } |
if ($instcodefilter eq '') { $instcodefilter = '.'; } |
if ($type eq '') { $type = '.'; } |
if ($type eq '') { $type = '.'; } |
|
|
|
if (($clonerudom ne '') && ($cloneruname ne '')) { |
|
$cloner = $cloneruname.':'.$clonerudom; |
|
} |
%courses = |
%courses = |
&Apache::lonnet::courseiddump($filter->{'domainfilter'}, |
&Apache::lonnet::courseiddump($filter->{'domainfilter'}, |
$filter->{'descriptfilter'}, |
$filter->{'descriptfilter'}, |
Line 698 sub search_courses {
|
Line 816 sub search_courses {
|
$instcodefilter, |
$instcodefilter, |
$filter->{'combownerfilter'}, |
$filter->{'combownerfilter'}, |
$filter->{'coursefilter'}, |
$filter->{'coursefilter'}, |
undef,undef,$type,$regexpok); |
undef,undef,$type,$regexpok,undef,undef, |
|
undef,undef,$cloner,$env{'form.cc_clone'}, |
|
$filter->{'cloneableonly'}); |
if (($filter->{'personfilter'} ne '') && ($filter->{'persondomfilter'} ne '')) { |
if (($filter->{'personfilter'} ne '') && ($filter->{'persondomfilter'} ne '')) { |
my %rolehash = &Apache::lonnet::get_my_roles($filter->{'personfilter'}, |
my %rolehash = &Apache::lonnet::get_my_roles($filter->{'personfilter'}, |
$filter->{'persondomfilter'}, |
$filter->{'persondomfilter'}, |
Line 734 sub search_courses {
|
Line 854 sub search_courses {
|
} |
} |
|
|
sub course_chooser { |
sub course_chooser { |
my ($multiple,$cdom,$cnum,$cleandesc) = @_; |
my ($multiple,$cdom,$cnum,$cleandesc,$canclone) = @_; |
my $output; |
my $output; |
if ($multiple) { |
if ($multiple) { |
$output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n"; |
$output = '<label><input type="checkbox" name="course_id" value="'.$cdom.'_'.$cnum.'" />'."\n"; |
|
} elsif ((($env{'form.form'} eq 'ccrs') || ($env{'form.form'} eq 'requestcrs')) && (!$canclone)) { |
|
if ($env{'form.form'} eq 'ccrs') { |
|
$output = &mt('No cloning for ').$env{'form.cloner'}."\n"; |
|
} else { |
|
$output = &mt('No rights to clone')."\n"; |
|
} |
} else { |
} else { |
$output = '<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
$output = '<input type="button" value="'.&mt('Select').'" onClick="gochoose('. |
"'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n"; |
"'".$cnum."','".$cdom."','".$cleandesc."')".'" />'."\n"; |
Line 753 sub gochoose_javascript {
|
Line 879 sub gochoose_javascript {
|
total => 'coursetotal', |
total => 'coursetotal', |
list => 'courselist', |
list => 'courselist', |
}, |
}, |
'Non-standard Course' => { |
'Community' => { |
name => 'grouppick', |
name => 'grouppick', |
total => 'grouptotal', |
total => 'grouptotal', |
list => 'grouplist', |
list => 'grouplist', |
Line 870 Course Activity - how recently was cours
|
Line 996 Course Activity - how recently was cours
|
Course Domain - the domain of the course |
Course Domain - the domain of the course |
|
|
=item * |
=item * |
Course Type - Course or Non-standard Course |
Type - Course or Community |
|
|
=item * |
=item * |
Course Institutional Code - the institutional identifier assigned to the course |
Course Institutional Code - the institutional identifier assigned to the course |
Line 923 Following selection, and/or submission,
|
Line 1049 Following selection, and/or submission,
|
X<create_user_javascript()> |
X<create_user_javascript()> |
B<create_user_javascript($type)>: |
B<create_user_javascript($type)>: |
|
|
Input: 1 - $type - the course type - Course or Non-standard Course |
Input: 1 - $type - the course type - Course or Community |
|
|
Output: 1 - $output - javascript wrapped in E<lt>scriptE<gt>E<lt>/scriptE<gt> tags |
Output: 1 - $output - javascript wrapped in E<lt>scriptE<gt>E<lt>/scriptE<gt> tags |
|
|
Line 934 javascript code for reporting selected s
|
Line 1060 javascript code for reporting selected s
|
|
|
=item * |
=item * |
X<display_matched_courses()> |
X<display_matched_courses()> |
B<display_matched_courses($r,$type,$multiple,$action,$showroles,%courses)>: |
B<display_matched_courses($r,$type,$multiple,$action,$showroles,$cloneruname,$clonerudom,%courses)>: |
|
|
Input: 7 - request object, course type, multiple (0 or 1), form action, whether to show roles (for course personnel filter), hash of courses. |
Input: 7 - request object, course type, multiple (0 or 1), form action, whether to show roles (for course personnel filter), username of new course owner, domain of new course owner, hash of courses. |
|
|
Output: 0 |
Output: 0 |
|
|
Line 955 Side Effects: None
|
Line 1081 Side Effects: None
|
|
|
=item * |
=item * |
X<build_filters()> |
X<build_filters()> |
B<build_filters($filterlist,$type,$roleelement,$multelement,$filter,$action,$numfiltersref,$caller)>: |
B<build_filters($filterlist,$type,$roleelement,$multelement,$filter,$action,$numfiltersref,$caller,$cloneruname,$clonerudom)>: |
|
|
|
|
Input: 7 - anonymous array of search criteria; course type; $roleelement ; $multelement ; anonymous hash of criteria and their values; form action; ref to scalar (count of number of elements in institutional codes -- e.g., 4 for year, semester, department, and number); caller context (e.g., set to 'modifycourse' when routine is called from lonmodifycourse.pm). |
Input: 7 - anonymous array of search criteria; course type; $roleelement ; $multelement ; anonymous hash of criteria and their values; form action; ref to scalar (count of number of elements in institutional codes -- e.g., 4 for year, semester, department, and number); caller context (e.g., set to 'modifycourse' when routine is called from lonmodifycourse.pm). |
Line 966 Side Effects: None
|
Line 1092 Side Effects: None
|
|
|
=item * |
=item * |
X<search_courses()> |
X<search_courses()> |
B<search_courses($r,$type,$onlyown,$filter,$numtitles)>: |
B<search_courses($r,$type,$onlyown,$filter,$numtitles,$cloneruname,$clonerudom)>: |
|
|
|
|
Input: 5 - request object, course type, search scope: only courses in which user has active role (1), or any course (0); anonymous hash of criteria and their values; for institutional codes - number of categories). |
Input: 7 - request object, course type, search scope: only courses in which user has active role (1), or any course (0); anonymous hash of criteria and their values; for institutional codes - number of categories; optional username of new course owner, optional domain of new course owner). Last two needed when search is for courses to clone from course request form, or course creation form (DC). |
|
|
Output: 1 - %courses - hash of courses satisfying search criteria, keys = course IDs, values are corresponding colon-separated escaped description, institutional code, owner and type. |
Output: 1 - %courses - hash of courses satisfying search criteria, keys = course IDs, values are corresponding colon-separated escaped description, institutional code, owner and type. |
|
|
Line 978 Side Effects: None
|
Line 1104 Side Effects: None
|
|
|
=item * |
=item * |
X<course_chooser()> |
X<course_chooser()> |
B<course_chooser($multiple,$cdom,$cnum,$cleandesc)>: |
B<course_chooser($multiple,$cdom,$cnum,$cleandesc,$canclone)>: |
|
|
Input: 4 - single (0) or multiple (1) courses; course domain, course number; course description. |
Input: 5 - single (0) or multiple (1) courses; course domain, course number; course description; can clone course (1 if new course owner has cloning rights). |
|
|
Output: 1 - HTML for either checkbox (multiple=1) or select button (multiple=0) for user yo indicate course selection. |
Output: 1 - HTML for either checkbox (multiple=1) or select button (multiple=0) for user to indicate course selection. |
|
|
Side Effects: None |
Side Effects: None |
|
|
Line 1031 javascript functions used when user sele
|
Line 1157 javascript functions used when user sele
|
|
|
(g) Scantron Operator uploading a scantron file to a course - course number is written to visible form element in opener window. Child window closes. |
(g) Scantron Operator uploading a scantron file to a course - course number is written to visible form element in opener window. Child window closes. |
|
|
|
=item |
|
|
|
(h) User requesting creation of a course, and selecting a course to clone - course number and domain written to visible form elements in opener window. Child window closes. |
|
|
=back |
=back |
|
|
=cut |
=cut |