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 {* this template is used for adding/editing/deleting financial type *}
27 <h3>{if $action eq 8}{ts}Delete Financial Type Account{/ts}{elseif $action eq 1}{ts}Add New Financial Type Account{/ts}{elseif $action eq 2}{ts}Edit Financial Type Account{/ts}{/if}</h3>
28 <div class="crm-block crm-form-block crm-financial_type-form-block">
30 <div class="messages status">
31 <div class="icon inform-icon"></div>
32 {ts}WARNING: You cannot delete a financial type if it is currently used by any Contributions, Contribution Pages or Membership Types. Consider disabling this option instead.{/ts} {ts}Deleting a financial type cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
35 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
37 <table class="form-layout">
39 <tr class="crm-contribution-form-block-account_relationship">
40 <td class="label">{$form.account_relationship.label}</td>
41 <td class="html-adjust">{$form.account_relationship.html}</td>
43 <tr class="crm-contribution-form-block-financial_account_id">
44 <td class="label">{$form.financial_account_id.label}</td>
45 <td class="html-adjust">{$form.financial_account_id.html}</td>
50 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="botttom"}</div>
53 <script language="JavaScript" type="text/javascript">
55 cj("#financial_account_id").change(function()
58 relationID = "#account_relationship"
59 financialAccountID = "#financial_account_id"
60 callbackURL = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancialRelation'}"
62 var financialId = cj("#financial_account_id").val();
63 var check = cj(relationID).val();
64 if( check == 'select' || financialId == 'select' ){
65 callbackURL = callbackURL+"&_value="+financialId;
68 context: document.body,
69 success: function( data, textStatus ){
70 cj(relationID).html("");//clear old options
71 data = eval(data);//get json array
73 for (i = 0; i < data.length; i++) {
74 if( data[i].selected == 'Selected')
75 var idf = data[i].value;
76 cj(relationID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
80 cj(relationID).val(idf);
81 //cj("option:first", relationID).attr( "selected", "selected" );//select first option
85 if( financialId == 'select' ){
88 callbackURLs = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancial'}"
90 callbackURLs = callbackURLs+"&_value=select";
93 context: document.body,
94 success: function( data, textStatus ){
95 cj(financialAccountID).html("");//clear old options
96 data = eval(data);//get json array
98 for (i = 0; i < data.length; i++) {
99 cj(financialAccountID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
112 cj("#account_relationship").change(function()
115 relationID = "#account_relationship"
116 financialAccountID = "#financial_account_id"
117 callbackURLs = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancial'}"
119 var financialId = cj("#account_relationship").val();
120 var check = cj(financialAccountID).val();
121 if( check == 'select' || financialId == 'select' ){
122 callbackURLs = callbackURLs+"&_value="+financialId;
125 context: document.body,
126 success: function( data, textStatus ){
127 cj(financialAccountID).html("");//clear old options
128 data = eval(data);//get json array
129 if ( data != null ) {
130 for (i = 0; i < data.length; i++) {
131 cj(financialAccountID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
138 if( financialId == 'select' ){
140 callbackURL = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancialRelation'}"
142 callbackURL = callbackURL+"&_value=select";
145 context: document.body,
146 success: function( data, textStatus ){
147 cj(relationID).html("");//clear old options
148 data = eval(data);//get json array
149 if ( data != null ) {
150 for (i = 0; i < data.length; i++) {
151 if( data[i].selected == 'Selected')
152 var idf = data[i].value;
153 cj(relationID).get(0).add(new Option(data[i].name, data[i].value), document.all ? i : null);
157 cj(relationID).val(idf);
158 //cj("option:first", relationID).attr( "selected", "selected" );//select first option