[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.9, Wed Mar 12 16:14:39 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 77  Line 98 
98    # Build nice tab menu here    # Build nice tab menu here
99    $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$name" );    $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$name" );
100    $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$name" );    $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$name" );
101    $menu->add_category( 'Subsystem Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$name" );    $menu->add_category( 'Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$name" );
102    $menu->add_category( 'Subsystem Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$name" );    $menu->add_category( 'Illustrations', "SubsysEditor.cgi?page=ShowIllustrations&subsystem=$name" );
103    $menu->add_category( 'Subsystem Check', "SubsysEditor.cgi?page=ShowCheck&subsystem=$name" );    $menu->add_category( 'Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$name" );
104    $menu->add_category( 'Subsystem Tree', "SubsysEditor.cgi?page=ShowTree&subsystem=$name" );    $menu->add_category( 'Show Check', "SubsysEditor.cgi?page=ShowCheck&subsystem=$name" );
105      $menu->add_category( 'Show Tree', "SubsysEditor.cgi?page=ShowTree&subsystem=$name" );
106    
107    
108    ##############################    ##############################
# Line 156  Line 178 
178    my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );    my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );
179    
180    my $versionlink = '';    my $versionlink = '';
181  print STDERR $can_alter." CANALTER\n";  
182    if ( $can_alter ) {    if ( $can_alter ) {
183      $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";  
184    }    }
185    
186    my $mod_time = get_mod_time( $name );    my $mod_time = get_mod_time( $name );
# Line 184  Line 205 
205      $classification_stuff .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";      $classification_stuff .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";
206    }    }
207    
     print STDERR $versionlink . " VL\n";  
208    my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD><TR>";    my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD><TR>";
209    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";
210    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";
# Line 293  Line 313 
313      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'>";
314      my $optstring = '';      my $optstring = '';
315      foreach my $secc ( sort @{ $ssclass->{ $firstc } } ) {      foreach my $secc ( sort @{ $ssclass->{ $firstc } } ) {
316        if ( defined( $SUBSYSH2 ) && $SUBSYSH2 eq $secc ) {        if ( defined( $SUBSYSH2 ) && $SUBSYSH2 eq $secc && $SUBSYSH1 eq $firstc ) {
317          $optstring .= "<OPTION SELECTED VALUE='$secc'>$secc</OPTION>";          $optstring .= "<OPTION SELECTED VALUE='$secc'>$secc</OPTION>";
318          # we have to show the selectbox if there is a selected value          # we have to show the selectbox if there is a selected value
319          $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.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3