initializeFilterAndPager( $data, $disable_paging ); $data['filter_data']['user_id'] = $this->getCurrentUserObject()->getId(); $ndtlf = TTnew( 'SystemJobQueueListFactory' ); /** @var SystemJobQueueListFactory $ndtlf */ $ndtlf->getAPISearchByCompanyIdAndArrayCriteria( $this->getCurrentCompanyObject()->getId(), $data['filter_data'], $data['filter_items_per_page'], $data['filter_page'], null, $data['filter_sort']); Debug::Text( 'Record Count: ' . $ndtlf->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10 ); if ( $ndtlf->getRecordCount() > 0 ) { $this->setPagerObject( $ndtlf ); $retarr = []; foreach ( $ndtlf as $ndt_obj ) { $tmp_data = $ndt_obj->getObjectAsArray( $data['filter_columns'] ); $tmp_data['elapsed_time'] = TTDate::getHumanTimeSince( $ndt_obj->getEffectiveDate() ); $retarr[] = $tmp_data; } return $this->returnHandler( $retarr ); } return $this->returnHandler( true ); //No records returned. } /** * Returns an int count of pending and running jobs for current user. * @return int|bool */ function getPendingAndRunningSystemJobQueue() { $sjqlf = TTnew( 'SystemJobQueueListFactory' ); /** @var SystemJobQueueListFactory $sjqlf */ $total = $sjqlf->getPendingSystemJobsByCompanyIdAndUserid( $this->getCurrentCompanyObject()->getId(), $this->getCurrentUserObject()->getId() ); return $this->returnHandler( $total ); } } ?>