diff --git a/packages/vtiger/mandatory/PBXManager.zip b/packages/vtiger/mandatory/PBXManager.zip index f8f566a209efd55447e926e9de8735f490f1e640..6a2d99700d1d27f3613716458aeb251f7398f028 100644 Binary files a/packages/vtiger/mandatory/PBXManager.zip and b/packages/vtiger/mandatory/PBXManager.zip differ diff --git a/pkg/vtiger/modules/PBXManager/modules/PBXManager/models/Module.php b/pkg/vtiger/modules/PBXManager/modules/PBXManager/models/Module.php index c1b425660203f445abb3e21f45ab7bf1a2b4f521..7228ddf713bb81d13545bcbae7eefeb69596fe8a 100644 --- a/pkg/vtiger/modules/PBXManager/modules/PBXManager/models/Module.php +++ b/pkg/vtiger/modules/PBXManager/modules/PBXManager/models/Module.php @@ -32,7 +32,7 @@ class PBXManager_Module_Model extends Vtiger_Module_Model { public function getModuleBasicLinks() { $basicLinks = parent::getModuleBasicLinks(); foreach ($basicLinks as $key => $basicLink) { - if ($basicLink['linklabel'] == 'LBL_ADD_RECORD') { + if (in_array($basicLink['linklabel'], array('LBL_ADD_RECORD', 'LBL_IMPORT'))) { unset($basicLinks[$key]); } } @@ -47,27 +47,31 @@ class PBXManager_Module_Model extends Vtiger_Module_Model { if(!$this->isEntityModule()) { return array(); } - vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php'); - $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif'); - $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png'); $settingsLinks = array(); + $currentUser = Users_Record_Model::getCurrentUserModel(); + if($currentUser->isAdminUser()) { + vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php'); + + $layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif'); + $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png'); + + if(VTWorkflowUtils::checkModuleWorkflow($this->getName())) { + $settingsLinks[] = array( + 'linktype' => 'LISTVIEWSETTING', + 'linklabel' => 'LBL_EDIT_WORKFLOWS', + 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule='.$this->getName(), + 'linkicon' => $editWorkflowsImagePath + ); + } - if(VTWorkflowUtils::checkModuleWorkflow($this->getName())) { $settingsLinks[] = array( - 'linktype' => 'LISTVIEWSETTING', - 'linklabel' => 'LBL_EDIT_WORKFLOWS', - 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule='.$this->getName(), - 'linkicon' => $editWorkflowsImagePath + 'linktype' => 'LISTVIEWSETTINGS', + 'linklabel'=> 'LBL_SERVER_CONFIGURATION', + 'linkurl' => 'index.php?parent=Settings&module=PBXManager&view=Index', + 'linkicon'=> '' ); } - - $settingsLinks[] = array( - 'linktype' => 'LISTVIEWSETTINGS', - 'linklabel'=> 'LBL_SERVER_CONFIGURATION', - 'linkurl' => 'index.php?parent=Settings&module=PBXManager&view=Index', - 'linkicon'=> '' - ); return $settingsLinks; } diff --git a/pkg/vtiger/modules/PBXManager/modules/PBXManager/views/List.php b/pkg/vtiger/modules/PBXManager/modules/PBXManager/views/List.php new file mode 100644 index 0000000000000000000000000000000000000000..3374c9c315ed0bf26fd24b76069e58faf66ea629 --- /dev/null +++ b/pkg/vtiger/modules/PBXManager/modules/PBXManager/views/List.php @@ -0,0 +1,41 @@ +<?php +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ + +class PBXManager_List_View extends Vtiger_List_View { + + function process(Vtiger_Request $request) { + $viewer = $this->getViewer($request); + $moduleName = $request->getModule(); + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $viewName = $request->get('viewname'); + if ($viewName) { + $this->viewName = $viewName; + } + + $this->initializeListViewContents($request, $viewer); + $this->assignCustomViews($request, $viewer); + $viewer->assign('VIEW', $request->get('view')); + $viewer->assign('MODULE_MODEL', $moduleModel); + $viewer->assign('RECORD_ACTIONS', $this->getRecordActionsFromModule($moduleModel)); + $viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel()); + + $viewer->assign('IS_CREATE_PERMITTED', false); + $viewer->assign('IS_MODULE_EDITABLE', false); + $viewer->assign('IS_MODULE_DELETABLE', false); + $viewer->view('ListViewContents.tpl', $moduleName); + } + + public function getRecordActionsFromModule($moduleModel) { + $recordActions = array(); + $recordActions['edit'] = false; + $recordActions['delete'] = false; + return $recordActions; + } +}