[Rt-commit] r11878 - rt/branches/3.8-TESTING/html/installation

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Apr 24 14:36:22 EDT 2008


Author: sunnavy
Date: Thu Apr 24 14:36:21 2008
New Revision: 11878

Modified:
   rt/branches/3.8-TESTING/html/installation/Basics.html
   rt/branches/3.8-TESTING/html/installation/DatabaseDetails.html
   rt/branches/3.8-TESTING/html/installation/DatabaseType.html
   rt/branches/3.8-TESTING/html/installation/Emails.html
   rt/branches/3.8-TESTING/html/installation/Sendmail.html

Log:
render page using widgets

Modified: rt/branches/3.8-TESTING/html/installation/Basics.html
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/Basics.html	(original)
+++ rt/branches/3.8-TESTING/html/installation/Basics.html	Thu Apr 24 14:36:21 2008
@@ -51,60 +51,32 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form method="post">
-<table>
-% for ( @types ) {
-<tr title="<% $title{$_} |n%>">
-<td class="label"><% loc($_) %>:</td>
-<td>
-% if ( $_ eq 'TimeZone' ) {
+<& Elements/Edit, Types => \@Types &>
+<div id="form-box-timezone">
+<span class="label">Timezone</span>
+<span class="value">
 <& /Elements/SelectTimezone, Name => 'Timezone',  &>
-% } else {
-<input type="text" <% $_ eq 'MinimumPasswordLength' ? q[onchange="(!this.value || this.value.match(/^\d+$/)) ?
-this.style.background='white' : this.style.background='red'" ]: () |n %>
-name="<% $_ %>" value="<% $ARGS{$_} || $RT::Installer->{InstallConfig}{$_} %>" />
-% }
-</td>
-</tr>
-% }
-
-</table>
+</div>
 
 <input type="hidden" name="Run" value="1">
 <& /Elements/Submit, Label => loc('Next: Customize Emails'), Back => 1,
     BackLabel => loc('Back: Customize Database Details') &>
 </form>
 </&>
+
+
 <%init>
 my @results;
-push @results, 'Connected Database with success!' unless
-$RT::Installer->{InstallConfig}{DatabaseType} eq 'SQLite';
+push @results, 'Connected Database with success!' unless $RT::Installer->{InstallConfig}{DatabaseType} eq 'SQLite';
+
+my @Types = qw/rtname Organization MinimumPasswordLength/;
+# XXX treat TimeZone specially, since it's not compatibal with /Widgets/
 
-my @types = qw/rtname Organization TimeZone MinimumPasswordLength/;
-my %title = (
-rtname => <<'EOF'
-rtname is the string that RT will look for in mail messages to figure out what ticket a new piece of mail belongs to Your domain name is recommended, so as not to pollute the namespace.  once you start using a given tag, you should probably never change it.
-(otherwise, mail for existing tickets won't get put in the right place
-EOF
-,
-Organization => <<'EOF'
-You should set this to your organization's DNS domain. For example, fsck.com or asylum.arkham.ma.us. It's used by the linking interface to guarantee that ticket URIs are unique and easy to construct.
-EOF
-,
-TimeZone => <<'EOF'
-$Timezone is used to convert times entered by users into GMT and back again It should be set to a timezone recognized by your local unix box.
-EOF
-,
-MinimumPasswordLength => <<'EOF'
-$MinimumPasswordLength defines the minimum length for user passwords. Setting it to 0 disables this check
-EOF
-,
-);
 
 if ( $Run ) {
 
-    for ( @types ) {
-        $RT::Installer->{InstallConfig}{$_} = $ARGS{$_} if $ARGS{$_};
-    }
+    $m->comp('Elements/Process', Types => \@Types, Arguments => \%ARGS);
+    $RT::Installer->{InstallConfig}{TimeZone} = $ARGS{TimeZone};
     $RT::Installer->{TimeStamp} = time;
 
     for ( qw/MininumPasswordLength/ ) {
@@ -117,7 +89,8 @@
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
 'installation/DatabaseDetails.html');
     }
-    unless ( @results ) {
+    if ( $RT::Installer->{InstallConfig}{DatabaseType} eq 'SQLite' ?
+            @results == 0 : @results == 1 ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .
 'installation/Emails.html');
     }

Modified: rt/branches/3.8-TESTING/html/installation/DatabaseDetails.html
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/DatabaseDetails.html	(original)
+++ rt/branches/3.8-TESTING/html/installation/DatabaseDetails.html	Thu Apr 24 14:36:21 2008
@@ -51,86 +51,31 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form method="post">
-<table>
-<tr title="<% $title{DatabaseName} %>">
-<td class="label"><% loc('DatabaseName') %>:</td>
-<td>
-<input type="text" name="DatabaseName" value="<% $ARGS{DatabaseName} ||
-$RT::Installer->{InstallConfig}{DatabaseName} %>" />
-</td>
-</tr>
-% if ( $RT::Installer->{InstallConfig}{DatabaseType} ne 'SQLite' ) {
-% for ( qw/DatabaseHost DatabasePort DatabaseUser DatabasePassword/ ) {
-<tr title="<% $title{$_} |n %>">
-<td class="label"><% loc($_) %>:</td>
-<td>
-<input type="<% /Password/ ? 'password' : 'text' %>" name="<% $_ %>" value="<% $ARGS{$_} || $RT::Installer->{InstallConfig}{$_} %>" />
-</td>
-</tr>
-
-% }
-% if ( $RT::Installer->{InstallConfig}{DatabaseType} eq 'Pg' ) {
-<tr title="<% $title{DatabaseRequireSSL} |n %>" >
-<td class="label"><% loc('DatabaseRequireSSL') %>:</td>
-<td>
-<input type="checkbox" name="DatabaseRequireSSL" value="1" <%
-$ARGS{DatabaseRequireSSL} ? 'checked="checked"' : '' %> />
-</td>
-</tr>
-% }
-
-% }
-</table>
+<& Elements/Edit, Types => \@Types &>
 <input type="hidden" name="Run" value="1">
 
 <& /Elements/Submit, Label => $RT::Installer->{InstallConfig}{DatabaseType} eq
-'SQLite' ? loc('Next: Customize Basics') : loc('Next: Check Database
-        Connectivity'), Back => 1, BackLabel => loc('Back: Select Database Type'),
-    &>
+'SQLite' ? loc('Next: Customize Basics') : loc('Next: Check Database Connectivity'), Back => 1, BackLabel => loc('Back: Select Database Type'),
+&>
 </form>
 </&>
 <%init>
 my @results;
 
-my %title = (
-DatabaseHost => <<'EOF'
-The domain name of your database server
-If you're running mysql and it's on localhost,
-leave it blank for enhanced performance
-EOF
-,
-DatabasePort => <<'EOF'
-The port that your database server is running on.  Ignored unless it's
-a positive integer. It's usually safe to leave this blank
-EOF
-,
-DatabaseUser => <<'EOF'
-The name of the database user (inside the database)
-EOF
-,
-DatabasePassword => <<'EOF'
-Password the DatabaseUser should use to access the database
-EOF
-,
-DatabaseName => <<'EOF'
-The name of the RT's database on your database server
-EOF
-,
-DatabaseRequireSSL => <<'EOF'
-If you're using Postgres and have compiled in SSL support,
-set DatabaseRequireSSL to 1 to turn on SSL communication
-EOF
-,
+my @Types = 'DatabaseName';
+
+unless ( $RT::Installer->{InstallConfig}{DatabaseType} eq 'SQLite' ) {
+    push @Types, 'DatabaseHost', 'DatabasePort', 'DatabaseUser',
+         'DatabasePassword';
+}
+if ( $RT::Installer->{InstallConfig}{DatabaseType} eq 'Pg' ) {
+    push @Types, 'DatabaseRequireSSL';
+}
 
-);
 
 if ( $Run ) {
 
-    for ( qw/DatabaseName DatabaseUser DatabasePassword DatabasePort
-            DatabaseHost DatabaseRequireSSL/ ) {
-        $RT::Installer->{InstallConfig}{$_} = $ARGS{$_};
-    }
-    $RT::Installer->{TimeStamp} = time;
+    $m->comp('Elements/Process', Types => \@Types, Arguments => \%ARGS);
 
     if ( $Back ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .

Modified: rt/branches/3.8-TESTING/html/installation/DatabaseType.html
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/DatabaseType.html	(original)
+++ rt/branches/3.8-TESTING/html/installation/DatabaseType.html	Thu Apr 24 14:36:21 2008
@@ -51,22 +51,7 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form method="post">
-<table>
-<tr>
-<td class="label"><% loc('DatabaseType') %>:</td>
-<td>
-<select name="DatabaseType">
-% for ( sort @Types ) {
-% if ( $DatabaseType && ( $_ eq $DatabaseType ) ) {
-<option selected="selected"><% $_ %></option>
-% } else {
-<option><% $_ %></option>
-% }
-% }
-</select>
-</td>
-</tr>
-</table>
+<& Elements/Edit, Types => \@Types &>
 
 <input type="hidden" name="Run" value="1">
 <& /Elements/Submit, Label => loc('Next: Check your database credentials') &>
@@ -74,31 +59,18 @@
 </&>
 <%init>
 
-my ( @Types, @results );
- at Types = qw/SQLite mysql Pg Oracle/;
-require UNIVERSAL::require;
- at Types = grep { my $m = 'DBD::' . $_; $m->require ? 1 : 0 } @Types;
+my @results;
+my @Types = 'DatabaseType';
 
 if ( $Run ) {
 
-    if ( grep { $DatabaseType eq $_ } @Types ) {
-    
-        $RT::Installer->{InstallConfig}{DatabaseType} = $DatabaseType;
-        $RT::Installer->{TimeStamp} = time; # need this to force %session update
-        
-        RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .  'installation/DatabaseDetails.html');
-    }
-    else {
-        push @results, "invalid database type: $DatabaseType";
-    }
-}
-else {
-    $DatabaseType ||= $RT::Installer->{InstallConfig}{DatabaseType};
+    $m->comp('Elements/Process', Types => \@Types, Arguments => \%ARGS);
+
+    RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .  'installation/DatabaseDetails.html');
 }
 
 </%init>
 
 <%args>
-$DatabaseType => undef
 $Run => undef
 </%args>

Modified: rt/branches/3.8-TESTING/html/installation/Emails.html
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/Emails.html	(original)
+++ rt/branches/3.8-TESTING/html/installation/Emails.html	Thu Apr 24 14:36:21 2008
@@ -51,18 +51,8 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form method="post">
-<table>
-% for ( @types ) {
-<tr title="<% $title{$_} |n%>">
-<td class="label"><% loc($_) %>:</td>
-<td>
-<input type="text" <% $_ eq 'MaxAttachmentSize' ? q[onchange="(!this.value || this.value.match(/^\d+$/)) ? this.style.background='white' : this.style.background='red'" ]: () |n %>
-name="<% $_ %>" value="<% $ARGS{$_} || $RT::Installer->{InstallConfig}{$_} %>" />
-</td>
-</tr>
-% }
+<& Elements/Edit, Types => \@Types &>
 
-</table>
 <input type="hidden" name="Run" value="1">
 <& /Elements/Submit, Label => loc('Next: Customize Sendmail'), Back => 1,
     BackLabel => loc('Back: Customize Basics') &>
@@ -71,34 +61,11 @@
 <%init>
 my @results;
 
-my @types = qw/MaxAttachmentSize OwnerEmail CommentAddress CorrespondAddress/;
-my %title = (
-MaxAttachmentSize => <<'EOF'
-$MaxAttachmentSize sets the maximum size (in bytes) of attachments stored in the database.
-EOF
-,
-OwnerEmail => <<'EOF'
-OwnerEmail is the address of a human who manages RT. RT will send
-errors generated by the mail gateway to this address.  This address
-should _not_ be an address that's managed by your RT instance.
-EOF
-,
-CommentAddress => <<'EOF'
-CommentAddress is the default address that will be listed in From: and Reply-To: headers of comment mail tracked by RT, unless overridden by a queue-specific address.
-EOF
-,
-CorrespondAddress => <<'EOF'
-CorrespondAddress is the default address that will be listed in From: and Reply-To: headers of correspondence mail tracked by RT, unless overridden by a queue-specific address.
-EOF
-,
-);
+my @Types = qw/MaxAttachmentSize OwnerEmail CommentAddress CorrespondAddress/;
 
 if ( $Run ) {
 
-    for ( @types ) {
-        $RT::Installer->{InstallConfig}{$_} = $ARGS{$_} if $ARGS{$_};
-    }
-    $RT::Installer->{TimeStamp} = time;
+    $m->comp('Elements/Process', Types => \@Types, Arguments => \%ARGS);
 
     if ( $Back ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .

Modified: rt/branches/3.8-TESTING/html/installation/Sendmail.html
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/Sendmail.html	(original)
+++ rt/branches/3.8-TESTING/html/installation/Sendmail.html	Thu Apr 24 14:36:21 2008
@@ -54,17 +54,8 @@
 </div>
 <hr />
 <form method="post">
-<table>
-% for ( @types ) {
-<tr title="<% $title{$_} |n%>">
-<td class="label"><% loc($_) %>:</td>
-<td>
-<input type="text" name="<% $_ %>" value="<% $ARGS{$_} || $RT::Installer->{InstallConfig}{$_} %>" />
-</td>
-</tr>
-% }
+<& Elements/Edit, Types => \@Types &>
 
-</table>
 <input type="hidden" name="Run" value="1">
 <& /Elements/Submit, Label => loc('Next: Initialize Database'), Back => 1,
     BackLabel => loc('Back: Customize Emails') &>
@@ -73,33 +64,11 @@
 <%init>
 my @results;
 
-my @types = qw/MailCommand SendmailArguments SendmailBounceArguments SendmailPath/;
-my %title = (
-MailCommand => <<'EOF'
-MailCommand defines which method RT will use to try to send mail.  We know that 'sendmailpipe' works fairly well.  If 'sendmailpipe' doesn't work well for you, try 'sendmail'.  Other options are 'smtp' or 'qmail'.
-EOF
-,
-SendmailArguments => <<'EOF'
-SendmailArguments defines what flags to pass to $SendmailPath If you picked 'sendmailpipe', you MUST add a -t flag to $SendmailArguments These options are good for most sendmail wrappers and workalikes
-EOF
-,
-SendmailBounceArguments => <<'EOF'
-SendmailBounceArguments defines what flags to pass to $Sendmail assuming RT needs to send an error (ie. bounce).
-EOF
-,
-SendmailPath => <<'EOF'
-If you selected 'sendmailpipe' above, you MUST specify the path to your sendmail binary in $SendmailPath.
-EOF
-,      
-        
-);
+my @Types = qw/MailCommand SendmailArguments SendmailBounceArguments SendmailPath/;
 
 if ( $Run ) {
 
-    for ( @types ) {
-        $RT::Installer->{InstallConfig}{$_} = $ARGS{$_} if $ARGS{$_};
-    }
-    $RT::Installer->{TimeStamp} = time;
+    $m->comp('Elements/Process', Types => \@Types, Arguments => \%ARGS);
 
     if ( $Back ) {
         RT::Interface::Web::Redirect(RT->Config->Get('WebURL') .


More information about the Rt-commit mailing list