[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.4, Thu Dec 13 21:17:21 2007 UTC revision 1.8, Fri Feb 29 17:50:02 2008 UTC
# Line 36  Line 36 
36  sub output {  sub output {
37    my ( $self ) = @_;    my ( $self ) = @_;
38    
   use Data::Dumper;  
   
39    my $fig = new FIG;    my $fig = new FIG;
40    my $cgi = $self->application->cgi;    my $cgi = $self->application->cgi;
41    
# Line 64  Line 62 
62      }      }
63    }    }
64    
65    if ( $user && $user->has_right( $self->application, 'edit', 'subsystem', $name ) ) {    if ( $user ) {
66        if ( $user->has_right( $self->application, 'edit', 'subsystem', $name ) ) {
67          $can_alter = 1;
68          $fig->set_user( $seeduser );
69        }
70        else {
71          # we might have the problem that the user has not yet got the right for editing the
72          # subsystem due to that it was created in the old seed or what do I know where.
73          my $curatorOfSS = $fig->subsystem_curator( $name );
74          my $su = lc( $seeduser );
75          my $cu = lc( $curatorOfSS );
76          if ( $su eq $cu ) {
77            # now set the rights...
78            my $right = $dbmaster->Rights->create( { name => 'edit',
79                                                     scope => $user->get_user_scope,
80                                                     data_type => 'subsystem',
81                                                     data_id => $name,
82                                                     granted => 1,
83                                                     delegated => 0 } );
84            if ( $right ) {
85      $can_alter = 1;      $can_alter = 1;
86      $fig->set_user( $seeduser );      $fig->set_user( $seeduser );
87    }    }
88          }
89        }
90      }
91    
92    ######################    ######################
93    # Construct the menu #    # Construct the menu #
94    ######################    ######################
# Line 156  Line 177 
177    my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );    my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );
178    
179    my $versionlink = '';    my $versionlink = '';
180  print STDERR $can_alter." CANALTER\n";  
181    if ( $can_alter ) {    if ( $can_alter ) {
182      $versionlink = " -- <A HREF='".$self->application->url()."?page=ResetSubsystem&subsystem=$name'>Reset to Previous Timestamp</A>";      $versionlink = " -- <A HREF='".$self->application->url()."?page=ResetSubsystem&subsystem=$name'>Reset to Previous Timestamp</A>";
     print STDERR $versionlink . " VL\n";  
183    }    }
184    
185    my $mod_time = get_mod_time( $name );    my $mod_time = get_mod_time( $name );
# Line 184  Line 204 
204      $classification_stuff .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";      $classification_stuff .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";
205    }    }
206    
     print STDERR $versionlink . " VL\n";  
207    my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD><TR>";    my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD><TR>";
208    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";
209    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";
# Line 293  Line 312 
312      my $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='hideme'>";      my $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='hideme'>";
313      my $optstring = '';      my $optstring = '';
314      foreach my $secc ( sort @{ $ssclass->{ $firstc } } ) {      foreach my $secc ( sort @{ $ssclass->{ $firstc } } ) {
315        if ( defined( $SUBSYSH2 ) && $SUBSYSH2 eq $secc ) {        if ( defined( $SUBSYSH2 ) && $SUBSYSH2 eq $secc && $SUBSYSH1 eq $firstc ) {
316          $optstring .= "<OPTION SELECTED VALUE='$secc'>$secc</OPTION>";          $optstring .= "<OPTION SELECTED VALUE='$secc'>$secc</OPTION>";
317          # we have to show the selectbox if there is a selected value          # we have to show the selectbox if there is a selected value
318          $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='showme'>";          $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='showme'>";

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3