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

Diff of /FigWebServices/get_dlits.cgi

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

revision 1.11, Thu Jul 10 19:35:34 2008 UTC revision 1.13, Thu Jun 25 22:45:59 2009 UTC
# Line 123  Line 123 
123    
124  #  This is a one-time special case to add an index to the dlits table  #  This is a one-time special case to add an index to the dlits table
125    
 if ( $user eq 'master:gjo' && $cgi->param('add_pubmed_index') ) { &add_pubmed_index( $rdbH, $html ) }  
   
126    
127  #  Process a page of curated literature ----------------------------------------  #  Process a page of curated literature ----------------------------------------
128    
# Line 201  Line 199 
199      push @$html, $cgi->h3( '<FONT Color=red>Please select a role.</FONT>' ) if $submit4;      push @$html, $cgi->h3( '<FONT Color=red>Please select a role.</FONT>' ) if $submit4;
200    
201      my $where1 = $show_just ? " AND (dlits.status = '$show_just')" : "";      my $where1 = $show_just ? " AND (dlits.status = '$show_just')" : "";
202      my $where2 = $curator   ? " AND (curr_role.curator = '$curator' AND curr_role.role = hash_role.role)" : "";      my($where2, $from_list);
203    
204        $from_list = "hash_role,dlits";
205        if ($curator)
206        {
207            $where2 =  " AND (curr_role.curator = '$curator' AND curr_role.role = hash_role.role)";
208            $from_list .= ",curr_role";
209        }
210    
211      my @roles = sort { lc $a cmp lc $b }  #  Make sort case insensitive      my @roles = sort { lc $a cmp lc $b }  #  Make sort case insensitive
212                  map { $_->[0] }                  map { $_->[0] }
213                  @{ $rdbH->SQL( "SELECT DISTINCT hash_role.role "                  @{ $rdbH->SQL( "SELECT DISTINCT hash_role.role "
214                               . "FROM hash_role,dlits,curr_role "                               . "FROM $from_list "
215                               . "WHERE hash_role.md5_hash = dlits.md5_hash $where1 $where2"                               . "WHERE hash_role.md5_hash = dlits.md5_hash $where1 $where2"
216                               ) };                               ) };
217      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),      push( @$html, $cgi->start_form(-action => "get_dlits.cgi", -method => 'post'),
# Line 605  Line 610 
610      push( @$html, $cgi->h2( "<FONT Color=green>Made $n_change requested changes.</FONT>" ) );      push( @$html, $cgi->h2( "<FONT Color=green>Made $n_change requested changes.</FONT>" ) );
611  }  }
612    
   
 # Not sure why this was not done before  
   
 sub add_pubmed_index {  
     my ( $rdbH, $html ) = @_;  
     return if ! $rdbH;  
     my $rtn = $rdbH->SQL( 'SHOW INDEX FROM dlits' );  
     push @$html, "<BR />Initial return value from 'SHOW INDEX FROM dlits' = $rtn\n";  
     if ( $rtn == 3 )  
     {  
         my $rtn = $rdbH->create_index( idx  => "pubmed_in_dlits_ix",  
                                        tbl  => "dlits",  
                                        type => "btree",  
                                        flds => "pubmed" );  
         $rtn = $rdbH->SQL( 'SHOW INDEX FROM dlits' );  
         push @$html, "<BR />Final return value from 'SHOW INDEX FROM dlits' = $rtn<BR />\n";  
     }  
     else  
     {  
         push @$html, "<BR />Index might already exist<BR />\n";  
     }  
 }  

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.13

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3