diff --git a/Admin/Install/db.json b/Admin/Install/db.json index 0196b64..f81e97a 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -20,8 +20,8 @@ "type": "INT", "default": null, "null": true, - "foreignTable": "organization_unit", - "foreignKey": "organization_unit_id" + "foreignTable": "unit", + "foreignKey": "unit_id" } } }, diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 354f267..75cb351 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -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; diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 30583b2..6b335f0 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -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/');