';
return ('',$warning);
@@ -813,11 +874,11 @@ sub get_coordinator_cloneable {
}
sub instcode_selectors {
- my ($codedom,$formname,$officialjs) = @_;
- my ($output,@codetitles,%cat_titles,%cat_order,%cat_items);
+ my ($codedom,$formname,$officialjs,$codetitles) = @_;
+ my ($output,%cat_titles,%cat_order,%cat_items);
my ($jscript,$totcodes,$numtitles,$lasttitle) =
&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) {
my $official = ' checked="checked" ';
my $unofficial = '';
@@ -831,7 +892,7 @@ sub instcode_selectors {
''.&mt('No').' '.
&Apache::courseclassifier::build_instcode_selectors($numtitles,
- $lasttitle,\%cat_items,\@codetitles,\%cat_titles,\%cat_order)."\n".
+ $lasttitle,\%cat_items,$codetitles,\%cat_titles,\%cat_order)."\n".
''."\n".
''."\n";
@@ -840,7 +901,7 @@ sub instcode_selectors {
}
sub search_courses {
- my ($r,$type,$onlyown,$filter,$numtitles,$cloneruname,$clonerudom) = @_;
+ my ($r,$type,$onlyown,$filter,$numtitles,$cloneruname,$clonerudom,$domcloner,$codetitles) = @_;
my (%courses,%showcourses,$cloner,$ccrole);
if ($type eq 'Community') {
$ccrole = 'co';
@@ -848,7 +909,7 @@ sub search_courses {
$ccrole = 'cc';
}
if (!$onlyown) {
- $r->print(&mt('Searching ...').'
');
+ $r->print('
'.&mt('Searching ...').'
');
$r->rflush();
if (($filter->{'ownerfilter'} ne '') ||
($filter->{'ownerdomfilter'} ne '')) {
@@ -860,16 +921,22 @@ sub search_courses {
$filter->{$item}='.';
}
}
+ my $now = time;
my $timefilter =
- ($filter->{'sincefilter'}==-1?1:time-$filter->{'sincefilter'});
+ ($filter->{'sincefilter'}==-1?1:$now-$filter->{'sincefilter'});
+ my ($createdbefore,$createdafter);
+ if (($filter->{'createdfilter'} ne '') && ($filter->{'createdfilter'} !=-1)) {
+ $createdbefore = $now;
+ $createdafter = $now-$filter->{'createdfilter'};
+ }
my ($instcodefilter,$regexpok);
if ($numtitles) {
if ($env{'form.official'} eq 'on') {
$instcodefilter =
- &Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'},$numtitles);
+ &Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'},$numtitles,$codetitles);
$regexpok = 1;
} elsif ($env{'form.official'} eq 'off') {
- $instcodefilter = &Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'},$numtitles);
+ $instcodefilter = &Apache::courseclassifier::instcode_search_str($filter->{'domainfilter'},$numtitles,$codetitles);
unless ($instcodefilter eq '') {
$regexpok = -1;
}
@@ -892,7 +959,9 @@ sub search_courses {
$filter->{'coursefilter'},
undef,undef,$type,$regexpok,undef,undef,
undef,undef,$cloner,$env{'form.cc_clone'},
- $filter->{'cloneableonly'});
+ $filter->{'cloneableonly'},
+ $createdbefore,$createdafter,undef,
+ $domcloner);
if (($filter->{'personfilter'} ne '') && ($filter->{'persondomfilter'} ne '')) {
my %rolehash = &Apache::lonnet::get_my_roles($filter->{'personfilter'},
$filter->{'persondomfilter'},
@@ -939,7 +1008,7 @@ sub course_chooser {
$output = &mt('No rights to clone')."\n";
}
} else {
- $output = ''."\n";
}
return $output;
@@ -959,8 +1028,7 @@ sub gochoose_javascript {
list => 'courselist',
},
);
- my $output .= qq|
-
|;
- return $output;
+ return &Apache::lonhtmlcommon::scripttag($output);
}
1;
@@ -1161,10 +1233,10 @@ Side Effects: None
=item *
X
-B:
+B:
-Input: 11 - 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), username and domain of new course owner who wants to clone, $tyepelem
+Input: 12 - 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); username and domain of new course owner who wants to clone, $typeelem; reference to array of titles of components in institutional codes (official courses).
Output: 1 - $output - HTML for display of search criteria, and hidden form elements.
@@ -1172,10 +1244,12 @@ Side Effects: None
=item *
X
-B:
+B:
-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).
+Input: 9 - 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). Seventh and eighth needed when search is for courses to clone from course request form, or course creation form (DC). Optional "domcloner" flag (has value=1 if user has ccc priv in
+domain being filtered by (used when DC is using course creation form). Ninth is reference to array of titles of components in institutional codes (official courses).
Output: 1 - %courses - hash of courses satisfying search criteria, keys = course IDs, values are corresponding colon-separated escaped description, institutional code, owner and type.
@@ -1235,7 +1309,7 @@ javascript functions used when user sele
=item
-(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) Bubblesheet Scanning Operator uploading a bubblesheet file to a course - course number is written to visible form element in opener window. Child window closes.
=item