[Rt-commit] rt branch, 4.0/custom-fields-groups, updated. rt-4.0.4-230-g132fd7c
Ruslan Zakirov
ruz at bestpractical.com
Fri Sep 7 09:16:32 EDT 2012
The branch, 4.0/custom-fields-groups has been updated
via 132fd7cf8888a515736bf30c0a0915144c94699c (commit)
via 24e933608b0b79704a2e30e678c6ceb0919e7577 (commit)
via 4407c72b0c4862169ba36d2856f2e8101078752e (commit)
from 1f03dbf232da529db13cce11dac57720e5fded54 (commit)
Summary of changes:
lib/RT/CustomField.pm | 2 +-
lib/RT/Interface/Web.pm | 8 ++++++++
share/html/Ticket/Create.html | 6 +++++-
share/html/Ticket/Elements/ShowSummary | 5 +++--
share/html/Ticket/Modify.html | 6 +++++-
share/html/Ticket/ModifyAll.html | 6 +++++-
6 files changed, 27 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 4407c72b0c4862169ba36d2856f2e8101078752e
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Sep 7 16:09:38 2012 +0400
mark BUILTIN_GROUPS as our for potential extensions
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index d605662..39860b4 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -1212,7 +1212,7 @@ sub Groups {
@groups;
}
-my %BUILTIN_GROUPS = (
+our %BUILTIN_GROUPS = (
'RT::Ticket' => { map { $_ => 1 } qw(Basics Dates Links People) },
);
$BUILTIN_GROUPS{''} = { map { %$_ } values %BUILTIN_GROUPS };
commit 24e933608b0b79704a2e30e678c6ceb0919e7577
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Sep 7 17:15:10 2012 +0400
put group name into title of the box
diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index f42afe4..a4d2d86 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -54,7 +54,8 @@
class => 'ticket-info-basics',
&><& /Ticket/Elements/ShowBasics, Ticket => $Ticket &></&>
% foreach my $group ( RT::CustomField->CustomGroups($Ticket), '' ) {
- <&| /Widgets/TitleBox, title => loc('Custom Fields'),
+ <&| /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',
hide_empty => 1,
commit 132fd7cf8888a515736bf30c0a0915144c94699c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Sep 7 17:16:01 2012 +0400
add ticket-info-cfs-group class to title boxes
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index c880115..19cc709 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2823,6 +2823,14 @@ sub _NewScrubber {
return $scrubber;
}
+sub CSSClass {
+ my $value = shift;
+ return '' unless defined $value;
+ $value =~ s/[^A-Za-z0-9_-]/_/g;
+ return $value;
+}
+
+
package RT::Interface::Web;
RT::Base->_ImportOverlays();
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 7165189..3405ebf 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -108,7 +108,11 @@
% $m->callback( CallbackName => 'AfterBasics', QueueObj => $QueueObj );
% foreach my $group ( RT::CustomField->CustomGroups( 'RT::Ticket' ), '' ) {
-<&| /Widgets/TitleBox, title => $group? loc($group) : loc('Custom Fields'), class => 'ticket-info-cfs', hide_empty => 1 &>
+<&| /Widgets/TitleBox,
+ title => $group? loc($group) : loc('Custom Fields'),
+ class => 'ticket-info-cfs '. ($group? CSSClass("ticket-info-cfs-$group") : ''),
+ hide_empty => 1
+&>
<& Elements/EditCustomFields, %ARGS, QueueObj => $QueueObj, DefaultsFromTopArguments => 0, Group => $group &>
</&>
% }
diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index a4d2d86..0c5a3eb 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -57,7 +57,7 @@
<&| /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',
+ class => 'ticket-info-cfs '. ($group? CSSClass("ticket-info-cfs-$group") : ''),
hide_empty => 1,
&><& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket, Group => $group &></&>
% }
diff --git a/share/html/Ticket/Modify.html b/share/html/Ticket/Modify.html
index e6f46cf..67edcdb 100755
--- a/share/html/Ticket/Modify.html
+++ b/share/html/Ticket/Modify.html
@@ -62,7 +62,11 @@
% $m->callback( CallbackName => 'AfterBasics', Ticket => $TicketObj );
% foreach my $group ( RT::CustomField->CustomGroups( $TicketObj ), '' ) {
-<&| /Widgets/TitleBox, title => $group? loc($group) : loc('Custom Fields'), class=>'ticket-info-cfs', hide_empty => 1 &>
+<&| /Widgets/TitleBox,
+ title => $group? loc($group) : loc('Custom Fields'),
+ class => 'ticket-info-cfs '. ($group? CSSClass("ticket-info-cfs-$group") : ''),
+ hide_empty => 1,
+&>
<& Elements/EditCustomFields, TicketObj => $TicketObj, DefaultsFromTopArguments => 0, Group => $group &>
</&>
% }
diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index 2fba239..017285f 100755
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -63,7 +63,11 @@
% $m->callback(CallbackName => 'AfterBasics', Ticket => $Ticket);
% foreach my $group ( RT::CustomField->CustomGroups( $Ticket ), '' ) {
-<&| /Widgets/TitleBox, title => $group? loc($group) : loc('CustomFields'), class => 'ticket-info-cfs', hide_empty => 1 &>
+<&| /Widgets/TitleBox,
+ title => $group? loc($group) : loc('CustomFields'),
+ class => 'ticket-info-cfs '. ($group? CSSClass("ticket-info-cfs-$group") : ''),
+ hide_empty => 1,
+&>
<& Elements/EditCustomFields, TicketObj => $Ticket, Group => $group &>
</&>
% }
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list