_getDataObj()->setPrimaryKey($this->getLicenseId()); $this->_doView(); return $this; } protected function _prepareViewItem(array &$item) { Qs_View::getInstance()->addHelperPath('App/License/View/Helper/', 'App\License\View\Helper\\'); $item['tpl'] = $this->getTemplate('view.tpl'); $item['isTribalAccount'] = AclPermission::isTribalAccount(); if ($this->handler == 'admin' && $item['isTribalAccount'] && (!AclPermission::hasPermission([ TribalAccountAcl::ACL_LICENSES_READ_ID, TribalAccountAcl::ACL_LICENSES_READ_APPROVE_ID, TribalAccountAcl::ACL_LICENSES_READ_APPROVE_DECLINE_ID ], [])) ) { $item['isClassificationsOnly'] = true; } else { $item['isClassificationsOnly'] = false; } if ($this->handler == 'admin') { $item['backUrl'] = LicenseAdminView::getPage('url'); } else { $item['backUrl'] = $this->url(['action' => 'back']); } $item['receiptUrl'] = PdfView::getReceiptUrl($item['id']); if ($item['isTribalAccount'] && Entity::STATUS_ACTIVE == $item['status'] && Entity::TRIBE_STATUS_APPROVED == $item['tribeStatus'] ) { $item['licenseUrl'] = PdfView::getLicenseUrl($item['id'], AclPermission::getAdminTribeId()); } else { if (Entity::STATUS_ACTIVE == $item['status']) { foreach ($item['tribes'] as &$tribe) { if (Entity::TRIBE_STATUS_APPROVED == $tribe['status']) { $tribe['licenseUrl'] = PdfView::getLicenseUrl($item['id'], $tribe['tribeId']); } } unset($tribe); } } return $this; } public function getLicenseId() { return $this->licenseId; } public function setLicenseId($licenseId) { $this->licenseId = $licenseId; return $this; } public function getHandler() { return $this->handler; } public function setHandler($handler) { $this->handler = $handler; return $this; } }