1 {extends file="page.tpl"}
4 <form action="{path_for name="mailings_filter"}" method="post" id="filtre">
6 <label for="start_date_filter">{_T string="since"}</label>
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>
9 <input type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{$history->filters->end_date_filter}"/>
11 {assign var="senders" value=$history->getSendersList()}
12 {if $senders|@count gt 0}
13 <label for="sender_filter">{_T string="Sender"}</label>
14 <select name="sender_filter" id="sender_filter">
15 <option value="0"{if $history->filters->sender_filter eq 0} selected="selected"{/if}>{_T string="Select a sender"}</option>
16 {foreach from=$senders item=$sender key=$key}
17 <option value="{$key}"{if $history->filters->sender_filter == $key} selected="selected"{/if}>{$sender}</option>
22 <input type="submit" class="inline" value="{_T string="Filter"}"/>
23 <input type="submit" name="clear_filter" class="inline" value="{_T string="Clear filter"}"/>
26 <label for="subject_filter">{_T string="Subject"}</label>
27 <input type="text" name="subject_filter" id="subject_filter" value="{$history->filters->subject_filter}"/>
28 {_T string="Sent mailings:"}
29 <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}>
30 <label for="filter_dc_sent" >{_T string="Don't care"}</label>
31 <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}>
32 <label for="filter_sent" >{_T string="Yes"}</label>
33 <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}>
34 <label for="filter_not_sent" >{_T string="No"}</label>
37 <table class="infoline">
39 <td class="left nowrap">
40 {_T string="%count entry" plural="%count entries" count=$history->getCount() pattern="/%count/" replace=$history->getCount()}
43 <label for="nbshow">{_T string="Records per page:"}</label>
44 <select name="nbshow" id="nbshow">
45 {html_options options=$nbshow_options selected=$numrows}
47 <noscript> <span><input type="submit" value="{_T string="Change"}" /></span></noscript>
54 <table class="listing">
57 <th class="small_head">#</th>
58 <th class="left date_row">
59 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_DATE"|constant]}">
61 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_DATE')}
62 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
63 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
65 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
70 <th class="left username_row">
71 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_SENDER"|constant]}">
73 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_SENDER')}
74 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
75 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
77 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
82 <th class="left small_head">
83 {_T string="Recipients"}
86 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_SUBJECT"|constant]}">
88 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_SUBJECT')}
89 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
90 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
92 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
97 <th title="{_T string="Attachments"}" class="small_head">
100 <th class="left right small_head">
101 <a href="{path_for name="mailings" data=["option" => "order", "value" => "Galette\Filters\MailingsList::ORDERBY_SENT"|constant]}">
103 {if $history->filters->orderby eq constant('Galette\Filters\MailingsList::ORDERBY_SENT')}
104 {if $history->filters->ordered eq constant('Galette\Filters\MailingsList::ORDER_ASC')}
105 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt="{_T string="Ascendent"}"/>
107 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt="{_T string="Descendant"}"/>
112 <th class="small_head"></th>
116 {foreach from=$logs item=log name=eachlog}
117 <tr class="{if $smarty.foreach.eachlog.iteration % 2 eq 0}even{else}odd{/if}">
118 <td data-scope="row">
119 {if $preferences->pref_show_id}
122 {$smarty.foreach.eachlog.iteration}
124 <span class="row-title">
125 {_T string="Mailing entry %id" pattern="/%id/" replace=$log.mailing.mailing_id}
128 <td class="nowrap" data-title="{_T string="Date"}">{$log.mailing_date|date_format:"%a %d/%m/%Y - %R"}</td>
129 <td data-title="{_T string="Sender"}">{if $log.mailing_sender eq 0}{_T string="Superadmin"}{else}{$log.mailing_sender_name}{/if}</td>
130 <td data-title="{_T string="Recipients"}">{$log.mailing_recipients|unserialize|@count}</td>
131 <td data-title="{_T string="Subject"}">{$log.mailing_subject}</td>
132 <td class="center" data-title="{_T string="Attachments"}">{$log.attachments}</td>
133 <td class="center {if $log.mailing_sent == 1}use{else}delete{/if}" data-title="{_T string="Sent"}">
134 {if $log.mailing_sent == 1}
135 <i class="fas fa-thumbs-up"></i>
137 <i class="fas fa-thumbs-down"></i>
140 <td class="center nowrap actions_row">
142 href="{path_for name="mailingPreview" data=["id" => $log.mailing_id]}"
143 class="showdetails tooltip"
145 <i class="fas fa-eye"></i>
146 <span class="sr-only">{_T string="Display mailing '%subject' details in preview window" pattern="/%subject/" replace=$log.mailing_subject}</span>
149 href="{path_for name="mailing"}?from={$log.mailing_id}"
152 <i class="fas fa-clone"></i>
153 <span class="sr-only">{_T string="Use mailing '%subject' as a template for a new one" pattern="/%subject/" replace=$log.mailing_subject}</span>
156 href="{path_for name="removeMailing" data=["id" => $log.mailing_id]}"
157 class="delete tooltip"
159 <i class="fas fa-trash"></i>
160 <span class="sr-only">{_T string="Delete mailing '%subject'" pattern="/%subject/" replace=$log.mailing_subject}</span>
165 <tr><td colspan="8" class="emptylist">{_T string="No sent mailing has been stored in the database yet."}</td></tr>
169 <div class="center cright">
170 {_T string="Pages:"}<br/>
171 <ul class="pages">{$pagination}</ul>
176 href="{path_for name="mailing"}?mailing_new=true"
178 <i class="fas fa-plus-square"></i>
179 {_T string="Create new mailing"}
184 {block name="javascripts"}
185 <script type="text/javascript">
186 $('#nbshow').change(function() {
190 {include file="js_removal.tpl"}
192 $('#start_date_filter, #end_date_filter').datepicker({
196 buttonText: '<i class="far fa-calendar-alt"></i> <span class="sr-only">{_T string="Select a date" escape="js"}</span>'
200 $('.showdetails').click(function(){
202 url: $(this).attr('href'),
207 {include file="js_loader.tpl"},
208 success: function(res){
209 _preview_dialog(res);
212 alert("{_T string="An error occurred displaying preview :(" escape="js"}");
218 var _preview_dialog = function(res){
219 var _el = $('<div id="ajax_preview" title="{_T string="Mailing preview" escape="js"}"> </div>');
220 _el.appendTo('body').dialog({
225 close: function(event, ui){
229 $('#ajax_preview').append( res );