Rename activity search field from status_id to activity_status_id
[civicrm-core.git] / templates / CRM / Activity / Form / Search / Common.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
1188c7a8 3 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 4 | |
1188c7a8
TO
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 |
6a488035
TO
8 +--------------------------------------------------------------------+
9*}
14016388 10<tr>
637ca83b 11 <td colspan="2">
79d954ae 12 {$form.activity_role.html}
14016388 13 </span>
14016388
ML
14 </td>
15</tr>
6a488035 16<tr>
637ca83b 17 {if $form.activity_type_id}
9ab34172 18 <td><label>{$form.activity_type_id.label}</label>
19 <br />
20 {$form.activity_type_id.html}
637ca83b 21 </td>
6a488035 22 {else}
637ca83b 23 <td>&nbsp;</td>
24 {/if}
6ac95f0b 25 {if $form.activity_survey_id || $buildEngagementLevel}
637ca83b 26 <td>
27 {if $form.activity_survey_id}
28 <label>{$form.activity_survey_id.label}</label>
29 <br/>
30 {$form.activity_survey_id.html}
31 {/if}
32 {if $buildEngagementLevel}
33 <br
34 / >
35 <br/>
36 <label>{$form.activity_engagement_level.label}</label>
37 <br/>
38 {$form.activity_engagement_level.html}
39 {/if}
40 </td>
41 {/if}
6a488035 42
4c24c842
PN
43 <td>
44 <table>
45 <tr><td>
46 {if $form.parent_id}
7f7fa13a
EM
47 <label>{ts}Has a Followup Activity?{/ts}</label>
48 <br/>
49 {$form.parent_id.html}
4c24c842
PN
50 {/if}
51 </td></tr>
52 <tr><td>
7f7fa13a
EM
53 {if $form.followup_parent_id}
54 <label>{ts}Is a Followup Activity?{/ts}</label>
55 <br/>
56 {$form.followup_parent_id.html}
4c24c842
PN
57 {/if}
58 </td></tr>
59 </table>
60 </td>
6a488035
TO
61</tr>
62
15a788af
PN
63{if $form.activity_tags}
64 <tr>
65 <td><label>{$form.activity_tags.label}</label>
66 <br/>
67 {$form.activity_tags.html}
68 </td>
69 </tr>
70{/if}
71
6a488035 72<tr>
b04ec479
SL
73 {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="activity_date_time" colspan="2"}
74 <td>&nbsp;</td>
6a488035
TO
75</tr>
76<tr>
77 <td>
92e9c781
AS
78 {$form.activity_text.label}<br/>
79 {$form.activity_text.html|crmAddClass:big}<br/>
c9c5c58d 80 {$form.activity_option.html}<br/>
6a488035
TO
81 </td>
82 <td colspan="2">
a13c931b 83 {$form.activity_status_id.label}<br/>
84 {$form.activity_status_id.html}
14016388
ML
85 </td>
86</tr>
87<tr>
da236f9a 88 <td>
89 {$form.priority_id.label}<br />
90 {$form.priority_id.html}
91 </td>
14016388 92 <td colspan="2">
637ca83b 93 {$form.activity_test.label} {help id="is-test" file="CRM/Contact/Form/Search/Advanced"}
6a488035 94 &nbsp; {$form.activity_test.html}
6a488035
TO
95 </td>
96</tr>
d934f895 97<tr>
98<td>{$form.activity_location.label}<br />
99 {$form.activity_location.html}</td>
100<td></td>
101</tr>
4041c9b6 102{if $buildSurveyResult }
7f7fa13a
EM
103 <tr>
104 <td id="activityResult">
105 <label>{$form.activity_result.label}</label><br />
106 {$form.activity_result.html}
107 </td>
108 <td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td>
109 </tr>
4041c9b6 110{else}
7f7fa13a
EM
111 <tr>
112 <td colspan="3">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td>
113 </tr>
4041c9b6 114{/if}
6a488035
TO
115
116{* campaign in activity search *}
117{include file="CRM/Campaign/Form/addCampaignToComponent.tpl"
118campaignContext="componentSearch" campaignTrClass='' campaignTdClass=''}
119
120{if $activityGroupTree}
637ca83b 121 <tr id="activityCustom">
2392a753 122 <td id="activityCustomData" colspan="4">
637ca83b 123 {include file="CRM/Custom/Form/Search.tpl" groupTree=$activityGroupTree showHideLinks=false}
124 </td>
125 </tr>
6a488035
TO
126{/if}
127
128{literal}
129<script type="text/javascript">
3cc60a06 130 CRM.$(function($) {
6a488035
TO
131 //Searchable activity custom fields which extend ALL activity types are always displayed in the form
132 //hence hide remaining activity custom data
ae8f569f
CW
133 $('#activityCustom').children( ).each( function( ) {
134 $('#'+$(this).attr('id')+' div').each( function( ) {
135 if ($(this).children( ).attr('id')) {
136 var activityCustomdataGroup = $(this).attr('id'); //div id
137 var fieldsetId = $(this).children( ).attr('id'); // fieldset id
6a488035
TO
138 var splitFieldsetId = fieldsetId.split("\ 1");
139 var splitFieldsetLength = splitFieldsetId.length; //length of fieldset
140 var show = 0;
141 //setdefault activity custom data group if corresponding activity type is checked
ae8f569f
CW
142 $('#Activity div').each(function( ) {
143 var checkboxId = $(this).children().attr('id'); //activity type element name
6a488035
TO
144 if (document.getElementById( checkboxId ).checked ) {
145 var element = checkboxId.split('[');
146 var splitElement = element[1].split(']'); // get activity type id
147 for (var i=0; i<splitFieldsetLength; i++) {
148 var singleFieldset = splitFieldsetId[i];
149 if (parseInt( singleFieldset)) {
150 if (singleFieldset == splitElement[0]) {
151 show++;
152 }
153 }
154 }
155 }
156 });
157 if (show < 1) {
ae8f569f 158 $('#'+activityCustomdataGroup).hide( );
6a488035
TO
159 }
160 }
161 });
162 });
163 });
6a488035 164
637ca83b 165 function showCustomData(chkbox) {
6a488035
TO
166 if (document.getElementById(chkbox).checked) {
167 //inject Searchable activity custom fields according to activity type selected
168 var element = chkbox.split("[");
169 var splitElement = element[1].split("]");
170 cj('#activityCustom').children().each(function( ) {
171 cj('#'+cj(this).attr( 'id' )+' div').each(function( ) {
172 if (cj(this).children().attr('id')) {
173 if (cj('#'+cj(this).attr('id')+(' fieldset')).attr('id')) {
174 var fieldsetId = cj('#' + cj(this).attr('id')+(' fieldset')).attr('id').split("\ 1");
175 var activityTypeId = jQuery.inArray(splitElement[0], fieldsetId);
176 if (fieldsetId[activityTypeId] == splitElement[0]) {
177 cj(this).show();
178 }
179 }
180 }
181 });
182 });
183 }
184 else {
185 //hide activity custom fields if the corresponding activity type is unchecked
186 var setcount = 0;
187 var element = chkbox.split( "[" );
188 var splitElement = element[1].split( "]" );
189 cj('#activityCustom').children().each( function( ) {
190 cj('#'+cj(this).attr( 'id' )+' div').each(function() {
191 if (cj(this).children().attr('id')) {
192 if (cj('#'+cj(this).attr('id')+(' fieldset')).attr('id')) {
193 var fieldsetId = cj( '#'+cj(this).attr('id')+(' fieldset')).attr('id').split("\ 1");
194 var activityTypeId = jQuery.inArray( splitElement[0],fieldsetId);
195 if (fieldsetId[activityTypeId] == splitElement[0]) {
196 cj('#'+cj(this).attr('id')).each( function() {
197 if (cj(this).children().attr('id')) {
198 //if activity custom data extends more than one activity types then
199 //hide that only when all the extended activity types are unchecked
200 cj('#'+cj(this).attr('id')+(' fieldset')).each( function( ) {
201 var splitFieldsetId = cj( this ).attr('id').split("\ 1");
202 var splitFieldsetLength = splitFieldsetId.length;
203 for( var i=0;i<splitFieldsetLength;i++ ) {
204 var setActivityTypeId = splitFieldsetId[i];
205 if (parseInt(setActivityTypeId)) {
206 var activityTypeId = 'activity_type_id['+setActivityTypeId+']';
207 if (document.getElementById(activityTypeId).checked) {
208 return false;
209 }
210 else {
211 setcount++;
212 }
213 }
214 }
215 if (setcount > 0) {
216 cj('#'+cj(this).parent().attr('id')).hide();
217 }
218 });
219 }
220 });
221 }
222 }
223 }
224 });
225 });
226 }
227}
228{/literal}
229</script>