diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:32:26 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:32:26 -0700 |
commit | 026dc7ad72ba972f230b6709e31fa64397d75ad4 (patch) | |
tree | c5af1a7ac9154744afc3660e9a9405892f2bb50b /rt/share/html/Ticket/Modify.html | |
parent | 07b4bc84d1078f7390221d766cdb3142513db4b0 (diff) | |
parent | 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (diff) |
merge RT 4.2.11 and Header changes to disable RT javascript, RT#34237
Diffstat (limited to 'rt/share/html/Ticket/Modify.html')
-rwxr-xr-x | rt/share/html/Ticket/Modify.html | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/rt/share/html/Ticket/Modify.html b/rt/share/html/Ticket/Modify.html index af417e9ed..40adbda2a 100755 --- a/rt/share/html/Ticket/Modify.html +++ b/rt/share/html/Ticket/Modify.html @@ -56,36 +56,61 @@ <input type="hidden" class="hidden" name="id" value="<% $TicketObj->Id %>" /> <&| /Widgets/TitleBox, title => loc('Modify ticket #[_1]',$TicketObj->Id), class=>'ticket-info-basics' &> -<& Elements/EditBasics, TicketObj => $TicketObj &> -<& Elements/EditCustomFields, TicketObj => $TicketObj, DefaultsFromTopArguments => 0 &> +<table> +<& Elements/EditBasics, TicketObj => $TicketObj, defaults => \%ARGS, InTable => 1 &> +<& Elements/EditCustomFields, Object => $TicketObj, Grouping => 'Basics', InTable => 1, DefaultsFromTopArguments => 0 &> +</table> </&> % $m->callback( CallbackName => 'AfterBasics', Ticket => $TicketObj ); +<& /Elements/EditCustomFieldCustomGroupings, Object => $TicketObj &> + <& /Elements/Submit, Name => 'SubmitTicket', Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#993333" &> </form> + +% $m->callback(CallbackName => 'AfterForm', ARGSRef => \%ARGS, Ticket => $TicketObj); <%INIT> my $TicketObj = LoadTicket($id); my $CustomFields = $TicketObj->CustomFields; -# call this to show up hints of valid cf values. -$m->comp( - '/Elements/ValidateCustomFields', - CustomFields => $CustomFields, - ARGSRef => {}, -); +my @results; +my $skip_update = 0; # Now let callbacks have a chance at editing %ARGS -$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef => \%ARGS ); +$m->callback( TicketObj => $TicketObj, CustomFields => $CustomFields, ARGSRef => \%ARGS, skip_update => \$skip_update, results => \@results ) -my @results; -push @results, ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS); -push @results, ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS); push @results, ProcessTicketStatus(TicketObj => $TicketObj, ARGSRef => \%ARGS); # for WillResolve push @results, ProcessTicketDates( TicketObj => $TicketObj, ARGSRef => \%ARGS); -$TicketObj->ApplyTransactionBatch; +{ + my ($status, @msg) = $m->comp( + '/Elements/ValidateCustomFields', + Object => $TicketObj, + CustomFields => $CustomFields, + ARGSRef => \%ARGS, + ); + unless ($status) { + push @results, @msg; + $skip_update = 1; + } +} + +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; + + MaybeRedirectForResults( + Actions => \@results, + Path => "/Ticket/Modify.html", + Arguments => { id => $TicketObj->id }, + ); +} unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { if (@results) { |