Skip to content
Snippets Groups Projects

Inventory service item popup selection does not work after searching any data!

Merged its4you requested to merge its4you/vtigercrm:fix_inventory_service_popup into master
+ 32
21
Compare changes
  • Side-by-side
  • Inline
@@ -111,27 +111,38 @@ abstract class Vtiger_Action_Controller extends Vtiger_Controller {
function requiresPermission(Vtiger_Request $request) {
return array();
}
function checkPermission(Vtiger_Request $request) {
$permissions = $this->requiresPermission($request);
foreach($permissions as $permission) {
if(array_key_exists('module_parameter', $permission)){
$moduleParameter = $request->get($permission['module_parameter']);
}else{
$moduleParameter = 'module';
}
if(array_key_exists('record_parameter', $permission)){
$recordParameter = $request->get($permission['record_parameter']);
}else{
$recordParameter = '';
}
if(!Users_Privileges_Model::isPermitted($moduleParameter, $permission['action'], $recordParameter)) {
throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}
if(Vtiger_Runtime::isRestricted('modules',$moduleParameter)){}
}
return true;
}
/**
* @param Vtiger_Request $request
*
* @return bool
* @throws AppException
*/
function checkPermission(Vtiger_Request $request)
{
$permissions = $this->requiresPermission($request);
foreach ($permissions as $permission) {
if (array_key_exists('module_parameter', $permission)) {
if ($request->has($permission['module_parameter']) && !empty($request->get($permission['module_parameter']))) {
$moduleParameter = $request->get($permission['module_parameter']);
} elseif ($request->has('record') && !empty($request->get('record'))) {
$moduleParameter = getSalesEntityType($request->get('record'));
}
} else {
$moduleParameter = 'module';
}
if (array_key_exists('record_parameter', $permission)) {
$recordParameter = $request->get($permission['record_parameter']);
} else {
$recordParameter = '';
}
if (!Users_Privileges_Model::isPermitted($moduleParameter, $permission['action'], $recordParameter)) {
throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}
}
return true;
}
}
/**
Loading