[Rt-commit] r14601 - in rt/branches/3.999-DANGEROUS: share/html/Install

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Jul 29 12:22:07 EDT 2008


Author: sunnavy
Date: Tue Jul 29 12:22:06 2008
New Revision: 14601

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/share/html/Install/Basics.html
   rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseDetails.html
   rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseType.html
   rt/branches/3.999-DANGEROUS/share/html/Install/Finish.html
   rt/branches/3.999-DANGEROUS/share/html/Install/Global.html
   rt/branches/3.999-DANGEROUS/share/html/Install/Initialize.html
   rt/branches/3.999-DANGEROUS/share/html/Install/Sendmail.html
   rt/branches/3.999-DANGEROUS/share/html/Install/autohandler
   rt/branches/3.999-DANGEROUS/share/html/Install/index.html

Log:
 r15066 at sunnavys-mb:  sunnavy | 2008-07-30 00:19:20 +0800
 refacotr form below /Install/ to use actions


Modified: rt/branches/3.999-DANGEROUS/share/html/Install/Basics.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/Basics.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/Basics.html	Tue Jul 29 12:22:06 2008
@@ -47,55 +47,21 @@
 %# END BPS TAGGED BLOCK }}}
 <&| Elements/Wrapper, title => _('Step %1 of %2: ', 3, 7) . _('Customize Basics') &> 
 
-<& Elements/Errors, errors => \@errors &>
-
 <p>
 <&|/l&>These configuration options cover some of the basics needed to get RT up and running.  We need to know the name of your RT installation and the domain name where RT will live.  You will also need to set a password for your defauly administrative user.</&>
 </p>
 
-<form method="post">
-<& /Widgets/BulkEdit, types => \@Types,meta => $RT::Installer->{Meta},
-    current_value => RT::Installer->current_values(@Types) &>
-
-<input type="hidden" name="run" value="1">
-<& /Elements/Submit, label => _('Next: ') . _('Customize Email Configuration'),back => 1, back_label => _('Back: ' ) . _( 'Customize Database Details') &>
-</form>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/Install/Sendmail.html' ) %>
+% for my $field ( @fields ) {
+<% $action->form_field( $field ) %>
+% }
+<% Jifty->web->form->submit( label => _('Email Configuration')) %>
+<% Jifty->web->form->end %>
 </&>
 
 
 <%init>
-my @errors;
-
-my @Types = qw/rtname WebDomain WebPort Password/;
-
-if ( $run ) {
-
-    $m->comp('/Widgets/BulkProcess', types => \@Types, arguments => \%ARGS,
-            store => $RT::Installer->{InstallConfig},
-            meta => $RT::Installer->{Meta} );
-    
-    if ( $ARGS{web_port} && $ARGS{web_port} !~ /^\d+$/ ) {
-        push @errors, _("Invalid %1: it should be a number", 'WebPort');
-    }
-
-    unless ( $ARGS{password} ) {
-        push @errors, _("You must enter an Administrative password");
-    }
-
-    if ( $back ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/DatabaseDetails.html');
-    }
-
-    unless ( @errors ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Sendmail.html');
-    }
-}
-
+my $action = Jifty->web->new_action( class => 'Install' );
+my @fields = qw/rtname web_domain web_port password/;
 </%init>
-
-<%args>
-$run => undef
-$back => undef
-</%args>

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseDetails.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseDetails.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseDetails.html	Tue Jul 29 12:22:06 2008
@@ -65,132 +65,110 @@
 
 % }
 
-<form method="post">
-<& /Widgets/BulkEdit, types => \@Types, meta => $RT::Installer->{Meta},
-    current_value => { %{RT::Installer->current_values(@Types)},
-        database_admin =>
-            RT::Installer->current_value( 'DatabaseAdmin' ) ||
-            $RT::Installer->{InstallConfig}{DatabaseAdmin} ||
-            ( $db_type eq 'mysql' ? 'root'
-              : $db_type eq 'Pg' ? 'postgres'
-              : '' ),
-        }
-                    &>
-<input type="hidden" name="run" value="1">
-
-% if ( @results && !@errors ) {
-<& /Elements/Submit, label => _('Next: ') . _('Customize Basics'),
-back => 1, back_label => _('Back: ') . _('Select Database Type'),
-name => 'next' &>
-% } else {
-<& /Elements/Submit, label => _('Check Database Connectivity'),
-back => 1, back_label => _('Back: ') . _('Select Database Type')
-&>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/Install/Basics.html' ) %>
+% for my $field ( @fields ) {
+<% $action->form_field( $field ) %>
 % }
-
-</form>
+<% Jifty->web->form->submit( label => 'Next' ) %>
+<% Jifty->web->form->end %>
 </&>
 
 <%init>
-my (@results, @errors);
-my $ConnectionSucceeded;
-
-my @Types = 'DatabaseName';
-
-my $db_type = $RT::Installer->{InstallConfig}{DatabaseType};
-
-unless ( $db_type eq 'SQLite' ) {
-    push @Types, 'DatabaseHost', 'DatabasePort', 'DatabaseAdmin',
-        'DatabaseAdminPassword', 'DatabaseUser', 'DatabasePassword';
+my $action = Jifty->web->new_action( class => 'Install' );
+my @fields = 'database_name';
+my $db_type = $RT::Installer->{config}{database_type};
+
+if ( $db_type ne 'SQLite' ) {
+    push @fields, 'database_host', 'database_port', 'database_admin',
+         'database_admin_password', 'database_user', 'database_password';
 }
+
 if ( $db_type eq 'Pg' ) {
-    push @Types, 'DatabaseRequireSSL';
+    push @fields, 'DatabaseRequireSSL';
 }
 
 
-if ( $run ) {
-
-    $m->comp('/Widgets/BulkProcess', types => \@Types, arguments => \%ARGS, 
-            store => $RT::Installer->{InstallConfig}, 
-            meta => $RT::Installer->{Meta}, keep_undef => 1 ); 
-    if ( $back ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/DatabaseType.html');
-    }
-    
-    if ( $ARGS{next} ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Basics.html');
-    }
-    my ( $status, $msg ) = RT::Installer->save_config;
-    if ( $status ) {
-        delete $INC{'RT_SiteConfig.pm'};
-        RT->load_config;
-        RT::Handle->finalize_database_type();
-    # dba connect systemdsn
-        my $dbh = DBI->connect(
-            RT::Handle->system_dsn, $ARGS{database_admin}, $ARGS{database_admin_password}, { RaiseError => 0, PrintError => 0 },
-        );
-    
-        if ( $dbh ) {
-            push @results, _('Connection succeeded');
-            # dba connect dsn, which has table info
-            $dbh = DBI->connect(
-                RT::Handle->DSN, $ARGS{database_admin}, $ARGS{database_admin_password}, { RaiseError => 0, PrintError => 0 },
-            );
-    
-            if ( $dbh ) {
-                # check if table Users exists
-                eval {
-                    my $dbh = DBI->connect(
-                        RT::Handle->DSN,
-                        $ARGS{database_admin},
-                        $ARGS{database_admin_password},
-                        { RaiseError => 1, PrintError => 0 },
-                    );
-
-                    my $sth = $dbh->prepare('select * from Users');
-                };
-
-                unless ( $@ ) {
-    
-                    my $sth = $dbh->prepare('select id from Users where Name=?');
-                    $sth->execute('RT_System'); 
-                    if ( $sth->fetchrow_array ) {
-                        $RT::Installer->{DatabaseAction} = 'none';
-                        push @results, _("%1 appears to be fully initialized.  We won't need to create any tables or insert metadata, but you can continue to customez RT by clicking 'Customize Basics' below", $RT::DatabaseName);
-                    }
-                    else {
-                        $RT::Installer->{DatabaseAction} = 'acl,coredata,insert';
-                        push @results, _("%1 already exists and has RT's tables in place, but does not contain RT's metadata. The 'Initialize Database' step later on can insert metadata into this existing database. If this is acceptable, click 'Customize Basics' below to continue customizing RT.", $RT::DatabaseName);
-                    }
-                }
-                else {
-                    $RT::Installer->{DatabaseAction} = 'schema,acl,coredata,insert';
-                    push @results, _("%1 already exists, but does not contain RT's tables or metadata. The 'Initialize Database' step later on can insert tables and metadata into this existing database. if this is acceptable, click 'Customize Basic' below to continue customizing RT.", $RT::DatabaseName );
-                }
-
-            }
-            else {
-                $RT::Installer->{DatabaseAction} =
-    'create,schema,acl,coredata,insert';
-            }
-        }
-        else {
-            $RT::Installer->{DatabaseAction} = 'error';
-            push @errors, _("Failed to connect to database: %1",
-                    $DBI::errstr );
-        }
-    }
-    else {
-        push @results, _($msg);
-    }
-
-}
+my (@results, @errors);
+#my $ConnectionSucceeded;
+#if ( $run ) {
+#
+#    $m->comp('/Widgets/BulkProcess', types => \@Types, arguments => \%ARGS, 
+#            store => $RT::Installer->{InstallConfig}, 
+#            meta => $RT::Installer->{Meta}, keep_undef => 1 ); 
+#    if ( $back ) {
+#        RT::Interface::Web::redirect(RT->config->get('WebURL') .
+#'Install/DatabaseType.html');
+#    }
+#    
+#    if ( $ARGS{next} ) {
+#        RT::Interface::Web::redirect(RT->config->get('WebURL') .
+#'Install/Basics.html');
+#    }
+#    my ( $status, $msg ) = RT::Installer->save_config;
+#    if ( $status ) {
+#        delete $INC{'RT_SiteConfig.pm'};
+#        RT->load_config;
+#        RT::Handle->finalize_database_type();
+#    # dba connect systemdsn
+#        my $dbh = DBI->connect(
+#            RT::Handle->system_dsn, $ARGS{database_admin}, $ARGS{database_admin_password}, { RaiseError => 0, PrintError => 0 },
+#        );
+#    
+#        if ( $dbh ) {
+#            push @results, _('Connection succeeded');
+#            # dba connect dsn, which has table info
+#            $dbh = DBI->connect(
+#                RT::Handle->DSN, $ARGS{database_admin}, $ARGS{database_admin_password}, { RaiseError => 0, PrintError => 0 },
+#            );
+#    
+#            if ( $dbh ) {
+#                # check if table Users exists
+#                eval {
+#                    my $dbh = DBI->connect(
+#                        RT::Handle->DSN,
+#                        $ARGS{database_admin},
+#                        $ARGS{database_admin_password},
+#                        { RaiseError => 1, PrintError => 0 },
+#                    );
+#
+#                    my $sth = $dbh->prepare('select * from Users');
+#                };
+#
+#                unless ( $@ ) {
+#    
+#                    my $sth = $dbh->prepare('select id from Users where Name=?');
+#                    $sth->execute('RT_System'); 
+#                    if ( $sth->fetchrow_array ) {
+#                        $RT::Installer->{DatabaseAction} = 'none';
+#                        push @results, _("%1 appears to be fully initialized.  We won't need to create any tables or insert metadata, but you can continue to customez RT by clicking 'Customize Basics' below", $RT::DatabaseName);
+#                    }
+#                    else {
+#                        $RT::Installer->{DatabaseAction} = 'acl,coredata,insert';
+#                        push @results, _("%1 already exists and has RT's tables in place, but does not contain RT's metadata. The 'Initialize Database' step later on can insert metadata into this existing database. If this is acceptable, click 'Customize Basics' below to continue customizing RT.", $RT::DatabaseName);
+#                    }
+#                }
+#                else {
+#                    $RT::Installer->{DatabaseAction} = 'schema,acl,coredata,insert';
+#                    push @results, _("%1 already exists, but does not contain RT's tables or metadata. The 'Initialize Database' step later on can insert tables and metadata into this existing database. if this is acceptable, click 'Customize Basic' below to continue customizing RT.", $RT::DatabaseName );
+#                }
+#
+#            }
+#            else {
+#                $RT::Installer->{DatabaseAction} =
+#    'create,schema,acl,coredata,insert';
+#            }
+#        }
+#        else {
+#            $RT::Installer->{DatabaseAction} = 'error';
+#            push @errors, _("Failed to connect to database: %1",
+#                    $DBI::errstr );
+#        }
+#    }
+#    else {
+#        push @results, _($msg);
+#    }
+#
+#}
 
 </%init>
-
-<%args>
-$run => undef
-$back => undef
-</%args>

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseType.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseType.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/DatabaseType.html	Tue Jul 29 12:22:06 2008
@@ -62,29 +62,13 @@
 </p>
 </div>
 
-<form method="post">
-<& /Widgets/BulkEdit, types => \@Types, meta => $RT::Installer->{Meta},
-    current_value => RT::Installer->current_values(@Types) &>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/Install/DatabaseDetails.html' ) %>
+<% $action->form_field( 'database_type' ) %>
+<% Jifty->web->form->submit( label => 'Next' ) %>
+<% Jifty->web->form->end %>
 
-<input type="hidden" name="run" value="1">
-<& /Elements/Submit, label => _('Next: ') . _( 'Check your database credentials') &>
-</form>
 </&>
 <%init>
-
-my @Types = 'DatabaseType';
-
-if ( $run ) {
-
-    $m->comp('/Widgets/BulkProcess', types => \@Types, arguments => \%ARGS, meta
-            => $RT::Installer->{Meta}, store => $RT::Installer->{InstallConfig} );
-
-    RT::Interface::Web::redirect(RT->config->get('WebURL') .  'Install/DatabaseDetails.html');
-}
-
-
+my $action = Jifty->web->new_action( class => 'Install' );
 </%init>
-
-<%args>
-$run => undef
-</%args>

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/Finish.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/Finish.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/Finish.html	Tue Jul 29 12:22:06 2008
@@ -65,26 +65,14 @@
 </p>
 </div>
 
-<form method="post">
-<input type="hidden" value="1" name="run" />
-<& /Elements/Submit, label => 'Finish Installation' &>
-</form>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/' ) %>
+<% $action->hidden( 'finish' ) %>
+<% Jifty->web->form->submit( label => _('Finish')) %>
+<% Jifty->web->form->end %>
 
 </&>
 <%init>
-if ( $run ) {
-    RT->install_mode(0);
-    RT->init_system_objects();
-    RT->init();
-
-    my $root = RT::Model::User->new( RT->system_user );
-    $root->load('root');
-    $root->set_password( $RT::Installer->{InstallConfig}{Password} );
-
-    RT::Interface::Web::redirect(RT->config->get('WebURL'));
-}
+my $action = Jifty->web->new_action( class => 'Install' );
+my @fields = 'finish';
 </%init>
-
-<%args>
-$run => undef
-</%args>

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/Global.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/Global.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/Global.html	Tue Jul 29 12:22:06 2008
@@ -45,75 +45,27 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<&| Elements/Wrapper, title => _('Step %1 of %2: ', 5, 7 ) . _('Customize Email Addresses') &> 
-
-<& Elements/Errors, errors => \@errors &>
+<&| Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 5, 7 ) . loc('Customize Email Addresses') &> 
 
 <p><&|/l&>Help us set up some useful defaults for RT.</&></p>
 
 <p><&|/l&>When RT sends an email it sets the From: and Reply-To: headers so users can add to the conversation by just hitting Reply in their mail client.  It uses different addresses for Replies and Comments.  These can be changed for each of your queues.  These addresses will need to be configured to use the <tt>rt-mailgate</tt> program.</&></p>
 
 <p><&|/l&>By default, RT will use the timezone of your system.  This lets you set a global default for the display of dates and times in RT.  Your users can choose a different Timezone in their preferences.</&></p>
-<form method="post">
-<& /Widgets/BulkEdit, types => \@Types,meta => $RT::Installer->{Meta},
-    current_value => RT::Installer->current_values(@Types)
-&>
-
-<input type="hidden" name="run" value="1">
-<& /Elements/Submit, label => $RT::Installer->{DatabaseAction} eq 'none' ?
-_('Next: ') . _('Finish') : _('Next: ') . _( 'Initialize Database'),
-    back => 1, back_label => _('Back: ' ) . _('Customize Email Configuration') &>
-</form>
-</&>
-<%init>
-my @errors;
-
-my @Types = qw/comment_address correspond_address Timezone/;
 
-if ( $run ) {
 
-    $m->comp('/Widgets/BulkProcess', types => \@Types, arguments => \%ARGS,
-            store => $RT::Installer->{InstallConfig},
-            meta => $RT::Installer->{Meta}, keep_undef => 1 );
-
-    if ( $back ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Sendmail.html');
-    }
-
-    for ( qw/comment_address correspond_address/ ) {
-        if ( $ARGS{$_} && $ARGS{$_} !~ /.+ at .+/ ) {
-            push @errors,
-                _("Invalid %1: '%2' doesn't look like an email address",
-                $_, $ARGS{$_});
-        }
-    }
-
-    unless ( @errors ) {
-        my ( $status, $msg ) = RT::Installer->save_config;
-
-        if ( $status ) {
-            delete $INC{'RT_SiteConfig.pm'};
-            RT->load_config;
-
-            if ( $RT::Installer->{DatabaseAction} ne 'none' ) {
-                RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Initialize.html');
-            }
-            else {
-                RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Finish.html');
-            }
-        }
-        else {
-            push @errors, _($msg);
-        }
-    }
-}
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => 
+        $RT::Installer->{database_action} eq 'none' ?
+        '/Install/Finish.html' : '/Install/Initialize.html' ) %>
+% for my $field ( @fields ) {
+<% $action->form_field( $field ) %>
+% }
+<% Jifty->web->form->submit( label => _('Initialize Database')) %>
+<% Jifty->web->form->end %>
 
+</&>
+<%init>
+my @fields = qw/comment_address correspond_address timezone/;
+my $action = Jifty->web->new_action( class => 'Install' );
 </%init>
-
-<%args>
-$run => undef
-$back => undef
-</%args>

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/Initialize.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/Initialize.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/Initialize.html	Tue Jul 29 12:22:06 2008
@@ -47,94 +47,17 @@
 %# END BPS TAGGED BLOCK }}}
 <&|Elements/Wrapper, title => _('Step %1 of %2: ', 6, 7) . _('Initialize Database') &> 
 
-<& Elements/Errors, errors => \@errors &>
-
-% unless ( @errors ) {
 <div>
 <&|/l&>Click "Initialize Database" to create RT's database and insert initial metadata. This may take a few moments</&>
 </div>
-% }
 
-<form method="post">
-<input type="hidden" name="run" value="1">
-<& /Elements/Submit, label => _('Initialize Database'), back => 1,
-    back_label => _('Back: ') . _('Customize Global') &>
-</form>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/Install/Finish.html' ) %>
+<% $action->hidden('init') %>
+<% Jifty->web->form->submit( label => _('Initialize Database')) %>
+<% Jifty->web->form->end %>
+
 </&>
 <%init>
-my @errors;
-if ( $run ) {
-    if ( $back ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Global.html');
-    }
-
-    my @actions = split /,/, $RT::Installer->{DatabaseAction};
-
-    my $sysdbh = DBI->connect(
-        RT::Handle->system_dsn,
-        $RT::Installer->{InstallConfig}{DatabaseAdmin},
-        $RT::Installer->{InstallConfig}{DatabaseAdminPassword}, 
-        { RaiseError => 0, PrintError => 0 },
-    );
-    die $DBI::errstr unless $sysdbh;
-
-    my ( $status, $msg ) = ( 1, '' );
-
-    if ( $actions[0] eq 'create' ) {
-        ($status, $msg) = RT::Handle->create_database( $sysdbh );
-        unless ( $status ) {
-            push @errors, _('ERROR: %1', $msg );
-        }
-
-        shift @actions; # shift the 'create' action since its job is done.
-    }
-
-    if ( $status ) {
-
-        my $dbh = DBI->connect(
-            RT::Handle->DSN, $RT::Installer->{InstallConfig}{DatabaseAdmin},
-            $RT::Installer->{InstallConfig}{DatabaseAdminPassword}, 
-            { RaiseError => 0, PrintError => 0 },
-        );
-        die $DBI::errstr unless $dbh;
-
-        foreach my $action ( @actions ) {
-            ($status, $msg) = (1, '');
-            if ( $action eq 'schema' ) {
-                ($status, $msg) = RT::Handle->insert_schema( $dbh );
-            }
-            elsif ( $action eq 'acl' ) {
-                ($status, $msg) = RT::Handle->insert_acl( $dbh );
-            }
-            elsif ( $action eq 'coredata' ) {
-                $RT::Handle = new RT::Handle;
-                $RT::Handle->dbh( undef );
-                RT::ConnectToDatabase();
-                RT::InitLogging();
-                ($status, $msg) = $RT::Handle->insert_initial_data;
-            }
-            elsif ( $action eq 'insert' ) {
-                $RT::Handle = new RT::Handle;
-                RT::Init();
-                my $file = $RT::EtcPath . "/initialdata";
-                ($status, $msg) = $RT::Handle->insert_data( $file );
-            }
-            unless ( $status ) {
-                push @errors, _('ERROR: %1', $msg);
-                last;
-            }
-        }
-    }
-
-    unless ( @errors ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Finish.html');
-    }
-}
+my $action = Jifty->web->new_action( class => 'Install' );
 </%init>
-<%args>
-$run => undef
-$back => undef
-</%args>
-

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/Sendmail.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/Sendmail.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/Sendmail.html	Tue Jul 29 12:22:06 2008
@@ -45,61 +45,23 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<&|Elements/Wrapper, title => _('Step %1 of %2: ', 4, 7 ) . _('Email Configuration') &> 
-
-<& Elements/Errors, errors => \@errors &>
+<&|Elements/Wrapper, Title => loc('Step [_1] of [_2]: ', 4, 7 ) . loc('Email Configuration') &> 
 
 <p>
 <&|/l&>RT can communicate with your users about new tickets or new correspondence on tickets. Tell us where to find sendmail (or a sendmail compatible binary such as the one provided by postifx).  RT also needs to know who to notify when someone sends invalid email.  This must not be an address that feeds back into RT.</&>
 </p>
 
-<form method="post">
-<& /Widgets/BulkEdit, types => \@Types,meta => $RT::Installer->{Meta},
-    current_value => RT::Installer->current_values(@Types)
-&>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/Install/Global.html' ) %>
+% for my $field ( @fields ) {
+<% $action->form_field( $field ) %>
+% }
+<% Jifty->web->form->submit( label => _('Customize Global Defaults') ) %>
+
+<% Jifty->web->form->end %>
 
-<input type="hidden" name="run" value="1">
-<& /Elements/Submit, label => _('Next: ') . _( 'Customize Global Defaults'),
-    back => 1, back_label => _('Back: ' ) . _('Customize Basics') &>
-</form>
 </&>
 <%init>
-my @errors;
-
-my @Types = qw/SendmailPath OwnerEmail/;
-
-if ( $run ) {
-
-    $m->comp('/Widgets/BulkProcess', types => \@Types, arguments => \%ARGS,
-            store => $RT::Installer->{InstallConfig},
-            meta => $RT::Installer->{Meta}, keep_undef => 1);
-
-    if ( $back ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Basics.html');
-    }
-
-
-    unless ( -e $ARGS{sendmail_path} ) {
-        push @errors, _( "%1 doesn't exist.", $ARGS{sendmail_path} );
-    }
-
-    if ( ! $ARGS{owner_email} || $ARGS{owner_email} !~ /.+ at .+/ ) {
-        push @errors,
-            _("Invalid %1: that doesn't look like an email address",
-            'Administrator Email');
-    }
-
-
-    unless ( @errors ) {
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .
-'Install/Global.html');
-    }
-}
-
+my $action = Jifty->web->new_action( class => 'Install' );
+my @fields = qw/sendmail_path owner_email/;
 </%init>
-
-<%args>
-$run => undef 
-$back => undef
-</%args>

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/autohandler
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/autohandler	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/autohandler	Tue Jul 29 12:22:06 2008
@@ -55,9 +55,6 @@
 if (RT->install_mode) {
     $r->content_type("text/html; charset=utf-8");
     require RT::Installer;
-
-    $RT::Installer->{'CurrentUser'} = RT::CurrentUser->new();
-    $RT::Installer->{Meta} = RT::Installer->meta;
     $m->call_next;
 }
 else {

Modified: rt/branches/3.999-DANGEROUS/share/html/Install/index.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Install/index.html	(original)
+++ rt/branches/3.999-DANGEROUS/share/html/Install/index.html	Tue Jul 29 12:22:06 2008
@@ -70,39 +70,25 @@
 <&|/l&>If you already have a working RT server and database, you should take this opportunity to make sure that your database server is running and that the RT server can connect to it. Once you've done that, stop and start the RT server.</p></&>
 </div>
 
-<form method="post">
-<input type="hidden" name="run" value="1" />
-<& /Elements/Submit, label => _( "Let's go!") &>
-</form>
+<% Jifty->web->form->start %>
+<% Jifty->web->form->next_page( url => '/Install/DatabaseType.html' ) %>
+<% $action->hidden('start') %>
+<% Jifty->web->form->submit(label => _("Let's go") ) %>
+<% Jifty->web->form->end %>
+
 % }
 </&>
 <%init>
 my @errors;
 my $locked;
-    my $file = File::Spec->catfile( $RT::EtcPath, 'RT_SiteConfig.pm' );
-    $locked = 1 unless -w $file;
-    
-    if ( $locked ) {
-        push @errors, _("Config file %1 is locked", $file);
-    }
-    elsif ( $run ) {
-        $RT::Installer->{InstallConfig} ||= {};
-        for my $field  ( qw/DatabaseType DatabaseName DatabaseHost DatabasePort
-                DatabaseUser DatabaseRequireSSL rtname
-                organization TimeZone comment_address correspond_address 
-                SendmailPath WebDomain WebPort/ ) {
-            $RT::Installer->{InstallConfig}{$field} ||= RT->config->get($field);
-        }
-
-        for my $field ( qw/OwnerEmail Password DatabasePassword
-                DatabaseAdminPassword/ ) {
-            # stuff we don't want to keep null
-            $RT::Installer->{InstallConfig}{$field} = '';
-        }
-
-        RT::Interface::Web::redirect(RT->config->get('WebURL') .  'Install/DatabaseType.html');
-    
-        }
+my $file = File::Spec->catfile( $RT::EtcPath, 'RT_SiteConfig.pm' );
+$locked = 1 unless -w $file;
+
+if ( $locked ) {
+    push @errors, _("Config file %1 is locked", $file);
+}
+
+my $action = Jifty->web->new_action( class => 'Install' );
 </%init>
 
 <%args>


More information about the Rt-commit mailing list