CRM-15759 - Use crmEditable for changing case activity status
[civicrm-core.git] / templates / CRM / Case / Page / DashboardSelector.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 {capture assign=expandIconURL}<img src="{$config->resourceBase}i/TreePlus.gif" alt="{ts}open section{/ts}"/>{/capture}
27 {strip}
28 <table class="caseSelector">
29 <tr class="columnheader">
30 <th></th>
31 <th>{ts}Contact{/ts}</th>
32 <th>{ts}Subject{/ts}</th>
33 <th>{ts}Status{/ts}</th>
34 <th>{ts}Type{/ts}</th>
35 <th>{ts}My Role{/ts}</th>
36 <th>{ts}Manager{/ts}</th>
37 <th>{if $list EQ 'upcoming'}{ts}Next Sched.{/ts}{elseif $list EQ 'recent'}{ts}Most Recent{/ts}{/if}</th>
38 <th></th>
39 </tr>
40
41 {counter start=0 skip=1 print=false}
42 {foreach from=$rows item=row}
43
44 <tr id='{$context}-{$list}-rowid-{$row.case_id}' class="crm-case crm-case_{$row.case_id}">
45 <td>
46 {* &nbsp;{$row.contact_type_icon}<br /> *}
47 <span id="{$context}{$list}{$row.case_id}_show">
48 <a href="#" onclick="{$context}{$list}CaseDetails('{$row.case_id}','{$row.contact_id}', '{$list}', '{$context}');
49 showCaseActivities('{$row.case_id}','{$list}', '{$context}');
50 return false;"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}open section{/ts}"/></a>
51 </span>
52 <span id="minus{$context}{$list}{$row.case_id}_hide">
53 <a href="#" onclick="hideCaseActivities('{$row.case_id}','{$list}', '{$context}');
54 return false;"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}open section{/ts}"/></a>
55 </td>
56
57 <td class="crm-case-phone"><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a>{if $row.phone}<br /><span class="description">{$row.phone}</span>{/if}<br /><span class="description">{ts}Case ID{/ts}: {$row.case_id}</span></td>
58 <td class="crm-case-case_subject">{$row.case_subject}</td>
59 <td class="{$row.class} crm-case-case_status">{$row.case_status}</td>
60 <td class="crm-case-case_type">{$row.case_type}</td>
61 <td class="crm-case-case_role">{if $row.case_role}{$row.case_role}{else}---{/if}</td>
62 <td class="crm-case-casemanager">{if $row.casemanager_id}<a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.casemanager_id`"}">{$row.casemanager}</a>{else}---{/if}</td>
63 {if $list eq 'upcoming'}
64 <td class="crm-case-case_scheduled_activity">
65 {if $row.case_upcoming_activity_viewable}
66 <a class="crm-popup {$row.activity_status}" href="{crmURL p='civicrm/case/activity/view' h=0 q="cid="}{$row.contact_id}&aid={$row.case_scheduled_activity_id}" title="{ts}View activity{/ts}">{$row.case_scheduled_activity_type}</a>
67 {else}
68 {$row.case_scheduled_activity_type}
69 {/if}
70 &nbsp;&nbsp;
71 {if $row.case_upcoming_activity_editable}
72 <a class="action-item crm-hover-button" href="{crmURL p="civicrm/case/activity" q="reset=1&cid=`$row.contact_id`&caseid=`$row.case_id`&action=update&id=`$row.case_scheduled_activity_id`"}" title="{ts}Edit activity{/ts}"><span class="icon ui-icon-pencil"></span></a>
73 {/if}
74 <br />
75 {$row.case_scheduled_activity_date|crmDate}
76 </td>
77
78 {elseif $list eq 'recent'}
79 <td class="crm-case-case_recent_activity">
80 {if $row.case_recent_activity_viewable}
81 <a class="action-item crm-hover-button" href="{crmURL p='civicrm/case/activity/view' h=0 q="cid="}{$row.contact_id}&aid={$row.case_recent_activity_id}" title="{ts}View activity{/ts}">{$row.case_recent_activity_type}</a>
82 {else}
83 {$row.case_recent_activity_type}
84 {/if}
85 {if $row.case_recent_activity_editable and $row.case_recent_activity_type_name != 'Inbound Email' && $row.case_recent_activity_type_name != 'Email'}&nbsp;&nbsp;<a href="{crmURL p="civicrm/case/activity" q="reset=1&cid=`$row.contact_id`&caseid=`$row.case_id`&action=update&id=`$row.case_recent_activity_id`"}" title="{ts}Edit activity{/ts}" class="crm-hover-button crm-popup"><span class="icon ui-icon-pencil"></span></a>
86 {/if}<br />
87 {$row.case_recent_activity_date|crmDate}
88 </td>
89 {/if}
90
91 <td>{$row.action}{$row.moreActions}</td>
92 </tr>
93 <tr id="{$list}{$row.case_id}_hide" class="crm-case_{$row.case_id}">
94 <td>
95 </td>
96 <td colspan="7" width="99%" class="enclosingNested crm-case_{$row.case_id}">
97 <div id="{$context}-{$list}-casedetails-{$row.case_id}"></div>
98 </td>
99 </tr>
100 <script type="text/javascript">
101 cj('#minus{$context}{$list}{$row.case_id}_hide').hide();
102 </script>
103 {/foreach}
104
105 {* Dashboard only lists 10 most recent casess. *}
106 {if $context EQ 'dashboard' and $limit and $pager->_totalItems GT $limit }
107 <tr class="even-row">
108 <td colspan="10"><a href="{crmURL p='civicrm/case/search' q='reset=1'}">&raquo; {ts}Find more cases{/ts}... </a></td>
109 </tr>
110 {/if}
111
112 </table>
113
114 {/strip}
115
116 {* Build case details*}
117 {literal}
118 <script type="text/javascript">
119 function {/literal}{$context}{$list}{literal}CaseDetails( caseId, contactId, type, context )
120 {
121 var dataUrl = CRM.url('civicrm/case/details', {caseId: caseId, cid: contactId, type: type});
122 CRM.loadPage(dataUrl, {target: '#'+ context + '-' + type +'-casedetails-' + caseId});
123 }
124
125 function showCaseActivities( caseId, type, context ) {
126 cj('#' + context + '-' + type +'-casedetails-'+ caseId).show();
127 cj('#' + context+type+caseId+'_show').hide();
128 cj('#minus'+context+type+caseId+'_hide').show();
129 }
130
131 function hideCaseActivities( caseId , type, context ) {
132 cj('#' + context + '-' + type +'-casedetails-' + caseId).hide();
133 cj('#' + context+type+caseId+'_show').show();
134 cj('#minus'+context+type+caseId+'_hide').hide();
135 }
136
137 </script>
138 {/literal}