private function _setListComponent($performanceTrackerLogList) { $configurationFactory = new PerformanceTrackerLogListConfigurationFactory(); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setActivePlugin('orangehrmPerformanceTrackerPlugin'); ohrmListComponent::setListData($performanceTrackerLogList); }
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); }
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); }
/** * * @param Doctrine_Collection $reviews */ protected function setListComponent($reviews, $countReview) { $pageNumber = $this->getPageNumber(); $configurationFactory = $this->getListConfigurationFactory(); ohrmListComponent::setActivePlugin('orangehrmPerformancePlugin'); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setListData($reviews); ohrmListComponent::setPageNumber($pageNumber); ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page')); ohrmListComponent::setNumberOfRecords($countReview); }
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 ListCompnentParameterHolder $parameters */ protected function initializeListComponent(ListCompnentParameterHolder $parameters) { ohrmListComponent::setConfigurationFactory($parameters->getConfigurationFactory()); ohrmListComponent::setActivePlugin('orangehrmCoreLeavePlugin'); ohrmListComponent::setListData($parameters->getListData()); ohrmListComponent::setItemsPerPage($parameters->getNoOfRecords()); ohrmListComponent::setNumberOfRecords($parameters->getTotalRecordsCount()); ohrmListComponent::$pageNumber = $parameters->getPageNumber(); }
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); }
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($leaveList) { ohrmListComponent::setHeaderPartial("leave/leave_request_comments"); ohrmListComponent::setConfigurationFactory($this->getListConfigurationFactory()); ohrmListComponent::setActivePlugin('orangehrmLeavePlugin'); ohrmListComponent::setListData($leaveList); ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page')); ohrmListComponent::setNumberOfRecords(count($leaveList)); }
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); }
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 $performanceTrackerLogList */ private function _setListComponent($performanceTrackerLogList) { PerformanceTrackerLogListConfigurationFactory::setLoggedInEmpNumber($this->loggedInEmpNumber); $configurationFactory = new PerformanceTrackerLogListConfigurationFactory($this->title); ohrmListComponent::setConfigurationFactory($configurationFactory); ohrmListComponent::setActivePlugin('orangehrmPerformanceTrackerPlugin'); ohrmListComponent::setListData($performanceTrackerLogList); }
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); }