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 {* this template is used for building tabbed custom data *}
27 {if $cdType || $postedInfo}
28 {include file="CRM/Custom/Form/CustomData.tpl"}
29 {if $multiRecordDisplay eq 'single'}
30 <div class="html-adjust">{$form.buttons.html}</div>
31 {* for form rule handling *}
32 {include file="CRM/Form/validate.tpl"}
34 <script type='text/javascript'>
36 $('#custom-record-dialog .crm-container-snippet #CustomData').validate(CRM.validate.params);
38 success: checkResponse // post-submit callback
41 //binding the callback to snippet profile form
42 $('.crm-container-snippet #CustomData').ajaxForm(formOptions);
45 // post-submit callback
46 function checkResponse(responseText, statusText, xhr, $form) {
47 //if there is any form error show the dialog
48 //else redirect to post url
49 if (!cj(responseText).find('.crm-error').html()) {
50 window.location.href = '{/literal}{$backUrl}{literal}';
53 var errorInfo = cj(responseText).find('div.crm-error').html();
54 cj('.crm-container-snippet #CustomData').prepend(errorInfo);
61 <div id="customData"></div>
62 <div class="html-adjust">{$form.buttons.html}</div>
64 {*include custom data js file*}
65 {include file="CRM/common/customData.tpl"}
67 {if $customValueCount}
69 <script type="text/javascript">
70 var customValueCount = {/literal}"{$customValueCount}"{literal};
71 var groupID = {/literal}"{$groupID}"{literal};
72 var contact_type = {/literal}"{$contact_type}"{literal};
73 var contact_subtype = {/literal}"{$contact_subtype}"{literal};
74 CRM.buildCustomData( contact_type, contact_subtype );
75 for ( var i = 1; i < customValueCount; i++ ) {
76 CRM.buildCustomData( contact_type, contact_subtype, null, i, groupID, true );
83 {include file="CRM/Form/attachmentjs.tpl"}