[freeside-commits] branch FREESIDE_4_BRANCH updated. 68a40ba5d789dfce7342ab16ab8b1c3e722825b4
Christopher Burger
burgerc at freeside.biz
Mon Nov 19 15:30:14 PST 2018
The branch, FREESIDE_4_BRANCH has been updated
via 68a40ba5d789dfce7342ab16ab8b1c3e722825b4 (commit)
via 7b7113c2ebbd1de0264f100009c36393005c7806 (commit)
from 6c9e440a283115a77346c1e12cf1d9db22d5c222 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 68a40ba5d789dfce7342ab16ab8b1c3e722825b4
Merge: 7b7113c2e 6c9e440a2
Author: Christopher Burger <burgerc at freeside.biz>
Date: Mon Nov 19 18:27:26 2018 -0500
Merge branch 'FREESIDE_4_BRANCH' of ssh://git.freeside.biz/home/git/freeside into FREESIDE_4_BRANCH
commit 7b7113c2ebbd1de0264f100009c36393005c7806
Author: Christopher Burger <burgerc at freeside.biz>
Date: Fri Oct 27 12:12:23 2017 -0400
RT# 75628 - Added AutoreplyOrCorrespondence template to freeside core RT.
diff --git a/rt/etc/initialdata b/rt/etc/initialdata
index 908505087..aa2010fd1 100644
--- a/rt/etc/initialdata
+++ b/rt/etc/initialdata
@@ -319,6 +319,110 @@ you may reply to this message.</p>
],
},
{ Queue => '0',
+ Name => 'AutoreplyOrCorrespondence', # loc
+ Description => 'Plaintext AutoreplyOrCorrespondence template', # loc
+ Content => q[{
+ use RT::Template;
+ my $creator_name = $Ticket->CreatorObj->Name;
+ my $requestors = $Ticket->Requestors->UserMembersObj;
+ my ( $c_requestor, $r_count ) = ( 0, 0 );
+ while ( my $r = $requestors->Next() ) {
+ if ( $r->Name eq $creator_name ) {
+ $c_requestor++;
+ }
+ else {
+ $r_count++;
+ }
+ }
+ my $template = new RT::Template($RT::SystemUser);
+ my $template_name;
+
+ #if the creator is not a requestor or
+ #there is more than one requestor ( who's not the creator )
+ #use the Correspondence template
+ if ( ! $c_requestor || $r_count ) {
+ $template_name = 'Correspondence';
+ }
+ else {
+ #otherwise use the Autoreply template
+ $template_name = 'Autoreply';
+ }
+
+ #Load the Queue Template
+ $template->LoadQueueTemplate(
+ Queue => $Ticket->Queue,
+ Name => $template_name,
+ );
+ #if there's no Queue Template attempt to find a Global one.
+ unless ( $template->id ) {
+ $template->LoadGlobalTemplate( $template_name );
+ unless ( $template->id ) {
+ $RT::Logger->error("Could not load template : $template_name")
+ }
+ }
+ #Process embedded fields & expressions of true templates;
+ #note that we can only meaningfully use the body
+ my($ret, $msg) = $template->Parse(
+ TicketObj => $Ticket,
+ TransactionObj => $Transaction,
+ );
+ $ret ? $template->MIMEObj->stringify : $msg;
+ }
+],
+ },
+ { Queue => '0',
+ Name => 'AutoreplyOrCorrespondence in HTML', # loc
+ Description => 'HTML AutoreplyOrCorrespondence template', # loc
+ Content => q[{
+ use RT::Template;
+ my $creator_name = $Ticket->CreatorObj->Name;
+ my $requestors = $Ticket->Requestors->UserMembersObj;
+ my ( $c_requestor, $r_count ) = ( 0, 0 );
+ while ( my $r = $requestors->Next() ) {
+ if ( $r->Name eq $creator_name ) {
+ $c_requestor++;
+ }
+ else {
+ $r_count++;
+ }
+ }
+ my $template = new RT::Template($RT::SystemUser);
+ my $template_name;
+
+ #if the creator is not a requestor or
+ #there is more than one requestor ( who's not the creator )
+ #use the Correspondence template
+ if ( ! $c_requestor || $r_count ) {
+ $template_name = 'Correspondence in HTML';
+ }
+ else {
+ #otherwise use the Autoreply in HTML template
+ $template_name = 'Autoreply in HTML';
+ }
+
+ #Load the Queue Template
+ $template->LoadQueueTemplate(
+ Queue => $Ticket->Queue,
+ Name => $template_name,
+ );
+ #if there's no Queue Template attempt to find a Global one.
+ unless ( $template->id ) {
+ $template->LoadGlobalTemplate( $template_name );
+ unless ( $template->id ) {
+ $RT::Logger->error("Could not load template : $template_name")
+ }
+ }
+ #Process embedded fields & expressions of true templates;
+ #note that we can only meaningfully use the body
+ my($ret, $msg) = $template->Parse(
+ TicketObj => $Ticket,
+ TransactionObj => $Transaction,
+ );
+ $ret ? $template->MIMEObj->stringify : $msg;
+ }
+],
+ },
+ { Queue => '0',
Name => 'Transaction', # loc
Description => 'Plain text transaction template', # loc
Content => 'RT-Attach-Message: yes
-----------------------------------------------------------------------
Summary of changes:
rt/etc/initialdata | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
More information about the freeside-commits
mailing list