2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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}
29 <span class="crm-clear-link">
30 (<a href="#" title="unselect"
31 onclick="unselectRadio('activity_role', '{$form.formName}');
39 {if $form.activity_type_id}
40 <td><label>{ts}Activity Type(s){/ts}</label>
41 <div id="Activity" class="listing-box">
42 {foreach from=$form.activity_type_id item="activity_type_val"}
43 <div class="{cycle values='odd-row,even-row'}">
44 {$activity_type_val.html}
52 {if $form.activity_survey_id || $buildEngagementLevel}
54 {if $form.activity_survey_id}
55 <label>{$form.activity_survey_id.label}</label>
57 {$form.activity_survey_id.html}
59 {if $buildEngagementLevel}
63 <label>{$form.activity_engagement_level.label}</label>
65 {$form.activity_engagement_level.html}
70 {if $form.activity_tags}
71 <td><label>{ts}Activity Tag(s){/ts}</label>
72 <div id="Tags" class="listing-box">
73 {foreach from=$form.activity_tags item="tag_val"}
74 <div class="{cycle values='odd-row,even-row'}">
85 <td><label>{ts}Activity Dates{/ts}</label></td>
88 {include file="CRM/Core/DateRange.tpl" fieldName="activity_date" from='_low' to='_high'}
92 {$form.activity_subject.label}<br/>
93 {$form.activity_subject.html|crmAddClass:big}
96 {$form.activity_status.label}<br/>
97 {$form.activity_status.html}
101 {* td intentionally left blank to align the 'is test' widget on the right *}
104 {$form.activity_test.label} {help id="is-test" file="CRM/Contact/Form/Search/Advanced"}
105 {$form.activity_test.html}
106 <span class="crm-clear-link">
107 (<a href="#" onclick="unselectRadio('activity_test','{$form.formName}'); return false;">{ts}clear{/ts}</a>)
113 <td colspan="3">{include file="CRM/common/Tag.tpl" tagsetType='activity'}</td>
116 {* campaign in activity search *}
117 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl"
118 campaignContext="componentSearch" campaignTrClass='' campaignTdClass=''}
120 {if $activityGroupTree}
121 <tr id="activityCustom">
122 <td id="activityCustomData" colspan="2">
123 {include file="CRM/Custom/Form/Search.tpl" groupTree=$activityGroupTree showHideLinks=false}
129 <script type="text/javascript">
131 //Searchable activity custom fields which extend ALL activity types are always displayed in the form
132 //hence hide remaining activity custom data
133 cj('#activityCustom').children( ).each( function( ) {
134 cj('#'+cj(this).attr('id')+' div').each( function( ) {
135 if (cj(this).children( ).attr('id')) {
136 var activityCustomdataGroup = cj(this).attr('id'); //div id
137 var fieldsetId = cj(this).children( ).attr('id'); // fieldset id
138 var splitFieldsetId = fieldsetId.split("
\ 1");
139 var splitFieldsetLength = splitFieldsetId.length; //length of fieldset
141 //setdefault activity custom data group if corresponding activity type is checked
142 cj('#Activity div').each(function( ) {
143 var checkboxId = cj(this).children().attr('id'); //activity type element name
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]) {
158 cj('#'+activityCustomdataGroup).hide( );
167 <script type="text/javascript">
169 function showCustomData(chkbox) {
170 if (document.getElementById(chkbox).checked) {
171 //inject Searchable activity custom fields according to activity type selected
172 var element = chkbox.split("[");
173 var splitElement = element[1].split("]");
174 cj('#activityCustom').children().each(function( ) {
175 cj('#'+cj(this).attr( 'id' )+' div').each(function( ) {
176 if (cj(this).children().attr('id')) {
177 if (cj('#'+cj(this).attr('id')+(' fieldset')).attr('id')) {
178 var fieldsetId = cj('#' + cj(this).attr('id')+(' fieldset')).attr('id').split("
\ 1");
179 var activityTypeId = jQuery.inArray(splitElement[0], fieldsetId);
180 if (fieldsetId[activityTypeId] == splitElement[0]) {
189 //hide activity custom fields if the corresponding activity type is unchecked
191 var element = chkbox.split( "[" );
192 var splitElement = element[1].split( "]" );
193 cj('#activityCustom').children().each( function( ) {
194 cj('#'+cj(this).attr( 'id' )+' div').each(function() {
195 if (cj(this).children().attr('id')) {
196 if (cj('#'+cj(this).attr('id')+(' fieldset')).attr('id')) {
197 var fieldsetId = cj( '#'+cj(this).attr('id')+(' fieldset')).attr('id').split("
\ 1");
198 var activityTypeId = jQuery.inArray( splitElement[0],fieldsetId);
199 if (fieldsetId[activityTypeId] == splitElement[0]) {
200 cj('#'+cj(this).attr('id')).each( function() {
201 if (cj(this).children().attr('id')) {
202 //if activity custom data extends more than one activity types then
203 //hide that only when all the extended activity types are unchecked
204 cj('#'+cj(this).attr('id')+(' fieldset')).each( function( ) {
205 var splitFieldsetId = cj( this ).attr('id').split("
\ 1");
206 var splitFieldsetLength = splitFieldsetId.length;
207 for( var i=0;i<splitFieldsetLength;i++ ) {
208 var setActivityTypeId = splitFieldsetId[i];
209 if (parseInt(setActivityTypeId)) {
210 var activityTypeId = 'activity_type_id['+setActivityTypeId+']';
211 if (document.getElementById(activityTypeId).checked) {
220 cj('#'+cj(this).parent().attr('id')).hide();