Commit | Line | Data |
---|---|---|
fc7d8951 DJ |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
fc7d8951 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
fc7d8951 DJ |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {*this template is used for activity accordion*} | |
ad280fb6 | 11 | {assign var=caseid value=$caseID} |
692f930e | 12 | {if isset($isForm) and $isForm} |
13 | <div class="crm-accordion-wrapper crm-case_activities-accordion crm-case-activities-block"> | |
14 | <div class="crm-accordion-header"> | |
15 | {ts}Activities{/ts} | |
16 | </div> | |
17 | ||
f94bc68e AH |
18 | <div id="activities" class="crm-accordion-body padded"> |
19 | <div class="crm-collapsible crm-search_filters-accordion collapsed"> | |
20 | <div class="collapsible-title"> | |
e96d5fa3 | 21 | {ts}Search Filters{/ts} |
f94bc68e AH |
22 | </div> |
23 | <table class="no-border form-layout-compressed" id="searchOptions"> | |
24 | <tr> | |
25 | <td class="crm-case-caseview-form-block-repoter_id"colspan="2"><label for="reporter_id">{ts}Reporter/Role{/ts}</label><br /> | |
26 | {$form.reporter_id.html|crmAddClass:twenty} | |
27 | </td> | |
28 | <td class="crm-case-caseview-form-block-status_id"><label for="status_id">{$form.status_id.label}</label><br /> | |
29 | {$form.status_id.html} | |
30 | </td> | |
31 | </tr> | |
32 | <tr> | |
33 | <td class="crm-case-caseview-form-block-activity_date_low"> | |
34 | {assign var=activitylow value=activity_date_low_$caseID} | |
35 | {$form.$activitylow.label}<br /> | |
36 | {$form.$activitylow.html} | |
37 | </td> | |
38 | <td class="crm-case-caseview-form-block-activity_date_high"> | |
39 | {assign var=activityhigh value=activity_date_high_$caseID} | |
40 | {$form.$activityhigh.label}<br /> | |
41 | {$form.$activityhigh.html} | |
42 | </td> | |
43 | <td class="crm-case-caseview-form-block-activity_type_filter_id"> | |
44 | {$form.activity_type_filter_id.label}<br /> | |
45 | {$form.activity_type_filter_id.html} | |
46 | </td> | |
47 | </tr> | |
48 | {if $form.activity_deleted} | |
49 | <tr class="crm-case-caseview-form-block-activity_deleted"> | |
50 | <td> | |
51 | {$form.activity_deleted.html}{$form.activity_deleted.label} | |
fc7d8951 DJ |
52 | </td> |
53 | </tr> | |
f94bc68e AH |
54 | {/if} |
55 | </table> | |
fc7d8951 | 56 | </div><!-- /.crm-accordion-wrapper --> |
692f930e | 57 | {/if} |
fc7d8951 | 58 | |
762ffa71 | 59 | <table id="case_id_{$caseid}" class="nestedActivitySelector crm-ajax-table" data-page-length="10"> |
fc7d8951 | 60 | <thead><tr> |
ad280fb6 JL |
61 | <th data-data="activity_date_time" class="crm-case-activities-date">{ts}Date{/ts}</th> |
62 | <th data-data="subject" cell-class="crmf-subject crm-editable" class="crm-case-activities-subject">{ts}Subject{/ts}</th> | |
63 | <th data-data="type" class="crm-case-activities-type">{ts}Type{/ts}</th> | |
64 | <th data-data="target_contact_name" class="crm-case-activities-with">{ts}With{/ts}</th> | |
65 | <th data-data="source_contact_name" class="crm-case-activities-assignee">{ts}Reporter{/ts}</th> | |
66 | <th data-data="assignee_contact_name" class="crm-case-activities-assignee">{ts}Assignee{/ts}</th> | |
b62580ac | 67 | <th data-data="status_id" cell-class="crmf-status_id crm-editable" cell-data-type="select" cell-data-refresh=1 class="crm-case-activities-status">{ts}Status{/ts}</th> |
ad280fb6 | 68 | <th data-data="links" data-orderable="false" class="crm-case-activities-status"> </th> |
fc7d8951 DJ |
69 | </tr></thead> |
70 | </table> | |
ad280fb6 JL |
71 | {literal} |
72 | <script type="text/javascript"> | |
73 | (function($) { | |
74 | var caseId = {/literal}{$caseID}{literal}; | |
75 | CRM.$('table#case_id_' + caseId).data({ | |
76 | "ajax": { | |
692f930e | 77 | "url": {/literal}'{crmURL p="civicrm/ajax/activity" h=0 q="snippet=4&caseID=$caseID&cid=$contactID&userID=$userID"}'{literal}, |
ad280fb6 JL |
78 | "data": function (d) { |
79 | d.status_id = $("select#status_id_" + caseId).val(), | |
80 | d.reporter_id = $("select#reporter_id_" + caseId).val(), | |
81 | d.activity_type_id = $("select#activity_type_filter_id_" + caseId).val(), | |
82 | d.activity_date_low = $("#activity_date_low_" + caseId).val(), | |
3fff685f | 83 | d.activity_date_high = $("#activity_date_high_" + caseId).val(), |
43f790f3 | 84 | d.activity_deleted = ($("#activity_deleted_" + caseId).prop('checked')) ? 1 : 0; |
ad280fb6 JL |
85 | } |
86 | } | |
87 | }); | |
88 | $(function($) { | |
89 | $('#searchOptions :input').change(function(){ | |
90 | CRM.$('table#case_id_' + caseId).DataTable().draw(); | |
91 | }); | |
92 | }); | |
93 | })(CRM.$); | |
94 | </script> | |
95 | {/literal} | |
b62580ac CW |
96 | <style type="text/css"> |
97 | {crmAPI var='statuses' entity='OptionValue' action='get' return="color,value" option_limit=0 option_group_id="activity_status"} | |
98 | {foreach from=$statuses.values item=status} | |
99 | {if !empty($status.color)} | |
100 | table#case_id_{$caseID} tr.status-id-{$status.value} {ldelim} | |
101 | border-left: 3px solid {$status.color}; | |
102 | {rdelim} | |
103 | {/if} | |
104 | {/foreach} | |
105 | </style> | |
fc7d8951 | 106 | |
692f930e | 107 | {if isset($isForm) and $isForm} |
108 | </div><!-- /.crm-accordion-body --> | |
109 | </div><!-- /.crm-accordion-wrapper --> | |
110 | {/if} |