File: BeforeUpdate

package info (click to toggle)
rt-extension-customfieldsonupdate 1.03-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: perl: 2,402; sh: 60; makefile: 29
file content (25 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<%ARGS>
$TicketObj
$skip_update
$results
$ARGSRef => {}
</%ARGS>
<%INIT>
return unless $ARGSRef->{'SubmitTicket'};

my $CFs = $TicketObj->CustomFields;
my $ValidCFs = $m->comp(
    '/Elements/ValidateCustomFields',
    CustomFields => $CFs,
    NamePrefix => "Object-RT::Ticket-". $TicketObj->id ."-CustomField-",
    Object => $TicketObj,
    ARGSRef => $ARGSRef
);
unless ( $ValidCFs ) { 
    $$skip_update = 1;
    while (my $CF = $CFs->Next) {
        my $msg = $m->notes('InvalidField-' . $CF->Id) or next;
        push @$results, loc($CF->Name) . ': ' . $msg;
    }
}
</%INIT>