[LON-CAPA-cvs] cvs: loncom /interface lonmodifycourse.pm lonpickcourse.pm

raeburn raeburn@source.lon-capa.org
Fri, 08 May 2009 17:22:17 -0000


raeburn		Fri May  8 17:22:17 2009 EDT

  Modified files:              
    /loncom/interface	lonpickcourse.pm lonmodifycourse.pm 
  Log:
  - Restoring $caller as the last argument (now eighth) in lonpickcourse::build_filters().
    (removed in rev 1.78).
  - Modifying calls to lonpickcourse.pm routines: build_filters() and display_matched_courses() in lonmodifycourse.pm, to take account of changed args.  
  
  
Index: loncom/interface/lonpickcourse.pm
diff -u loncom/interface/lonpickcourse.pm:1.80 loncom/interface/lonpickcourse.pm:1.81
--- loncom/interface/lonpickcourse.pm:1.80	Tue May  5 05:30:00 2009
+++ loncom/interface/lonpickcourse.pm	Fri May  8 17:22:17 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Pick a course
 #
-# $Id: lonpickcourse.pm,v 1.80 2009/05/05 05:30:00 raeburn Exp $
+# $Id: lonpickcourse.pm,v 1.81 2009/05/08 17:22:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -51,7 +51,6 @@
         ($ENV{'QUERY_STRING'},['domainfilter','form','cnumelement',
 			       'cdomelement','cnameelement','roleelement',
                                'multiple','type','setroles','fixeddom']);
-
     my ($type,$title,$jscript,$multelement,$multiple,$roleelement,
         $lastaction,$autosubmit,$submitopener);
 
@@ -423,12 +422,14 @@
 
 sub build_filters {
     my ($filterlist,$type,$roleelement,$multelement,$filter,$action,
-        $numtitlesref) = @_;
+        $numtitlesref,$caller) = @_;
     my $list;
     my $formname;
     my ($fixeddom,$codedom,$jscript);
     if (defined($env{'form.form'})) {
-         $formname = $env{'form.form'};
+        $formname = $env{'form.form'};
+    } else {
+        $formname = $caller;
     }
     my ($domainselectform,$sincefilterform,$ownerdomselectform,$persondomselectform,
         $instcodeform,$typeselectform,$instcodetitle);
@@ -954,10 +955,10 @@
 
 =item *
 X<build_filters()>
-B<build_filters($filterlist,$type,$roleelement,$multelement,$filter,$action,$numfiltersref)>:
+B<build_filters($filterlist,$type,$roleelement,$multelement,$filter,$action,$numfiltersref,$caller)>:
 
 
-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).  
+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).
 
 Output: 1 - $output - HTML for display of search criteria, and hidden form elements. 
 
Index: loncom/interface/lonmodifycourse.pm
diff -u loncom/interface/lonmodifycourse.pm:1.43 loncom/interface/lonmodifycourse.pm:1.44
--- loncom/interface/lonmodifycourse.pm:1.43	Sun Mar  8 21:49:33 2009
+++ loncom/interface/lonmodifycourse.pm	Fri May  8 17:22:17 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # handler for DC-only modifiable course settings
 #
-# $Id: lonmodifycourse.pm,v 1.43 2009/03/08 21:49:33 weissno Exp $
+# $Id: lonmodifycourse.pm,v 1.44 2009/05/08 17:22:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -118,8 +118,9 @@
     &print_header($r);
     my $filterlist = ['descriptfilter',
                       'instcodefilter','ownerfilter',
-                      'ownerdomfilter','coursefilter'];
+                      'coursefilter'];
     my $filter = {};
+    my $numtitles;
     my $type = 'Course';
     my $action = '/adm/modifycourse';
     my $cctitle = &Apache::lonnet::plaintext('cc',$type);
@@ -131,7 +132,7 @@
         '<li>'.&mt('View or modify course settings which only a [_1] may modify.'
                   ,$dctitle).'</li>'."\n".'</ul>');
     $r->print(&Apache::lonpickcourse::build_filters($filterlist,$type,
-                             undef,undef,$filter,$action,'modifycourse'));
+                             undef,undef,$filter,$action,\$numtitles,'modifycourse'));
 }
 
 sub print_course_selection_page {
@@ -155,7 +156,7 @@
     $filter{'domainfilter'} = $dom;
     my %courses = &Apache::lonpickcourse::search_courses($r,$type,0,
                                                          \%filter);
-    &Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,
+    &Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,
                                                     %courses);
     return;
 }