2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 +--------------------------------------------------------------------+
26 {*this template is used for activity accordion*}
27 <div class="crm-accordion-wrapper crm-case_activities-accordion crm-case-activities-block">
28 <div class="crm-accordion-header">
31 <div id="activities" class="crm-accordion-body">
32 <div class="crm-accordion-wrapper crm-accordion-inner crm-search_filters-accordion collapsed">
33 <div class="crm-accordion-header">
34 {ts}Search Filters{/ts}
35 </div><!-- /.crm-accordion-header -->
36 <div class="crm-accordion-body">
37 <table class="no-border form-layout-compressed" id="searchOptions">
39 <td class="crm-case-caseview-form-block-repoter_id"colspan="2"><label for="reporter_id">{ts}Reporter/Role{/ts}</label><br />
40 {$form.reporter_id.html|crmAddClass:twenty}
42 <td class="crm-case-caseview-form-block-status_id"><label for="status_id">{$form.status_id.label}</label><br />
43 {$form.status_id.html}
45 <td style="vertical-align: bottom;">
46 {assign var=caseid value=$caseID}
47 <span class="crm-button crm-icon-button">
48 <span class="crm-button-icon ui-icon-check"></span>
49 <input class="crm-form-submit default" name="_qf_Basic_refresh" value="{ts}Search{/ts}" type="button" data-case-id="{$caseid}" />
54 <td class="crm-case-caseview-form-block-activity_date_low">
55 {assign var=activitylow value=activity_date_low_$caseID}
56 {$form.$activitylow.label}<br />
57 {include file="CRM/common/jcalendar.tpl" elementName=$activitylow}
59 <td class="crm-case-caseview-form-block-activity_date_high">
60 {assign var=activityhigh value=activity_date_high_$caseID}
61 {$form.$activityhigh.label}<br />
62 {include file="CRM/common/jcalendar.tpl" elementName=$activityhigh}
64 <td class="crm-case-caseview-form-block-activity_type_filter_id">
65 {$form.activity_type_filter_id.label}<br />
66 {$form.activity_type_filter_id.html}
69 {if $form.activity_deleted}
70 <tr class="crm-case-caseview-form-block-activity_deleted">
72 {$form.activity_deleted.html}{$form.activity_deleted.label}
77 </div><!-- /.crm-accordion-body -->
78 </div><!-- /.crm-accordion-wrapper -->
80 <table id=case_id_{$caseid} class="nestedActivitySelector">
82 <th class='crm-case-activities-date'>{ts}Date{/ts}</th>
83 <th class='crm-case-activities-subject'>{ts}Subject{/ts}</th>
84 <th class='crm-case-activities-type'>{ts}Type{/ts}</th>
85 <th class='crm-case-activities-with'>{ts}With{/ts}</th>
86 <th class='crm-case-activities-assignee'>{ts}Reporter / Assignee{/ts}</th>
87 <th class='crm-case-activities-status'>{ts}Status{/ts}</th>
88 <th class='crm-case-activities-status' id="nosort"> </th>
89 <th class='hiddenElement'> </th>
93 </div><!-- /.crm-accordion-body -->
94 </div><!-- /.crm-accordion-wrapper -->
97 <script type="text/javascript">
99 var CaseId = {/literal}{$caseID}{literal};
100 buildCaseActivities(false);
101 $('input.crm-form-submit[data-case-id=' + CaseId + ']').click(buildCaseActivities);
103 function buildCaseActivities(filterSearch) {
109 var sourceUrl = {/literal}"{crmURL p='civicrm/ajax/activity' h=0 q='snippet=4&caseID='}"{literal}+CaseId;
110 sourceUrl = sourceUrl + '&cid={/literal}{$contactID}{literal}';
111 sourceUrl = sourceUrl + '&userID={/literal}{$userID}{literal}';
113 $('#case_id_'+CaseId+' th').each(function( ) {
114 if ($(this).attr('id') != 'nosort') {
115 columns += '{"sClass": "' + $(this).attr('class') +'"},';
118 columns += '{ "bSortable": false },';
123 columns = columns.substring(0, columns.length - 1 );
124 eval('columns =[' + columns + ']');
126 oTable = $('#case_id_'+CaseId).dataTable({
128 "bAutoWidth" : false,
130 "aoColumns" : columns,
133 "asStripClasses" : [ "odd-row", "even-row" ],
134 "sPaginationType": "full_numbers",
135 "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
137 "sAjaxSource": sourceUrl,
138 "iDisplayLength": 10,
140 "fnDrawCallback": function() {
143 // FIXME: trigger crmLoad and crmEditable would happen automatically
144 $('.crm-editable', '#case_id_'+CaseId).crmEditable();
146 "fnServerData": function ( sSource, aoData, fnCallback ) {
148 if ( filterSearch ) {
149 var activity_deleted = 0;
150 if ( $("#activity_deleted_"+CaseId+":checked").val() == 1 ) {
151 activity_deleted = 1;
154 {name:'status_id', value: $("select#status_id_"+CaseId).val()},
155 {name:'reporter_id', value: $("select#reporter_id_"+CaseId).val()},
156 {name:'activity_type_id', value: $("select#activity_type_filter_id_"+CaseId).val()},
157 {name:'activity_date_low', value: $("#activity_date_low_"+CaseId).val()},
158 {name:'activity_date_high', value: $("#activity_date_high_"+CaseId).val() },
159 {name:'activity_deleted', value: activity_deleted }
167 "success": fnCallback
173 function setRowIds() {
174 $("#case_id_"+CaseId+" tbody tr").each(function() {
176 link = $('a.action-item', this).attr('href');
178 id = link.match(/&id=(\d+)/);
182 .addClass('crm-entity')
183 .data('entity', 'activity')
189 function setSelectorClass() {
190 $("#case_id_"+CaseId+" td:last-child").each(function() {
191 $(this).parent().addClass($(this).text());