| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 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 | {*this template is used for activity accordion*} |
| 27 | {assign var=caseid value=$caseID} |
| 28 | <div class="crm-accordion-wrapper crm-case_activities-accordion crm-case-activities-block"> |
| 29 | <div class="crm-accordion-header"> |
| 30 | {ts}Activities{/ts} |
| 31 | </div> |
| 32 | <div id="activities" class="crm-accordion-body"> |
| 33 | <div class="crm-accordion-wrapper crm-accordion-inner crm-search_filters-accordion collapsed"> |
| 34 | <div class="crm-accordion-header"> |
| 35 | {ts}Search Filters{/ts} |
| 36 | </div><!-- /.crm-accordion-header --> |
| 37 | <div class="crm-accordion-body"> |
| 38 | <table class="no-border form-layout-compressed" id="searchOptions"> |
| 39 | <tr> |
| 40 | <td class="crm-case-caseview-form-block-repoter_id"colspan="2"><label for="reporter_id">{ts}Reporter/Role{/ts}</label><br /> |
| 41 | {$form.reporter_id.html|crmAddClass:twenty} |
| 42 | </td> |
| 43 | <td class="crm-case-caseview-form-block-status_id"><label for="status_id">{$form.status_id.label}</label><br /> |
| 44 | {$form.status_id.html} |
| 45 | </td> |
| 46 | </tr> |
| 47 | <tr> |
| 48 | <td class="crm-case-caseview-form-block-activity_date_low"> |
| 49 | {assign var=activitylow value=activity_date_low_$caseID} |
| 50 | {$form.$activitylow.label}<br /> |
| 51 | {include file="CRM/common/jcalendar.tpl" elementName=$activitylow} |
| 52 | </td> |
| 53 | <td class="crm-case-caseview-form-block-activity_date_high"> |
| 54 | {assign var=activityhigh value=activity_date_high_$caseID} |
| 55 | {$form.$activityhigh.label}<br /> |
| 56 | {include file="CRM/common/jcalendar.tpl" elementName=$activityhigh} |
| 57 | </td> |
| 58 | <td class="crm-case-caseview-form-block-activity_type_filter_id"> |
| 59 | {$form.activity_type_filter_id.label}<br /> |
| 60 | {$form.activity_type_filter_id.html} |
| 61 | </td> |
| 62 | </tr> |
| 63 | {if $form.activity_deleted} |
| 64 | <tr class="crm-case-caseview-form-block-activity_deleted"> |
| 65 | <td> |
| 66 | {$form.activity_deleted.html}{$form.activity_deleted.label} |
| 67 | </td> |
| 68 | </tr> |
| 69 | {/if} |
| 70 | </table> |
| 71 | </div><!-- /.crm-accordion-body --> |
| 72 | </div><!-- /.crm-accordion-wrapper --> |
| 73 | |
| 74 | <table id="case_id_{$caseid}" class="nestedActivitySelector crm-ajax-table" data-order='[[0,"desc"]]' data-page-length="10"> |
| 75 | <thead><tr> |
| 76 | <th data-data="activity_date_time" class="crm-case-activities-date">{ts}Date{/ts}</th> |
| 77 | <th data-data="subject" cell-class="crmf-subject crm-editable" class="crm-case-activities-subject">{ts}Subject{/ts}</th> |
| 78 | <th data-data="type" class="crm-case-activities-type">{ts}Type{/ts}</th> |
| 79 | <th data-data="target_contact_name" class="crm-case-activities-with">{ts}With{/ts}</th> |
| 80 | <th data-data="source_contact_name" class="crm-case-activities-assignee">{ts}Reporter{/ts}</th> |
| 81 | <th data-data="assignee_contact_name" class="crm-case-activities-assignee">{ts}Assignee{/ts}</th> |
| 82 | <th data-data="status_id" cell-class="crmf-status_id crm-editable" cell-data-type="select" class="crm-case-activities-status">{ts}Status{/ts}</th> |
| 83 | <th data-data="links" data-orderable="false" class="crm-case-activities-status"> </th> |
| 84 | </tr></thead> |
| 85 | </table> |
| 86 | {literal} |
| 87 | <script type="text/javascript"> |
| 88 | (function($) { |
| 89 | var caseId = {/literal}{$caseID}{literal}; |
| 90 | CRM.$('table#case_id_' + caseId).data({ |
| 91 | "ajax": { |
| 92 | "url": {/literal}'{crmURL p="civicrm/ajax/activity" h=0 q="snippet=4&caseID=$caseId&cid=$contactID&userID=$userID"}'{literal}, |
| 93 | "data": function (d) { |
| 94 | d.status_id = $("select#status_id_" + caseId).val(), |
| 95 | d.reporter_id = $("select#reporter_id_" + caseId).val(), |
| 96 | d.activity_type_id = $("select#activity_type_filter_id_" + caseId).val(), |
| 97 | d.activity_date_low = $("#activity_date_low_" + caseId).val(), |
| 98 | d.activity_date_high = $("#activity_date_high_" + caseId).val(), |
| 99 | d.activity_deleted = ($("#activity_deleted_1").prop('checked')) ? 1 : 0; |
| 100 | } |
| 101 | } |
| 102 | }); |
| 103 | $(function($) { |
| 104 | $('#searchOptions :input').change(function(){ |
| 105 | CRM.$('table#case_id_' + caseId).DataTable().draw(); |
| 106 | }); |
| 107 | }); |
| 108 | })(CRM.$); |
| 109 | </script> |
| 110 | {/literal} |
| 111 | |
| 112 | </div><!-- /.crm-accordion-body --> |
| 113 | </div><!-- /.crm-accordion-wrapper --> |