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

Diff of /FigWebServices/get_dlit.cgi

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

revision 1.1, Sun May 25 01:15:52 2008 UTC revision 1.5, Sat Jun 28 12:12:22 2008 UTC
# Line 26  Line 26 
26  use CGI;  use CGI;
27  my $cgi = new CGI;  my $cgi = new CGI;
28    
 my $user = $cgi->param('user');  
   
 $fig->set_user($user);  
29    
30  if (0)  if (0)
31  {  {
# Line 36  Line 33 
33      eval(join("",`cat /tmp/get_dlit_parms`));      eval(join("",`cat /tmp/get_dlit_parms`));
34      $cgi = $VAR1;      $cgi = $VAR1;
35      print STDERR &Dumper($cgi);      print STDERR &Dumper($cgi);
     exit;  
36  }  }
37    
38  if (0)  if (0)
# Line 63  Line 59 
59    
60  my $html = [];  my $html = [];
61  unshift @$html, "<TITLE>Get Dlits</TITLE>\n";  unshift @$html, "<TITLE>Get Dlits</TITLE>\n";
62    push(@$html,$cgi->h1("You should be using get_dlits.cgi -- add an 's' and try again"));
63    &HTML::show_page($cgi,$html);
64    exit;
65    #######
66    
67    my $user = $cgi->param('user');
68  my $curator = $cgi->param('curator');  my $curator = $cgi->param('curator');
69  my $roleN   = $cgi->param('roleN');  my $roleN   = $cgi->param('roleN');
70    if ($roleN) { $roleN =~ s/^(\d+)\t.*$/$1/; }
71  my @checked = $cgi->param('checked');  my @checked = $cgi->param('checked');
72    
73  if (! $user)  if (! $user)
# Line 79  Line 82 
82  {  {
83      if (opendir(CUR,"$FIG_Config::data/DlitByCurator/ByCurator"))      if (opendir(CUR,"$FIG_Config::data/DlitByCurator/ByCurator"))
84      {      {
85          my @cur = grep { $_ !~ /^\./ } readdir(CUR);          my @cur = sort grep { $_ !~ /^\./ } readdir(CUR);
86          my $curN = @cur;          my $curN = @cur;
87          push(@$html, $cgi->start_form(-action => "get_dlit.cgi", -method => 'post'),          push(@$html, $cgi->start_form(-action => "get_dlit.cgi", -method => 'post'),
88                       $cgi->hidden(-name => 'user', -value=>$user),                       $cgi->hidden(-name => 'user', -value=>$user),
# Line 99  Line 102 
102  {  {
103      if (opendir(CUR,"$FIG_Config::data/DlitByCurator/ByCurator/$curator"))      if (opendir(CUR,"$FIG_Config::data/DlitByCurator/ByCurator/$curator"))
104      {      {
105          my @roles    = grep { $_ !~ /^\./ } readdir(CUR);          my @roles    = sort grep { $_ !~ /^\./ } readdir(CUR);
106          push(@$html, $cgi->start_form(-action => "get_dlit.cgi", -method => 'post'),          my %rolesH = map { $_ => 1 } @roles;
107            my @rolesE = map { $_ =~ /^(\d+)\t(\S.*\S)/; $rolesH{$1} ? [$1,$2] : () }
108                         `cat $FIG_Config::data/DlitByCurator/index.of.roles`;
109            my @rolesV = map { $_->[0] } @rolesE;
110            my %role_map = map { $_->[0] => $_->[1] } @rolesE;
111    
112            push(@$html, $cgi->start_form(-action => "get_dlit.cgi", -method => 'post', -target => '_blank'),
113                       $cgi->hidden(-name => 'user', -value=>$user),                       $cgi->hidden(-name => 'user', -value=>$user),
114                       $cgi->hidden(-name => 'curator', -value=>$curator),                       $cgi->hidden(-name => 'curator', -value=>$curator),
115                       "Pick one<br>",                       "Pick one<br>",
116                        $cgi->scrolling_list( -name   => 'roleN',                        $cgi->scrolling_list( -name   => 'roleN',
117                                              -values => [ @roles ],                                              -values => [ sort @rolesV ],
118                                                -labels => \%role_map,
119                                              -size   => 20                                              -size   => 20
120                                              ),                                              ),
121                   $cgi->br,                   $cgi->br,
# Line 130  Line 140 
140              my $check = $cgi->checkbox(-name => 'checked', -value => "$peg:$pubmed", -checked => 0, -override => 1, -label => '');              my $check = $cgi->checkbox(-name => 'checked', -value => "$peg:$pubmed", -checked => 0, -override => 1, -label => '');
141              push(@$tab,[$check,              push(@$tab,[$check,
142                          $role,                          $role,
143                          "<a href=http://www.ncbi.nlm.nih.gov/sites/entrez?db=pubmed&cmd=search&term=$pubmed>$pubmed</a>",                          "<a target=_blank href=http://www.ncbi.nlm.nih.gov/sites/entrez?db=pubmed&cmd=search&term=$pubmed>$pubmed</a>",
144                          &HTML::fid_link($cgi,$peg),                          &HTML::fid_link($cgi,$peg),
145                          $gs,                          $gs,
146                          &HTML::sp_link($cgi,"sp|$sp"),                          &HTML::sp_link($cgi,"sp|$sp"),
# Line 158  Line 168 
168          foreach $_ (@checked)          foreach $_ (@checked)
169          {          {
170              $_ =~ s/:/\t/;              $_ =~ s/:/\t/;
171              print DLITS "$_\n";              print DLITS "$_\t$user\n";
172          }          }
173          close(DLITS);          close(DLITS);
174      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3