| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.6 | |
| 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 $notConfigured} {* Case types not present. Component is not configured for use. *} |
| 27 | {include file="CRM/Case/Page/ConfigureError.tpl"} |
| 28 | |
| 29 | {elseif $redirectToCaseAdmin} |
| 30 | <div class="messages status no-popup"> |
| 31 | <div class="icon inform-icon"></div> |
| 32 | <strong>{ts}Oops, It looks like there are no active case types.{/ts}</strong> |
| 33 | {if call_user_func(array('CRM_Core_Permission','check'), ' administer CiviCase')} |
| 34 | {capture assign=adminCaseTypeURL}{crmURL p='civicrm/a/#/caseType'} |
| 35 | {/capture} |
| 36 | {ts 1=$adminCaseTypeURL 2=$adminCaseStatusURL}Enable <a href='%1'>case types</a>.{/ts} |
| 37 | {/if} |
| 38 | </div> |
| 39 | |
| 40 | {else} |
| 41 | |
| 42 | {capture assign=newCaseURL}{crmURL p="civicrm/case/add" q="reset=1&action=add&cid=`$contactId`&context=case"}{/capture} |
| 43 | |
| 44 | {if $action eq 1 or $action eq 2 or $action eq 8 or $action eq 32768 } {* add, update, delete, restore*} |
| 45 | {include file="CRM/Case/Form/Case.tpl"} |
| 46 | {elseif $action eq 4 } |
| 47 | {include file="CRM/Case/Form/CaseView.tpl"} |
| 48 | |
| 49 | {else} |
| 50 | <div class="crm-block crm-content-block"> |
| 51 | <div class="view-content"> |
| 52 | <div id="help"> |
| 53 | {ts 1=$displayName}This page lists all case records for %1.{/ts} |
| 54 | {if $permission EQ 'edit' and call_user_func(array('CRM_Core_Permission','check'), 'access all cases and activities') and $allowToAddNewCase} |
| 55 | {ts 1="href='$newCaseURL' class='action-item'"}Click <a %1>Add Case</a> to add a case record for this contact.{/ts}{/if} |
| 56 | </div> |
| 57 | |
| 58 | {if $action eq 16 and $permission EQ 'edit' and |
| 59 | ( call_user_func(array('CRM_Core_Permission','check'), 'access all cases and activities') OR |
| 60 | call_user_func(array('CRM_Core_Permission','check'), 'add cases') ) AND |
| 61 | $allowToAddNewCase} |
| 62 | <div class="action-link"> |
| 63 | <a accesskey="N" href="{$newCaseURL}" class="button"><span><div class="icon ui-icon-circle-plus"></div> {ts}Add Case{/ts}</span></a> |
| 64 | </div> |
| 65 | {/if} |
| 66 | |
| 67 | {if $rows} |
| 68 | {include file="CRM/Case/Form/Selector.tpl"} |
| 69 | {else} |
| 70 | <div class="messages status no-popup"> |
| 71 | <div class="icon inform-icon"></div> |
| 72 | {ts}There are no case records for this contact.{/ts} |
| 73 | </div> |
| 74 | {/if} |
| 75 | </div> |
| 76 | </div> |
| 77 | {/if} |
| 78 | {/if} |