Merge pull request #2602 from pratik-joshi/CRM-13964-qa
[civicrm-core.git] / templates / CRM / Contact / Page / View / CustomData.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
232624b1 3 | CiviCRM version 4.4 |
6a488035
TO
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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{* template for custom data *}
27{if $action eq 0 or $action eq 1 or $action eq 2 or $recordActivity}
fe06c0fb 28 {include file="CRM/Contact/Form/CustomData.tpl" mainEdit=$mainEditForm}
6a488035 29{/if}
e41f4660 30{if $displayStyle eq 'tableOriented'}
eb2b4bdb
PJ
31 {include file='CRM/Profile/Page/MultipleRecordFieldsListing.tpl' showListing=1 dontShowTitle=1 pageViewType='customDataView'}
32 {literal}
33 <script type="text/javascript">
b05a0fb6 34 function showDeleteInDialog(valueID, groupID, contactID, redirectUrl) {
eb2b4bdb
PJ
35 var confirmText = '{/literal}{ts escape='js'}Are you sure you want to delete this record?{/ts}{literal}';
36 cj('#browseValues').after("<div id='delete-record'></div>");
37 cj('#delete-record').html(confirmText).dialog({
38 title: "{/literal}{ts escape='js'}Delete Record{/ts}{literal}",
39 modal: true,
40 width: 680,
41 overlay: {
42 opacity: 0.5,
43 background: "black"
44 },
45
46 buttons: {
47 {/literal}"{ts escape='js'}Cancel{/ts}"{literal}: function() {
48 cj(this).dialog("close");
49 cj('#delete-record').html('');
50 },
51 {/literal}"{ts escape='js'}OK{/ts}{literal}": function() {
b05a0fb6 52 deleteCustomValueRec(valueID, groupID, contactID, redirectUrl);
eb2b4bdb
PJ
53 }
54 }
55 });
56 }
57
b05a0fb6 58 function deleteCustomValueRec(valueID, groupID, contactID, redirectUrl) {
eb2b4bdb
PJ
59 var postUrl = {/literal}"{crmURL p='civicrm/ajax/customvalue' h=0 }"{literal};
60 cj.ajax({
61 type: "POST",
62 data: "valueID=" + valueID + "&groupID=" + groupID + "&contactId=" + contactID + "&key={/literal}{crmKey name='civicrm/ajax/customvalue'}{literal}",
63 url: postUrl,
64 success: function (html) {
b05a0fb6 65 window.location.href = redirectUrl;
eb2b4bdb
PJ
66 }
67 });
68 }
69 </script>
70 {/literal}
e41f4660 71{else}
6a488035 72{strip}
fe06c0fb
KJ
73 {if $action eq 16 or $action eq 4} {* Browse or View actions *}
74 <div class="form-item">
75 {include file="CRM/Custom/Page/CustomDataView.tpl"}
76 </div>
77 {/if}
6a488035 78{/strip}
fe06c0fb 79
6a488035 80{if $mainEditForm}
fe06c0fb
KJ
81 <script type="text/javascript">
82 var showBlocks1 = new Array({$showBlocks1});
83 var hideBlocks1 = new Array({$hideBlocks1});
84
85 on_load_init_blocks(showBlocks1, hideBlocks1);
86 </script>
6a488035 87{else}
fe06c0fb 88 <script type="text/javascript">
6a488035
TO
89 var showBlocks = new Array({$showBlocks});
90 var hideBlocks = new Array({$hideBlocks});
91
92 {* hide and display the appropriate blocks as directed by the php code *}
fe06c0fb 93 on_load_init_blocks(showBlocks, hideBlocks);
6a488035
TO
94 </script>
95{/if}
e41f4660 96{/if}