To solve this problem, edit on your module the file: vtigerinstallation_path\modules\module_name\views\Detail.php comment all lines inside the function public function getHeaderScripts(Vtiger_Request $request) { }
but not comment the function.
Example: Disable editing on service module.
public function getHeaderScripts(Vtiger_Request $request) {
// I will to comment from here
/*
parent::getHeaderScripts($request);
$headerScriptInstances = parent::getHeaderScripts($request);
$moduleName = $request->getModule();
$modulePopUpFile = 'modules.'.$moduleName.'.resources.Edit';
unset($headerScriptInstances[$modulePopUpFile]);
$jsFileNames = array(
'modules.Products.resources.Edit',
);
$jsFileNames[] = $modulePopUpFile;
$jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
$headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances);
return $headerScriptInstances;
*/
//to here
}
// I will to comment from here
/*
parent::getHeaderScripts($request);
$headerScriptInstances = parent::getHeaderScripts($request);
$moduleName = $request->getModule();
$modulePopUpFile = 'modules.'.$moduleName.'.resources.Edit';
unset($headerScriptInstances[$modulePopUpFile]);
$jsFileNames = array(
'modules.Products.resources.Edit',
);
$jsFileNames[] = $modulePopUpFile;
$jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
$headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances);
return $headerScriptInstances;
*/
//to here
}
Now you can't edit the fields from details view.
Best regards.
Update:
Another way by Anonymous
On the showModuleDetailView function. I erased few lines, just to show that I comment the
"IS_AJAX_ENABLED" option in the array that returns the value of the field edit option. This way you didn't disable anything else that need the scripts and you disable the AJAX editing.
File: /modules/Vtiger/views/Detail.php:
function showModuleDetailView(Vtiger_Request $request)
{
/*$viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel));*/
}
function showModuleSummaryView($request)
{
/*$viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel));*/
}
{
/*$viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel));*/
}
function showModuleSummaryView($request)
{
/*$viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel));*/
}
Hello. You just saved my life. Workflows not running when quick-editing were a pain in the a...
ReplyDeleteFor potentials and accounts, you have to do this in /modules/vtiger/views/detail.php.
Best regards and thanks again.
I'm glad you like it. Thanks.
DeleteExcellent, thank you very much. You save me a lot of code research, I was looking into this for a couple of hours in the code.
ReplyDeleteI'm glad you like it. Thanks.
DeleteI'll like to add something for this need I just found. If you disable the scripts, then there is a few things that stop working, like clicking on the other related list to take its views.
ReplyDeleteMaybe it will be easier to do this, on the showModuleDetailView function. I erased few lines, just to show that I comment the "IS_AJAX_ENABLED" option in the array that returns the value of the field edit option. This way you didn't disable anything else that need the scripts and you disable the AJAX editing.
File: /modules/Vtiger/views/Detail.php:
function showModuleDetailView(Vtiger_Request $request) {
// $viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel));
}
Thank you. I have updated the post with your solution.
DeleteHi there, I was trying to add Form Save with Ajax for one of the custom modules, i followed Calendar Quick Create but its not working. Can you pls suggest anything for this?
ReplyDeleteThanku
Hey,
ReplyDeleteThank's for this, it's perfect for my module :)
Best
Most of the time I don’t make comments on but I'd like to say that this article really forced me to do so. Really nice post!
ReplyDeleteonline assignment help
affordable assignments
Supereb ... nice post
ReplyDeleteyet another simpler way: just override the constructor of Vtiger_Detail_View and set $this->isAjaxEnabled to false.
ReplyDeletepublic function __construct()
{
parent::__construct();
$this->isAjaxEnabled = false;
}