mirror of
https://github.com/Karaka-Management/oms-Kanban.git
synced 2026-02-17 12:48:41 +00:00
org -> unit change, some new functionality
This commit is contained in:
parent
7b1a688b0f
commit
cb508cee45
|
|
@ -14,6 +14,11 @@
|
||||||
"type": "VARCHAR(255)",
|
"type": "VARCHAR(255)",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
|
"kanban_board_color": {
|
||||||
|
"color": "kanban_board_color",
|
||||||
|
"type": "VARCHAR(9)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"kanban_board_desc": {
|
"kanban_board_desc": {
|
||||||
"name": "kanban_board_desc",
|
"name": "kanban_board_desc",
|
||||||
"type": "TEXT",
|
"type": "TEXT",
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$board = new KanbanBoard();
|
$board = new KanbanBoard();
|
||||||
$board->name = (string) $request->getData('title');
|
$board->name = (string) $request->getData('title');
|
||||||
|
$board->color = (string) ($request->getData('color') ?? '');
|
||||||
$board->description = Markdown::parse((string) ($request->getData('plain') ?? ''));
|
$board->description = Markdown::parse((string) ($request->getData('plain') ?? ''));
|
||||||
$board->descriptionRaw = (string) ($request->getData('plain') ?? '');
|
$board->descriptionRaw = (string) ($request->getData('plain') ?? '');
|
||||||
$board->order = (int) ($request->getData('order') ?? 1);
|
$board->order = (int) ($request->getData('order') ?? 1);
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
if ($board->createdBy->getId() !== $accountId
|
if ($board->createdBy->getId() !== $accountId
|
||||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::BOARD, $board->getId())
|
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::BOARD, $board->getId())
|
||||||
) {
|
) {
|
||||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
@ -183,7 +183,7 @@ final class BackendController extends Controller
|
||||||
$accountId = $request->header->account;
|
$accountId = $request->header->account;
|
||||||
|
|
||||||
if (!$this->app->accountManager->get($accountId)->hasPermission(
|
if (!$this->app->accountManager->get($accountId)->hasPermission(
|
||||||
PermissionType::CREATE, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::BOARD)
|
PermissionType::CREATE, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::BOARD)
|
||||||
) {
|
) {
|
||||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
@ -229,7 +229,7 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
if ($card->createdBy->getId() !== $accountId
|
if ($card->createdBy->getId() !== $accountId
|
||||||
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
&& !$this->app->accountManager->get($accountId)->hasPermission(
|
||||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::NAME, PermissionCategory::CARD, $card->getId())
|
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::CARD, $card->getId())
|
||||||
) {
|
) {
|
||||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,14 @@ class KanbanBoard implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public string $name = '';
|
public string $name = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public string $color = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Board status.
|
* Board status.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ final class KanbanBoardMapper extends DataMapperFactory
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'kanban_board_id' => ['name' => 'kanban_board_id', 'type' => 'int', 'internal' => 'id'],
|
'kanban_board_id' => ['name' => 'kanban_board_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'kanban_board_name' => ['name' => 'kanban_board_name', 'type' => 'string', 'internal' => 'name'],
|
'kanban_board_name' => ['name' => 'kanban_board_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
|
'kanban_board_color' => ['name' => 'kanban_board_color', 'type' => 'string', 'internal' => 'color'],
|
||||||
'kanban_board_desc' => ['name' => 'kanban_board_desc', 'type' => 'string', 'internal' => 'description'],
|
'kanban_board_desc' => ['name' => 'kanban_board_desc', 'type' => 'string', 'internal' => 'description'],
|
||||||
'kanban_board_descraw' => ['name' => 'kanban_board_descraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
'kanban_board_descraw' => ['name' => 'kanban_board_descraw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
||||||
'kanban_board_status' => ['name' => 'kanban_board_status', 'type' => 'int', 'internal' => 'status'],
|
'kanban_board_status' => ['name' => 'kanban_board_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||||
$this->app->orgId = 1;
|
$this->app->unitId = 1;
|
||||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||||
$this->app->appSettings = new CoreSettings();
|
$this->app->appSettings = new CoreSettings();
|
||||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user