[Rt-commit] rt branch, 4.2/custom-field-callbacks, created. rt-4.1.6-276-g3521f05
Jim Brandt
jbrandt at bestpractical.com
Thu Feb 21 15:30:14 EST 2013
The branch, 4.2/custom-field-callbacks has been created
at 3521f05e6d3088b155dd636aba695e289e120838 (commit)
- Log -----------------------------------------------------------------
commit 3521f05e6d3088b155dd636aba695e289e120838
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Thu Feb 21 14:19:55 2013 -0500
Add callbacks to provide hooks for modifying CF portlets
Add callbacks before and after custom field display in Edit
and Show to allow you to add content in a CF portlet. If you add
form fields, you need a chance to update them, so add a callback
in Modify for running any update or processing code.
diff --git a/share/html/Elements/EditCustomFieldCustomGroupings b/share/html/Elements/EditCustomFieldCustomGroupings
index 4868040..c0ad6df 100644
--- a/share/html/Elements/EditCustomFieldCustomGroupings
+++ b/share/html/Elements/EditCustomFieldCustomGroupings
@@ -51,8 +51,14 @@
class => $css_class .' '. ($group? CSSClass("$css_class-$group") : ''),
hide_empty => 1,
&>
+% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object,
+% Group => $group, ARGSRef => \%ARGS );
+
% $ARGS{CustomFields} = $CustomFieldGenerator->() if $CustomFieldGenerator;
<& EditCustomFields, %ARGS, Object => $Object, Grouping => $group &>
+
+% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object,
+% Group => $group, ARGSRef => \%ARGS );
</&>
% }
<%ARGS>
diff --git a/share/html/Elements/ShowCustomFieldCustomGroupings b/share/html/Elements/ShowCustomFieldCustomGroupings
index d3f65fc..e2879d9 100644
--- a/share/html/Elements/ShowCustomFieldCustomGroupings
+++ b/share/html/Elements/ShowCustomFieldCustomGroupings
@@ -52,7 +52,13 @@
hide_empty => 1,
%$TitleBoxARGS,
&>
+% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object,
+% Group => $group, ARGSRef => \%ARGS );
+
<& ShowCustomFields, %ARGS, Object => $Object, Grouping => $group &>
+
+% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object,
+% Group => $group, ARGSRef => \%ARGS );
</&>
% }
<%ARGS>
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