[Rt-commit] r13682 - in rt/3.8/trunk: share/html/Install

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Jun 28 20:05:05 EDT 2008


Author: sunnavy
Date: Sat Jun 28 20:05:05 2008
New Revision: 13682

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/share/html/Install/Basics.html
   rt/3.8/trunk/share/html/Install/DatabaseDetails.html
   rt/3.8/trunk/share/html/Install/DatabaseType.html
   rt/3.8/trunk/share/html/Install/Global.html
   rt/3.8/trunk/share/html/Install/Initialize.html
   rt/3.8/trunk/share/html/Install/Sendmail.html
   rt/3.8/trunk/share/html/Install/index.html

Log:
 r13948 at sunnavys-mb:  sunnavy | 2008-06-29 08:03:50 +0800
 rewrote the way errors shown


Modified: rt/3.8/trunk/share/html/Install/Basics.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/Basics.html	(original)
+++ rt/3.8/trunk/share/html/Install/Basics.html	Sat Jun 28 20:05:05 2008
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <&| Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 3, 7) . loc('Customize Basics') &> 
 
-<& /Elements/ListActions, actions => \@results &>
+<& Elements/Errors, Errors => \@errors &>
 
 <p>
 <&|/l&>
@@ -68,7 +68,7 @@
 
 
 <%init>
-my @results;
+my @errors;
 
 my @Types = qw/rtname WebDomain WebPort Password/;
 
@@ -79,11 +79,11 @@
             Meta => $RT::Installer->{Meta} );
     
     if ( $ARGS{WebPort} && $ARGS{WebPort} !~ /^\d+$/ ) {
-        push @results, loc("Invalid [_1]: it should be a number", 'WebPort');
+        push @errors, loc("Invalid [_1]: it should be a number", 'WebPort');
     }
 
     unless ( $ARGS{Password} ) {
-        push @results, loc("You must enter an Administrative password");
+        push @errors, loc("You must enter an Administrative password");
     }
 
     if ( $Back ) {
@@ -91,7 +91,7 @@
 'Install/DatabaseDetails.html');
     }
 
-    unless ( @results ) {
+    unless ( @errors ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
 'Install/Sendmail.html');
     }

Modified: rt/3.8/trunk/share/html/Install/DatabaseDetails.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/DatabaseDetails.html	(original)
+++ rt/3.8/trunk/share/html/Install/DatabaseDetails.html	Sat Jun 28 20:05:05 2008
@@ -47,18 +47,8 @@
 %# END BPS TAGGED BLOCK }}}
 <&| Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 2, 7 ) . loc('Check your database credentials') &> 
 
-<& /Elements/ListActions, actions => \@results &>
-
-% if ( $ConnectionSucceeded ) {
-
-<p>
-<&|/l&>
-We were able to find your database and connect as the DBA.  You can click on 'Customize Basics' to continue
-customizing RT.
-</&>
-
-% } else {
-
+% if ( @errors ) {
+<& Elements/Errors, Errors => \@errors &>
 <p>
 <&|/l&>Tell us a little about how to find the database RT will be using</&>
 <p>
@@ -74,6 +64,16 @@
 When you click on 'Check Database Connectivity' there may be a small delay while RT tries to connect to your
 database
 </&>
+
+% } else {
+<& /Elements/ListActions, actions => \@results &>
+
+<p>
+<&|/l&>
+We were able to find your database and connect as the DBA.  You can click on 'Customize Basics' to continue
+customizing RT.
+</&>
+
 % }
 
 <form method="post">
@@ -89,7 +89,7 @@
                     &>
 <input type="hidden" name="Run" value="1">
 
-% if ( $ConnectionSucceeded ) {
+% unless ( @errors ) {
 <& /Elements/Submit, Label => loc('Next: ') . loc('Customize Basics'),
 Back => 1, BackLabel => loc('Back: ') . loc('Select Database Type'),
 Name => 'Next' &>
@@ -103,7 +103,7 @@
 </&>
 
 <%init>
-my @results;
+my (@results, @errors);
 my $ConnectionSucceeded;
 
 my @Types = 'DatabaseName';
@@ -189,7 +189,7 @@
         }
         else {
             $RT::Installer->{DatabaseAction} = 'error';
-            push @results, loc("Failed to connect to database: [_1]",
+            push @errors, loc("Failed to connect to database: [_1]",
                     $DBI::errstr );
         }
     }
@@ -197,8 +197,6 @@
         push @results, loc($msg);
     }
 
-$ConnectionSucceeded =
-    ( @results && $results[0] eq loc('Connection succeeded') ) ? 1 : 0;
 }
 
 </%init>

Modified: rt/3.8/trunk/share/html/Install/DatabaseType.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/DatabaseType.html	(original)
+++ rt/3.8/trunk/share/html/Install/DatabaseType.html	Sat Jun 28 20:05:05 2008
@@ -47,8 +47,6 @@
 %# END BPS TAGGED BLOCK }}}
 <&|Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 1, 7 ) . loc('Choose a database engine') &>
 
-<& /Elements/ListActions, actions => \@results &>
-
 <div class="intro">
 <p>
 <&|/l&>
@@ -84,7 +82,6 @@
 </&>
 <%init>
 
-my @results;
 my @Types = 'DatabaseType';
 
 if ( $Run ) {

Modified: rt/3.8/trunk/share/html/Install/Global.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/Global.html	(original)
+++ rt/3.8/trunk/share/html/Install/Global.html	Sat Jun 28 20:05:05 2008
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <&| Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 5, 7 ) . loc('Customize Email Addresses') &> 
 
-<& /Elements/ListActions, actions => \@results &>
+<& Elements/Errors, Errors => \@errors &>
 
 <p><&|/l&>Help us set up some useful defaults for RT.</&></p>
 
@@ -73,7 +73,7 @@
 </form>
 </&>
 <%init>
-my @results;
+my @errors;
 
 my @Types = qw/CommentAddress CorrespondAddress Timezone/;
 
@@ -90,13 +90,13 @@
 
     for ( qw/CommentAddress CorrespondAddress/ ) {
         if ( $ARGS{$_} && $ARGS{$_} !~ /.+ at .+/ ) {
-            push @results,
+            push @errors,
                 loc("Invalid [_1]: '[_2]' doesn't look like an email address",
                 $_, $ARGS{$_});
         }
     }
 
-    unless ( @results ) {
+    unless ( @errors ) {
         my ( $status, $msg ) = RT::Installer->SaveConfig;
 
         if ( $status ) {
@@ -113,7 +113,7 @@
             }
         }
         else {
-            push @results, loc($msg);
+            push @errors, loc($msg);
         }
     }
 }

Modified: rt/3.8/trunk/share/html/Install/Initialize.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/Initialize.html	(original)
+++ rt/3.8/trunk/share/html/Install/Initialize.html	Sat Jun 28 20:05:05 2008
@@ -47,9 +47,9 @@
 %# END BPS TAGGED BLOCK }}}
 <&|Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 6, 7) . loc('Initialize Database') &> 
 
-<& /Elements/ListActions, actions => \@results &>
+<& Elements/Errors, Errors => \@errors &>
 
-% unless ( @results ) {
+% unless ( @errors ) {
 <div>
 <&|/l&>Click "Initialize Database" to create RT's database and insert initial metadata. This may take a few moments</&>
 </div>
@@ -62,7 +62,7 @@
 </form>
 </&>
 <%init>
-my @results;
+my @errors;
 if ( $Run ) {
     if ( $Back ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
@@ -84,7 +84,7 @@
     if ( $actions[0] eq 'create' ) {
         ($status, $msg) = RT::Handle->CreateDatabase( $sysdbh );
         unless ( $status ) {
-            push @results, loc('ERROR: [_1]', $msg );
+            push @errors, loc('ERROR: [_1]', $msg );
         }
 
         shift @actions; # shift the 'create' action since its job is done.
@@ -121,13 +121,13 @@
                 ($status, $msg) = $RT::Handle->InsertData( $file );
             }
             unless ( $status ) {
-                push @results, loc('ERROR: [_1]', $msg);
+                push @errors, loc('ERROR: [_1]', $msg);
                 last;
             }
         }
     }
 
-    unless ( @results ) {
+    unless ( @errors ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
 'Install/Finish.html');
     }

Modified: rt/3.8/trunk/share/html/Install/Sendmail.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/Sendmail.html	(original)
+++ rt/3.8/trunk/share/html/Install/Sendmail.html	Sat Jun 28 20:05:05 2008
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <&|Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 4, 7 ) . loc('Email Configuration') &> 
 
-<& /Elements/ListActions, actions => \@results &>
+<& Elements/Errors, Errors => \@errors &>
 
 <p>
 <&|/l&>
@@ -69,7 +69,7 @@
 </form>
 </&>
 <%init>
-my @results;
+my @errors;
 
 my @Types = qw/SendmailPath OwnerEmail/;
 
@@ -86,17 +86,17 @@
 
 
     unless ( -e $ARGS{SendmailPath} ) {
-        push @results, loc( "[_1] doesn't exist.", $ARGS{SendmailPath} );
+        push @errors, loc( "[_1] doesn't exist.", $ARGS{SendmailPath} );
     }
 
     if ( ! $ARGS{OwnerEmail} || $ARGS{OwnerEmail} !~ /.+ at .+/ ) {
-        push @results,
+        push @errors,
             loc("Invalid [_1]: that doesn't look like an email address",
             'Administrator Email');
     }
 
 
-    unless ( @results ) {
+    unless ( @errors ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
 'Install/Global.html');
     }

Modified: rt/3.8/trunk/share/html/Install/index.html
==============================================================================
--- rt/3.8/trunk/share/html/Install/index.html	(original)
+++ rt/3.8/trunk/share/html/Install/index.html	Sat Jun 28 20:05:05 2008
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <&| Elements/Wrapper, Title => loc('Welcome to RT!') &>
 
-<& /Elements/ListActions, actions => \@results &>
+<& Elements/Errors, Errors => \@errors &>
 
 % if ( !$locked) {
 
@@ -85,13 +85,13 @@
 % }
 </&>
 <%init>
-my @results;
+my @errors;
 my $locked;
     my $file = File::Spec->catfile( $RT::EtcPath, 'RT_SiteConfig.pm' );
     $locked = 1 unless -w $file;
     
     if ( $locked ) {
-        push @results, loc("Config file [_1] is locked", $file);
+        push @errors, loc("Config file [_1] is locked", $file);
     }
     elsif ( $Run ) {
         $RT::Installer->{InstallConfig} ||= {};


More information about the Rt-commit mailing list