[Rt-commit] r17271 - in rtir/2.4/trunk/html/RTIR: .
ruz at bestpractical.com
ruz at bestpractical.com
Tue Dec 16 18:26:50 EST 2008
Author: ruz
Date: Tue Dec 16 18:26:50 2008
New Revision: 17271
Modified:
rtir/2.4/trunk/html/RTIR/Create.html
rtir/2.4/trunk/html/RTIR/Investigation/Elements/Create
Log:
* add support for RTFM on Create in RTIR, needs RTFM trunk (not yet released 2.4.1)
Modified: rtir/2.4/trunk/html/RTIR/Create.html
==============================================================================
--- rtir/2.4/trunk/html/RTIR/Create.html (original)
+++ rtir/2.4/trunk/html/RTIR/Create.html Tue Dec 16 18:26:50 2008
@@ -314,6 +314,7 @@
% $ARGS{Content} =~ s/\>/>/g;
% }
% }
+% $m->callback( %ARGS, CallbackPage => '/Ticket/Create.html', CallbackName => 'BeforeMessageBox' );
<& /Elements/MessageBox, Default => $ARGS{Content}, QuoteTransaction => $QuoteTransaction &>
</td>
</tr>
@@ -364,7 +365,8 @@
}
$name ||= $Type;
-my (@results, $checks_failure);
+my (@results, $checks_failure, $skip_create);
+$skip_create = !$ARGS{'Create'};
my $IncidentObj;
if ( $Incident ) {
@@ -410,7 +412,7 @@
self => $gnupg_widget,
QueueObj => $QueueObj,
);
-if ( $ARGS{'Create'} && $gnupg_widget ) {
+if ( !$skip_create && $gnupg_widget ) {
my $status = $m->comp('/Elements/GnuPG/SignEncryptWidget:Check',
self => $gnupg_widget,
Operation => 'Create',
@@ -419,7 +421,7 @@
$checks_failure = 1 unless $status;
}
-if ( $ARGS{'Create'} ) {
+unless ( $skip_create ) {
if ( $Type eq 'Investigation' && !$ARGS{'Requestors'} ) {
push @results, loc( "You must enter a correspondent" );
$checks_failure = 1;
@@ -436,16 +438,25 @@
push @results, loc( "Invalid value(s) of the custom fields:" ), @msg;
$checks_failure = 1;
}
+}
- unless ( $checks_failure ) {
- $ARGS{'new-MemberOf'} = $parentvalue if $parentvalue;
- $m->callback(CallbackName => 'BeforeDisplay', Ticket => $TicketObj, ARGSRef => \%ARGS);
- push @{ $session{'Actions'}{''} ||= [] }, @results;
- return $m->comp( 'Display.html', %ARGS, SkipNotification => \@SkipNotification );
- }
- unshift @results, loc("Creation failed:") if @results;
+# for RTFM and other things
+$m->callback(
+ CallbackName => 'BeforeCreate', CallbackPage => '/Ticket/Create.html',
+ ARGSRef => \%ARGS, results => \@results,
+ skip_create => \$skip_create, checks_failure => $checks_failure
+);
+
+unless ( $skip_create || $checks_failure ) {
+ $ARGS{'new-MemberOf'} = $parentvalue if $parentvalue;
+ $m->callback(CallbackName => 'BeforeDisplay', Ticket => $TicketObj, ARGSRef => \%ARGS);
+ push @{ $session{'Actions'}{''} ||= [] }, @results;
+ return $m->comp( 'Display.html', %ARGS, SkipNotification => \@SkipNotification );
}
+unshift @results, loc("Creation failed:")
+ if $checks_failure && @results;
+
my ($Title, $SubmitCaption);
if ( $Split ) {
$Title = loc("Split [_1] #[_2]: [_3]", $name, $TicketObj->id, $TicketObj->Subject);
@@ -460,7 +471,6 @@
}
}
-
</%INIT>
<%ARGS>
Modified: rtir/2.4/trunk/html/RTIR/Investigation/Elements/Create
==============================================================================
--- rtir/2.4/trunk/html/RTIR/Investigation/Elements/Create (original)
+++ rtir/2.4/trunk/html/RTIR/Investigation/Elements/Create Tue Dec 16 18:26:50 2008
@@ -89,7 +89,10 @@
% unless ( $SkipField{'Content'} || $HideField{'Content'} ) {
<tr><td class="labeltop"><&|/l&>Message</&>:</td>
-<td><& /Elements/MessageBox,
+<td>
+% $m->callback( %ARGS, MessageBoxName => $NamePrefix .'Content',
+% CallbackPage => '/Ticket/Create.html', CallbackName => 'BeforeMessageBox' );
+<& /Elements/MessageBox,
Name => $NamePrefix .'Content',
Default => $value_cb->('Content'),
QuoteTransaction => $value_cb->('QuoteTransaction'),
More information about the Rt-commit
mailing list