2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 {* include wysiwyg related files*}
27 {if !$includeWysiwygEditor}
28 {include file="CRM/common/wysiwyg.tpl" includeWysiwygEditor=true}
30 {* Custom Data view mode*}
31 {foreach from=$viewCustomData item=customValues key=customGroupId}
32 {foreach from=$customValues item=cd_edit key=cvID}
33 {assign var='index' value=$groupId|cat:"_$cvID"}
34 <div id="{$cd_edit.name}" class="crm-accordion-wrapper {if $cd_edit.collapse_display neq 0}collapsed{/if}">
35 <div class="crm-accordion-header">
38 <div class="crm-accordion-body">
39 {foreach from=$cd_edit.fields item=element key=field_id}
40 <table class="crm-info-panel">
42 {if $element.options_per_line != 0}
43 <td class="label">{$element.field_title}</td>
44 <td class="html-adjust">
45 {* sort by fails for option per line. Added a variable to iterate through the element array*}
46 {foreach from=$element.field_value item=val}
51 <td class="label">{$element.field_title}</td>
52 {if $element.field_type == 'File'}
53 {if $element.field_value.displayURL}
54 <td class="html-adjust">
55 <a href="{$element.field_value.displayURL}" class='crm-image-popup'>
56 <img src="{$element.field_value.displayURL}" height = "100" width="100">
60 <td class="html-adjust">
61 <a href="{$element.field_value.fileURL}">{$element.field_value.fileName}</a>
65 <td class="html-adjust">{$element.field_value}</td>
72 <a href="{crmURL p="civicrm/case/cd/edit" q="cgcount=1&action=update&reset=1&type=Case&entityID=$caseID&groupID=$customGroupId&cid=$contactID&subType=$caseTypeID"}" class="button">
73 <span><div class="icon edit-icon"></div>{ts}Edit{/ts}</span>
77 <div class="clear"></div>
83 <div id="case_custom_edit"></div>
85 {*currently delete is available only for tab custom data*}
87 <script type="text/javascript">
89 function hideStatus(valueID, groupID) {
90 cj('#statusmessg_' + groupID + '_' + valueID).hide( );
93 function showDelete(valueID, elementID, groupID, contactID) {
94 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>';
95 cj('tr#statusmessg_' + groupID + '_' + valueID).show( ).children().find('span').html( confirmMsg );
98 function deleteCustomValue( valueID, elementID, groupID, contactID ) {
99 var postUrl = {/literal}"{crmURL p='civicrm/ajax/customvalue' h=0 }"{literal};
100 var request = cj.ajax({
102 data: "valueID=" + valueID + "&groupID=" + groupID +"&contactId=" + contactID + "&key={/literal}{crmKey name='civicrm/ajax/customvalue'}{literal}",
104 success: function(html){
105 cj('#'+ elementID).hide();
106 hideStatus(valueID, groupID);
107 var element = cj( '.ui-tabs-nav #tab_custom_' + groupID + ' a' );
108 cj(element).html(cj(element).attr('title') + ' ('+ html+') ');
111 CRM.status({success: '{/literal}{ts escape="js"}Record Deleted{/ts}{literal}'}, request);