[Rt-commit] rt branch, 4.2/custom-field-callbacks, created. rt-4.1.6-287-g3952e96
Jim Brandt
jbrandt at bestpractical.com
Fri Mar 1 15:04:17 EST 2013
The branch, 4.2/custom-field-callbacks has been created
at 3952e961178ee58eac199ac7ab653230b52c7925 (commit)
- Log -----------------------------------------------------------------
commit c09b2ba59ab74c216042269a1f520ab6ad5ccb18
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Mar 1 21:54:07 2013 +0800
more callbacks and callback args for Show/EditCustomFields
* add AfterCustomFieldValue callback
* add "Grouping" and "ARGSRef" args to AfterCustomFields
* add "Grouping," "Object" and "ARGSRef" args to BeforeCustomFields
diff --git a/share/html/Elements/EditCustomFields b/share/html/Elements/EditCustomFields
index 3724730..5528d72 100644
--- a/share/html/Elements/EditCustomFields
+++ b/share/html/Elements/EditCustomFields
@@ -45,6 +45,8 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
+% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object,
+% Grouping => $Grouping, ARGSRef => \%ARGS );
% if ( $WRAP ) {
<<% $WRAP %> class="edit-custom-fields">
% }
@@ -76,13 +78,15 @@
</span>
% }
</<% $CELL %>>
+% $m->callback( CallbackName => 'AfterCustomFieldValue', CustomField => $CustomField, Object => $Object, Grouping => $Grouping );
</<% $FIELD %>>
% }
% if ( $WRAP ) {
</<% $WRAP %>>
% }
-% $m->callback( %ARGS, CallbackName => 'AfterCustomFields' );
+% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object,
+% Grouping => $Grouping, ARGSRef => \%ARGS );
<%INIT>
$CustomFields ||= $Object->CustomFields;
diff --git a/share/html/Elements/ShowCustomFields b/share/html/Elements/ShowCustomFields
index 1bd56db..d01e200 100644
--- a/share/html/Elements/ShowCustomFields
+++ b/share/html/Elements/ShowCustomFields
@@ -45,7 +45,8 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% $m->callback( CallbackName => 'BeforeCustomFields' );
+% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object,
+% Grouping => $Grouping, ARGSRef => \%ARGS );
% if ($Table) {
<table>
% }
@@ -69,12 +70,14 @@
</ul>
% }
</td>
+% $m->callback( CallbackName => 'AfterCustomFieldValue', CustomField => $CustomField, Object => $Object, Grouping => $Grouping );
</tr>
% }
% if ($Table) {
</table>
% }
-% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object );
+% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object,
+% Grouping => $Grouping, ARGSRef => \%ARGS );
<%INIT>
$m->callback(
%ARGS,
commit 3952e961178ee58eac199ac7ab653230b52c7925
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Fri Mar 1 13:53:16 2013 -0500
Add ProcessUpdates callback in Modify.html
Add a callback in Modify for running any update or processing
code. This is useful if you're adding some form fields and storing
values in attributes, for example.
diff --git a/share/html/Ticket/Modify.html b/share/html/Ticket/Modify.html
index 4079c84..cb3de87 100644
--- a/share/html/Ticket/Modify.html
+++ b/share/html/Ticket/Modify.html
@@ -92,6 +92,8 @@ $m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef =>
unless ($skip_update) {
push @results, ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS);
push @results, ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS);
+ $m->callback( CallbackName => 'ProcessUpdates', TicketObj => $TicketObj,
+ ARGSRef => \%ARGS, Results => \@results );
$TicketObj->ApplyTransactionBatch;
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list