* @copyright Copyright (c) 2022 Metaways Infosystems GmbH (http://www.metaways.de) * */ /** * AttendanceRecorderDevice Controller * * @package HumanResources * @subpackage Controller */ class HumanResources_Controller_AttendanceRecorderDevice extends Tinebase_Controller_Record_Abstract { /** @use Tinebase_Controller_SingletonTrait */ use Tinebase_Controller_SingletonTrait; /** * the constructor * * don't use the constructor. use the singleton */ protected function __construct() { $this->_applicationName = HumanResources_Config::APP_NAME; $this->_backend = new Tinebase_Backend_Sql([ Tinebase_Backend_Sql::TABLE_NAME => HumanResources_Model_AttendanceRecorderDevice::TABLE_NAME, Tinebase_Backend_Sql::MODLOG_ACTIVE => true, Tinebase_Backend_Sql::MODEL_NAME => HumanResources_Model_AttendanceRecorderDevice::class, ]); $this->_modelName = HumanResources_Model_AttendanceRecorderDevice::class; $this->_purgeRecords = false; $this->_doContainerACLChecks = false; } protected function _checkRight($_action) { if (! $this->_doRightChecks) { return; } parent::_checkRight($_action); if (self::ACTION_GET === $_action) { return; } if (!Tinebase_Core::getUser()->hasRight(HumanResources_Config::APP_NAME, Tinebase_Acl_Rights::ADMIN)) { throw new Tinebase_Exception_AccessDenied('no right to ' . $_action . ' ' . $this->_modelName); } } protected function _inspectDelete(array $_ids) { $_ids = parent::_inspectDelete($_ids); return array_filter($_ids, function($val) { return $val !== HumanResources_Model_AttendanceRecorderDevice::SYSTEM_PROJECT_TIME_ID && $val !== HumanResources_Model_AttendanceRecorderDevice::SYSTEM_WORKING_TIME_ID && $val !== HumanResources_Model_AttendanceRecorderDevice::SYSTEM_STANDALONE_PROJECT_TIME_ID; }); } }