e528963393b85db5487ed9b0b4e87e658a63e1d7
[civicrm-core.git] / templates / CRM / Activity / Selector / Selector.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2016 |
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 <div class="crm-activity-selector-{$context}">
27 <div class="crm-accordion-wrapper crm-search_filters-accordion">
28 <div class="crm-accordion-header">
29 {ts}Filter by Activity Type{/ts}</a>
30 </div><!-- /.crm-accordion-header -->
31 <div class="crm-accordion-body">
32 <div class="no-border form-layout-compressed activity-search-options">
33 <div class="crm-contact-form-block-activity_type_filter_id crm-inline-edit-field">
34 {$form.activity_type_filter_id.label} {$form.activity_type_filter_id.html|crmAddClass:big}
35 </div>
36 <div class="crm-contact-form-block-activity_type_exclude_filter_id crm-inline-edit-field">
37 {$form.activity_type_exclude_filter_id.label} {$form.activity_type_exclude_filter_id.html|crmAddClass:big}
38 </div>
39 </div>
40 </div><!-- /.crm-accordion-body -->
41 </div><!-- /.crm-accordion-wrapper -->
42 <table class="contact-activity-selector-{$context} crm-ajax-table">
43 <thead>
44 <tr>
45 <th data-data="activity_type" class="crm-contact-activity-activity_type">{ts}Type{/ts}</th>
46 <th data-data="subject" cell-class="crmf-subject crm-editable" class="crm-contact-activity_subject">{ts}Subject{/ts}</th>
47 <th data-data="source_contact_name" class="crm-contact-activity-source_contact">{ts}Added By{/ts}</th>
48 <th data-data="target_contact_name" data-orderable="false" class="crm-contact-activity-target_contact">{ts}With{/ts}</th>
49 <th data-data="assignee_contact_name" data-orderable="false" class="crm-contact-activity-assignee_contact">{ts}Assigned{/ts}</th>
50 <th data-data="activity_date_time" class="crm-contact-activity-activity_date">{ts}Date{/ts}</th>
51 <th data-data="status_id" cell-class="crmf-status_id crm-editable" cell-data-type="select" cell-data-refresh="true" class="crm-contact-activity-activity_status">{ts}Status{/ts}</th>
52 <th data-data="links" data-orderable="false" class="crm-contact-activity-links">&nbsp;</th>
53 </tr>
54 </thead>
55 </table>
56
57 {literal}
58 <script type="text/javascript">
59 (function($) {
60 var context = {/literal}"{$context}"{literal};
61 CRM.$('table.contact-activity-selector-' + context).data({
62 "ajax": {
63 "url": {/literal}'{crmURL p="civicrm/ajax/contactactivity" h=0 q="snippet=4&context=$context&cid=$contactId"}'{literal},
64 "data": function (d) {
65 d.activity_type_id = $('.crm-activity-selector-' + context + ' select#activity_type_filter_id').val(),
66 d.activity_type_exclude_id = $('.crm-activity-selector-' + context + ' select#activity_type_exclude_filter_id').val()
67 }
68 }
69 });
70 $(function($) {
71 $('.activity-search-options :input').change(function(){
72 CRM.$('table.contact-activity-selector-' + context).DataTable().draw();
73 });
74 });
75 })(CRM.$);
76 </script>
77 {/literal}
78 <style type="text/css">
79 {crmAPI var='statuses' entity='OptionValue' action='get' return="color,value" option_limit=0 option_group_id="activity_status"}
80 {foreach from=$statuses.values item=status}
81 {if !empty($status.color)}
82 table.contact-activity-selector-{$context} tr.status-id-{$status.value} {ldelim}
83 border-left: 3px solid {$status.color};
84 {rdelim}
85 {/if}
86 {/foreach}
87 </style>
88 </div>
89 {include file="CRM/Case/Form/ActivityToCase.tpl" contactID=$contactId}