I would like to add a custom button (without removing exisiting buttons) to the Cases Edit View. I only want the button to show when the Case Type is of a specific value and only if the User is in a particular Security Group.
I have not been able to achieve this by modifying the editviewdefs.php. Is there is a way to do this in the editviewdefs.php?
Is there another way to do this?
I found this in the developers guide but have not figured out how to use it.
The ParserFactory
The ParserFactory can be used to manipulate layouts such as editviewdefs or
detailviewdefs. This is a handy when creating custom plugins and needing to
merge changes into an existing layout.The following example will demonstrate
how to add a button to the detail view:
<?php
> //Instantiate the parser factory for the Accounts DetailView.
> require_once('modules/ModuleBuilder/parsers/ParserFactory.php');
> $parser = ParserFactory::getParser('detailview', 'Accounts');
> //Button to add
> $button = array(
> 'customCode'=>'<input type="button" name="customButton"
> value="Custom Button">'
> );
> //Add button into the parsed layout
> array_push($parser->_viewdefs['templateMeta']['form']['buttons'],$button);
> //Save the layout
> $parser->handleSave(false);
Thanks
Tony