Merge pull request #1458 from colemanw/contactTypeSearch
[civicrm-core.git] / templates / CRM / Case / Page / Tab.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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>&nbsp;
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/admin/options/case_type' q='reset=1&group=case_type'}
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
55 call_user_func(array('CRM_Core_Permission','check'), 'access all cases and activities') and
56 $allowToAddNewCase}
57 {ts 1=$newCaseURL}Click <a href='%1'>Add Case</a> to add a case record for this contact.{/ts}{/if}
58 </div>
59
60 {if $action eq 16 and $permission EQ 'edit' and
61 ( call_user_func(array('CRM_Core_Permission','check'), 'access all cases and activities') OR
62 call_user_func(array('CRM_Core_Permission','check'), 'add cases') ) AND
63 $allowToAddNewCase}
64 <div class="action-link">
65 <a accesskey="N" href="{$newCaseURL}" class="button"><span><div class="icon add-icon"></div> {ts}Add Case{/ts}</span></a>
66 </div>
67 {/if}
68
69 {if $rows}
70 {include file="CRM/Case/Form/Selector.tpl"}
71 {else}
72 <div class="messages status no-popup">
73 <div class="icon inform-icon"></div>
74 {ts}There are no case records for this contact.{/ts}
75 </div>
76 {/if}
77 </div>
78 </div>
79 {/if}
80 {/if}