diff --git a/modules/Reports/views/List.php b/modules/Reports/views/List.php index a0826fecab94fa3e1db79c9434ff0d779f432854..2deb1731fc8609e2a47be15fcb88b9690b6fad57 100644 --- a/modules/Reports/views/List.php +++ b/modules/Reports/views/List.php @@ -73,10 +73,23 @@ class Reports_List_View extends Vtiger_Index_View { "modules.$moduleName.resources.List", "modules.$moduleName.resources.ChartDetail", "modules.Vtiger.resources.ListSidebar", - '~/libraries/jquery/vtchart.js', "~layouts/v7/lib/jquery/sadropdown.js", "~layouts/" .Vtiger_Viewer::getDefaultLayoutName(). "/lib/jquery/floatThead/jquery.floatThead.js", "~layouts/" .Vtiger_Viewer::getDefaultLayoutName(). "/lib/jquery/perfect-scrollbar/js/perfect-scrollbar.jquery.js", + '~/libraries/jquery/gridster/jquery.gridster.min.js', + '~/libraries/jquery/jqplot/jquery.jqplot.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.pieRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.pointLabels.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.funnelRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.logAxisRenderer.min.js', + '~/libraries/jquery/VtJqplotInterface.js', + '~/libraries/jquery/vtchart.js', ); $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); diff --git a/modules/Reports/views/ListViewQuickPreview.php b/modules/Reports/views/ListViewQuickPreview.php index e591785ffa75437b42725ff01f934ed87a36e639..a4f997cebe457415643f9ee0d5016c5e2c1d2fd7 100644 --- a/modules/Reports/views/ListViewQuickPreview.php +++ b/modules/Reports/views/ListViewQuickPreview.php @@ -10,7 +10,7 @@ class Reports_ListViewQuickPreview_View extends Vtiger_ListViewQuickPreview_View { - function process(Vtiger_Request $request) { + function process(Vtiger_Request $request) { $moduleName = $request->getModule(); $viewer = $this->getViewer($request); $record = $request->get('record'); @@ -34,5 +34,36 @@ class Reports_ListViewQuickPreview_View extends Vtiger_ListViewQuickPreview_View $viewer->view('ListViewQuickPreview.tpl', $moduleName); } + + /** + * Function to get the list of Script models to be included + * @param Vtiger_Request $request + * @return <Array> - List of Vtiger_JsScript_Model instances + */ + function getHeaderScripts(Vtiger_Request $request) { + $headerScriptInstances = parent::getHeaderScripts($request); + $moduleName = $request->getModule(); + + $jsFileNames = array( + '~/libraries/jquery/gridster/jquery.gridster.min.js', + '~/libraries/jquery/jqplot/jquery.jqplot.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.pieRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.pointLabels.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.funnelRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js', + '~/libraries/jquery/jqplot/plugins/jqplot.logAxisRenderer.min.js', + '~/libraries/jquery/VtJqplotInterface.js', + '~/libraries/jquery/vtchart.js', + ); + + $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); + $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances); + return $headerScriptInstances; + } } diff --git a/modules/Settings/Workflows/actions/SaveWorkflow.php b/modules/Settings/Workflows/actions/SaveWorkflow.php index 6ac8eaa6a105bad9380442389606a3c2b2fb8515..1455030d0bc77c94c70d5f028783433826ce8966 100644 --- a/modules/Settings/Workflows/actions/SaveWorkflow.php +++ b/modules/Settings/Workflows/actions/SaveWorkflow.php @@ -9,6 +9,15 @@ ************************************************************************************/ class Settings_Workflows_SaveWorkflow_Action extends Vtiger_Action_Controller { + + function checkPermission(Vtiger_Request $request) { + parent::checkPermission($request); + $currentUserModel = Users_Record_Model::getCurrentUserModel(); + if(!$currentUserModel->isAdminUser()) { + throw new AppException(vtranslate('LBL_PERMISSION_DENIED', 'Vtiger')); + } + return true; + } public function process(Vtiger_Request $request) { $recordId = $request->get('record'); diff --git a/modules/Users/actions/Save.php b/modules/Users/actions/Save.php index ca25a36f28b1c6e5f4c99cc3e712b3d2a2159856..433479214a62bb9435fd1dd12877f31fc6e4f8e9 100644 --- a/modules/Users/actions/Save.php +++ b/modules/Users/actions/Save.php @@ -10,6 +10,10 @@ class Users_Save_Action extends Vtiger_Save_Action { + public function requiresPermission(\Vtiger_Request $request) { + return array(); + } + public function checkPermission(Vtiger_Request $request) { $allowed = parent::checkPermission($request); if ($allowed) { diff --git a/modules/Users/views/List.php b/modules/Users/views/List.php index 20a53952f0e337c0550a32d1411d2dab88692fda..40bff8e2273cee67f5e593119a6e496017bf78ff 100644 --- a/modules/Users/views/List.php +++ b/modules/Users/views/List.php @@ -10,13 +10,6 @@ class Users_List_View extends Settings_Vtiger_List_View { - function checkPermission(Vtiger_Request $request) { - $currentUserModel = Users_Record_Model::getCurrentUserModel(); - if(!$currentUserModel->isAdminUser()) { - throw new AppException(vtranslate('LBL_PERMISSION_DENIED', 'Vtiger')); - } - } - function getHeaderScripts(Vtiger_Request $request) { $headerScriptInstances = parent::getHeaderScripts($request); diff --git a/modules/Vtiger/views/Extension.php b/modules/Vtiger/views/Extension.php index 2fb2555fdda83adf5923c7b91dae7406406be970..aa41b14d796810d3b74b439e164fb149cf04bafc 100644 --- a/modules/Vtiger/views/Extension.php +++ b/modules/Vtiger/views/Extension.php @@ -12,19 +12,24 @@ class Vtiger_Extension_View extends Vtiger_List_View { public function requiresPermission(\Vtiger_Request $request) { $permissions = parent::requiresPermission($request); - $permissions[] = array('module_parameter' => 'extensionModule', 'action' => 'DetailView'); return $permissions; } public function checkPermission(Vtiger_Request $request) { - $moduleName = $request->get('extensionModule'); - parent::checkPermission($request); + $moduleName = $request->get('extensionModule'); + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); - if (empty($moduleModel)) { + if(empty($moduleModel)) { throw new AppException(vtranslate('LBL_HANDLER_NOT_FOUND')); } + + $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); + $permission = $userPrivilegesModel->hasModulePermission($moduleModel->getId()); + if(!$permission) { + throw new AppException(vtranslate($moduleName).' '.vtranslate('LBL_NOT_ACCESSIBLE')); + } return true; }