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