public function getFrontierChargeReviewedAction() { /** * @var \DDD\Service\UniversalDashboard\Widget\PendingTransaction $pendingTransactionWidgetService */ $pendingTransactionWidgetService = $this->getServiceLocator()->get('service_universal_dashboard_widget_pending_transaction'); $auth = $this->getServiceLocator()->get('library_backoffice_auth'); if (!$auth->checkUniversalDashboardPermission(UserService::DASHBOARD_FRONTIER_CHARGE_REVIEWED, Roles::ROLE_BOOKING_TRANSACTION_VERIFIER)) { return $this->redirect()->toRoute('home'); } $dataSet = $pendingTransactionWidgetService->getPendingTransactions('frontier'); $preparedData = []; $statusList = Booking\BankTransaction::$transactionStatus; if ($dataSet && count($dataSet)) { foreach ($dataSet as $row) { $strStatuses = ''; $transactionId = $row['id']; $reservationId = $row['reservation_id']; foreach ($statusList as $key => $item) { if ($key == Booking\BankTransaction::BANK_TRANSACTION_STATUS_PENDING) { continue; } $strStatuses .= "<li><a href='javascript:void(0)' onClick='changePendingTransaction(this, {$key}, {$transactionId}, {$reservationId})'>{$item}</a></li>"; } $actionsColumn = ' <a href="//' . DomainConstants::BO_DOMAIN_NAME . '/booking/edit/' . $row['res_number'] . '#financial_details" class="btn btn-xs btn-primary" target="_blank" data-html-content="View"></a> <div class="btn-group"> <button type="button" class="btn btn-xs btn-success dropdown-toggle" data-toggle="dropdown"> Select Status <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> ' . $strStatuses . '</ul> </div>'; $preparedData[] = ["0" => $row['res_number'], "1" => $row['acc_name'], "2" => $row['guest'], "3" => Objects::getChargeTypeById($row['type']), "4" => $row['acc_amount'] . ' ' . $row['symbol'], "5" => date(Constants::GLOBAL_DATE_TIME_FORMAT, strtotime($row['date'])), "6" => $actionsColumn]; } } return new JsonModel(["aaData" => $preparedData]); }