Yetiforcecrm: [Question] [PL][ENG] Is it possible to hide the "Add Record" button in the selected module?

Created on 16 Jul 2020  ·  6Comments  ·  Source: YetiForceCompany/YetiForceCRM

Czy jest możliwość, aby ukryć przycisk "Dodaj rekord" w wybranym module?
_Is it possible to hide the "Add Record" button in the selected module?_

Chce zachować uprawnienia do tworzenia rekordu, dodawanie rekordu odbywa się tylko przez mapowanie, a nie bezpośrednio w module.
_I want to keep the record creation permissions, adding the record is done only through the mapping, not directly in the module._

obraz

❔ question

Most helpful comment

{if $MODULE != "SQuotes" && $MODULE != "SSingleOrders"}
{include file=\App\Layout::getTemplatePath('ButtonLink.tpl', $MODULE) BUTTON_VIEW='listView' CLASS='mr-sm-1 mb-1 c-btn-block-sm-down'}
{/if}

All 6 comments

You need to change rights to profiles to disable ability to create records. This button will dissapear

Thanks for the answer, I can't do that because then I can't generate the record by mapping as well.

@vdpawel in this case you need to change code of system to add condition of this button appearance like if module is yourmodule then button disabled. I think this can be done by templates modification.

Thank you, I have followed your advice.

In the file
/layouts/basic/modules/Vtiger/ListViewHeader.tpl

I put the appropriate condition into the line displaying the button:
{include file = \ App \ Layout :: getTemplatePath ('ButtonLink.tpl', $ MODULE) BUTTON_VIEW = 'listView' CLASS = 'mr-sm-1 mb-1 c-btn-block-sm-down'}

Works!

@vdpawel could you share your code instead original?

{if $MODULE != "SQuotes" && $MODULE != "SSingleOrders"}
{include file=\App\Layout::getTemplatePath('ButtonLink.tpl', $MODULE) BUTTON_VIEW='listView' CLASS='mr-sm-1 mb-1 c-btn-block-sm-down'}
{/if}

Was this page helpful?
0 / 5 - 0 ratings