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