2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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 {* Custom Data view mode*}
27 {foreach from=$viewCustomData item=customValues key=customGroupId}
28 {foreach from=$customValues item=cd_edit key=cvID}
29 {assign var='index' value=$groupId|cat:"_$cvID"}
30 <div id="{$cd_edit.name}" class="crm-accordion-wrapper {if $cd_edit.collapse_display neq 0}collapsed{/if}">
31 <div class="crm-accordion-header">
34 <div class="crm-accordion-body">
35 {foreach from=$cd_edit.fields item=element key=field_id}
36 <table class="crm-info-panel">
38 {if $element.options_per_line != 0}
39 <td class="label">{$element.field_title}</td>
40 <td class="html-adjust">
41 {* sort by fails for option per line. Added a variable to iterate through the element array*}
42 {foreach from=$element.field_value item=val}
47 <td class="label">{$element.field_title}</td>
48 {if $element.field_type == 'File'}
49 {if $element.field_value.displayURL}
50 <td class="html-adjust">
51 <a href="#" onclick="imagePopUp('{$element.field_value.imageURL}'); return false;">
52 <img src="{$element.field_value.displayURL}" height = "100" width="100">
56 <td class="html-adjust">
57 <a href="{$element.field_value.fileURL}">{$element.field_value.fileName}</a>
61 <td class="html-adjust">{$element.field_value}</td>
68 <a href="#" class="button" style="margin-left: 6px;"
69 onclick="updateCaseCustom({$caseID}, {$customGroupId}, {$contactID}, {$caseTypeID}); return false;">
70 <span><div class="icon edit-icon"></div>{ts}Edit{/ts}</span>
75 <div class="clear"></div>
80 <div id="case_custom_edit"></div>
83 <script type="text/javascript">
89 {*currently delete is available only for tab custom data*}
91 <script type="text/javascript">
93 function hideStatus(valueID, groupID) {
94 cj('#statusmessg_' + groupID + '_' + valueID).hide( );
97 function showDelete(valueID, elementID, groupID, contactID) {
98 var confirmMsg = '{/literal}{ts escape='js'}Are you sure you want to delete this record?{/ts}{literal} <a href="#" onclick="deleteCustomValue( ' + valueID + ',\'' + elementID + '\',' + groupID + ',' + contactID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}Yes{/ts}{literal}</a> <a href="#" onclick="hideStatus( ' + valueID + ', ' + groupID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}No{/ts}{literal}</a>';
99 cj('tr#statusmessg_' + groupID + '_' + valueID).show( ).children().find('span').html( confirmMsg );
102 function deleteCustomValue( valueID, elementID, groupID, contactID ) {
103 var postUrl = {/literal}"{crmURL p='civicrm/ajax/customvalue' h=0 }"{literal};
106 data: "valueID=" + valueID + "&groupID=" + groupID +"&contactId=" + contactID + "&key={/literal}{crmKey name='civicrm/ajax/customvalue'}{literal}",
108 success: function(html){
109 cj('#'+ elementID).hide();
110 hideStatus(valueID, groupID);
111 CRM.alert('', '{/literal}{ts escape="js"}Record Deleted{/ts}{literal}', 'success');
112 var element = cj( '.ui-tabs-nav #tab_custom_' + groupID + ' a' );
113 cj(element).html(cj(element).attr('title') + ' ('+ html+') ');
120 <script type="text/javascript">
122 function updateCaseCustom( entityID, groupID, contactID, subType ) {
123 var dataURL = {/literal}"{crmURL p="civicrm/case/cd/edit" q="snippet=5&cgcount=1&action=update&reset=1" h=0}"{literal};
124 dataURL = dataURL + '&type=Case&entityID=' + entityID + '&groupID=' + groupID + '&cid=' + contactID + ( subType ? '&subType=' + subType : '');
128 success: function(content) {
129 cj('#case_custom_edit').show( ).html(content).dialog({
130 title: "Update Custom Information",
137 close: function(event, ui) {
138 cj('#case_custom_edit').fadeOut(5000);