[Rt-commit] rt branch, 4.0/custom-fields-groups, updated. rt-4.0.4-241-g92604f0

Thomas Sibley trs at bestpractical.com
Mon Oct 15 12:49:25 EDT 2012


The branch, 4.0/custom-fields-groups has been updated
       via  92604f04d1740e856ba05c2d2d8a3acadcea6da4 (commit)
      from  1299ec2e0e72c30be68c099cf0945b95a863ae8a (commit)

Summary of changes:
 ...tomFieldCustomGroups => ShowCustomFieldCustomGroups} |  7 +++++--
 share/html/Ticket/Elements/ShowSummary                  | 17 +++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)
 copy share/html/Elements/{EditCustomFieldCustomGroups => ShowCustomFieldCustomGroups} (75%)

- Log -----------------------------------------------------------------
commit 92604f04d1740e856ba05c2d2d8a3acadcea6da4
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Oct 15 09:35:50 2012 -0700

    ShowCustomFieldCustomGroups element to match the element for Edit

diff --git a/share/html/Elements/ShowCustomFieldCustomGroups b/share/html/Elements/ShowCustomFieldCustomGroups
new file mode 100644
index 0000000..598fa5f
--- /dev/null
+++ b/share/html/Elements/ShowCustomFieldCustomGroups
@@ -0,0 +1,22 @@
+% foreach my $group ( RT::CustomField->CustomGroups( $Object ), '' ) {
+<&| /Widgets/TitleBox,
+    title => $group? loc($group) : loc('Custom Fields'),
+    class => $css_class .' '. ($group? CSSClass("$css_class-$group") : ''),
+    hide_empty => 1,
+    %$TitleBoxARGS,
+&>
+<& ShowCustomFields, %ARGS, Object => $Object, Group => $group &>
+</&>
+% }
+<%ARGS>
+$Object
+</%ARGS>
+<%INIT>
+my $css_class = lc(ref($Object)||$Object);
+$css_class =~ s/^rt:://;
+$css_class =~ s/::/-/g;
+$css_class = CSSClass($css_class);
+$css_class .= '-info-cfs';
+
+my $TitleBoxARGS = delete $ARGS{TitleBoxARGS} || {};
+</%INIT>
diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index 0c5a3eb..de94323 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -53,14 +53,15 @@
         (($can_modify || $can_modify_cf) ? (title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-basics',
     &><& /Ticket/Elements/ShowBasics, Ticket => $Ticket &></&>
-% foreach my $group ( RT::CustomField->CustomGroups($Ticket), '' ) {
-    <&| /Widgets/TitleBox,
-        title => $group? loc($group) : loc('Custom Fields'),
-        (($can_modify || $can_modify_cf) ? (title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id) : ()),
-        class => 'ticket-info-cfs '. ($group? CSSClass("ticket-info-cfs-$group") : ''),
-        hide_empty => 1,
-    &><& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket, Group => $group &></&>
-% }
+
+    <& /Elements/ShowCustomFieldCustomGroups,
+        Object       => $Ticket,
+        TitleBoxARGS => {
+            (($can_modify || $can_modify_cf)
+                ? (title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id)
+                : ()),
+        },
+        &>
 
     <&| /Widgets/TitleBox, title => loc('People'),
         (($can_modify || $can_modify_owner) ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),

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


More information about the Rt-commit mailing list