2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
28 {$form.activity_role.html}
33 {if $form.activity_type_id}
34 <td><label>{$form.activity_type_id.label}</label>
36 {$form.activity_type_id.html}
41 {if $form.activity_survey_id || $buildEngagementLevel}
43 {if $form.activity_survey_id}
44 <label>{$form.activity_survey_id.label}</label>
46 {$form.activity_survey_id.html}
48 {if $buildEngagementLevel}
52 <label>{$form.activity_engagement_level.label}</label>
54 {$form.activity_engagement_level.html}
63 <label>{ts}Has a Followup Activity?{/ts}</label>
65 {$form.parent_id.html}
69 {if $form.followup_parent_id}
70 <label>{ts}Is a Followup Activity?{/ts}</label>
72 {$form.followup_parent_id.html}
77 {if $form.activity_tags}
78 <td><label>{ts}Activity Tag(s){/ts}</label>
79 <div id="Tags" class="listing-box">
80 {foreach from=$form.activity_tags item="tag_val"}
81 <div class="{cycle values='odd-row,even-row'}">
92 <td><label>{ts}Activity Dates{/ts}</label></td>
95 {include file="CRM/Core/DateRange.tpl" fieldName="activity_date" from='_low' to='_high'}
99 {$form.activity_text.label}<br/>
100 {$form.activity_text.html|crmAddClass:big}<br/>
101 {$form.activity_option.html}<br/>
104 {$form.status_id.label}<br/>
105 {$form.status_id.html}
110 {$form.priority_id.label}<br />
111 {$form.priority_id.html}
114 {$form.activity_test.label} {help id="is-test" file="CRM/Contact/Form/Search/Advanced"}
115 {$form.activity_test.html}
118 {if $buildSurveyResult }
120 <td id="activityResult">
121 <label>{$form.activity_result.label}</label><br />
122 {$form.activity_result.html}
124 <td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td>
128 <td colspan="3">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td>
132 {* campaign in activity search *}
133 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl"
134 campaignContext="componentSearch" campaignTrClass='' campaignTdClass=''}
136 {if $activityGroupTree}
137 <tr id="activityCustom">
138 <td id="activityCustomData" colspan="2">
139 {include file="CRM/Custom/Form/Search.tpl" groupTree=$activityGroupTree showHideLinks=false}
145 <script type="text/javascript">
147 //Searchable activity custom fields which extend ALL activity types are always displayed in the form
148 //hence hide remaining activity custom data
149 $('#activityCustom').children( ).each( function( ) {
150 $('#'+$(this).attr('id')+' div').each( function( ) {
151 if ($(this).children( ).attr('id')) {
152 var activityCustomdataGroup = $(this).attr('id'); //div id
153 var fieldsetId = $(this).children( ).attr('id'); // fieldset id
154 var splitFieldsetId = fieldsetId.split("
\ 1");
155 var splitFieldsetLength = splitFieldsetId.length; //length of fieldset
157 //setdefault activity custom data group if corresponding activity type is checked
158 $('#Activity div').each(function( ) {
159 var checkboxId = $(this).children().attr('id'); //activity type element name
160 if (document.getElementById( checkboxId ).checked ) {
161 var element = checkboxId.split('[');
162 var splitElement = element[1].split(']'); // get activity type id
163 for (var i=0; i<splitFieldsetLength; i++) {
164 var singleFieldset = splitFieldsetId[i];
165 if (parseInt( singleFieldset)) {
166 if (singleFieldset == splitElement[0]) {
174 $('#'+activityCustomdataGroup).hide( );
181 function showCustomData(chkbox) {
182 if (document.getElementById(chkbox).checked) {
183 //inject Searchable activity custom fields according to activity type selected
184 var element = chkbox.split("[");
185 var splitElement = element[1].split("]");
186 cj('#activityCustom').children().each(function( ) {
187 cj('#'+cj(this).attr( 'id' )+' div').each(function( ) {
188 if (cj(this).children().attr('id')) {
189 if (cj('#'+cj(this).attr('id')+(' fieldset')).attr('id')) {
190 var fieldsetId = cj('#' + cj(this).attr('id')+(' fieldset')).attr('id').split("
\ 1");
191 var activityTypeId = jQuery.inArray(splitElement[0], fieldsetId);
192 if (fieldsetId[activityTypeId] == splitElement[0]) {
201 //hide activity custom fields if the corresponding activity type is unchecked
203 var element = chkbox.split( "[" );
204 var splitElement = element[1].split( "]" );
205 cj('#activityCustom').children().each( function( ) {
206 cj('#'+cj(this).attr( 'id' )+' div').each(function() {
207 if (cj(this).children().attr('id')) {
208 if (cj('#'+cj(this).attr('id')+(' fieldset')).attr('id')) {
209 var fieldsetId = cj( '#'+cj(this).attr('id')+(' fieldset')).attr('id').split("
\ 1");
210 var activityTypeId = jQuery.inArray( splitElement[0],fieldsetId);
211 if (fieldsetId[activityTypeId] == splitElement[0]) {
212 cj('#'+cj(this).attr('id')).each( function() {
213 if (cj(this).children().attr('id')) {
214 //if activity custom data extends more than one activity types then
215 //hide that only when all the extended activity types are unchecked
216 cj('#'+cj(this).attr('id')+(' fieldset')).each( function( ) {
217 var splitFieldsetId = cj( this ).attr('id').split("
\ 1");
218 var splitFieldsetLength = splitFieldsetId.length;
219 for( var i=0;i<splitFieldsetLength;i++ ) {
220 var setActivityTypeId = splitFieldsetId[i];
221 if (parseInt(setActivityTypeId)) {
222 var activityTypeId = 'activity_type_id['+setActivityTypeId+']';
223 if (document.getElementById(activityTypeId).checked) {
232 cj('#'+cj(this).parent().attr('id')).hide();