forked from CiviWare/com.megaphonetech.relateentities
Added extension code
This commit is contained in:
21
templates/CRM/RelateEntities/Common.tpl
Normal file
21
templates/CRM/RelateEntities/Common.tpl
Normal 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"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</br></br>
|
||||
{/foreach}
|
12
templates/CRM/RelateEntities/Expand.tpl
Normal file
12
templates/CRM/RelateEntities/Expand.tpl
Normal 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}
|
1
templates/CRM/RelateEntities/Form/RelatedEntity.tpl
Normal file
1
templates/CRM/RelateEntities/Form/RelatedEntity.tpl
Normal file
@ -0,0 +1 @@
|
||||
{include file="CRM/Core/Form/EntityForm.tpl"}
|
7
templates/CRM/RelateEntities/Page/Tab.tpl
Normal file
7
templates/CRM/RelateEntities/Page/Tab.tpl
Normal 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}
|
Reference in New Issue
Block a user