[Bio] / SubsystemEditor / WebPage / ShowSubsystem.pm Repository:
ViewVC logotype

Diff of /SubsystemEditor/WebPage/ShowSubsystem.pm

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

revision 1.9, Wed Mar 12 16:14:39 2008 UTC revision 1.10, Thu Mar 13 19:36:58 2008 UTC
# Line 165  Line 165 
165      }      }
166      $subsystem->set_classification( [ $class1, $class2 ] );      $subsystem->set_classification( [ $class1, $class2 ] );
167    
168        my $litstoset = $cgi->param( 'SUBSYSLIT' );
169        my @lits = split( ', ', $litstoset );
170        setLiteratures( $fig, $name, \@lits );
171    
172      # here we really edit the files in the subsystem directory #      # here we really edit the files in the subsystem directory #
173      $subsystem->incr_version();      $subsystem->incr_version();
174      $subsystem->db_sync();      $subsystem->db_sync();
# Line 209  Line 213 
213    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";
214    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";
215    $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";    $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";
216    
217      my $lit = getLiteratures( $fig, $name );
218      my $litstring = '';
219      my $litvoid = '';
220      if ( defined( $lit ) && scalar( @$lit ) > 0 ) {
221        my @litlinks;
222        foreach my $l ( @$lit ) {
223          my $thislink = "<a href=\"javascript:void(0)\"onclick=\"window.open('http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=retrieve&db=pubmed&list_uids=" . $l ."')\">$l</a>";
224          push @litlinks, $thislink;
225        }
226        $litstring = join( ', ', @litlinks );
227        $litvoid = join( ', ', @$lit );
228      }
229    
230    if ( $can_alter ) {    if ( $can_alter ) {
231    
232        my $editLitButton = "<INPUT TYPE=BUTTON ID='EditLitButton' VALUE='Edit Literature' ONCLICK='MakeEditableLit( \"0\" );'><INPUT TYPE=BUTTON ID='ShowLitButton' VALUE='Show Links' STYLE='display: none;' ONCLICK='MakeEditableLit( \"1\" );'>";
233        $infotable .= "<TR><TH>Literature</TH><TD><TABLE><TR><TD><SPAN ID='LitSpan'>$litstring</SPAN></TD><TD>$editLitButton</TD><TD><INPUT TYPE=TEXT STYLE='width: 200px; display: none;' NAME='SUBSYSLIT' ID='SUBSYSLIT' VALUE='$litvoid'></TD><TD><SPAN ID='TEXTSPAN' STYLE='display: none;'>Multiple PMIDs should be separated by \', \'</SPAN></TD></TR></TABLE></TD></TR>";
234      $infotable .= "<TR><TH>Description</TH><TD><TEXTAREA NAME='SSDESC' ROWS=6 STYLE='width: 772px;'>$ssdesc</TEXTAREA></TD></TR>";      $infotable .= "<TR><TH>Description</TH><TD><TEXTAREA NAME='SSDESC' ROWS=6 STYLE='width: 772px;'>$ssdesc</TEXTAREA></TD></TR>";
235      $infotable .= "<TR><TH>Notes</TH><TD><TEXTAREA NAME='SSNOTES' ROWS=6 STYLE='width: 772px;'>$ssnotes</TEXTAREA></TD></TR>";      $infotable .= "<TR><TH>Notes</TH><TD><TEXTAREA NAME='SSNOTES' ROWS=6 STYLE='width: 772px;'>$ssnotes</TEXTAREA></TD></TR>";
236    }    }
# Line 361  Line 382 
382    return $sdContent;    return $sdContent;
383  }  }
384    
385    ########################################
386    # get Literature-string for subsystems #
387    ########################################
388    sub getLiteratures {
389      my ( $fig, $name ) = @_;
390    
391      my $frpubs;
392      my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_PUBMED_RELEVANT" );
393    
394      foreach my $k ( @rel_lit_num ) {
395        my ( $ss, $key, $value ) = @$k;
396        push @$frpubs, $value;
397      }
398    
399      return $frpubs;
400    }
401    
402    ########################################
403    # set Literature-string for subsystems #
404    ########################################
405    sub setLiteratures {
406      my ( $fig, $name, $newpubs ) = @_;
407    
408      my @values;
409      my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_PUBMED_RELEVANT" );
410    
411      foreach my $k ( @rel_lit_num ) {
412        my ( $ss, $key, $value ) = @$k;
413        $fig->delete_matching_attributes( "Subsystem:$name", "SUBSYSTEM_PUBMED_RELEVANT", $value );
414      }
415    
416      foreach my $np ( @$newpubs ) {
417        $fig->add_attribute( "Subsystem:$name", "SUBSYSTEM_PUBMED_RELEVANT", $np );
418      }
419    }
420    
421  sub supported_rights {  sub supported_rights {
422    
423    return [ [ 'edit', 'subsystem', '*' ] ];    return [ [ 'edit', 'subsystem', '*' ] ];

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3