protected function _setListComponent($leaveTypeList, $permissions) { $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { if ($permissions->canDelete()) { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfModal', 'class' => 'delete'); } } $runtimeDefinitions['buttons'] = $buttons; $readOnlyLeaveTypeIds = $this->getUnselectableLeaveTypeIds(); if (count($readOnlyLeaveTypeIds) > 0) { $runtimeDefinitions['unselectableRowIds'] = $readOnlyLeaveTypeIds; } $configurationFactory = $this->getListConfigurationFactory(); $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setActivePlugin('orangehrmLeavePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($leaveTypeList); ohrmListComponent::setPageNumber(0); $numRecords = count($leaveTypeList); ohrmListComponent::setItemsPerPage($numRecords); ohrmListComponent::setNumberOfRecords($numRecords); }
private function _setListComponent($reports, $noOfRecords, $pageNumber, $totalRecords) { $configurationFactory = new ViewDefinedPredefinedReportsConfigurationFactory(); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($totalRecords); ohrmListComponent::setListData($reports); }
private function _setListComponent($JobTitleList, $noOfRecords, $pageNumber) { $configurationFactory = new JobTitleHeaderFactory(); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($JobTitleList); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords(count($this->getJobTitleService()->getJobTitleList())); }
/** * * @param <type> $customerList * @param <type> $noOfRecords * @param <type> $pageNumber */ private function _setListComponent($customerList, $noOfRecords, $pageNumber) { $configurationFactory = new CustomerHeaderFactory(); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($customerList); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($this->getCustomerService()->getCustomerCount()); }
protected function _setListComponent($leaveTypeList) { $configurationFactory = $this->getListConfigurationFactory(); ohrmListComponent::setActivePlugin('orangehrmCoreLeavePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($leaveTypeList); ohrmListComponent::setPageNumber(0); $numRecords = count($leaveTypeList); ohrmListComponent::setItemsPerPage($numRecords); ohrmListComponent::setNumberOfRecords($numRecords); }
private function _setListComponent($performanceTrackList, $performanceTrackListCount) { $pageNumber = $this->getPageNumber(); $configurationFactory = new PerformanceTrackListAdminConfigurationFactory(); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setActivePlugin('orangehrmPerformanceTrackerPlugin'); ohrmListComponent::setListData($performanceTrackList); ohrmListComponent::setPageNumber($pageNumber); $numRecords = $performanceTrackListCount; ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page')); ohrmListComponent::setNumberOfRecords($numRecords); }
/** * * @param Doctrine_Collection $kpiList */ protected function setListComponent($kpiList, $kpiListCount) { $pageNumber = $this->getPageNumber(); $configurationFactory = $this->getListConfigurationFactory(); ohrmListComponent::setActivePlugin('orangehrmPerformancePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($kpiList); ohrmListComponent::setPageNumber($pageNumber); $numRecords = $kpiListCount; ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page')); ohrmListComponent::setNumberOfRecords($numRecords); }
private function _setListComponent($JobTitleList, $noOfRecords, $pageNumber, $permissions) { $configurationFactory = $this->_getConfigurationFactory($permissions); $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { if ($permissions->canDelete()) { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfModal', 'class' => 'delete'); } } $runtimeDefinitions['buttons'] = $buttons; $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($JobTitleList); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords(count($this->getJobTitleService()->getJobTitleList())); }
/** * * @param <type> $candidates * @param <type> $noOfRecords * @param CandidateSearchParameters $searchParam */ private function _setListComponent($usrObj, $candidates, $noOfRecords, CandidateSearchParameters $searchParam, $pageNumber, $permissions) { $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { if ($permissions->canDelete()) { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfirmation', 'class' => 'delete'); } } $runtimeDefinitions['buttons'] = $buttons; $configurationFactory = new CandidateHeaderFactory(); // if (!($usrObj->isAdmin() || $usrObj->isHiringManager())) { // $configurationFactory->setRuntimeDefinitions(array( // 'hasSelectableRows' => false, // 'buttons' => array(), // )); // } $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($candidates); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($this->getCandidateService()->getCandidateRecordsCount($searchParam)); }
/** * * @param type $locationList * @param type $limit * @param type $pageNumber * @param type $recordCount */ private function _setListComponent($locationList, $limit, $pageNumber, $recordCount) { $configurationFactory = new LocationHeaderFactory(); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($locationList); ohrmListComponent::setItemsPerPage($limit); ohrmListComponent::setNumberOfRecords($recordCount); }
private function _setListComponent($reports, $noOfRecords, $pageNumber, $totalRecords, $permissions) { $configurationFactory = new ViewDefinedPredefinedReportsConfigurationFactory(); $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add', 'function' => 'addPredefinedReport'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { if ($permissions->canDelete()) { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfModal', 'class' => 'delete'); } } $runtimeDefinitions['buttons'] = $buttons; if ($permissions->canUpdate()) { $configurationFactory->setEdit(true); } else { $configurationFactory->setEdit(false); } $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($totalRecords); ohrmListComponent::setListData($reports); }
private function _setListComponent($records, $noOfRecords, $pageNumber, $count = null, $showEdit = null, $allowedActions = null) { $configurationFactory = new AttendanceRecordHeaderFactory(); $notSelectable = array(); foreach ($records as $record) { if (!$this->allowedToPerformAction(WorkflowStateMachine::FLOW_ATTENDANCE, PluginWorkflowStateMachine::ATTENDANCE_ACTION_DELETE, $record->getState(), $this->decoratedUser)) { $notSelectable[] = $record->getId(); } } // print_r($allowedActions); $buttons = array(); if (isset($allowedActions)) { if (isset($showEdit) && $showEdit) { if ($allowedActions['Edit']) { $buttons['Edit'] = array('label' => __('Edit'), 'type' => 'button'); } if ($allowedActions['PunchIn']) { $buttons['PunchIn'] = array('label' => __('Add Attendance Records'), 'type' => 'button', 'class' => 'punch'); } if ($allowedActions['PunchOut']) { $buttons['PunchOut'] = array('label' => __('Add Attendance Records'), 'type' => 'button', 'class' => 'punch'); } } if ($allowedActions['Delete']) { $buttons['Delete'] = array('label' => __('Delete'), 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#dialogBox', 'class' => 'delete'); } } $configurationFactory->setRuntimeDefinitions(array('buttons' => $buttons, 'unselectableRowIds' => $notSelectable)); ohrmListComponent::setActivePlugin('orangehrmAttendancePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($records); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($count); }
/** * * @param <type> $vacancyList * @param <type> $noOfRecords * @param <type> $srchParams */ private function _setListComponent($vacancyList, $noOfRecords, $srchParams, $pageNumber) { $configurationFactory = new JobVacancyHeaderFactory(); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($vacancyList); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($this->getVacancyService()->searchVacanciesCount($srchParams)); }
protected function setListComponent($employeeList, $count, $noOfRecords, $page) { $configurationFactory = $this->getListConfigurationFactory(); $permissions = $this->getContext()->get('screen_permissions'); $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $allowedToAddEmployee = $this->getContext()->getUserRoleManager()->isActionAllowed(PluginWorkflowStateMachine::FLOW_EMPLOYEE, Employee::STATE_NOT_EXIST, PluginWorkflowStateMachine::EMPLOYEE_ACTION_ADD); if ($allowedToAddEmployee) { $buttons['Add'] = array('label' => 'Add'); } } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { $deleteActiveEmployee = $this->getContext()->getUserRoleManager()->isActionAllowed(PluginWorkflowStateMachine::FLOW_EMPLOYEE, Employee::STATE_ACTIVE, PluginWorkflowStateMachine::EMPLOYEE_ACTION_DELETE_ACTIVE); $deleteTerminatedEmployee = $this->getContext()->getUserRoleManager()->isActionAllowed(PluginWorkflowStateMachine::FLOW_EMPLOYEE, Employee::STATE_TERMINATED, PluginWorkflowStateMachine::EMPLOYEE_ACTION_DELETE_TERMINATED); if ($deleteActiveEmployee || $deleteTerminatedEmployee) { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfModal', 'class' => 'delete'); } } $runtimeDefinitions['buttons'] = $buttons; $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setActivePlugin('orangehrmPimPlugin'); ohrmListComponent::setListData($employeeList); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($count); ohrmListComponent::setPageNumber($page); }
protected function setListComponent($leaveList, $count, $page) { ohrmListComponent::setConfigurationFactory($this->getListConfigurationFactory()); ohrmListComponent::setActivePlugin('orangehrmLeavePlugin'); ohrmListComponent::setListData($leaveList); ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page')); ohrmListComponent::setNumberOfRecords($count); ohrmListComponent::setPageNumber($page); }
protected function setListComponent($employeeList, $count, $noOfRecords, $page) { $configurationFactory = $this->getListConfigurationFactory(); $permissions = $this->getContext()->get('screen_permissions'); $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit'); } $runtimeDefinitions['buttons'] = $buttons; $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setActivePlugin('orangehrmPimPlugin'); ohrmListComponent::setListData($employeeList); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($count); ohrmListComponent::setPageNumber($page); }
/** * * @param <type> $projectList * @param <type> $noOfRecords * @param <type> $pageNumber */ private function _setListComponent($projectList, $limit, $pageNumber, $recordCount, $usrObj) { $configurationFactory = new ProjectHeaderFactory(); if (!$usrObj->isAdmin()) { $configurationFactory->setRuntimeDefinitions(array('hasSelectableRows' => false, 'buttons' => array())); } ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($projectList); ohrmListComponent::setItemsPerPage($limit); ohrmListComponent::setNumberOfRecords($recordCount); }
/** * * @param <type> $vacancyList * @param <type> $noOfRecords * @param <type> $srchParams */ private function _setListComponent($vacancyList, $noOfRecords, $srchParams, $pageNumber, $permissions) { $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add', 'function' => 'addJobVacancy'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { if ($permissions->canDelete()) { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfirmation', 'class' => 'delete'); } } $runtimeDefinitions['buttons'] = $buttons; $configurationFactory = new JobVacancyHeaderFactory(); $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($vacancyList); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($this->getVacancyService()->searchVacanciesCount($srchParams)); }
/** * * @param <type> $candidates * @param <type> $noOfRecords * @param CandidateSearchParameters $searchParam */ private function _setListComponent($usrObj, $candidates, $noOfRecords, CandidateSearchParameters $searchParam, $pageNumber) { $configurationFactory = new CandidateHeaderFactory(); if (!($usrObj->isAdmin() || $usrObj->isHiringManager())) { $configurationFactory->setRuntimeDefinitions(array('hasSelectableRows' => false, 'buttons' => array())); } ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($candidates); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($this->getCandidateService()->getCandidateRecordsCount($searchParam)); }
private function _setListComponent($records, $noOfRecords, $pageNumber, $count = null, $showEdit = null, $allowedActions = null) { $configurationFactory = new AttendanceRecordHeaderFactory(); $userRoleManager = $this->getContext()->getUserRoleManager(); $loggedInEmpNumber = $this->getUser()->getEmployeeNumber(); $notSelectable = array(); foreach ($records as $record) { if (!$userRoleManager->isActionAllowed(WorkflowStateMachine::FLOW_ATTENDANCE, $record->getState(), WorkflowStateMachine::ATTENDANCE_ACTION_DELETE, array(), array(), array('Employee' => $this->employeeId))) { $notSelectable[] = $record->getId(); } } $buttons = array(); $canSelect = false; if (isset($allowedActions)) { if (isset($showEdit) && $showEdit) { if ($allowedActions['Edit']) { $buttons['Edit'] = array('label' => __('Edit'), 'type' => 'button'); } if ($allowedActions['PunchIn']) { $buttons['PunchIn'] = array('label' => __('Add Attendance Records'), 'type' => 'button', 'class' => 'punch'); } if ($allowedActions['PunchOut']) { $buttons['PunchOut'] = array('label' => __('Add Attendance Records'), 'type' => 'button', 'class' => 'punch'); } } if ($allowedActions['Delete']) { $canSelect = true; $buttons['Delete'] = array('label' => __('Delete'), 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#dialogBox', 'class' => 'delete'); } } $configurationFactory->setRuntimeDefinitions(array('buttons' => $buttons, 'unselectableRowIds' => $notSelectable, 'hasSelectableRows' => $canSelect)); ohrmListComponent::setActivePlugin('orangehrmAttendancePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($records); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($count); }
protected function setListComponent($leaveList, $count, $page, $showLeaveType = false) { $configurationFactory = $this->getListConfigurationFactory($showLeaveType); $dataGroupPermission = $this->getDataGroupPermissions(); $screenPermissions = $this->getContext()->get('screen_permissions'); $permissions = $screenPermissions->andWith($dataGroupPermission); $runtimeDefinitions = array(); $buttons = array(); if ($permissions->canCreate()) { $buttons['Add'] = array('label' => 'Add'); } if (!$permissions->canDelete()) { $runtimeDefinitions['hasSelectableRows'] = false; } else { $buttons['Delete'] = array('label' => 'Delete', 'type' => 'submit', 'data-toggle' => 'modal', 'data-target' => '#deleteConfModal', 'class' => 'delete'); } $configurationFactory->setAllowEdit($permissions->canUpdate()); $runtimeDefinitions['buttons'] = $buttons; $configurationFactory->setRuntimeDefinitions($runtimeDefinitions); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setActivePlugin('orangehrmLeavePlugin'); ohrmListComponent::setListData($leaveList); ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page')); ohrmListComponent::setNumberOfRecords($count); ohrmListComponent::setPageNumber($page); }
/** * * @param <type> $projectList * @param <type> $noOfRecords * @param <type> $pageNumber */ private function _setListComponent($systemUserList, $limit, $pageNumber, $recordCount) { $configurationFactory = $this->getSystemUserHeaderFactory(); $configurationFactory->setRuntimeDefinitions(array('hasSelectableRows' => true, 'unselectableRowIds' => array($this->getUser()->getAttribute('user')->getUserId()))); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($systemUserList); ohrmListComponent::setItemsPerPage($limit); ohrmListComponent::setNumberOfRecords($recordCount); }
private function _setListComponent($records, $noOfRecords, $pageNumber, $count) { $configurationFactory = new AttendanceRecordHeaderFactory(); $notSelectable = array(); foreach ($records as $record) { if (!$this->allowedToPerformAction(WorkflowStateMachine::FLOW_ATTENDANCE, PluginWorkflowStateMachine::ATTENDANCE_ACTION_DELETE, $record->getState(), $this->decoratedUser)) { $notSelectable[] = $record->getId(); } } $configurationFactory->setRuntimeDefinitions(array('unselectableRowIds' => $notSelectable)); ohrmListComponent::setActivePlugin('orangehrmAttendancePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($records); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage($noOfRecords); ohrmListComponent::setNumberOfRecords($count); }