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

Diff of /FigWebServices/HOPSS.cgi

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

revision 1.2, Sat Sep 24 14:46:41 2005 UTC revision 1.4, Tue Sep 27 13:16:34 2005 UTC
# Line 45  Line 45 
45  if (! $request)  if (! $request)
46  {  {
47      push(@$html,$cgi->br,      push(@$html,$cgi->br,
                 $cgi->h1("Welcome to <a href=Html/about_HOPSS.html target=help>HOPSS</a> database"),$cgi->br,  
48                  $cgi->h2("A Public Depository of Open Problems and Conjectures Identified by SubSystem analysis"),                  $cgi->h2("A Public Depository of Open Problems and Conjectures Identified by SubSystem analysis"),
49                    $cgi->h2("About <a href=Html/about_HOPSS.html target=help>HOPSS</a> database"),$cgi->br,
50                  "<br><br>"                  "<br><br>"
51           );           );
52    
# Line 104  Line 104 
104  sub update_problem {  sub update_problem {
105      my($fig,$cgi,$html,$problem) = @_;      my($fig,$cgi,$html,$problem) = @_;
106    
107        push(@$html,"<br><br><a href=HOPSS.cgi>Back to Summary</a>\n<br><br><br><hr>");
108      &write_problem($cgi,$problem);      &write_problem($cgi,$problem);
109      &update_form($fig,$cgi,$html,$problem);      &update_form($fig,$cgi,$html,$problem);
110        push(@$html,"<br><br><a href=HOPSS.cgi>Back to Summary</a>\n<br><br><br><hr>");
111  }  }
112    
113  sub update_form {  sub update_form {
# Line 121  Line 123 
123                    'Unresolved paralogs',                    'Unresolved paralogs',
124                    'other');                    'other');
125    
126        my $time_of_creation = &parameter($cgi,"time_of_creation");
127      my $type        = &parameter($cgi,"type");      my $type        = &parameter($cgi,"type");
128      my $title       = &parameter($cgi,'title');      my $title       = &parameter($cgi,'title');
129      my $subsystem   = &parameter($cgi,'subsystem');      my $subsystem   = &parameter($cgi,'subsystem');
# Line 134  Line 137 
137                  $cgi->hidden(-name => 'request', -value => 'update_problem', -override => 1),                  $cgi->hidden(-name => 'request', -value => 'update_problem', -override => 1),
138                  $cgi->hidden(-name => 'subsystem', -value => $subsystem, -override => 1),                  $cgi->hidden(-name => 'subsystem', -value => $subsystem, -override => 1),
139                  $cgi->hidden(-name => 'problem', -value => $problem, -override => 1),                  $cgi->hidden(-name => 'problem', -value => $problem, -override => 1),
140                    $cgi->hidden(-name => 'time_of_creation', -value => $time_of_creation, -override => 1),
141                  $cgi->br,                  $cgi->br,
142                  $cgi->br,                  $cgi->br,
143                  $cgi->br,                  $cgi->br,
# Line 202  Line 206 
206          {          {
207              $kv = &read_problem($problem );              $kv = &read_problem($problem );
208    
209                my $subsys_link = &subsys_link($cgi,&subsystem($kv));
210              push(@$tab,[              push(@$tab,[
211                          &problem_link($cgi,&title($kv),$problem),                          &problem_link($cgi,&title($kv),$problem),
212                          &subsystem($kv),                          $subsys_link,
213                          &type($kv),                          &type($kv),
214                          &time_of_creation($kv),                          &time_of_creation($kv),
215                          &who($kv),                          &who($kv),
# Line 212  Line 217 
217                          &num_comments($kv)                          &num_comments($kv)
218                          ]);                          ]);
219          }          }
220    
221          return &HTML::make_table($col_hdrs,[sort { ($a->[1] cmp $b->[1]) } @$tab],"Summary of Existing Problems and Conjectures");          return &HTML::make_table($col_hdrs,[sort { ($a->[1] cmp $b->[1]) } @$tab],"Summary of Existing Problems and Conjectures");
222      }      }
223      else      else
# Line 259  Line 265 
265  sub num_conjectures {  sub num_conjectures {
266      my($kv) = @_;      my($kv) = @_;
267    
268      my $x = @{$kv->{'conjecture'}};      my $x = $kv->{'conjecture'};
269      return $x ? scalar @$x : 0;      return $x ? scalar @$x : 0;
270  }  }
271    
272  sub num_comments {  sub num_comments {
273      my($kv) = @_;      my($kv) = @_;
274    
275      my $x = @{$kv->{'comment'}};      my $x = $kv->{'comment'};
276      return $x ? scalar @$x : 0;      return $x ? scalar @$x : 0;
277  }  }
278    
# Line 298  Line 304 
304    
305      my @existing = &problems;      my @existing = &problems;
306      my $new_prob = &next_id(\@existing);      my $new_prob = &next_id(\@existing);
307        my $timestamp = time;
308        $cgi->param(-name => 'time_of_creation', -value => $timestamp);
309      &write_problem($cgi,$new_prob);      &write_problem($cgi,$new_prob);
310  }  }
311    
# Line 315  Line 323 
323      open(NEW,">$FIG_Config::data/HOPSS/$new_prob/problem")      open(NEW,">$FIG_Config::data/HOPSS/$new_prob/problem")
324          || die "could not open $FIG_Config::data/HOPSS/$new_prob/problem";          || die "could not open $FIG_Config::data/HOPSS/$new_prob/problem";
325    
326        my $time_of_creation = &parameter($cgi,"time_of_creation");
327      my $type        = &parameter($cgi,'type');      my $type        = &parameter($cgi,'type');
328      my $title       = &parameter($cgi,'title');      my $title       = &parameter($cgi,'title');
329      my $subsystem   = &parameter($cgi,'subsystem');      my $subsystem   = &parameter($cgi,'subsystem');
# Line 326  Line 335 
335    
336      print NEW "ID\n$new_prob\n//\n";      print NEW "ID\n$new_prob\n//\n";
337    
338      print NEW "time_of_creation\n",time,"\n//\n";      print NEW "time_of_creation\n",$time_of_creation,"\n//\n";
339      print NEW "type\n$type\n//\n";      print NEW "type\n$type\n//\n";
340      print NEW "title\n$title\n//\n";      print NEW "title\n$title\n//\n";
341      print NEW "subsystem\n$subsystem\n//\n";      print NEW "subsystem\n$subsystem\n//\n";
# Line 377  Line 386 
386          {          {
387              foreach $_ (@val)              foreach $_ (@val)
388              {              {
389                  $_ =~ s/ /\n/g;  #               $_ =~ s/ //g;
390              }              }
391          }          }
392          else          else
# Line 390  Line 399 
399      {      {
400          my $val = $cgi->param($name);          my $val = $cgi->param($name);
401          $val = $val ? $val : "";          $val = $val ? $val : "";
402          $val =~ s/ /\n/g;  #       $val =~ s/ /\n/g;
403          return $val;          return $val;
404      }      }
405  }  }
# Line 439  Line 448 
448               );               );
449  }  }
450    
451    sub subsys_link {
452        my($cgi,$subsys) = @_;
453    
454        my $esc_sub = uri_escape($subsys);  # in URI::Escape
455        my %opts = (ssa_name => $esc_sub,
456                    request => 'show_ssa',
457                    show_clusters => 1,
458                    sort => 'by_phylo'
459                    );
460    
461        my $opts = join("&", map { "$_=$opts{$_}" } keys(%opts));
462        my $url = $cgi->a({href => "display_subsys.cgi?$opts"}, $subsys);
463        return $url;
464    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3