[LON-CAPA-cvs] cvs: loncom / lond /lonnet/perl lonnet.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 29 May 2008 05:44:54 -0000


raeburn		Thu May 29 01:44:54 2008 EDT

  Modified files:              
    /loncom	lond 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - user selected category (from course catalog) can be used as a filter in the display of courses. 
  
  
Index: loncom/lond
diff -u loncom/lond:1.400 loncom/lond:1.401
--- loncom/lond:1.400	Mon Apr 21 11:27:34 2008
+++ loncom/lond	Thu May 29 01:44:48 2008
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.400 2008/04/21 15:27:34 raeburn Exp $
+# $Id: lond,v 1.401 2008/05/29 05:44:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,7 +59,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.400 $'; #' stupid emacs
+my $VERSION='$Revision: 1.401 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -3626,7 +3626,7 @@
     my $userinput = "$cmd:$tail";
 
     my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter,
-        $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly) =split(/:/,$tail);
+        $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter) =split(/:/,$tail);
     my $now = time;
     if (defined($description)) {
 	$description=&unescape($description);
@@ -3667,6 +3667,9 @@
     if (defined($regexp_ok)) {
         $regexp_ok=&unescape($regexp_ok);
     }
+    if (defined($catfilter)) {
+        $catfilter=&unescape($catfilter);
+    }
     my $unpack = 1;
     if ($description eq '.' && $instcodefilter eq '.' && $coursefilter eq '.' && 
         $typefilter eq '.') {
@@ -3705,8 +3708,13 @@
                             next;
                         }
                     }
+                    if ($catfilter ne '') {
+                        next if ($items->{'category'} ne $catfilter);
+                    }
                 }
             } else {
+                next if ($catfilter ne '');
+                next if ($selfenrollonly); 
                 $is_hash =  0;
                 my @courseitems = split(/:/,$value);
                 $lasttime = pop(@courseitems);
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.958 loncom/lonnet/perl/lonnet.pm:1.959
--- loncom/lonnet/perl/lonnet.pm:1.958	Mon May 12 16:59:15 2008
+++ loncom/lonnet/perl/lonnet.pm	Thu May 29 01:44:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.958 2008/05/12 20:59:15 www Exp $
+# $Id: lonnet.pm,v 1.959 2008/05/29 05:44:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2762,7 +2762,7 @@
 sub courseiddump {
     my ($domfilter,$descfilter,$sincefilter,$instcodefilter,$ownerfilter,
         $coursefilter,$hostidflag,$hostidref,$typefilter,$regexp_ok,
-        $selfenrollonly)=@_;
+        $selfenrollonly,$catfilter)=@_;
     my $as_hash = 1;
     my %returnhash;
     if (!$domfilter) { $domfilter=''; }
@@ -2780,7 +2780,7 @@
                          &escape($instcodefilter).':'.&escape($ownerfilter).
                          ':'.&escape($coursefilter).':'.&escape($typefilter).
                          ':'.&escape($regexp_ok).':'.$as_hash.':'.
-                         &escape($selfenrollonly),$tryserver);
+                         &escape($selfenrollonly).':'.&escape($catfilter),$tryserver);
                 my @pairs=split(/\&/,$rep);
                 foreach my $item (@pairs) {
                     my ($key,$value)=split(/\=/,$item,2);