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