Merge pull request #22449 from mattwire/phpnotices
[civicrm-core.git] / templates / CRM / Mailing / Page / Browse.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
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 |
8 +--------------------------------------------------------------------+
9 *}
10 {if $sms}
11 {assign var='newMassUrl' value='civicrm/sms/send'}
12 {assign var='qVal' value='&sms=1'}
13 {assign var='linkTitle' value='New SMS'}
14 {assign var='componentName' value='Mass SMS'}
15 {else}
16 {assign var='newMassUrl' value='civicrm/mailing/send'}
17 {assign var='qVal' value=''}
18 {assign var='linkTitle' value='New Mailing'}
19 {assign var='componentName' value='Mailings'}
20 {/if}
21
22 {if $showLinks}
23 <div class="action-link">
24 {crmButton accesskey="N" p=$newMassUrl q='reset=1' icon="envelope"}{ts}{$linkTitle}{/ts}{/crmButton}<br/><br/>
25 </div>
26 {/if}
27 {include file="CRM/Mailing/Form/Search.tpl"}
28
29 {if $rows}
30 {include file="CRM/common/pager.tpl" location="top"}
31 {include file="CRM/common/pagerAToZ.tpl"}
32
33 {strip}
34 <table class="selector row-highlight">
35 <thead class="sticky">
36 {foreach from=$columnHeaders item=header}
37 <th>
38 {if !empty($header.sort)}
39 {assign var='key' value=$header.sort}
40 {$sort->_response.$key.link}
41 {elseif !empty($header.name)}
42 {$header.name}
43 {/if}
44 </th>
45 {/foreach}
46 </thead>
47
48 {counter start=0 skip=1 print=false}
49 {foreach from=$rows item=row}
50 <tr id="crm-mailing_{$row.id}" class="{cycle values="odd-row,even-row"} crm-mailing crm-mailing_status-{$row.status}">
51 <td class="crm-mailing-name">{$row.name}</td>
52 {if $multilingual}
53 <td class="crm-mailing-language">{$row.language}</td>
54 {/if}
55 <td class="crm-mailing-status crm-mailing_status-{$row.status}">{$row.status}</td>
56 <td class="crm-mailing-created_by">
57 <a href ={crmURL p='civicrm/contact/view' q="reset=1&cid="}{$row.created_id} title="{$row.created_by|escape}">
58 {$row.created_by|mb_truncate:20:"..."}
59 </a>
60 </td>
61 <td class="crm-mailing-created_date">{$row.created_date}</td>
62 <td class="crm-mailing-scheduled_by">
63 <a href ={crmURL p='civicrm/contact/view' q="reset=1&cid="}{$row.scheduled_id} title="{$row.scheduled_by|escape}">
64 {$row.scheduled_by|mb_truncate:20:"..."}
65 </a>
66 </td>
67 <td class="crm-mailing-scheduled">{$row.scheduled}</td>
68 <td class="crm-mailing-start">{$row.start}</td>
69 <td class="crm-mailing-end">{$row.end}</td>
70 {if call_user_func(array('CRM_Campaign_BAO_Campaign','isCampaignEnable'))}
71 <td class="crm-mailing-campaign">{$row.campaign}</td>
72 {/if}
73 <td>{$row.action|replace:'xx':$row.id}</td>
74 </tr>
75 {/foreach}
76 </table>
77 {/strip}
78
79 {include file="CRM/common/pager.tpl" location="bottom"}
80 {if $showLinks}
81 <div class="action-link">
82 {crmButton accesskey="N" p=$newMassUrl q='reset=1' icon="envelope"}{ts}{$linkTitle}{/ts}{/crmButton}<br/>
83 </div>
84 {/if}
85
86 {* No mailings to list. Check isSearch flag to see if we're in a search or not. *}
87 {elseif $isSearch eq 1}
88 {if $archived}
89 {capture assign=browseURL}{crmURL p='civicrm/mailing/browse/archived' q="reset=1"}{$qVal}{/capture}
90 {assign var="browseType" value="Archived"}
91 {elseif $unscheduled}
92 {capture assign=browseURL}{crmURL p='civicrm/mailing/browse/unscheduled' q="scheduled=false&reset=1"}{$qVal}{/capture}
93 {assign var="browseType" value="Draft and Unscheduled"}
94 {else}
95 {capture assign=browseURL}{crmURL p='civicrm/mailing/browse/scheduled' q="scheduled=true&reset=1"}{$qVal}{/capture}
96 {assign var="browseType" value="Scheduled and Sent"}
97 {/if}
98 <div class="status messages">
99 <table class="form-layout">
100 <tr>{icon icon="fa-info-circle"}{/icon}
101 {ts 1=$componentName}No %1 match your search criteria. Suggestions:{/ts}
102 </tr>
103 <div class="spacer"></div>
104 <ul>
105 <li>{ts}Check your spelling.{/ts}</li>
106 <li>{ts}Try a different spelling or use fewer letters.{/ts}</li>
107 </ul>
108 <tr>{ts 1=$browseURL 2=$browseType 3=$componentName}Or you can <a href='%1'>browse all %2 %3</a>.{/ts}</tr>
109 </table>
110 </div>
111 {elseif $unscheduled}
112
113 <div class="messages status no-popup">
114 {icon icon="fa-info-circle"}{/icon}
115 {capture assign=crmURL}{crmURL p=$newMassUrl q='reset=1'}{/capture}
116 {ts 1=$componentName}There are no Unscheduled %1.{/ts}
117 {if $showLinks}{ts 1=$crmURL}You can <a href='%1'>create and send one</a>.{/ts}{/if}
118 </div>
119
120 {elseif $archived}
121 <div class="messages status no-popup">
122 {icon icon="fa-info-circle"}{/icon}&nbsp
123 {capture assign=crmURL}{crmURL p='civicrm/mailing/browse/scheduled' q='scheduled=true&reset=1'}{$qVal}{/capture}
124 {ts 1=$crmURL 2=$componentName}There are no Archived %2. You can archive %2 from <a href='%1'>Scheduled or Sent %2</a>.{/ts}
125 </div>
126 {else}
127 <div class="messages status no-popup">
128 {icon icon="fa-info-circle"}{/icon}
129 {capture assign=crmURL}{crmURL p=$newMassUrl q='reset=1'}{/capture}
130 {capture assign=archiveURL}{crmURL p='civicrm/mailing/browse/archived' q='reset=1'}{$qVal}{/capture}
131 {ts 1=$componentName}There are no Scheduled or Sent %1.{/ts}
132 {if $showLinks}{ts 1=$crmURL}You can <a href='%1'>create and send one</a>{/ts}{/if}{if $archiveLinks}{ts 1=$archiveURL 2=$componentName} OR you can search the <a href='%1'>Archived %2</a>{/ts}{/if}.
133 </div>
134 {/if}