File: ModifyRecurrence.html

package info (click to toggle)
rt-extension-repeatticket 2.04-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 472 kB
  • sloc: perl: 4,006; sh: 70; makefile: 45
file content (50 lines) | stat: -rw-r--r-- 1,550 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<& /Elements/Header, Title => loc('Modify recurrence for #[_1]', $TicketObj->Id) &>
<& /Elements/Tabs &>

<& /Elements/ListActions, actions => \@results &>

% unless ( $skip ) {
<form method="post" name="ModifyRecurrence" action="ModifyRecurrence.html" class="mx-auto max-width-lg">
<input type="hidden" class="hidden" name="id" value="<%$TicketObj->Id%>" />
<&| /Widgets/TitleBox,title => loc('Modify recurrence for ticket # [_1]', $TicketObj->Id), class=> 'ticket-info-repeat' &>
<& Elements/EditRecurrence, Ticket => $TicketObj, ARGSRef => $ARGSRef &>
</&>

  <div class="form-row">
    <div class="col-12">
      <& /Elements/Submit, Name => 'SubmitTicket', Label => loc('Save Changes') &>
    </div>
  </div>
</form>
% }

<%INIT>

my $TicketObj = LoadTicket($id);
my @results;

my $skip;
my $cf = RT::CustomField->new($session{CurrentUser});
$cf->Load('Original Ticket');
unless( $cf->id && ( $cf->can('IsAdded') ? ( $cf->IsAdded(0) || $cf->IsAdded($TicketObj->Queue) ) : ( $cf->IsApplied(0) || $cf->IsApplied($TicketObj->Queue)) ) ) {
    push @results, loc('RepeatTicket is not enabled in this Queue');
    $skip = 1;
}

if ( $ARGS{SubmitTicket} ) {
    if ( $TicketObj->CurrentUserHasRight('ModifyTicket') ) {
        my ( $ret, $message ) = RT::Extension::RepeatTicket::SetRepeatAttribute( $TicketObj, %ARGS );
        $ARGSRef = \%ARGS if not $ret; # Save params on failure
        push @results, $message;
    }
    else {
        push @results, loc('Permission Denied');
    }
}

</%INIT>

<%ARGS>
$id => undef
$ARGSRef => undef
</%ARGS>