mirror of
https://github.com/Karaka-Management/oms-Knowledgebase.git
synced 2026-01-11 17:38:40 +00:00
org -> unit change, some new functionality
This commit is contained in:
parent
c1ceb56da5
commit
0753a831bc
|
|
@ -20,8 +20,8 @@
|
|||
"type": "INT",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "organization_unit",
|
||||
"foreignKey": "organization_unit_id"
|
||||
"foreignTable": "unit",
|
||||
"foreignKey": "unit_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$app = (int) ($request->getData('app') ?? $this->app->orgId);
|
||||
$app = (int) ($request->getData('app') ?? $this->app->unitId);
|
||||
|
||||
$view->setTemplate('/Modules/Knowledgebase/Theme/Backend/wiki-category-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005901001, $request, $response));
|
||||
|
|
@ -304,7 +304,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$app = (int) ($request->getData('app') ?? $this->app->orgId);
|
||||
$app = (int) ($request->getData('app') ?? $this->app->unitId);
|
||||
|
||||
/** @var \Modules\Knowledgebase\Models\WikiDoc $document */
|
||||
$document = WikiDocMapper::get()
|
||||
|
|
@ -319,7 +319,7 @@ final class BackendController extends Controller
|
|||
$accountId = $request->header->account;
|
||||
|
||||
if (!$this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::WIKI, $document->getId())
|
||||
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::WIKI, $document->getId())
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
|
|
@ -340,7 +340,7 @@ final class BackendController extends Controller
|
|||
$view->setData('categories', $categories);
|
||||
$view->setData('document', $document);
|
||||
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::WIKI, $document->getId())
|
||||
PermissionType::MODIFY, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::WIKI, $document->getId())
|
||||
);
|
||||
|
||||
return $view;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
};
|
||||
|
||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||
$this->app->orgId = 1;
|
||||
$this->app->unitId = 1;
|
||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||
$this->app->appSettings = new CoreSettings();
|
||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user