コード例 #1
0
 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($performanceTrackerLogList)
 {
     $configurationFactory = new PerformanceTrackerLogListConfigurationFactory();
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setActivePlugin('orangehrmPerformanceTrackerPlugin');
     ohrmListComponent::setListData($performanceTrackerLogList);
 }
コード例 #3
0
 private function _setListComponent($subscriberList, $notificationName)
 {
     $configurationFactory = new SubscriberHeaderFactory();
     $runtimeDefinitions = array('title' => __('Subscribers') . ' : ' . __($notificationName));
     $configurationFactory->setRuntimeDefinitions($runtimeDefinitions);
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($subscriberList);
 }
コード例 #4
0
 private function setListComponent($openIdProviderList)
 {
     $configurationFactory = new OpenIdProviderHeaderListConfigurationFactory();
     $runtimeDefinitions = $this->setRuntimeDefinitions();
     $configurationFactory->setRuntimeDefinitions($runtimeDefinitions);
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($openIdProviderList);
 }
コード例 #5
0
 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()));
 }
コード例 #6
0
 /**
  *
  * @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());
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 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);
 }
コード例 #9
0
 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 $reviews 
  */
 protected function setListComponent($reviews, $isReviewer, $reviewsCount)
 {
     $pageNumber = $this->getPageNumber();
     $configurationFactory = $this->getListConfigurationFactory($isReviewer);
     ohrmListComponent::setActivePlugin('orangehrmPerformancePlugin');
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($reviews);
     ohrmListComponent::setPageNumber($pageNumber);
     $numRecords = $reviewsCount;
     ohrmListComponent::setItemsPerPage(sfConfig::get('app_items_per_page'));
     ohrmListComponent::setNumberOfRecords($numRecords);
 }
コード例 #11
0
 private function _setListComponent($payGradeList, $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 = new PayGradeHeaderFactory();
     $configurationFactory->setRuntimeDefinitions($runtimeDefinitions);
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($payGradeList);
 }
コード例 #12
0
 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()));
 }
コード例 #13
0
 /**
  *
  * @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));
 }
 public function setListHeaderPartial()
 {
     ohrmListComponent::setHeaderPartial("time/attendanceSummaryReportHeader");
 }
コード例 #15
0
 /**
  *
  * @param <type> $customerList
  * @param <type> $noOfRecords
  * @param <type> $pageNumber
  */
 private function _setListComponent($customerList, $noOfRecords, $pageNumber)
 {
     $configurationFactory = new ProjectActivityHeaderFactory();
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($customerList);
 }
コード例 #16
0
 public function setListHeaderPartial()
 {
     ohrmListComponent::setHeaderPartial("time/employeeReportHeader");
 }
コード例 #17
0
 /**
  *
  * @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();
 }
コード例 #18
0
 /**
  *
  * @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);
 }
 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);
 }
コード例 #20
0
 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);
 }
コード例 #21
0
 private function _setListComponent($emailNotificationList)
 {
     $configurationFactory = new EmailNotificationHeaderFactory();
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($emailNotificationList);
 }
コード例 #22
0
 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);
 }
コード例 #23
0
 public function execute($request)
 {
     $this->setInitialActionDetails($request);
     $reportId = $request->getParameter("reportId");
     $backRequest = $request->getParameter("backRequest");
     $reportableGeneratorService = new ReportGeneratorService();
     $sql = $request->getParameter("sql");
     $reportableService = new ReportableService();
     $this->report = $reportableService->getReport($reportId);
     if (empty($this->report)) {
         return $this->renderText(__('Invalid Report Specified'));
     }
     $useFilterField = $this->report->getUseFilterField();
     if (!$useFilterField) {
         $this->setCriteriaForm();
         if ($request->isMethod('post')) {
             $this->form->bind($request->getParameter($this->form->getName()));
             if ($this->form->isValid()) {
                 $reportGeneratorService = new ReportGeneratorService();
                 $formValues = $this->form->getValues();
                 $this->setReportCriteriaInfoInRequest($formValues);
                 $sql = $reportGeneratorService->generateSqlForNotUseFilterFieldReports($reportId, $formValues);
             }
         }
     } else {
         if ($request->isMethod("get")) {
             $reportGeneratorService = new ReportGeneratorService();
             //                $selectedRuntimeFilterFieldList = $reportGeneratorService->getSelectedRuntimeFilterFields($reportId);
             $selectedFilterFieldList = $reportableService->getSelectedFilterFields($reportId, false);
             $values = $this->setValues();
             //                $linkedFilterFieldIdsAndFormValues = $reportGeneratorService->linkFilterFieldIdsToFormValues($selectedRuntimeFilterFieldList, $values);
             //                $runtimeWhereClauseConditionArray = $reportGeneratorService->generateWhereClauseConditionArray($linkedFilterFieldIdsAndFormValues);
             $runtimeWhereClauseConditionArray = $reportGeneratorService->generateWhereClauseConditionArray($selectedFilterFieldList, $values);
             $sql = $reportGeneratorService->generateSql($reportId, $runtimeWhereClauseConditionArray);
         }
     }
     $paramArray = array();
     if ($reportId == 1) {
         if (!isset($backRequest)) {
             $this->getUser()->setAttribute("reportCriteriaSql", $sql);
             $this->getUser()->setAttribute("parametersForListComponent", $this->setParametersForListComponent());
         }
         if (isset($backRequest) && $this->getUser()->hasAttribute("reportCriteriaSql")) {
             $sql = $this->getUser()->getAttribute("reportCriteriaSql");
             $paramArray = $this->getUser()->getAttribute("parametersForListComponent");
         }
     }
     $params = !empty($paramArray) ? $paramArray : $this->setParametersForListComponent();
     $rawDataSet = $reportableGeneratorService->generateReportDataSet($reportId, $sql);
     $dataSet = self::escapeData($rawDataSet);
     $headerGroups = $reportableGeneratorService->getHeaderGroups($reportId);
     $this->setConfigurationFactory();
     $configurationFactory = $this->getConfFactory();
     $configurationFactory->setHeaderGroups($headerGroups);
     if ($reportId == 3) {
         if (empty($dataSet[0]['employeeName']) && $dataSet[0]['totalduration'] == 0) {
             $dataSet = null;
         }
     }
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     $this->setListHeaderPartial();
     ohrmListComponent::setListData($dataSet);
     $this->parmetersForListComponent = $params;
     $this->initilizeDataRetriever($configurationFactory, $reportableGeneratorService, 'generateReportDataSet', array($reportId, $sql));
 }
コード例 #24
0
 private function _setListComponent($workShiftList)
 {
     $configurationFactory = new WorkShiftHeaderFactory();
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($workShiftList);
 }
コード例 #25
0
 /**
  *
  * @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));
 }
コード例 #26
0
 private function _setListComponent($nationalityList)
 {
     $configurationFactory = new NationalityHeaderFactory();
     ohrmListComponent::setConfigurationFactory($configurationFactory);
     ohrmListComponent::setListData($nationalityList);
 }
コード例 #27
0
 /**
  *
  * @return array
  */
 protected function loadDefinitions()
 {
     if (empty(self::$definitionsPath)) {
         if (empty(self::$activePlugin)) {
             self::$definitionsPath = sfConfig::get('sf_plugins_dir') . '/orangehrmCorePlugin/config/list_component.yml';
         } else {
             self::$definitionsPath = sfConfig::get('sf_plugins_dir') . '/' . self::$activePlugin . '/config/list_component.yml';
         }
     }
     return sfYaml::load(self::$definitionsPath);
 }
コード例 #28
0
 public function setListHeaderPartial()
 {
     ohrmListComponent::setHeaderPartial("time/projectReportHeader");
 }
コード例 #29
0
 /**
  *
  * @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);
 }
コード例 #30
0
 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);
 }