Merge pull request #5505 from colemanw/CRM-16178
[civicrm-core.git] / templates / CRM / Admin / Page / MessageTemplates.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
39de6fd5 3 | CiviCRM version 4.6 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26{capture assign=crmURL}{crmURL p='civicrm/admin/messageTemplates/add' q="action=add&reset=1"}{/capture}
27{if $action eq 1 or $action eq 2 or $action eq 8}
28 {include file="CRM/Admin/Form/MessageTemplates.tpl"}
edc51caa 29
6a488035
TO
30{elseif $action eq 4}
31 {* View a system default workflow template *}
32
33 <div id="help">
34 {ts}You are viewing the default message template for this system workflow.{/ts} {help id="id-view_system_default"}
35 </div>
36
37 <fieldset>
38 <div class="crm-section msg_title-section">
39 <div class="bold">{$form.msg_title.value}</div>
40 </div>
41 <div class="crm-section msg_subject-section">
42 <h3 class="header-dark">{$form.msg_subject.label}</h3>
43 <div class="text">
44 <textarea name="msg-subject" id="msg_subject" style="height: 6em; width: 45em;">{$form.msg_subject.value}</textarea>
45 <div class='spacer'></div>
46 <div class="section">
47 <a href='#' onclick='MessageTemplates.msg_subject.select(); return false;' class='button'><span>Select Subject</span></a>
48 <div class='spacer'></div>
49 </div>
50 </div>
51 </div>
edc51caa 52
6a488035
TO
53 <div class="crm-section msg_txt-section">
54 <h3 class="header-dark">{$form.msg_text.label}</h3>
55 <div class="text">
56 <textarea class="huge" name='msg_text' id='msg_text'>{$form.msg_text.value|htmlentities}</textarea>
57 <div class='spacer'></div>
58 <div class="section">
59 <a href='#' onclick='MessageTemplates.msg_text.select(); return false;' class='button'><span>Select Text Message</span></a>
60 <div class='spacer'></div>
61 </div>
62 </div>
63 </div>
64
65 <div class="crm-section msg_html-section">
66 <h3 class="header-dark">{$form.msg_html.label}</h3>
67 <div class='text'>
68 <textarea class="huge" name='msg_html' id='msg_html'>{$form.msg_html.value|htmlentities}</textarea>
69 <div class='spacer'></div>
70 <div class="section">
71 <a href='#' onclick='MessageTemplates.msg_html.select(); return false;' class='button'><span>Select HTML Message</span></a>
72 <div class='spacer'></div>
73 </div>
74 </div>
75 </div>
76
77 <div class="crm-section msg_html-section">
78 <h3 class="header-dark">{$form.pdf_format_id.label}</h3>
79 <div class='text'>
80 {$form.pdf_format_id.html}
81 </div>
82 </div>
edc51caa 83
6a488035
TO
84 <div id="crm-submit-buttons">{$form.buttons.html}</div>
85 </fieldset>
86{/if}
87
88{if $rows and $action ne 2 and $action ne 4}
89
ac0a3db5
CW
90 {* include wysiwyg related files*}
91 {include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true}
92
6a488035
TO
93 <div id='mainTabContainer'>
94 <ul>
95 <li id='tab_user'> <a href='#user' title='{ts}User-driven Messages{/ts}'> {ts}User-driven Messages{/ts} </a></li>
96 <li id='tab_workflow'><a href='#workflow' title='{ts}System Workflow Messages{/ts}'>{ts}System Workflow Messages{/ts}</a></li>
97 </ul>
edc51caa 98
6a488035 99 {* create two selector tabs, first being the ‘user’ one, the second being the ‘workflow’ one *}
4d17a233 100 {include file="CRM/common/enableDisableApi.tpl"}
6a488035
TO
101 {include file="CRM/common/jsortable.tpl"}
102 {foreach from=$rows item=template_row key=type}
103 <div id="{if $type eq 'userTemplates'}user{else}workflow{/if}" class='ui-tabs-panel ui-widget-content ui-corner-bottom'>
104 <div class="help">
105 {if $type eq 'userTemplates'}
b1dfb588
DG
106 {capture assign=schedRemURL}{crmURL p='civicrm/admin/scheduleReminders' q="reset=1"}{/capture}
107 {ts 1=$schedRemURL}User-driven message templates allow you to save and re-use messages with layouts. They are useful if you need to send similar emails or letters to contacts on a recurring basis. You can also use them in CiviMail mailings. Messages used for membership renewal reminders, as well as event and activity related reminders should be created via <a href="%1">Scheduled Reminders</a>.{/ts} {help id="id-intro"}
6a488035 108 {else}
b1dfb588 109 {ts}System workflow message templates are used to generate the emails sent to constituents and administrators for contribution receipts, event confirmations and many other workflows. You can customize the style and wording of these messages here.{/ts} {help id="id-system-workflow"}
6a488035
TO
110 {/if}
111 </div>
112 <div>
113 <p></p>
114 {if !empty( $template_row) }
115 <table class="display">
116 <thead>
117 <tr>
118 <th class="sortable">{if $type eq 'userTemplates'}{ts}Message Title{/ts}{else}{ts}Workflow{/ts}{/if}</th>
119 {if $type eq 'userTemplates'}
120 <th>{ts}Message Subject{/ts}</th>
121 <th>{ts}Enabled?{/ts}</th>
122 {/if}
123 <th></th>
124 </tr>
125 </thead>
126 <tbody>
127 {foreach from=$template_row item=row}
4d17a233 128 <tr id="message_template-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
6a488035
TO
129 <td>{$row.msg_title}</td>
130 {if $type eq 'userTemplates'}
131 <td>{$row.msg_subject}</td>
132 <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
133 {/if}
134 <td>{$row.action|replace:'xx':$row.id}</td>
135 </tr>
136 {/foreach}
137 </tbody>
138 </table>
139 {/if}
140
141 {if $action ne 1 and $action ne 2 and $type eq 'userTemplates'}
142 <div class="action-link">
f7296a9a 143 {crmButton p='civicrm/admin/messageTemplates/add' q="action=add&reset=1" id="newMessageTemplates" icon="circle-plus"}{ts}Add Message Template{/ts}{/crmButton}
6a488035
TO
144 </div>
145 <div class="spacer"></div>
146 {/if}
edc51caa 147
6a488035
TO
148 {if empty( $template_row) }
149 <div class="messages status no-popup">
150 <div class="icon inform-icon"></div>&nbsp;
151 {ts 1=$crmURL}There are no User-driven Message Templates entered. You can <a href='%1'>add one</a>.{/ts}
152 </div>
153 {/if}
154 </div>
155 </div>
156 {/foreach}
157 </div>
158
159 <script type='text/javascript'>
160 var selectedTab = 'user';
161 {if $selectedChild}selectedTab = '{$selectedChild}';{/if}
162 {literal}
3cc60a06 163 CRM.$(function($) {
ae8f569f
CW
164 var tabIndex = $('#tab_' + selectedTab).prevAll().length
165 $("#mainTabContainer").tabs( {active: tabIndex} );
6a488035
TO
166 });
167 {/literal}
168 </script>
169
170{elseif $action ne 1 and $action ne 2 and $action ne 4 and $action ne 8}
171 <div class="messages status no-popup">
172 <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
173 {ts 1=$crmURL}There are no Message Templates entered. You can <a href='%1'>add one</a>.{/ts}
174 </div>
175{/if}