Diff for /loncom/lond between versions 1.332 and 1.333

version 1.332, 2006/05/31 14:47:56 version 1.333, 2006/06/07 01:49:43
Line 3288  sub put_course_id_handler { Line 3288  sub put_course_id_handler {
             my @new_items = split(/:/,$courseinfo);              my @new_items = split(/:/,$courseinfo);
             my $numnew = scalar(@new_items);              my $numnew = scalar(@new_items);
             if ($numcurrent > 0) {              if ($numcurrent > 0) {
                 if ($numnew == 1) { # flushcourselogs() from 1.1 or earlier                  if ($numnew <= $numcurrent) { # flushcourselogs() from pre 2.2 
                     $courseinfo .= ':'.join(':',@current_items);                      for (my $j=$numcurrent-$numnew; $j>=0; $j--) {
                 } elsif ($numnew == 2) { # flushcourselogs() from 1.2.X                          $courseinfo .= ':'.$current_items[$numcurrent-$j-1];
                     $courseinfo .= ':'.$current_items[$numcurrent-1];                      }
                 }                  }
             }              }
     $hashref->{$key}=$courseinfo.':'.$now;      $hashref->{$key}=$courseinfo.':'.$now;
Line 3351  sub dump_course_id_handler { Line 3351  sub dump_course_id_handler {
   
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
   
     my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter) =split(/:/,$tail);      my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter,
           $typefilter) =split(/:/,$tail);
     if (defined($description)) {      if (defined($description)) {
  $description=&unescape($description);   $description=&unescape($description);
     } else {      } else {
Line 3372  sub dump_course_id_handler { Line 3373  sub dump_course_id_handler {
     } else {      } else {
         $coursefilter='.';          $coursefilter='.';
     }      }
       if (defined($typefilter)) {
           $typefilter=&unescape($typefilter);
       } else {
           $typefilter='.';
       }
   
     unless (defined($since)) { $since=0; }      unless (defined($since)) { $since=0; }
     my $qresult='';      my $qresult='';
     my $hashref = &tie_domain_hash($udom, "nohist_courseids", &GDBM_WRCREAT());      my $hashref = &tie_domain_hash($udom, "nohist_courseids", &GDBM_WRCREAT());
     if ($hashref) {      if ($hashref) {
  while (my ($key,$value) = each(%$hashref)) {   while (my ($key,$value) = each(%$hashref)) {
     my ($descr,$lasttime,$inst_code,$owner);      my ($descr,$lasttime,$inst_code,$owner,$type);
             my @courseitems = split(/:/,$value);              my @courseitems = split(/:/,$value);
             $lasttime = pop(@courseitems);              $lasttime = pop(@courseitems);
     ($descr,$inst_code,$owner)=@courseitems;      ($descr,$inst_code,$owner,$type)=@courseitems;
     if ($lasttime<$since) { next; }      if ($lasttime<$since) { next; }
             my $match = 1;              my $match = 1;
     unless ($description eq '.') {      unless ($description eq '.') {
Line 3408  sub dump_course_id_handler { Line 3414  sub dump_course_id_handler {
                     $match = 0;                      $match = 0;
                 }                  }
             }              }
               unless ($typefilter eq '.' || !defined($typefilter)) {
                   my $unescapeType = &unescape($type);
                   if (!defined($type)) {
                       if ($typefilter ne 'Course') {
                           $match = 0;
                       }
                   } else { 
                       unless (eval('$unescapeType=~/^\Q$typefilter\E$/')) {
                           $match = 0;
                       }
                   }
               }
             if ($match == 1) {              if ($match == 1) {
                 $qresult.=$key.'='.$descr.':'.$inst_code.':'.$owner.'&';                  $qresult.=$key.'='.$descr.':'.$inst_code.':'.$owner.'&';
             }              }

Removed from v.1.332  
changed lines
  Added in v.1.333


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>