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