Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-08-21-20-13-45
[civicrm-core.git] / templates / CRM / Case / Form / Case.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 {* Base template for Open Case. May be used for other special activity types at some point ..
27 Note: 1. We will include all the activity fields here however each activity type file may build (via php) only those required by them.
28 2. Each activity type file can include its case fields in its own template, so that they will be included during activity edit.
29 *}
30 <div class="crm-block crm-form-block crm-case-form-block">
31
32 {if $cdType }
33 {include file="CRM/Custom/Form/CustomData.tpl"}
34 {else}
35
36 {if $action neq 8 && $action neq 32768}
37 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
38 {/if}
39
40 <h3>{if $action eq 8}{ts}Delete Case{/ts}{elseif $action eq 32768}{ts}Restore Case{/ts}{/if}</h3>
41 {if $action eq 8 or $action eq 32768 }
42 <div class="messages status no-popup">
43 <div class="icon inform-icon"></div>
44 {if $action eq 8}
45 {ts}Click Delete to move this case and all associated activities to the Trash.{/ts}
46 {else}
47 {ts}Click Restore to retrieve this case and all associated activities from the Trash.{/ts}
48 {/if}
49 </div>
50 {else}
51 <table class="form-layout">
52 {if $activityTypeDescription }
53 <tr>
54 <div id="help">{$activityTypeDescription}</div>
55 </tr>
56 {/if}
57 {if $clientName}
58 <tr class="crm-case-form-block-clientName">
59 <td class="label font-size12pt">{ts}Client{/ts}</td>
60 <td class="font-size12pt bold view-value">{$clientName}</td>
61 </tr>
62 {elseif !$clientName and $action eq 1}
63 {if $context eq 'standalone'}
64 {include file="CRM/Contact/Form/NewContact.tpl"}
65 {/if}
66 {/if}
67 {* activity fields *}
68 {if $form.medium_id.html and $form.activity_location.html}
69 <tr class="crm-case-form-block-medium_id">
70 <td class="label">{$form.medium_id.label}</td>
71 <td class="view-value">{$form.medium_id.html}&nbsp;&nbsp;&nbsp;{$form.activity_location.label} &nbsp;{$form.activity_location.html}</td>
72 </tr>
73 {/if}
74
75 {if $form.activity_details.html}
76 <tr class="crm-case-form-block-activity_details">
77 <td class="label">{$form.activity_details.label}{help id="id-details" activityTypeFile=$activityTypeFile file="CRM/Case/Form/Case.hlp"}</td>
78 <td class="view-value">{if $defaultWysiwygEditor eq 0}{$form.activity_details.html|crmStripAlternatives|crmAddClass:huge40}{else}{$form.activity_details.html|crmStripAlternatives}{/if}</td>
79 </tr>
80 {/if}
81
82 {* custom data group *}
83 {if $groupTree}
84 <tr>
85 <td colspan="2">{include file="CRM/Custom/Form/CustomData.tpl"}</td>
86 </tr>
87 {/if}
88
89 {if $form.activity_subject.html}
90 <tr class="crm-case-form-block-activity_subject">
91 <td class="label">{$form.activity_subject.label}{help id="id-activity_subject" activityTypeFile=$activityTypeFile file="CRM/Case/Form/Case.hlp"}</td>
92 <td>{$form.activity_subject.html|crmAddClass:huge}</td>
93 </tr>
94 {/if}
95
96 {* inject activity type-specific form fields *}
97 {if $activityTypeFile}
98 {include file="CRM/Case/Form/Activity/$activityTypeFile.tpl"}
99 {/if}
100
101 {if $form.duration.html}
102 <tr class="crm-case-form-block-duration">
103 <td class="label">{$form.duration.label}</td>
104 <td class="view-value">
105 {$form.duration.html}
106 <span class="description">{ts}Total time spent on this activity (in minutes).{/ts}</span>
107 </td>
108 </tr>
109 {/if}
110
111 {if $form.tag.html}
112 <tr class="crm-case-form-block-tag">
113 <td class="label">{$form.tag.label}</td>
114 <td class="view-value"><div class="crm-select-container">{$form.tag.html}</div>
115 {literal}
116 <script type="text/javascript">
117 cj(".crm-case-form-block-tag select[multiple]").crmasmSelect({
118 addItemTarget: 'bottom',
119 animate: true,
120 highlight: true,
121 sortable: true,
122 respectParents: true
123 });
124 </script>
125 {/literal}
126 </td>
127 </tr>
128 {/if}
129
130 <tr class="crm-case-form-block-custom_data">
131 <td colspan="2">
132 <div id="customData"></div>
133 </td>
134 </tr>
135
136 <tr class="crm-case-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tag.tpl" tagsetType='case'}</td></tr>
137
138 </table>
139 {/if}
140
141 {if $action eq 1}
142 {*include custom data js file*}
143 {include file="CRM/common/customData.tpl"}
144 {literal}
145 <script type="text/javascript">
146 cj(document).ready(function() {
147 var customDataSubType = cj('#case_type_id').val();
148 if ( customDataSubType ) {
149 CRM.buildCustomData( {/literal}'{$customDataType}'{literal}, customDataSubType );
150 } else {
151 CRM.buildCustomData( {/literal}'{$customDataType}'{literal} );
152 }
153 });
154 </script>
155 {/literal}
156 {/if}
157
158 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
159
160 {* include jscript to warn if unsaved form field changes *}
161 {include file="CRM/common/formNavigate.tpl"}
162 {/if}
163 </div>