| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 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 | {if $action eq 1 or $action eq 2 or $action eq 8} |
| 27 | {include file="CRM/Financial/Form/FinancialTypeAccount.tpl"} |
| 28 | {else} |
| 29 | {if $rows} |
| 30 | <div id="ltype"> |
| 31 | <div class="form-item"> |
| 32 | {if $action ne 1 and $action ne 2} |
| 33 | <div class="action-link"> |
| 34 | {crmButton q="action=add&reset=1&aid=$aid" id="newfinancialTypeAccount" icon="circle-plus"}{ts}Assign Account{/ts}{/crmButton} |
| 35 | {crmButton p="civicrm/admin/financial/financialType" q="action=update&id=`$aid`&reset=1" icon="pencil"}{ts}Edit Financial Type{/ts}{/crmButton} |
| 36 | </div> |
| 37 | {/if} |
| 38 | {strip} |
| 39 | {* handle enable/disable actions*} |
| 40 | {include file="CRM/common/enableDisableApi.tpl"} |
| 41 | <table cellpadding="0" cellspacing="0" border="0"> |
| 42 | <thead class="sticky"> |
| 43 | <th>{ts}Relationship{/ts}</th> |
| 44 | <th>{ts}Financial Account{/ts}</th> |
| 45 | <th>{ts}Accounting Code{/ts}</th> |
| 46 | <th>{ts}Account Type (Code){/ts}</th> |
| 47 | <th>{ts}Owned By{/ts}</th> |
| 48 | <th>{ts}Is Active?{/ts}</th> |
| 49 | <th></th> |
| 50 | </thead> |
| 51 | {foreach from=$rows item=row} |
| 52 | <tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}"> |
| 53 | <td>{$row.account_relationship}</td> |
| 54 | <td>{$row.financial_account}</td> |
| 55 | <td>{$row.accounting_code}</td> |
| 56 | <td>{$row.financial_account_type}{if $row.account_type_code} ({$row.account_type_code}){/if}</td> |
| 57 | <td>{$row.owned_by}</td> |
| 58 | <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> |
| 59 | <td>{$row.action|replace:'xx':$row.id}</td> |
| 60 | </tr> |
| 61 | {/foreach} |
| 62 | </table> |
| 63 | {/strip} |
| 64 | |
| 65 | {if $action ne 1 and $action ne 2} |
| 66 | <div class="action-link"> |
| 67 | {crmButton q="action=add&reset=1&aid=$aid" id="newfinancialTypeAccount" icon="circle-plus"}{ts}Assign Account{/ts}{/crmButton} |
| 68 | {crmButton p="civicrm/admin/financial/financialType" q="action=update&id=`$aid`&reset=1" icon="pencil"}{ts}Edit Financial Type{/ts}{/crmButton} |
| 69 | </div> |
| 70 | {/if} |
| 71 | </div> |
| 72 | </div> |
| 73 | {else} |
| 74 | <div class="messages status no-popup"> |
| 75 | <div class="icon inform-icon"></div> |
| 76 | {capture assign=crmURL}{crmURL q="action=add&reset=1&aid=$aid"}{/capture} |
| 77 | {ts 1=$crmURL}There are no financial accounts assigned to this financial type. You can <a href='%1'>assign one</a>.{/ts} |
| 78 | </div> |
| 79 | {/if} |
| 80 | {/if} |