Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {capture assign=crmURL}{crmURL p='civicrm/admin/messageTemplates/add' q="action=add&reset=1"}{/capture} | |
11 | {if $action eq 1 or $action eq 2 or $action eq 8} | |
12 | {include file="CRM/Admin/Form/MessageTemplates.tpl"} | |
edc51caa | 13 | |
6a488035 TO |
14 | {elseif $action eq 4} |
15 | {* View a system default workflow template *} | |
16 | ||
f6eedce7 | 17 | <div class="help"> |
6a488035 TO |
18 | {ts}You are viewing the default message template for this system workflow.{/ts} {help id="id-view_system_default"} |
19 | </div> | |
20 | ||
21 | <fieldset> | |
22 | <div class="crm-section msg_title-section"> | |
23 | <div class="bold">{$form.msg_title.value}</div> | |
24 | </div> | |
25 | <div class="crm-section msg_subject-section"> | |
26 | <h3 class="header-dark">{$form.msg_subject.label}</h3> | |
27 | <div class="text"> | |
28 | <textarea name="msg-subject" id="msg_subject" style="height: 6em; width: 45em;">{$form.msg_subject.value}</textarea> | |
29 | <div class='spacer'></div> | |
30 | <div class="section"> | |
31 | <a href='#' onclick='MessageTemplates.msg_subject.select(); return false;' class='button'><span>Select Subject</span></a> | |
32 | <div class='spacer'></div> | |
33 | </div> | |
34 | </div> | |
35 | </div> | |
edc51caa | 36 | |
6a488035 TO |
37 | <div class="crm-section msg_txt-section"> |
38 | <h3 class="header-dark">{$form.msg_text.label}</h3> | |
39 | <div class="text"> | |
40 | <textarea class="huge" name='msg_text' id='msg_text'>{$form.msg_text.value|htmlentities}</textarea> | |
41 | <div class='spacer'></div> | |
42 | <div class="section"> | |
43 | <a href='#' onclick='MessageTemplates.msg_text.select(); return false;' class='button'><span>Select Text Message</span></a> | |
44 | <div class='spacer'></div> | |
45 | </div> | |
46 | </div> | |
47 | </div> | |
48 | ||
49 | <div class="crm-section msg_html-section"> | |
50 | <h3 class="header-dark">{$form.msg_html.label}</h3> | |
51 | <div class='text'> | |
52 | <textarea class="huge" name='msg_html' id='msg_html'>{$form.msg_html.value|htmlentities}</textarea> | |
53 | <div class='spacer'></div> | |
54 | <div class="section"> | |
55 | <a href='#' onclick='MessageTemplates.msg_html.select(); return false;' class='button'><span>Select HTML Message</span></a> | |
56 | <div class='spacer'></div> | |
57 | </div> | |
58 | </div> | |
59 | </div> | |
60 | ||
61 | <div class="crm-section msg_html-section"> | |
62 | <h3 class="header-dark">{$form.pdf_format_id.label}</h3> | |
63 | <div class='text'> | |
64 | {$form.pdf_format_id.html} | |
65 | </div> | |
66 | </div> | |
edc51caa | 67 | |
b0c14036 | 68 | <div id="crm-submit-buttons" class="crm-submit-buttons">{$form.buttons.html}</div> |
6a488035 TO |
69 | </fieldset> |
70 | {/if} | |
71 | ||
72 | {if $rows and $action ne 2 and $action ne 4} | |
e52d8c19 | 73 | <div class="crm-content-block crm-block"> |
6a488035 TO |
74 | <div id='mainTabContainer'> |
75 | <ul> | |
40a732a9 SA |
76 | {if $canEditUserDrivenMessageTemplates or $canEditMessageTemplates} |
77 | <li id='tab_user'><a href='#user' title='{ts}User-driven Messages{/ts}'>{ts}User-driven Messages{/ts}</a></li> | |
78 | {/if} | |
79 | {if $canEditSystemTemplates or $canEditMessageTemplates} | |
80 | <li id='tab_workflow'><a href='#workflow' title='{ts}System Workflow Messages{/ts}'>{ts}System Workflow Messages{/ts}</a></li> | |
81 | {/if} | |
6a488035 | 82 | </ul> |
edc51caa | 83 | |
6a488035 | 84 | {* create two selector tabs, first being the ‘user’ one, the second being the ‘workflow’ one *} |
4d17a233 | 85 | {include file="CRM/common/enableDisableApi.tpl"} |
6a488035 TO |
86 | {include file="CRM/common/jsortable.tpl"} |
87 | {foreach from=$rows item=template_row key=type} | |
40a732a9 SA |
88 | {if ( |
89 | $type ne 'userTemplates' and ($canEditSystemTemplates or $canEditMessageTemplates) | |
90 | ) or ( | |
91 | $type eq 'userTemplates'and ($canEditUserDrivenMessageTemplates or $canEditMessageTemplates) | |
92 | )} | |
6a488035 TO |
93 | <div id="{if $type eq 'userTemplates'}user{else}workflow{/if}" class='ui-tabs-panel ui-widget-content ui-corner-bottom'> |
94 | <div class="help"> | |
95 | {if $type eq 'userTemplates'} | |
b1dfb588 | 96 | {capture assign=schedRemURL}{crmURL p='civicrm/admin/scheduleReminders' q="reset=1"}{/capture} |
be0b6c32 DG |
97 | {ts 1=$schedRemURL}Message templates allow you to easily create similar emails or letters on a recurring basis. Messages used for membership renewal reminders, as well as event and activity related reminders should be created via <a href="%1">Schedule Reminders</a>.{/ts} |
98 | {if array_search('CiviMail', $config->enableComponents)} | |
45dc84d3 DG |
99 | {capture assign=automatedMsgURL}{crmURL p='civicrm/admin/component' q="reset=1"}{/capture} |
100 | {ts 1=$automatedMsgURL}You can also use message templates for CiviMail (bulk email) content. However, subscribe, unsubscribe and opt-out messages are configured at <a href="%1">Administer > CiviMail > Headers, Footers and Automated Messages</a>.{/ts} | |
be0b6c32 DG |
101 | {/if} |
102 | {help id="id-intro"} | |
6a488035 | 103 | {else} |
b1dfb588 | 104 | {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 |
105 | {/if} |
106 | </div> | |
107 | <div> | |
a57562f5 MW |
108 | {if $action ne 1 and $action ne 2 and $type eq 'userTemplates'} |
109 | <div class="action-link"> | |
110 | {crmButton p='civicrm/admin/messageTemplates/add' q="action=add&reset=1" id="newMessageTemplates" icon="plus-circle"}{ts}Add Message Template{/ts}{/crmButton} | |
111 | </div> | |
112 | <div class="spacer"></div> | |
113 | {/if} | |
6a488035 TO |
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"> | |
80bc2820 | 143 | {crmButton p='civicrm/admin/messageTemplates/add' q="action=add&reset=1" id="newMessageTemplates" icon="plus-circle"}{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> | |
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> | |
40a732a9 | 156 | {/if} |
6a488035 TO |
157 | {/foreach} |
158 | </div> | |
e52d8c19 | 159 | </div> |
c1bd8375 | 160 | {include file="CRM/common/TabSelected.tpl" defaultTab="user"} |
6a488035 TO |
161 | |
162 | {elseif $action ne 1 and $action ne 2 and $action ne 4 and $action ne 8} | |
163 | <div class="messages status no-popup"> | |
164 | <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/> | |
165 | {ts 1=$crmURL}There are no Message Templates entered. You can <a href='%1'>add one</a>.{/ts} | |
166 | </div> | |
167 | {/if} |