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

Diff of /FigWebServices/ssa2.cgi

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

revision 1.7, Mon Apr 26 11:54:25 2004 UTC revision 1.8, Tue May 4 18:19:55 2004 UTC
# Line 83  Line 83 
83      {      {
84          &show_ssa_noload($fig,$cgi,$html);          &show_ssa_noload($fig,$cgi,$html);
85      }      }
86      elsif ($request eq "delete_or_export_ssa")      #
87        # Note that this is a little different; I added another submit button
88        # to the delete_or_export_ssa form, so have to distinguish between them
89        # here based on $cgi->param('delete_export') - the original button,
90        # or $cgi->param('publish') - the new one.
91        #
92        elsif ($request eq "delete_or_export_ssa" and
93               defined($cgi->param('delete_export')))
94      {      {
95          my($ssa,$exported);          my($ssa,$exported);
96          $exported = 0;          $exported = 0;
# Line 105  Line 112 
112    
113          foreach $ssa ($cgi->param('delete'))          foreach $ssa ($cgi->param('delete'))
114          {          {
115              system "rm -rf $FIG_Config::data/Subsystems/$ssa";              system "rm -rf $fig_config::data/subsystems/$ssa";
116          }          }
117    
118          if (! $exported)          if (! $exported)
# Line 118  Line 125 
125              exit;              exit;
126          }          }
127      }      }
128        elsif ($request eq "delete_or_export_ssa" and
129               defined($cgi->param('publish')))
130        {
131            my($ssa,$exported);
132            my($ch) = $fig->get_clearinghouse();
133    
134            print $cgi->header;
135    
136            if (!defined($ch))
137            {
138                print "cannot publish: clearinghouse not available\n";
139                exit;
140            }
141    
142            foreach $ssa ($cgi->param('publish_to_clearinghouse'))
143            {
144                print "<h2>Publishing $ssa to clearinghouse...</h2>\n";
145                $| = 1;
146                print "<pre>\n";
147                my $res = $fig->publish_subsystem_to_clearinghouse($ssa);
148                print "</pre>\n";
149                if ($res)
150                {
151                    print "Published <i>$ssa </i> to clearinghouse<br>\n";
152                }
153                else
154                {
155                    print "<b>Failed</b> to publish <i>$ssa</i> to clearinghouse<br>\n";
156                }
157            }
158            exit;
159        }
160      elsif ($request eq "new_ssa")      elsif ($request eq "new_ssa")
161      {      {
162          &new_ssa($fig,$cgi,$html);          &new_ssa($fig,$cgi,$html);
# Line 1065  Line 1104 
1104      my($cgi,$html,$user,$ssaP) = @_;      my($cgi,$html,$user,$ssaP) = @_;
1105      my($ssa,$curator);      my($ssa,$curator);
1106      my($url1,$link1);      my($url1,$link1);
1107        my($publish_checkbox);
1108    
1109      my $can_alter = $cgi->param('can_alter');      my $can_alter = $cgi->param('can_alter');
1110      push(@$html, $cgi->start_form(-action => "ssa2.cgi",      push(@$html, $cgi->start_form(-action => "ssa2.cgi",
# Line 1084  Line 1124 
1124           $cgi->br           $cgi->br
1125          );          );
1126    
1127      my $col_hdrs = ["Export Full Subsystem","Export Just Assignments","Reset to Previous Timestamp","Delete","Name","Curator","Exchangable","Version"];      my $col_hdrs = [
1128                        "Name","Curator","Exchangable","Version",
1129                        "Reset to Previous Timestamp","Delete",
1130                        "Export Full Subsystem","Export Just Assignments", "Publish to Clearinghouse",
1131                        ];
1132      my $title    = "Existing Subsystem Annotations";      my $title    = "Existing Subsystem Annotations";
1133      my $tab = [];      my $tab = [];
1134      foreach $_ (@$ssaP)      foreach $_ (@$ssaP)
# Line 1116  Line 1160 
1160              $link1 = "";              $link1 = "";
1161          }          }
1162    
1163          push(@$tab,[$cgi->checkbox(-name => "export", -value => $ssa),          #
1164                      $cgi->checkbox(-name => "export_assignments", -value => $ssa),          # Only allow publish for subsystems we are curating?
1165                      $link,          #
1166                      ($curator eq $cgi->param('user')) ? $cgi->checkbox(-name => "delete", -value => $ssa) : "",          if (1 or $curator eq $cgi->param('user'))
1167            {
1168                $publish_checkbox = $cgi->checkbox(-name => "publish_to_clearinghouse",
1169                                                   -value => $ssa,
1170                                                   -label => "Publish"),
1171    
1172            }
1173    
1174            push(@$tab,[
1175                      &ssa_link($ssa,$user),                      &ssa_link($ssa,$user),
1176                      $curator,                      $curator,
1177                      $link1,                      $link1,
1178                      $fig->subsystem_version($ssa)                      $fig->subsystem_version($ssa),
1179                        $link,
1180                        ($curator eq $cgi->param('user')) ? $cgi->checkbox(-name => "delete", -value => $ssa) : "",
1181                        $cgi->checkbox(-name => "export", -value => $ssa, -label => "Export full"),
1182                        $cgi->checkbox(-name => "export_assignments", -value => $ssa, -label => "Export assignments"),
1183                        $publish_checkbox,
1184                      ]);                      ]);
1185      }      }
1186      push(@$html,&HTML::make_table($col_hdrs,$tab,$title),      push(@$html,
1187                           $cgi->submit('delete or export checked entries'),           &HTML::make_table($col_hdrs,$tab,$title),
1188             $cgi->submit(-name => 'delete_export',
1189                          -label => 'Process marked deletions and exports'),
1190             $cgi->submit(-name => 'publish',
1191                          -label => "Publish marked subsystems"),
1192                           $cgi->end_form                           $cgi->end_form
1193           );           );
1194  }  }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3