Merge pull request #3066 from relldoesphp/CRM-14466
[civicrm-core.git] / templates / CRM / Admin / Page / MessageTemplates.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
819d0d41 3 | CiviCRM version 4.5 |
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
CW
100 {include file="CRM/common/enableDisableApi.tpl"}
101 {include file="CRM/common/crmeditable.tpl"}
6a488035
TO
102 {include file="CRM/common/jsortable.tpl"}
103 {foreach from=$rows item=template_row key=type}
104 <div id="{if $type eq 'userTemplates'}user{else}workflow{/if}" class='ui-tabs-panel ui-widget-content ui-corner-bottom'>
105 <div class="help">
106 {if $type eq 'userTemplates'}
b1dfb588
DG
107 {capture assign=schedRemURL}{crmURL p='civicrm/admin/scheduleReminders' q="reset=1"}{/capture}
108 {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 109 {else}
b1dfb588 110 {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
111 {/if}
112 </div>
113 <div>
114 <p></p>
115 {if !empty( $template_row) }
116 <table class="display">
117 <thead>
118 <tr>
119 <th class="sortable">{if $type eq 'userTemplates'}{ts}Message Title{/ts}{else}{ts}Workflow{/ts}{/if}</th>
120 {if $type eq 'userTemplates'}
121 <th>{ts}Message Subject{/ts}</th>
122 <th>{ts}Enabled?{/ts}</th>
123 {/if}
124 <th></th>
125 </tr>
126 </thead>
127 <tbody>
128 {foreach from=$template_row item=row}
4d17a233 129 <tr id="message_template-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
6a488035
TO
130 <td>{$row.msg_title}</td>
131 {if $type eq 'userTemplates'}
132 <td>{$row.msg_subject}</td>
133 <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
134 {/if}
135 <td>{$row.action|replace:'xx':$row.id}</td>
136 </tr>
137 {/foreach}
138 </tbody>
139 </table>
140 {/if}
141
142 {if $action ne 1 and $action ne 2 and $type eq 'userTemplates'}
143 <div class="action-link">
144 <a href="{crmURL p='civicrm/admin/messageTemplates/add' q="action=add&reset=1"}" id="newMessageTemplates" class="button"><span><div class="icon add-icon"></div>{ts}Add Message Template{/ts}</span></a>
145 </div>
146 <div class="spacer"></div>
147 {/if}
edc51caa 148
6a488035
TO
149 {if empty( $template_row) }
150 <div class="messages status no-popup">
151 <div class="icon inform-icon"></div>&nbsp;
152 {ts 1=$crmURL}There are no User-driven Message Templates entered. You can <a href='%1'>add one</a>.{/ts}
153 </div>
154 {/if}
155 </div>
156 </div>
157 {/foreach}
158 </div>
159
160 <script type='text/javascript'>
161 var selectedTab = 'user';
162 {if $selectedChild}selectedTab = '{$selectedChild}';{/if}
163 {literal}
3cc60a06 164 CRM.$(function($) {
6a488035 165 var tabIndex = cj('#tab_' + selectedTab).prevAll().length
2ad3bb7d 166 cj("#mainTabContainer").tabs( {active: tabIndex} );
6a488035
TO
167 });
168 {/literal}
169 </script>
170
171{elseif $action ne 1 and $action ne 2 and $action ne 4 and $action ne 8}
172 <div class="messages status no-popup">
173 <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
174 {ts 1=$crmURL}There are no Message Templates entered. You can <a href='%1'>add one</a>.{/ts}
175 </div>
176{/if}