[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-196-ge907f5e

Shawn Moore sartak at bestpractical.com
Wed Jul 21 17:22:30 EDT 2010


The branch, new-style-templates has been updated
       via  e907f5e76c27b4658a860b0d1ee88a27a77398a9 (commit)
       via  3e3f4215930eb6144feab413f641caf394e36ec8 (commit)
      from  ae462317c67133d96efa4978f9fd9b9e67123923 (commit)

Summary of changes:
 etc/upgrade/3.9.1/content                |   26 ++++++++++++++++++++++++++
 share/html/Admin/Elements/ModifyTemplate |   10 ++++++++++
 share/html/Admin/Global/Template.html    |    8 ++++++--
 share/html/Admin/Queues/Template.html    |    8 ++++++--
 4 files changed, 48 insertions(+), 4 deletions(-)
 create mode 100644 etc/upgrade/3.9.1/content

- Log -----------------------------------------------------------------
commit 3e3f4215930eb6144feab413f641caf394e36ec8
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jul 21 17:22:59 2010 -0400

    Upgrade script for template Type field

diff --git a/etc/upgrade/3.9.1/content b/etc/upgrade/3.9.1/content
new file mode 100644
index 0000000..3b4b418
--- /dev/null
+++ b/etc/upgrade/3.9.1/content
@@ -0,0 +1,26 @@
+ at Initial = (
+    sub {
+        use strict;
+        $RT::Logger->debug('Make sure templates all have known types');
+
+        my $templates = RT::Templates->new($RT::SystemUser);
+        $templates->Limit(
+            FIELD => 'Type',
+            OPERATOR => '!=',
+            VALUE => 'Action',
+        );
+
+        if ($templates->Count) {
+            die "You have templates with Type other than Action. This will interfere with your upgrade because RT used to ignore the template Type field, but now uses it.";
+        }
+
+        $templates->UnLimit();
+        while (my $template = $templates->Next) {
+            my ($status, $msg) = $template->SetType('Full');
+            unless ( $status ) {
+                die "Couldn't change Type of Template #" . $template->Id . ": $msg";
+            }
+        }
+    },
+);
+

commit e907f5e76c27b4658a860b0d1ee88a27a77398a9
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jul 21 17:24:07 2010 -0400

    Add Full/Simple radio button for ModifyTemplate

diff --git a/share/html/Admin/Elements/ModifyTemplate b/share/html/Admin/Elements/ModifyTemplate
index a005761..5599616 100755
--- a/share/html/Admin/Elements/ModifyTemplate
+++ b/share/html/Admin/Elements/ModifyTemplate
@@ -63,6 +63,15 @@
 </td>
 </tr>
 <tr>
+<td align="right">
+<&|/l&>Type</&>:
+</td>
+<td>
+<input type="radio" name="Type" value="Full" <% $Type eq "Full" ? 'checked="checked"' : "" %>><&|/l&>Full</&></input><br />
+<input type="radio" name="Type" value="Simple" <% $Type eq "Simple" ? 'checked="checked"' : "" %>><&|/l&>Simple</&></input><br />
+</td>
+</tr>
+<tr>
 <td align="right" valign="top">
 <&|/l&>Content</&>:<br />
 </td>
@@ -81,4 +90,5 @@
 $Name => undef
 $Description => undef
 $Content => undef
+$Type => undef
 </%ARGS>
diff --git a/share/html/Admin/Global/Template.html b/share/html/Admin/Global/Template.html
index f833f8e..f3a09f3 100755
--- a/share/html/Admin/Global/Template.html
+++ b/share/html/Admin/Global/Template.html
@@ -62,8 +62,12 @@
 
 %# hang onto the queue id
 <input type="hidden" class="hidden" name="Queue" value="<%$Queue%>" />
-<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description =>
-$TemplateObj->Description, Content => $TemplateObj->Content &> 
+<& /Admin/Elements/ModifyTemplate,
+    Name        => $TemplateObj->Name,
+    Description => $TemplateObj->Description,
+    Content     => $TemplateObj->Content,
+    Type        => $TemplateObj->Type
+&>
 <& /Elements/Submit, Label => $SubmitLabel, Reset => 1 &>
 </form>
 
diff --git a/share/html/Admin/Queues/Template.html b/share/html/Admin/Queues/Template.html
index 54ba817..9f4f0bf 100755
--- a/share/html/Admin/Queues/Template.html
+++ b/share/html/Admin/Queues/Template.html
@@ -63,8 +63,12 @@
 
 %# hang onto the queue id
 <input type="hidden" class="hidden" name="Queue" value="<%$Queue%>" />
-<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description =>
-$TemplateObj->Description, Content => $TemplateObj->Content &> 
+<& /Admin/Elements/ModifyTemplate,
+    Name        => $TemplateObj->Name,
+    Description => $TemplateObj->Description,
+    Content     => $TemplateObj->Content,
+    Type        => $TemplateObj->Type
+&>
 <& /Elements/Submit, Label => $SubmitLabel, Reset => 1 &>
 </form>
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list