Added extension code

This commit is contained in:
civiwaresolution
2019-09-16 00:01:08 +01:00
committed by Pradeep Nayak
commit 5596e9b90b
17 changed files with 2435 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<div class="crm-accordion-wrapper crm-search_filters-accordion">
<a accesskey="N" href="{crmURL p='civicrm/relatedentities/add' q="action=add&reset=1&entityTable=$entityTable&entityId=$entityId"}" class="button"><span><i class="crm-i fa-plus-circle"></i> {ts}New Entity relation{/ts}</span></a>
</div>
</br></br>
{include file="CRM/common/enableDisableApi.tpl"}
{foreach from=$relatedEntities item="relatedEntity" key="entityRef"}
<h3>{ts}{$relatedEntity.label}{/ts}</h3>
<table id='related-entities' class="related-entities-selector-{$entityTable}-{$entityId} crm-ajax-table"
data-ajax="{crmURL p="civicrm/ajax/relatedentities" q="entityTable=$entityTable&entityId=$entityId&entityTableB=$entityRef"}"
dataref='{$entityRef}'>
<thead>
<tr>
{foreach from=$relatedEntity.columns item="header" key="key"}
<th data-data="{$key}" class="crm-related-entities-{$key}">{ts}{$header}{/ts}</th>
{/foreach}
<th data-data="links" data-orderable="false" class="crm-related-entities-links">&nbsp;</th>
</tr>
</thead>
</table>
</br></br>
{/foreach}

View File

@ -0,0 +1,12 @@
{crmScript file='js/crm.expandRow.js'}
{literal}
<script type="text/javascript">
CRM.$(function($) {
let rows = {/literal}{$rows|@json_encode}{literal};
$('table tr th:first').before('<th></th>');
$.each(rows, function(index, value) {
$('table tr#financial_type-' + value['id'] + ' td:first').before(value['expand']);
});
});
</script>
{/literal}

View File

@ -0,0 +1 @@
{include file="CRM/Core/Form/EntityForm.tpl"}

View File

@ -0,0 +1,7 @@
{if $action eq 1 or $action eq 2 or $action eq 8}
{include file="CRM/RelateEntities/Form/RelatedEntity.tpl"}
{else}
<div class="crm-related-entities-{$context}">
{include file="CRM/RelateEntities/Common.tpl"}
</div>
{/if}