Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose UI support for custom fields on financial types #12501

Merged
merged 3 commits into from
Jul 24, 2018

Conversation

pradpnayak
Copy link
Contributor

@pradpnayak pradpnayak commented Jul 17, 2018

Overview

https://lab.civicrm.org/dev/financial/issues/29

Before

Custom fields were not supported for Financial Type

After

after

@civibot
Copy link

civibot bot commented Jul 17, 2018

(Standard links)

@pradpnayak pradpnayak changed the title [WIP]Expose UI support for custom fields on financial types Expose UI support for custom fields on financial types Jul 19, 2018
@pradpnayak
Copy link
Contributor Author

pradpnayak commented Jul 19, 2018

Can anyone please review this for me?

@eileenmcnaughton
Copy link
Contributor

I haven't reviewed but I peeked at the code & the coding approach taken here is consistent with the work we have been doing in this area.

@eileenmcnaughton
Copy link
Contributor

@pradpnayak the one issue I have with this is that you are enabling custom fields out of the box. My position so far has been that we should make it possible for extensions to enable these but not do it in core.

My main concern with enabling in core is it sets expectations that we then accept things like making the data available in searches / reports etc & that is a whole extra conversation. I think we should remove that part before we merge it & discuss separately (ok to leave in for now as it might make it easier for a reviewer)

<div class="crm-submit-buttons">
<a href="{crmURL p='civicrm/admin/financial/financialType/accounts' q="action=browse&reset=1&aid=$aid"}" class="button"><span>{ts}View or Edit Financial Accounts{/ts}</a></span>
</div>
{/if}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton I need a help!!

How i can place the div section for button just besides the Save and Cancel buttom? Can i use JS to move the link or will i need to CRM/Core/Form/EntityForm.tpl to include sections insertions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems ok?

screenshot 2018-07-24 03 39 32

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you open in a new tab the 'View or Edit Financial Accounts' button goes below of Save and Cancel

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does overriding protected function addFormButtons() { help?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buttons look ok for me screenshot 2018-07-24 03 39 32

Copy link
Contributor Author

@pradpnayak pradpnayak Jul 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a link not a button actually. When i open in a new tab(right click new tab) i can see buttons not in line. But incase of pop-up it does.

screenshot from 2018-07-23 17-26-30

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm not sure maybe @colemanw has a good idea

I guess we could have an 'inner tpl' of

  {if $action eq 8}
    <div class="messages status no-popup">
      <div class="icon inform-icon"></div>
      {$deleteMessage|escape}
    </div>
  {else}
    <table class="form-layout-compressed">
      {foreach from=$entityFields item=fieldSpec}
        {assign var=fieldName value=$fieldSpec.name}
        <tr class="crm-{$entityInClassFormat}-form-block-{$fieldName}">
          {include file="CRM/Core/Form/Field.tpl"}
        </tr>
      {/foreach}
    </table>
    {include file="CRM/common/customDataBlock.tpl"}
  {/if}

that is included from CRM/Core/Form/EntityForm.tpl - so you can just include the inner if you want ... different buttons

@pradpnayak
Copy link
Contributor Author

@eileenmcnaughton I have updated the PR to include only form changes and moved installation code to an extension.

@eileenmcnaughton
Copy link
Contributor

@pradpnayak I tested this in view and edit mode and read through the code. I'm OK to merge this aside from your button alignment issue & I'm OK with that as a follow up too.

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton eileenmcnaughton merged commit d70904c into civicrm:master Jul 24, 2018
@pradpnayak
Copy link
Contributor Author

Thanks @eileenmcnaughton

@pradpnayak pradpnayak deleted the customFT branch July 24, 2018 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants