[Rt-commit] [rtir] 06/09: Code to pull defaults and pass to CustomFieldGroupings on Create
Kevin Falcone
falcone at bestpractical.com
Fri Jul 25 15:16:02 EDT 2014
This is an automated email from the git hooks/post-receive script.
falcone pushed a commit to branch 3.2/customfieldgroupings
in repository rtir.
commit ed9c816b5a9522baf61331f1e8d270b65d2da6a0
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Fri Jul 25 15:04:28 2014 -0400
Code to pull defaults and pass to CustomFieldGroupings on Create
During creation, RTIR reads configs from RTIR_Config.pm and those are
parsed by code in RTIR/Elements/EditCustomFields. We take that data and
pass it off to EditCustomFieldCustomGroupings which passes it to
EditCustomFields and ensures that grouped CFs get the same "RTIR
Default" code that ungrouped CFs do.
---
html/RTIR/Create.html | 14 +++++++++++++-
html/RTIR/Incident/Create.html | 14 +++++++++++++-
html/RTIR/Investigation/Elements/Create | 16 +++++++++++++++-
3 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index bcb44b3..a313a41 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -152,11 +152,22 @@
TicketObj => $ticket,
QueueObj => $QueueObj,
DefaultsFrom => $SplitObj || $IncidentObj[0],
+ CFDefaults => \%CFDefaults,
&>
<& /Ticket/Elements/EditTransactionCustomFields,
%ARGS, QueueObj => $QueueObj, InTable => 1,
&>
-</table></&></div>
+</table></&>
+
+<& /Elements/EditCustomFieldCustomGroupings,
+ %ARGS,
+ %CFDefaults,
+ Object => $ticket,
+ CustomFieldGenerator => sub { $QueueObj->TicketCustomFields },
+ Groupings => [ RT::CustomField->CustomGroupings('RTIR::Ticket'), '' ],
+&>
+
+</div>
<div id="ticket-create-message">
<&| /Widgets/TitleBox, title => $Title, class => 'messagedetails' &>
@@ -326,6 +337,7 @@
</form>
<%INIT>
+my %CFDefaults;
$m->callback(
CallbackName => 'Init', CallbackPage => '/Ticket/Create.html',
ARGSRef => \%ARGS,
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 96e373b..8ee315d 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -158,9 +158,20 @@ if ( $ChildObj && !$ChildObj->CurrentUserHasRight('ModifyTicket') ) {
TicketObj => $ticket,
QueueObj => $QueueObj,
DefaultsFrom => $SplitObj || $ChildObj,
+ CFDefaults => \%CFDefaults,
&>
-</table></&></div>
+</table></&>
+
+<& /Elements/EditCustomFieldCustomGroupings,
+ %ARGS,
+ %CFDefaults,
+ Object => $ticket,
+ CustomFieldGenerator => sub { $QueueObj->TicketCustomFields },
+ Groupings => [ RT::CustomField->CustomGroupings('RTIR::Ticket'), '' ],
+&>
+
+</div>
<div class="ticket-create-details">
@@ -278,6 +289,7 @@ if ( $ChildObj && !$ChildObj->CurrentUserHasRight('ModifyTicket') ) {
<%INIT>
+my %CFDefaults;
$m->callback(
CallbackName => 'Init', CallbackPage => '/Ticket/Create.html',
ARGSRef => \%ARGS,
diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index e6a827a..ee0a8ed 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -101,10 +101,23 @@
QueueObj => $QueueObj,
DefaultsFrom => $TicketObj,
CFIDPrefix => $NamePrefix,
+ CFDefaults => \%CFDefaults,
&>
% }
-</table></&></div>
+</table></&>
+
+% if ( ($QueueObj || $TicketObj) && !$SkipField{'CustomFields'} ) {
+<& /Elements/EditCustomFieldCustomGroupings,
+ %ARGS,
+ %CFDefaults,
+ Object => $ticket,
+ CustomFieldGenerator => sub { $QueueObj->TicketCustomFields },
+ Groupings => [ RT::CustomField->CustomGroupings('RTIR::Ticket'), '' ],
+&>
+% }
+
+</div>
<div class="ticket-create-details">
<&| /Widgets/TitleBox,
@@ -195,6 +208,7 @@ $TicketObj => undef
%SkipField => ()
</%ARGS>
<%INIT>
+my %CFDefaults;
my $value_cb = sub {
my $name = shift;
my $full_name = $NamePrefix . $name;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list