]> git.agnieray.net Git - galette.git/blob - galette/templates/default/gestion_mailings.tpl
Drop non working filter; closes #1595
[galette.git] / galette / templates / default / gestion_mailings.tpl
1 {extends file="page.tpl"}
2
3 {block name="content"}
4 <form action="{path_for name="mailings_filter"}" method="post" id="filtre">
5 <div id="listfilter">
6 <label for="start_date_filter">{_T string="since"}</label>&nbsp;
7 <input type="text" name="start_date_filter" id="start_date_filter" maxlength="10" size="10" value="{$history->filters->start_date_filter}"/>
8 <label for="end_date_filter">{_T string="until"}</label>&nbsp;
9 <input type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{$history->filters->end_date_filter}"/>
10 <input type="submit" class="inline" value="{_T string="Filter"}"/>
11 <input type="submit" name="clear_filter" class="inline" value="{_T string="Clear filter"}"/>
12
13 <div>
14 <label for="subject_filter">{_T string="Subject"}</label>
15 <input type="text" name="subject_filter" id="subject_filter" value="{$history->filters->subject_filter}"/>
16 {_T string="Sent mailings:"}
17 <input type="radio" name="sent_filter" id="filter_dc_sent" value="{Galette\Core\MailingHistory::FILTER_DC_SENT}"{if $history->filters->sent_filter eq constant('Galette\Core\MailingHistory::FILTER_DC_SENT')} checked="checked"{/if}>
18 <label for="filter_dc_sent" >{_T string="Don't care"}</label>
19 <input type="radio" name="sent_filter" id="filter_sent" value="{Galette\Core\MailingHistory::FILTER_SENT}"{if $history->filters->sent_filter eq constant('Galette\Core\MailingHistory::FILTER_SENT')} checked="checked"{/if}>
20 <label for="filter_sent" >{_T string="Yes"}</label>
21 <input type="radio" name="sent_filter" id="filter_not_sent" value="{Galette\Core\MailingHistory::FILTER_NOT_SENT}"{if $history->filters->sent_filter eq constant('Galette\Core\MailingHistory::FILTER_NOT_SENT')} checked="checked"{/if}>
22 <label for="filter_not_sent" >{_T string="No"}</label>
23 </div>
24 </div>
25 <table class="infoline">
26 <tr>
27 <td class="left nowrap">
28 {_T string="%count entry" plural="%count entries" count=$history->getCount() pattern="/%count/" replace=$history->getCount()}
29 </td>
30 <td class="right">
31 <label for="nbshow">{_T string="Records per page:"}</label>
32 <select name="nbshow" id="nbshow">
33 {html_options options=$nbshow_options selected=$numrows}
34 </select>
35 <noscript> <span><input type="submit" value="{_T string="Change"}" /></span></noscript>
36 {include file="forms_types/csrf.tpl"}
37 </td>
38 </tr>
39 </table>
40 </form>
41
42
43 <table class="listing">
44 <thead>
45 <tr>
46 <th class="small_head">#</th>
47 <th class="left date_row">
48 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_DATE"|constant]}">
49 {_T string="Date"}
50 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_DATE')}
51 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
52 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
53 {else}
54 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
55 {/if}
56 {/if}
57 </a>
58 </th>
59 <th class="left username_row">
60 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_SENDER"|constant]}">
61 {_T string="Sender"}
62 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_SENDER')}
63 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
64 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
65 {else}
66 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
67 {/if}
68 {/if}
69 </a>
70 </th>
71 <th class="left small_head">
72 {_T string="Recipients"}
73 </th>
74 <th class="left">
75 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_SUBJECT"|constant]}">
76 {_T string="Subject"}
77 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_SUBJECT')}
78 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
79 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
80 {else}
81 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
82 {/if}
83 {/if}
84 </a>
85 </th>
86 <th title="{_T string="Attachments"}" class="small_head">
87 {_T string="Att."}
88 </th>
89 <th class="left right small_head">
90 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_SENT"|constant]}">
91 {_T string="Sent"}
92 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_SENT')}
93 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
94 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
95 {else}
96 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
97 {/if}
98 {/if}
99 </a>
100 </th>
101 <th class="small_head"></th>
102 </tr>
103 </thead>
104 <tbody>
105 {foreach from=$logs item=log name=eachlog}
106 <tr class="{if $smarty.foreach.eachlog.iteration % 2 eq 0}even{else}odd{/if}">
107 <td data-scope="row">
108 {if $preferences->pref_show_id}
109 {$log.mailing_id}
110 {else}
111 {$smarty.foreach.eachlog.iteration}
112 {/if}
113 <span class="row-title">
114 {_T string="Mailing entry %id" pattern="/%id/" replace=$log.mailing_id}
115 </span>
116 </td>
117 <td class="nowrap" data-title="{_T string="Date"}">{$log.mailing_date|date_format:{_T string="Y-m-d H:i:s"}}</td>
118 <td data-title="{_T string="Sender"}">{if $log.mailing_sender eq 0}{_T string="Superadmin"}{else}{$log.mailing_sender_name}{/if}</td>
119 <td data-title="{_T string="Recipients"}">{$log.mailing_recipients|unserialize|@count}</td>
120 <td data-title="{_T string="Subject"}">{$log.mailing_subject}</td>
121 <td class="center" data-title="{_T string="Attachments"}">{$log.attachments}</td>
122 <td class="center{if $log.mailing_sent == 1} use{/if}" data-title="{_T string="Sent"}">
123 {if $log.mailing_sent == 1}
124 <i class="fas fa-thumbs-up"></i>
125 {else}
126 <i class="fas fa-thumbs-down"></i>
127 {/if}
128 </td>
129 <td class="center nowrap actions_row">
130 <a
131 href="{path_for name="mailingPreview" data=["id" => $log.mailing_id]}"
132 class="showdetails tooltip"
133 >
134 <i class="fas fa-eye"></i>
135 <span class="sr-only">{_T string="Display mailing '%subject' details in preview window" pattern="/%subject/" replace=$log.mailing_subject}</span>
136 </a>
137 <a
138 href="{path_for name="mailing"}?from={$log.mailing_id}"
139 class="tooltip"
140 >
141 <i class="fas fa-clone"></i>
142 <span class="sr-only">{_T string="Use mailing '%subject' as a template for a new one" pattern="/%subject/" replace=$log.mailing_subject}</span>
143 </a>
144 <a
145 href="{path_for name="removeMailing" data=["id" => $log.mailing_id]}"
146 class="delete tooltip"
147 >
148 <i class="fas fa-trash"></i>
149 <span class="sr-only">{_T string="Delete mailing '%subject'" pattern="/%subject/" replace=$log.mailing_subject}</span>
150 </a>
151 </td>
152 </tr>
153 {foreachelse}
154 <tr><td colspan="8" class="emptylist">{_T string="No sent mailing has been stored in the database yet."}</td></tr>
155 {/foreach}
156 </tbody>
157 </table>
158 <div class="center cright">
159 {_T string="Pages:"}<br/>
160 <ul class="pages">{$pagination}</ul>
161 </div>
162 <div class="center">
163 <a
164 class="button use"
165 href="{path_for name="mailing"}?mailing_new=true"
166 >
167 <i class="fas fa-plus-square"></i>
168 {_T string="Create new mailing"}
169 </a>
170 </div>
171 {/block}
172
173 {block name="javascripts"}
174 <script type="text/javascript">
175 {include file="js_removal.tpl"}
176
177 $('#start_date_filter, #end_date_filter').datepicker({
178 changeMonth: true,
179 changeYear: true,
180 showOn: 'button',
181 buttonText: '<i class="far fa-calendar-alt"></i> <span class="sr-only">{_T string="Select a date" escape="js"}</span>'
182 });
183
184 {* Preview popup *}
185 $('.showdetails').click(function(){
186 $.ajax({
187 url: $(this).attr('href'),
188 type: "POST",
189 data: {
190 ajax: true,
191 },
192 {include file="js_loader.tpl"},
193 success: function(res){
194 _preview_dialog(res);
195 },
196 error: function() {
197 alert("{_T string="An error occurred displaying preview :(" escape="js"}");
198 }
199 });
200 return false;
201 });
202
203 var _preview_dialog = function(res){
204 var _el = $('<div id="ajax_preview" title="{_T string="Mailing preview" escape="js"}"> </div>');
205 _el.appendTo('body').dialog({
206 modal: true,
207 hide: 'fold',
208 width: '80%',
209 height: 500,
210 close: function(event, ui){
211 _el.remove();
212 }
213 });
214 $('#ajax_preview').append( res );
215 }
216
217 </script>
218 {/block}