Hi everyone
i wan to know how can i remove edit and delete btn in detailview by condition using detailviewdefs.php
for example:
if the status of contract is signed the edit and delete btn should be removed
Thank u for help
Hi everyone
i wan to know how can i remove edit and delete btn in detailview by condition using detailviewdefs.php
for example:
if the status of contract is signed the edit and delete btn should be removed
Thank u for help
I wouldn’t try to remove the button using the detailviewdefs.php. You could hide the button using JavaScript instead. Have the script run on page load and check for the condition.
Would be really easy to do here is a tutorial on how to include JavaScript: http://sugarmods.co.uk/adding-custom-javascript-to-a-view-in-sugarcrm
Thank u for ur replay
But what is the detail of button code ??
Can u explain me more , URDHVATECH ??
Hello,
Here are custom code example for button . You can get idea from modules/Calls/metadata/detailviewdefs.php
Ok thank u ,
And i want to remove the change log btn too to all users except admin ,how can i proceed ??
I found it a lot easier to alter the subpanel delete button by creating an extension to the SugarWidget, and then using my extended SugarWidget in the default subpanel_layout
Example:
1.) add file that extends SugarWidgetSubPanelRemoveButton.php.
(see SugarWidgetSubPanelRemoveButtonAccount.php for a good example of an extension)
custom/include/generic/SugarWidgets/SugarWidgetsSubPanelRemoveButtonMyNameHere.php
hint: displayList(&$layout_def) function returning false will disable the remove button for the given entry
2.) Edit the subpanel def to use the new widget:
COPY modules/subpanelModuleHere/metadata/subpanels/default.php
TO custom/modules/subpanelModuleHere/metadata/subpanels/default.php
Replace ‘remove_button’ with:
‘remove_button’ =>
array(
‘vname’ => ‘LBL_REMOVE’,
‘widget_class’ => ‘SubPanelRemoveButtonMyNameHere’,
‘width’ => ‘4%’,
‘default’ => true,
),