[Bio] / FigWebServices / index.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/index.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8, Sat Jan 3 13:47:50 2004 UTC revision 1.9, Sat Jan 3 14:13:48 2004 UTC
# Line 479  Line 479 
479          @genomes = $fig->genomes;          @genomes = $fig->genomes;
480      }      }
481    
482      my @assignments = &assignments_made($fig,\@genomes,$who,$cgi->param('date'));      my @assignments = $fig->assignments_made(\@genomes,$who,$cgi->param('date'));
483      if (@assignments == 0)      if (@assignments == 0)
484      {      {
485          push(@$html,$cgi->h1("Sorry, no assignments where made by $who"));          push(@$html,$cgi->h1("Sorry, no assignments where made by $who"));
# Line 529  Line 529 
529      return $peg;      return $peg;
530  }  }
531    
 sub assignments_made {  
     my($fig,$genomes,$who,$date) = @_;  
     my($relational_db_response,$entry,$fid,$fileno,$seek,$len,$ann);  
   
     my %genomes = map { $_ => 1 } @$genomes;  
     $date = defined($date) ? $date-1 : 0;  
     my @assignments = ();  
     my $rdbH = $fig->db_handle;  
     if ($who eq "master")  
     {  
         $relational_db_response = $rdbH->SQL("SELECT fid, fileno, seek, len  FROM annotation_seeks WHERE ((ma = \'1\') AND (dateof > $date))");  
     }  
     else  
     {  
         $relational_db_response = $rdbH->SQL("SELECT fid, fileno, seek, len  FROM annotation_seeks WHERE (( who = \'$who\' ) AND (dateof > $date))");  
     }  
   
     if ($relational_db_response && (@$relational_db_response > 0))  
     {  
         foreach $entry (@$relational_db_response)  
         {  
             ($fid,$fileno,$seek,$len) = @$entry;  
             if (($fid =~ /^fig\|(\d+\.\d+)/) && $genomes{$1})  
             {  
                 $ann = $fig->read_annotation($fileno,$seek,$len);  
   
                 if (($ann =~ /^(fig\|\d+\.\d+\.peg\.\d+)\n(\d+)\n(\S+)\nSet ([^\n]*)function[^\n]*\n(\S[^\n]+\S)/s) &&  
                     (($who eq $3) || (($4 eq "master ") && ($who eq "master"))) &&  
                     ($2 >= $date))  
                 {  
                     push(@assignments,[$1,$5]);  
                 }  
             }  
         }  
     }  
     return @assignments;  
 }  

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3