commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / templates / CRM / Contact / Page / View / CustomData.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 {assign var="customDataGroupName" value=$customDataGroup.name}
28 {strip}
29 {if $displayStyle neq 'tableOriented' and ($action eq 16 or $action eq 4)} {* Browse or View actions *}
30 <div class="form-item">
31 {include file="CRM/Custom/Page/CustomDataView.tpl"}
32 </div>
33 {/if}
34 {/strip}
35 {foreach from=$viewCustomData item=customGroupWrapper}
36 {foreach from=$customGroupWrapper item=customGroup key=customGroupId}
37 {assign var="customRegion" value='contact-custom-data-'|cat:$customGroup.name}
38 {crmRegion name=$customRegion}
39 {if $customGroup.help_pre}
40 <div class="messages help">{$customGroup.help_pre}</div>
41 {/if}
42 {if $action eq 0 or $action eq 1 or $action eq 2 or $recordActivity}
43 {include file="CRM/Contact/Form/CustomData.tpl" mainEdit=$mainEditForm}
44 {/if}
45 {if $displayStyle eq 'tableOriented'}
46 {include file='CRM/Profile/Page/MultipleRecordFieldsListing.tpl' showListing=1 dontShowTitle=1 pageViewType='customDataView'}
47 {literal}
48 <script type="text/javascript">
49 CRM.$(function($) {
50 var $table = $("#{/literal}custom-{$customGroupId}-table-wrapper{literal}");
51 $('a.delete-custom-row', $table).on('click', function(e) {
52 var $el = $(this);
53 CRM.confirm({
54 message: '{/literal}{ts escape='js'}Are you sure you want to delete this record?{/ts}{literal}'
55 }).on('crmConfirm:yes', function() {
56 var postUrl = {/literal}"{crmURL p='civicrm/ajax/customvalue' h=0 }"{literal};
57 var request = $.post(postUrl, $el.data('delete_params'));
58 CRM.status({/literal}"{ts escape='js'}Record Deleted{/ts}"{literal}, request);
59 request.done(function() {
60 CRM.refreshParent($el);
61 });
62 })
63 e.preventDefault();
64 });
65 });
66 </script>
67 {/literal}
68 {else}
69 {if $mainEditForm}
70 <script type="text/javascript">
71 var showBlocks1 = new Array({$showBlocks1});
72 var hideBlocks1 = new Array({$hideBlocks1});
73
74 on_load_init_blocks(showBlocks1, hideBlocks1);
75 </script>
76 {else}
77 <script type="text/javascript">
78 var showBlocks = new Array({$showBlocks});
79 var hideBlocks = new Array({$hideBlocks});
80
81 {* hide and display the appropriate blocks as directed by the php code *}
82 on_load_init_blocks(showBlocks, hideBlocks);
83 </script>
84 {/if}
85 {/if}
86 {if $customGroup.help_post}
87 <div class="messages help">{$customGroup.help_post}</div>
88 {/if}
89 {/crmRegion}
90 {/foreach}
91 {/foreach}