RT# 75322 Add ticket action Quiet Resolve
[freeside.git] / rt / etc / initialdata
1 # Initial data for a fresh RT installation.
2
3 @Users = (
4     {  Name         => 'root',
5        Gecos        => 'root',
6        RealName     => 'Enoch Root',
7        Password     => 'password',
8        EmailAddress => "root\@localhost",
9        Comments     => 'SuperUser',
10        Privileged   => '1',
11     },
12 );
13
14 @Groups = (
15 );
16
17 @Queues = ({ Name              => 'General',
18              Description       => 'The default queue',
19              CorrespondAddress => "",
20              CommentAddress    => "", },
21            { Name        => '___Approvals',
22              Lifecycle   => 'approvals',
23              Description => 'A system-internal queue for the approvals system',
24              Disabled    => 2, } );
25
26 @ScripActions = (
27
28     {  Name        => 'Autoreply To Requestors',    # loc
29        Description =>
30 'Always sends a message to the requestors independent of message sender' ,                                            # loc
31        ExecModule => 'Autoreply',
32        Argument   => 'Requestor' },
33     { Name        => 'Notify Requestors',                    # loc
34       Description => 'Sends a message to the requestors',    # loc
35       ExecModule  => 'Notify',
36       Argument    => 'Requestor' },
37     { Name        => 'Notify Owner as Comment',              # loc
38       Description => 'Sends mail to the owner',              # loc
39       ExecModule  => 'NotifyAsComment',
40       Argument    => 'Owner' },
41     { Name        => 'Notify Owner',                         # loc
42       Description => 'Sends mail to the owner',              # loc
43       ExecModule  => 'Notify',
44       Argument    => 'Owner' },
45     { Name        => 'Notify Ccs as Comment',              # loc
46       Description => 'Sends mail to the Ccs as a comment', # loc
47       ExecModule  => 'NotifyAsComment',
48       Argument    => 'Cc' },
49     { Name        => 'Notify Ccs',                                   # loc
50       Description => 'Sends mail to the Ccs',                        # loc
51       ExecModule  => 'Notify',
52       Argument    => 'Cc' },
53     { Name        => 'Notify AdminCcs as Comment',                        # loc
54       Description => 'Sends mail to the administrative Ccs as a comment', # loc
55       ExecModule  => 'NotifyAsComment',
56       Argument    => 'AdminCc' },
57     { Name        => 'Notify AdminCcs',                                   # loc
58       Description => 'Sends mail to the administrative Ccs',              # loc
59       ExecModule  => 'Notify',
60       Argument    => 'AdminCc' },
61     { Name        => 'Notify Owner and AdminCcs',                         # loc
62       Description => 'Sends mail to the Owner and administrative Ccs',    # loc
63       ExecModule  => 'Notify',
64       Argument    => 'Owner,AdminCc' },
65     { Name        => 'Notify Owner or AdminCcs',                         # loc
66       Description => 'Sends mail to the Owner if set, otherwise administrative Ccs',    # loc
67       ExecModule  => 'NotifyOwnerOrAdminCc',
68     },
69     { Name        => 'Notify Requestors and Ccs as Comment',              # loc
70       Description => 'Send mail to requestors and Ccs as a comment',      # loc
71       ExecModule  => 'NotifyAsComment',
72       Argument    => 'Requestor,Cc' },
73
74 # deprecated
75 #    { Name        => 'Notify Requestors and Ccs',                         # loc
76 #      Description => 'Send mail to requestors and Ccs',                   # loc
77 #      ExecModule  => 'Notify',
78 #      Argument    => 'Requestor,Cc' },
79
80 # not yet deprecated
81     { Name        => 'Notify Owner, Requestors, Ccs and AdminCcs as Comment',    # loc
82       Description => 'Send mail to owner and all watchers as a "comment"',          # loc
83       ExecModule  => 'NotifyAsComment',
84       Argument    => 'All' },
85     { Name        => 'Notify Owner, Requestors, Ccs and AdminCcs',               # loc
86       Description => 'Send mail to owner and all watchers',                         # loc
87       ExecModule  => 'Notify',
88       Argument    => 'All' },
89     { Name        => 'Notify Other Recipients as Comment',                # loc
90       Description => 'Sends mail to explicitly listed Ccs and Bccs',      # loc
91       ExecModule  => 'NotifyAsComment',
92       Argument    => 'OtherRecipients' },
93 # deprecated?  now default create scrips use it in 4.2
94     { Name        => 'Notify Other Recipients',                           # loc
95       Description => 'Sends mail to explicitly listed Ccs and Bccs',      # loc
96       ExecModule  => 'Notify',
97       Argument    => 'OtherRecipients' },
98
99     { Name        => 'User Defined',                                      # loc
100       Description => 'Perform a user-defined action',                     # loc
101       ExecModule  => 'UserDefined', },
102     {  Name        => 'Create Tickets',                                    # loc
103        Description =>
104          'Create new tickets based on this scrip\'s template',             # loc
105        ExecModule => 'CreateTickets', },
106     { Name        => 'Open Tickets',                                      # loc
107       Description => 'Open tickets on correspondence',                    # loc
108       ExecModule  => 'AutoOpen' },
109     { Name        => 'Extract Subject Tag',                               # loc
110       Description => 'Extract tags from a Transaction\'s subject and add them to the Ticket\'s subject.', # loc
111       ExecModule  => 'ExtractSubjectTag' },
112     { Name        => 'Send Forward',                 # loc
113       Description => 'Send forwarded message',       # loc
114       ExecModule  => 'SendForward', },
115     #freeside
116     { Name        => 'Set Priority',
117       Description => 'Set ticket priority',
118       ExecModule  => 'SetPriority',
119       Argument    => '',
120     },
121     { Name        => 'Cancel Scheduled Resolve',
122       Description => 'Set ticket not to resolve in the future',
123       ExecModule  => 'SetWillResolve',
124       Argument    => '',
125     },
126     { Name        => 'Scheduled Resolve',
127       Description => 'Resolve ticket if its WillResolve date has passed',
128       ExecModule  => 'ScheduledResolve',
129       Argument    => '',
130     },
131 # combine these into a single action so they can see each other in the headers
132     { Name        => 'Notify Requestors, Ccs, and Other Recipients',
133       Description => 'Send mail to requestors, watchers, and explicit Ccs',
134       ExecModule  => 'Notify',
135       Argument    => 'Requestor,Cc,OtherRecipients',
136     },
137 );
138
139 @ScripConditions = (
140     { Name                 => 'On Create',                                # loc
141       Description          => 'When a ticket is created',                 # loc
142       ApplicableTransTypes => 'Create',
143       ExecModule           => 'AnyTransaction', },
144
145     { Name                 => 'On Transaction',                           # loc
146       Description          => 'When anything happens',                    # loc
147       ApplicableTransTypes => 'Any',
148       ExecModule           => 'AnyTransaction', },
149     {
150
151       Name                 => 'On Correspond',                             # loc
152       Description          => 'Whenever correspondence comes in',          # loc
153       ApplicableTransTypes => 'Correspond',
154       ExecModule           => 'AnyTransaction', },
155
156     {
157
158       Name                 => 'On Forward',                                # loc
159       Description          => 'Whenever a ticket or transaction is forwarded', # loc
160       ApplicableTransTypes => 'Forward Transaction,Forward Ticket',
161       ExecModule           => 'AnyTransaction', },
162
163     {
164
165       Name                 => 'On Forward Ticket',                         # loc
166       Description          => 'Whenever a ticket is forwarded',            # loc
167       ApplicableTransTypes => 'Forward Ticket',
168       ExecModule           => 'AnyTransaction', },
169
170     {
171
172       Name                 => 'On Forward Transaction',                    # loc
173       Description          => 'Whenever a transaction is forwarded',       # loc
174       ApplicableTransTypes => 'Forward Transaction',
175       ExecModule           => 'AnyTransaction', },
176
177     {
178
179       Name                 => 'On Comment',                                # loc
180       Description          => 'Whenever comments come in',                 # loc
181       ApplicableTransTypes => 'Comment',
182       ExecModule           => 'AnyTransaction' },
183     {
184
185       Name                 => 'On Status Change',                          # loc
186       Description          => 'Whenever a ticket\'s status changes',       # loc
187       ApplicableTransTypes => 'Status',
188       ExecModule           => 'AnyTransaction',
189
190     },
191     {
192
193       Name                 => 'On Priority Change',                       # loc
194       Description          => 'Whenever a ticket\'s priority changes',    # loc
195       ApplicableTransTypes => 'Set',
196       ExecModule           => 'PriorityChange',
197     },
198     {
199
200       Name                 => 'On Owner Change',                           # loc
201       Description          => 'Whenever a ticket\'s owner changes',        # loc
202       ApplicableTransTypes => 'Any',
203       ExecModule           => 'OwnerChange',
204
205     },
206     {
207
208       Name                 => 'On Queue Change',                           # loc
209       Description          => 'Whenever a ticket\'s queue changes',        # loc
210       ApplicableTransTypes => 'Set',
211       ExecModule           => 'QueueChange',
212
213     },
214     {  Name                 => 'On Resolve',                               # loc
215        Description          => 'Whenever a ticket is resolved',            # loc
216        ApplicableTransTypes => 'Status',
217        ExecModule           => 'StatusChange',
218        Argument             => 'resolved'
219
220     },
221     {  Name                 => 'On Reject',                                # loc
222        Description          => 'Whenever a ticket is rejected',            # loc
223        ApplicableTransTypes => 'Status',
224        ExecModule           => 'StatusChange',
225        Argument             => 'rejected'
226
227     },
228     {  Name                 => 'User Defined',                             # loc
229        Description          => 'Whenever a user-defined condition occurs', # loc
230        ApplicableTransTypes => 'Any',
231        ExecModule           => 'UserDefined'
232
233     },
234
235     {  Name                 => 'On Close',                                 # loc
236        Description          => 'Whenever a ticket is closed', # loc
237        ApplicableTransTypes => 'Status,Set',
238        ExecModule           => 'CloseTicket',
239     },
240     {  Name                 => 'On Reopen',                                # loc
241        Description          => 'Whenever a ticket is reopened', # loc
242        ApplicableTransTypes => 'Status,Set',
243        ExecModule           => 'ReopenTicket',
244     },
245
246     #freeside
247     #{  Name                 => 'On Custom Field Transaction',
248     #   Description          => 'When a custom field is changed',
249     #   ExecModule           => 'CustomFieldTransaction',
250     #   ApplicableTransTypes => 'Any',
251     #},
252     #{  Name                 => 'On Custom Field Change',
253     #   Description          => 'When a custom field is changed to some value',
254     #   ExecModule           => 'CustomFieldChange',
255     #   ApplicableTransTypes => 'Any',
256     #},
257     {  Name                 => 'On Resolve Allow Quiet',
258        Description          => 'Whenever a ticket is resolved, '.
259                                'except with resolve_quiet',
260        ApplicableTransTypes => 'Status',
261        ExecModule           => 'StatusChangeQuietResolve',
262     },
263 );
264
265 @Templates = (
266     { Queue       => '0',
267       Name        => 'Blank',                                             # loc
268       Description => 'A blank template',                                  # loc
269       Content     => '', },
270     {  Queue       => '0',
271        Name        => 'Autoreply',                                         # loc
272        Description => 'Plain text Autoresponse template',                     # loc
273        Content     => 'Subject: AutoReply: {$Ticket->Subject}
274
275
276 Greetings,
277
278 This message has been automatically generated in response to the
279 creation of a trouble ticket regarding:
280         "{$Ticket->Subject()}", 
281 a summary of which appears below.
282
283 There is no need to reply to this message right now.  Your ticket has been
284 assigned an ID of { $Ticket->SubjectTag }.
285
286 Please include the string:
287
288          { $Ticket->SubjectTag }
289
290 in the subject line of all future correspondence about this issue. To do so, 
291 you may reply to this message.
292
293                         Thank you,
294                         {$Ticket->QueueObj->CorrespondAddress()}
295
296 -------------------------------------------------------------------------
297 {$Transaction->Content()}
298 '
299     },
300     {  Queue       => '0',
301        Name        => 'Autoreply in HTML',                              # loc
302        Description => 'HTML Autoresponse template',                     # loc
303        Content     => q[Subject: AutoReply: {$Ticket->Subject}
304 Content-Type: text/html
305
306 <p>Greetings,</p>
307
308 <p>This message has been automatically generated in response to the
309 creation of a trouble ticket regarding <b>{$Ticket->Subject()}</b>,
310 a summary of which appears below.</p>
311
312 <p>There is no need to reply to this message right now.  Your ticket has been
313 assigned an ID of <b>{$Ticket->SubjectTag}</b>.</p>
314
315 <p>Please include the string <b>{$Ticket->SubjectTag}</b>
316 in the subject line of all future correspondence about this issue. To do so,
317 you may reply to this message.</p>
318
319 <p>Thank you,<br/>
320 {$Ticket->QueueObj->CorrespondAddress()}</p>
321
322 <hr/>
323 {$Transaction->Content(Type => 'text/html')}
324 ],
325     },
326     {  Queue       => '0',
327        Name        => 'AutoreplyOrCorrespondence',                      # loc
328        Description => 'Plaintext AutoreplyOrCorrespondence template',   # loc
329        Content     => q[{
330       use RT::Template;
331       my $creator_name = $Ticket->CreatorObj->Name;
332       my $requestors = $Ticket->Requestors->UserMembersObj;
333       my ( $c_requestor, $r_count ) = ( 0, 0 );
334       while ( my $r = $requestors->Next() ) {
335           if ( $r->Name eq $creator_name ) {
336               $c_requestor++;
337           }
338           else {
339               $r_count++;
340           }
341       }
342       my $template = new RT::Template($RT::SystemUser);
343       my $template_name;
344
345       #if the creator is not a requestor or
346       #there is more than one requestor ( who's not the creator )
347       #use the Correspondence template
348       if ( ! $c_requestor || $r_count ) {
349           $template_name = 'Correspondence';
350       }
351       else {
352           #otherwise use the Autoreply template
353           $template_name = 'Autoreply';
354       }
355
356       #Load the Queue Template
357       $template->LoadQueueTemplate(
358           Queue => $Ticket->Queue,
359           Name => $template_name,
360       );
361       #if there's no Queue Template attempt to find a Global one.
362       unless ( $template->id ) {
363           $template->LoadGlobalTemplate( $template_name );
364           unless ( $template->id ) {
365               $RT::Logger->error("Could not load template : $template_name")
366           }
367       }
368       #Process embedded fields & expressions of true templates;
369       #note that we can only meaningfully use the body
370       my($ret, $msg) = $template->Parse(
371                            TicketObj => $Ticket,
372                            TransactionObj => $Transaction,
373                        );
374       $ret ? $template->MIMEObj->stringify : $msg;
375     }
376 ],
377     },
378     {  Queue       => '0',
379        Name        => 'AutoreplyOrCorrespondence in HTML',              # loc
380        Description => 'HTML AutoreplyOrCorrespondence template',   # loc
381        Content     => q[{
382       use RT::Template;
383       my $creator_name = $Ticket->CreatorObj->Name;
384       my $requestors = $Ticket->Requestors->UserMembersObj;
385       my ( $c_requestor, $r_count ) = ( 0, 0 );
386       while ( my $r = $requestors->Next() ) {
387           if ( $r->Name eq $creator_name ) {
388               $c_requestor++;
389           }
390           else {
391               $r_count++;
392           }
393       }
394       my $template = new RT::Template($RT::SystemUser);
395       my $template_name;
396
397       #if the creator is not a requestor or
398       #there is more than one requestor ( who's not the creator )
399       #use the Correspondence template
400       if ( ! $c_requestor || $r_count ) {
401           $template_name = 'Correspondence in HTML';
402       }
403       else {
404           #otherwise use the Autoreply in HTML template
405           $template_name = 'Autoreply in HTML';
406       }
407
408       #Load the Queue Template
409       $template->LoadQueueTemplate(
410           Queue => $Ticket->Queue,
411           Name => $template_name,
412       );
413       #if there's no Queue Template attempt to find a Global one.
414       unless ( $template->id ) {
415           $template->LoadGlobalTemplate( $template_name );
416           unless ( $template->id ) {
417               $RT::Logger->error("Could not load template : $template_name")
418           }
419       }
420       #Process embedded fields & expressions of true templates;
421       #note that we can only meaningfully use the body
422       my($ret, $msg) = $template->Parse(
423                            TicketObj => $Ticket,
424                            TransactionObj => $Transaction,
425                        );
426       $ret ? $template->MIMEObj->stringify : $msg;
427     }
428 ],
429     },
430     {  Queue       => '0',
431        Name        => 'Transaction',                     # loc
432        Description => 'Plain text transaction template', # loc
433        Content     => 'RT-Attach-Message: yes
434
435
436 {$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.
437  Transaction: {$Transaction->Description}
438        Queue: {$Ticket->QueueObj->Name}
439      Subject: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"}
440        Owner: {$Ticket->OwnerObj->Name}
441   Requestors: {$Ticket->RequestorAddresses}
442       Status: {$Ticket->Status}
443  Ticket <URL: {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id} >
444
445
446 {$Transaction->Content()}
447 '
448     },
449     {  Queue       => '0',
450        Name        => 'Transaction in HTML',          # loc
451        Description => 'HTML transaction template',    # loc
452        Content     => 'RT-Attach-Message: yes
453 Content-Type: text/html
454
455 <b>{$Transaction->CreatedAsString}: Request <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{$Ticket->id}</a> was acted upon by {$Transaction->CreatorObj->Name}.</b>
456 <br>
457 <table border="0">
458 <tr><td align="right"><b>Transaction:</b></td><td>{$Transaction->Description}</td></tr>
459 <tr><td align="right"><b>Queue:</b></td><td>{$Ticket->QueueObj->Name}</td></tr>
460 <tr><td align="right"><b>Subject:</b></td><td>{$Transaction->Subject || $Ticket->Subject || "(No subject given)"} </td></tr>
461 <tr><td align="right"><b>Owner:</b></td><td>{$Ticket->OwnerObj->Name}</td></tr>
462 <tr><td align="right"><b>Requestors:</b></td><td>{$Ticket->RequestorAddresses}</td></tr>
463 <tr><td align="right"><b>Status:</b></td><td>{$Ticket->Status}</td></tr>
464 <tr><td align="right"><b>Ticket URL:</b></td><td><a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}</a></td></tr>
465 </table>
466 <br/>
467 <br/>
468 {$Transaction->Content( Type => "text/html")}
469 '
470     },
471     # Shadow the global templates of the same name to suppress duplicate
472     # notifications until rules is ripped out.
473     { Queue     => "___Approvals",
474       Name      => "Transaction in HTML",
475       Content   => "",
476     },
477     { Queue     => "___Approvals",
478       Name      => "Transaction",
479       Content   => "",
480     },
481     {
482
483       Queue       => '0',
484       Name        => 'Admin Correspondence',                     # loc
485       Description => 'Plain text admin correspondence template',    # loc
486       Content     => 'RT-Attach-Message: yes
487
488
489 <URL: {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id} >
490
491 {$Transaction->Content()}
492 '
493     },
494     {  Queue       => '0',
495        Name        => 'Admin Correspondence in HTML',                     # loc
496        Description => 'HTML admin correspondence template',    # loc
497        Content     => 'RT-Attach-Message: yes
498 Content-Type: text/html
499
500 Ticket URL: <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}</a>
501 <br />
502 <br />
503 {$Transaction->Content(Type => "text/html");}
504 '
505     },
506     {  Queue       => '0',
507        Name        => 'Correspondence',                          # loc
508        Description => 'Plain text correspondence template',         # loc
509        Content     => 'RT-Attach-Message: yes
510
511 {$Transaction->Content()}
512 '
513     },
514     {  Queue       => '0',
515        Name        => 'Correspondence in HTML',                 # loc
516        Description => 'HTML correspondence template',           # loc
517        Content     => 'RT-Attach-Message: yes
518 Content-Type: text/html
519
520 {$Transaction->Content( Type => "text/html")}
521 '
522     },
523     {  Queue       => '0',
524        Name        => 'Admin Comment',                           # loc
525        Description => 'Plain text admin comment template',          # loc
526        Content     =>
527 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject||""); $s =~ s/\\[Comment\\]\\s*//g; $s =~ s/^Re:\\s*//i; $s;}
528 RT-Attach-Message: yes
529
530
531 {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id}
532 This is a comment.  It is not sent to the Requestor(s):
533
534 {$Transaction->Content()}
535 '
536     },
537     {  Queue       => '0',
538        Name        => 'Admin Comment in HTML',                  # loc
539        Description => 'HTML admin comment template',            # loc
540        Content     => 
541 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject||""); $s =~ s/\\[Comment\\]\\s*//g; $s =~ s/^Re:\\s*//i; $s;}
542 RT-Attach-Message: yes
543 Content-Type: text/html
544
545 <p>This is a comment about <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">ticket {$Ticket->id}</a>. It is not sent to the Requestor(s):</p>
546
547 {$Transaction->Content(Type => "text/html")}
548 '
549     },
550     {  Queue       => '0',
551        Name        => 'Reminder',                           # loc
552        Description => 'Default reminder template',          # loc
553        Content     =>
554 'Subject:{$Ticket->Subject} is due {$Ticket->DueObj->AsString}
555
556 This reminder is for ticket #{$Target = $Ticket->RefersTo->First->TargetObj;$Target->Id}.
557
558 {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Target->Id}
559 '
560     },
561
562     {  Queue       => '0',
563        Name        => 'Status Change',                                     # loc
564        Description => 'Ticket status changed',                             # loc
565        Content     => 'Subject: Status Changed to: {$Transaction->NewValue}
566
567
568 {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id}
569
570 {$Transaction->Content()}
571 '
572     },
573     {  Queue       => '0',
574        Name        => 'Status Change in HTML',              # loc
575        Description => 'HTML Ticket status changed',              # loc
576        Content     => 'Subject: Status Changed to: {$Transaction->NewValue}
577 Content-Type: text/html
578
579 <a href="{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}">{RT->Config->Get("WebURL")}Ticket/Display.html?id={$Ticket->id}</a>
580 <br/>
581 <br/>
582 {$Transaction->Content(Type => "text/html")}
583 '
584     },
585     {
586
587       Queue       => '0',
588       Name        => 'Resolved',                 # loc
589       Description => 'Ticket Resolved',          # loc
590       Content     => 'Subject: Resolved: {$Ticket->Subject}
591
592 According to our records, your request has been resolved. If you have any
593 further questions or concerns, please respond to this message.
594 '
595     },
596     {  Queue       => '0',
597        Name        => 'Resolved in HTML',               # loc
598        Description => 'HTML Ticket Resolved',           # loc
599        Content     => 'Subject: Resolved: {$Ticket->Subject}
600 Content-Type: text/html
601
602 <p>According to our records, your request has been resolved.  If you have any further questions or concerns, please respond to this message.</p>
603 '
604     },
605     {  Queue       => '___Approvals',
606        Name        => "New Pending Approval",    # loc
607        Description =>
608          "Notify Owners and AdminCcs of new items pending their approval", # loc
609        Content => 'Subject: New Pending Approval: {$Ticket->Subject}
610
611 Greetings,
612
613 There is a new item pending your approval: "{$Ticket->Subject()}", 
614 a summary of which appears below.
615
616 Please visit {RT->Config->Get(\'WebURL\')}Approvals/Display.html?id={$Ticket->id}
617 to approve or reject this ticket, or {RT->Config->Get(\'WebURL\')}Approvals/ to
618 batch-process all your pending approvals.
619
620 -------------------------------------------------------------------------
621 {$Transaction->Content()}
622 '
623     },
624     {  Queue       => '___Approvals',
625        Name        => "New Pending Approval in HTML",                                   # loc
626        Description => "Notify Owners and AdminCcs of new items pending their approval", # loc
627        Content     => 'Subject: New Pending Approval: {$Ticket->Subject}
628 Content-Type: text/html
629
630 <p>Greetings,</p>
631
632 <p>There is a new item pending your approval: <b>{$Ticket->Subject()}</b>,
633 a summary of which appears below.</p>
634
635 <p>Please <a href="{RT->Config->Get(\'WebURL\')}Approvals/Display.html?id={$Ticket->id}">approve
636 or reject this ticket</a>, or visit the <a href="{RT->Config->Get(\'WebURL\')}Approvals/">approvals
637 overview</a> to batch-process all your pending approvals.</p>
638
639 <hr />
640 {$Transaction->Content()}
641 '
642     },
643     {  Queue       => '___Approvals',
644        Name        => "Approval Passed",    # loc
645        Description =>
646          "Notify Requestor of their ticket has been approved by some approver", # loc
647        Content => 'Subject: Ticket Approved: {$Ticket->Subject}
648
649 Greetings,
650
651 Your ticket has been approved by { eval { $Approver->Name } }.
652 Other approvals may be pending.
653
654 Approver\'s notes: { $Notes }
655 '
656     },
657     {  Queue       => '___Approvals',
658        Name        => "Approval Passed in HTML",    # loc
659        Description =>
660          "Notify Requestor of their ticket has been approved by some approver", # loc
661        Content => 'Subject: Ticket Approved: {$Ticket->Subject}
662 Content-Type: text/html
663
664 <p>Greetings,</p>
665
666 <p>Your ticket has been approved by <b>{ eval { $Approver->Name } }</b>.
667 Other approvals may be pending.</p>
668
669 <p>Approver\'s notes:</p>
670 <blockquote>{ $Notes }</blockquote>
671 '
672     },
673     {  Queue       => '___Approvals',
674        Name        => "All Approvals Passed",    # loc
675        Description =>
676          "Notify Requestor of their ticket has been approved by all approvers", # loc
677        Content => 'Subject: Ticket Approved: {$Ticket->Subject}
678
679 Greetings,
680
681 Your ticket has been approved by { eval { $Approver->Name } }.
682 Its Owner may now start to act on it.
683
684 Approver\'s notes: { $Notes }
685 '
686     },
687     {  Queue       => '___Approvals',
688        Name        => "All Approvals Passed in HTML",    # loc
689        Description =>
690          "Notify Requestor of their ticket has been approved by all approvers", # loc
691        Content => 'Subject: Ticket Approved: {$Ticket->Subject}
692 Content-Type: text/html
693
694 <p>Greetings,</p>
695
696 <p>Your ticket has been approved by <b>{ eval { $Approver->Name } }</b>.
697 Its Owner may now start to act on it.</p>
698
699 <p>Approver\'s notes:</p>
700 <blockquote>{ $Notes }</blockquote>
701 '
702     },
703     {  Queue       => '___Approvals',
704        Name        => "Approval Rejected",    # loc
705        Description =>
706          "Notify Owner of their rejected ticket", # loc
707        Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
708
709 Greetings,
710
711 Your ticket has been rejected by { eval { $Approver->Name } }.
712
713 Approver\'s notes: { $Notes }
714 '
715     },
716     {  Queue       => '___Approvals',
717        Name        => "Approval Rejected in HTML",    # loc
718        Description =>
719          "Notify Owner of their rejected ticket", # loc
720        Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
721 Content-Type: text/html
722
723 <p>Greetings,</p>
724
725 <p>Your ticket has been rejected by <b>{ eval { $Approver->Name } }</b>.</p>
726
727 <p>Approver\'s notes:</p>
728 <blockquote>{ $Notes }</blockquote>
729 '
730     },
731     {  Queue       => '___Approvals',
732        Name        => "Approval Ready for Owner",    # loc
733        Description =>
734          "Notify Owner of their ticket has been approved and is ready to be acted on", # loc
735        Content => 'Subject: Ticket Approved: {$Ticket->Subject}
736
737 Greetings,
738
739 The ticket has been approved, you may now start to act on it.
740
741 '
742     },
743     {  Queue       => '___Approvals',
744        Name        => "Approval Ready for Owner in HTML",    # loc
745        Description =>
746          "Notify Owner of their ticket has been approved and is ready to be acted on", # loc
747        Content => 'Subject: Ticket Approved: {$Ticket->Subject}
748 Content-Type: text/html
749
750 <p>Greetings,</p>
751
752 <p>The ticket has been approved, you may now start to act on it.</p>
753
754 '
755     },
756     {  Queue       => 0,
757        Name        => "Forward",    # loc
758        Description => "Forwarded message", # loc
759        Content => q{
760
761 { $ForwardTransaction->Content =~ /\S/ ? $ForwardTransaction->Content : "This is a forward of transaction #".$Transaction->id." of ticket #". $Ticket->id }
762 }
763     },
764     {  Queue       => 0,
765        Name        => "Forward Ticket",    # loc
766        Description => "Forwarded ticket message", # loc
767        Content => q{
768
769 { $ForwardTransaction->Content =~ /\S/ ? $ForwardTransaction->Content : "This is a forward of ticket #". $Ticket->id }
770 }
771     },
772     {  Queue       => 0,
773        Name        => "Error: unencrypted message",    # loc
774        Description =>
775          "Inform user that their unencrypted mail has been rejected", # loc
776        Content => q{Subject: RT requires that all incoming mail be encrypted
777
778 You received this message because RT received mail from you that was not encrypted.  As such, it has been rejected.
779 }
780     },
781     {  Queue       => 0,
782        Name        => "Error: public key",    # loc
783        Description =>
784          "Inform user that he has problems with public key and couldn't recieve encrypted content", # loc
785        Content => q{Subject: We have no your public key or it's wrong
786
787 You received this message as we have no your public PGP key or we have a problem with your key. Inform the administrator about the problem.
788 }
789     },
790     {  Queue       => 0,
791        Name        => "Error to RT owner: public key",    # loc
792        Description =>
793          "Inform RT owner that user(s) have problems with public keys", # loc
794        Content => q{Subject: Some users have problems with public keys
795
796 You received this message as RT has problems with public keys of the following user:
797 {
798     foreach my $e ( @BadRecipients ) {
799         $OUT .= "* ". $e->{'Message'} ."\n";
800     }
801 }}
802     },
803     {  Queue       => 0,
804        Name        => "Error: no private key",    # loc
805        Description =>
806          "Inform user that we received an encrypted email and we have no private keys to decrypt", # loc
807        Content => q{Subject: we received message we cannot decrypt
808
809 You sent an encrypted message with subject '{ $Message->head->get('Subject') }',
810 but we have no private key it's encrypted to.
811
812 Please, check that you encrypt messages with correct keys
813 or contact the system administrator.}
814     },
815     {  Queue       => 0,
816        Name        => "Error: bad encrypted data",    # loc
817        Description =>
818          "Inform user that a message he sent has invalid encryption data", # loc
819        Content => q{Subject: We received a message we cannot handle
820
821 You sent us a message that we cannot handle due to corrupted signature or encrypted block. we get the following error(s):
822 { foreach my $msg ( @Messages ) {
823     $OUT .= "* $msg\n";
824   }
825 }}
826     },
827     {  Queue       => 0,
828        Name        => "PasswordChange",    # loc
829        Description =>
830          "Inform user that his password has been reset", # loc
831        Content => q{Subject: [{RT->Config->Get('rtname')}] Password reset
832
833 Greetings,
834
835 Someone at {$ENV{'REMOTE_ADDR'}} requested a password reset for you on {RT->Config->Get('WebURL')}
836
837 Your new password is:
838   {$NewPassword}
839 }
840     },
841
842                {   Queue       => '0',
843                    Name        => 'Email Digest',    # loc
844                    Description => 'Email template for periodic notification digests',  # loc
845                    Content => q[Subject: RT Email Digest
846
847 { $Argument }
848 ],
849                },
850
851 {
852     Queue       => 0,
853     Name        => "Error: Missing dashboard",    # loc
854     Description =>
855       "Inform user that a dashboard he subscribed to is missing", # loc
856     Content => q{Subject: [{RT->Config->Get('rtname')}] Missing dashboard!
857
858 Greetings,
859
860 You are subscribed to a dashboard that is currently missing. Most likely, the dashboard was deleted.
861
862 RT will remove this subscription as it is no longer useful. Here's the information RT had about your subscription:
863
864 DashboardID:  { $SubscriptionObj->SubValue('DashboardId') }
865 Frequency:    { $SubscriptionObj->SubValue('Frequency') }
866 Hour:         { $SubscriptionObj->SubValue('Hour') }
867 {
868     $SubscriptionObj->SubValue('Frequency') eq 'weekly'
869     ? "Day of week:  " . $SubscriptionObj->SubValue('Dow')
870     : $SubscriptionObj->SubValue('Frequency') eq 'monthly'
871       ? "Day of month: " . $SubscriptionObj->SubValue('Dom')
872       : ''
873 }
874 }
875 },
876     {  Queue       => 0,
877        Name        => 'Custom Field Transaction',
878        Description => 'Custom field value changed',
879        Content     => q[Subject: {$Transaction->BriefDescription()}
880
881 {RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}
882
883 {$Transaction->Content()}
884 ],
885     },
886
887 );
888
889 @Scrips = (
890     {  Description    => 'On Comment Notify AdminCcs as Comment',
891        ScripCondition => 'On Comment',
892        ScripAction    => 'Notify AdminCcs As Comment',
893        Template       => 'Admin Comment in HTML' },
894     {  Description    => 'On Comment Notify Other Recipients as Comment',
895        ScripCondition => 'On Comment',
896        ScripAction    => 'Notify Other Recipients As Comment',
897        Template       => 'Correspondence in HTML' },
898     {  Description    => 'On Correspond Notify Owner and AdminCcs',
899        ScripCondition => 'On Correspond',
900        ScripAction    => 'Notify Owner and AdminCcs',
901        Template       => 'Admin Correspondence in HTML' },
902 #    {  Description    => 'On Correspond Notify Other Recipients',
903 #       ScripCondition => 'On Correspond',
904 #       ScripAction    => 'Notify Other Recipients',
905 #       Template       => 'Correspondence in HTML' },
906 #    {  Description    => 'On Correspond Notify Requestors and Ccs',
907 #       ScripCondition => 'On Correspond',
908 #       ScripAction    => 'Notify Requestors And Ccs',
909 #       Template       => 'Correspondence in HTML' },
910     {  Description    => 'On Correspond Notify Requestors, Ccs, and Other Recipients',
911        ScripCondition => 'On Correspond',
912        ScripAction    => 'Notify Requestors, Ccs, and Other Recipients',
913        Template       => 'Correspondence', },
914
915     {  Description    => 'On Correspond Open Tickets',
916        ScripCondition => 'On Correspond',
917        ScripAction    => 'Open Tickets',
918        Template       => 'Blank' },
919     {  Description    => 'On Create Autoreply To Requestors',
920        ScripCondition => 'On Create',
921        ScripAction    => 'AutoReply To Requestors',
922        Template       => 'AutoReply in HTML' },
923     {  Description    => 'On Create Notify Owner and AdminCcs',
924        ScripCondition => 'On Create',
925        ScripAction    => 'Notify Owner and AdminCcs',
926        Template       => 'Transaction in HTML' },
927     {  Description    => 'On Create Notify Ccs',
928        ScripCondition => 'On Create',
929        ScripAction    => 'Notify Ccs',
930        Template       => 'Correspondence in HTML' },
931     {  Description    => 'On Create Notify Other Recipients',
932        ScripCondition => 'On Create',
933        ScripAction    => 'Notify Other Recipients',
934        Template       => 'Correspondence in HTML' },
935     {  Description    => 'On Owner Change Notify Owner',
936        ScripCondition => 'On Owner Change',
937        ScripAction    => 'Notify Owner',
938        Template       => 'Transaction in HTML' },
939 #    {  Description    => 'On Resolve Notify Requestors',
940 #       ScripCondition => 'On Resolve',
941 #       ScripAction    => 'Notify Requestors',
942 #       Template       => 'Resolved in HTML' },
943     {  Description    => 'On Resolve Notify Requestors, Allow Quiet Resolve',
944        ScripCondition => 'On Resolve Allow Quiet',
945        ScripAction    => 'Notify Requestors',
946        Template       => 'Resolved in HTML' },
947     {  Description    => "On transaction, add any tags in the transaction's subject to the ticket's subject",
948        ScripCondition => 'On Transaction',
949        ScripAction    => 'Extract Subject Tag',
950        Template       => 'Blank' },
951     {  Description    => 'On Forward Transaction Send forwarded message',
952        ScripCondition => 'On Forward Transaction',
953        ScripAction    => 'Send Forward',
954        Template       => 'Forward' },
955     {  Description    => 'On Forward Ticket Send forwarded message',
956        ScripCondition => 'On Forward Ticket',
957        ScripAction    => 'Send Forward',
958        Template       => 'Forward Ticket' },
959     {  Description    => 'On Correspond, cancel future resolve',
960        ScripCondition => 'On Correspond',
961        ScripAction    => 'Cancel Scheduled Resolve',
962        Template       => 'Blank' },
963 );
964
965 @ACL = (
966     { UserId => 'root',        # - principalid
967       Right  => 'SuperUser', },
968
969     { GroupDomain => 'SystemInternal',
970       GroupType => 'privileged',
971       Right  => 'ShowApprovalsTab', },
972
973 );
974
975 # Predefined searches
976
977 @Attributes = (
978     { Name => 'Search - My Tickets',
979       Description => '[_1] highest priority tickets I own', # loc
980       Content     =>
981       { Format =>  q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
982                  . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
983                  . q{Priority, QueueName, ExtendedStatus},
984         Query   => " Owner = '__CurrentUser__' AND ( Status = 'new' OR Status = 'open')",
985         OrderBy => 'Priority',
986         Order   => 'DESC'
987       },
988     },
989     { Name => 'Search - Unowned Tickets',
990       Description => '[_1] newest unowned tickets', # loc
991       Content     =>
992 # 'Take' #loc
993       { Format =>  q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
994                  . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
995                  . q{QueueName, ExtendedStatus, CreatedRelative, }
996                  . q{'<A HREF="__WebPath__/Ticket/Display.html?Action=Take&id=__id__">__loc(Take)__</a>/TITLE:NBSP'},
997         Query   => " Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')",
998         OrderBy => 'Created',
999         Order   => 'DESC'
1000       },
1001     },
1002     { Name => 'Search - Bookmarked Tickets',
1003       Description => 'Bookmarked Tickets', #loc
1004       Content     =>
1005       { Format => q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
1006                 . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
1007                 . q{Priority, QueueName, ExtendedStatus, Bookmark},
1008         Query   => "id = '__Bookmarked__'",
1009         OrderBy => 'LastUpdated',
1010         Order   => 'DESC' },
1011     },
1012     {
1013         Name        => 'HomepageSettings',
1014         Description => 'HomepageSettings',
1015         Content     => {
1016             'body' =>                               # loc_left_pair
1017               [
1018                 {
1019                     type => 'system',
1020                     name => 'My Tickets',           # loc
1021                 },
1022                 {
1023                     type => 'system',
1024                     name => 'Unowned Tickets'       # loc
1025                 },
1026                 {
1027                     type => 'system',
1028                     name => 'Bookmarked Tickets'    # loc
1029                 },
1030                 {
1031                     type => 'component',
1032                     name => 'QuickCreate'           # loc
1033                 },
1034               ],
1035             'sidebar' =>                            # loc_left_pair
1036               [
1037                 {
1038                     type => 'component',
1039                     name => 'MyReminders'           # loc
1040                 },
1041                 {
1042                     type => 'component',
1043                     name => 'Quicksearch'           # loc
1044                 },
1045                 {
1046                     type => 'component',
1047                     name => 'Dashboards'            # loc
1048                 },
1049                 {
1050                     type => 'component',
1051                     name => 'RefreshHomepage'       # loc
1052                 },
1053               ],
1054         },
1055     },
1056 );
1057
1058 # freeside upgrade
1059 # Obsolete/erroneous scrips
1060 # If
1061 #   $Delete_Scrips{conditionname}{actionname}{templatename}
1062 # exists, and the scrip was created by the system user, it 
1063 # will be deleted on upgrade.  Lowercase all the names here.
1064
1065 %Delete_Scrips = (
1066   'on correspond' => {
1067     'notify requestors and ccs' => { 'correspondence' => 1 },
1068     'notify other recipients'   => { 'correspondence' => 1 },
1069     # RT 4.2
1070     # superseded by "notify owner and adminccs"
1071     'notify adminccs'           => { 'admin correspondence' => 1 },
1072     # the new way, but doesn't work right vs. "open tickets"
1073     'open inactive tickets'              => { 'blank' => 1 },
1074   },
1075   'on create' => {
1076     # RT 4.2
1077     # superseded by "notify owner and adminccs"
1078     'notify adminccs'           => { 'transaction' => 1 },
1079   },
1080   'on resolve' => {
1081     # superseded by "On Resolve Notify Requestors, Allow Quiet Resolve"
1082     'notify requestors' => { 'resolved in html' => 1 },
1083   },
1084 );
1085
1086 # -*- perl -*-
1087
1088 push @ScripActions, (
1089
1090     { Name        => 'Extract Custom Field Values',          # loc
1091       Description => 'extract cf-values out of a message',    # loc
1092       ExecModule  => 'ExtractCustomFieldValues' },
1093
1094     { Name        => 'Extract Custom Field Values With Code in Template', # loc
1095       Description => 'extract cf-values out of a message with a Text::Template template',    # loc
1096       ExecModule  => 'ExtractCustomFieldValuesWithCodeInTemplate' }
1097
1098 );
1099
1100 push @Templates, (
1101     {  Queue       => '0',
1102        Name        => 'CustomFieldScannerExample',                     # loc
1103        Description => 'Example Template for ExtractCustomFieldValues', # loc
1104        Content     => <<'EOTEXT'
1105 #### Syntax:
1106 # CF Name | Header name or "Body" | MatchString(re) | Postcmd | Options
1107
1108 #### Allowed Options:
1109
1110 # q - (quiet) Don't record a transaction for adding the custom field
1111 #     value
1112 # * - (wildcard) The MatchString regex should contain _two_
1113 #     capturing groups, the first of which is the CF name,
1114 #     the second of which is the value.  If this option is
1115 #     given, the <cf-name> field is ignored.
1116
1117 #### Examples:
1118
1119 # 1. Put the content of the "X-MI-Test" header into the "testcf"
1120 #    custom field:
1121 # testcf|X-MI-Test|.*
1122
1123 # 2. Scan the body for Host:name and put name into the "bodycf" custom
1124 #    field:
1125 # bodycf|Body|Host:\s*(\w+)
1126
1127 # 3. Scan the "X-MI-IP" header for an IP-Adresse and get the hostname
1128 #    by reverse-resolving it:
1129 # Hostname|X-MI-IP|\d+\.\d+\.\d+\.\d+|use Socket; ($value) = gethostbyaddr(inet_aton($value),AF_INET);
1130
1131 # 4. scan the "CC" header for an many email addresses, and add them to
1132 #    a custom field named "parsedCCs". If "parsedCCs" is a multivalue
1133 #    CF, then this should yield separate values for all email adress
1134 #    found.
1135 # parsedCCs|CC|.*|$value =~ s/^\s+//; $value =~ s/\s+$//;
1136
1137 # 5. Looks for an "Email:" field in the body of the email, then loads
1138 #    up that user and makes them privileged The blank first field
1139 #    means the automatic CustomField setting is not invoked.
1140 # |Body|Email:\s*(.+)$|my $u = RT::User->new($RT::SystemUser); $u->LoadByEmail($value); $u->SetPrivileged(1)|
1141
1142 # 6. Looks for any text of the form "Set CF Name: Value" in the body,
1143 #    and sets the CF named "CF Name" to the given value, which may be
1144 #    multi-line.  The '*' option controls the wildcard nature of this
1145 #    example.
1146 # Separator=!
1147 # !Body!^Set ([^\n:]*?):\s*((?s).*?)(?:\Z|\n\Z|\n\n)!!*
1148
1149 # 7. Looks for the regex anywhere in the headers and stores the match
1150 #    in the AllHeaderSearch CF
1151 # AllHeaderSearch|Headers|Site:\s*(\w+)
1152
1153 # 8. If you need to dynamically build your matching, and want to trigger on headers and body
1154 #    and invode some arbitrary code like example 5
1155 # Separator=~~
1156 # {
1157 #    my $action = 'use My::Site; My::Site::SetSiteID( Ticket => $self->TicketObj, Site => $_ );';
1158 #
1159 #    for my $regex (My::Site::ValidRegexps) {
1160 #        for my $from ('headers', 'body') {
1161 #            $OUT .= join '~~',
1162 #                '', # CF name
1163 #                $from,
1164 #                $regex,
1165 #                $action;
1166 #            $OUT .= "\n";
1167 #        }
1168 #    }
1169 # }
1170
1171 EOTEXT
1172     }
1173 );
1174
1175 1;