mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-12 02:48:39 +00:00
Add plain/raw descriptions
This commit is contained in:
parent
3c5b81efde
commit
ffd2a6b6cf
|
|
@ -48,7 +48,8 @@ class Installer extends InstallerAbstract
|
||||||
`group_id` int(11) NOT NULL AUTO_INCREMENT,
|
`group_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`group_name` varchar(50) NOT NULL,
|
`group_name` varchar(50) NOT NULL,
|
||||||
`group_status` int(3) NOT NULL,
|
`group_status` int(3) NOT NULL,
|
||||||
`group_desc` varchar(255) DEFAULT NULL,
|
`group_desc` text DEFAULT NULL,
|
||||||
|
`group_desc_raw` text DEFAULT NULL,
|
||||||
`group_created` datetime DEFAULT NULL,
|
`group_created` datetime DEFAULT NULL,
|
||||||
PRIMARY KEY (`group_id`)
|
PRIMARY KEY (`group_id`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Module\ModuleAbstract;
|
use phpOMS\Module\ModuleAbstract;
|
||||||
use phpOMS\Module\WebInterface;
|
use phpOMS\Module\WebInterface;
|
||||||
use phpOMS\System\MimeType;
|
use phpOMS\System\MimeType;
|
||||||
|
use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||||
use phpOMS\Views\View;
|
use phpOMS\Views\View;
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
|
|
||||||
|
|
@ -491,7 +492,8 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
$group = GroupMapper::get((int) $request->getData('id'));
|
$group = GroupMapper::get((int) $request->getData('id'));
|
||||||
|
|
||||||
$group->setName((string) ($request->getData('name') ?? $group->getName()));
|
$group->setName((string) ($request->getData('name') ?? $group->getName()));
|
||||||
$group->setDescription((string) ($request->getData('description') ?? $group->getDescription()));
|
$group->setDescription(Markdown::parse((string) ($request->getData('description') ?? $group->getDescription())));
|
||||||
|
$group->setDescriptionRaw((string) ($request->getData('description') ?? $group->getDescriptionRaw()));
|
||||||
|
|
||||||
GroupMapper::update($group);
|
GroupMapper::update($group);
|
||||||
|
|
||||||
|
|
@ -565,7 +567,8 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
$group->setCreatedBy($request->getHeader()->getAccount());
|
$group->setCreatedBy($request->getHeader()->getAccount());
|
||||||
$group->setName((string) ($request->getData('name') ?? ''));
|
$group->setName((string) ($request->getData('name') ?? ''));
|
||||||
$group->setStatus((int) ($request->getData('status') ?? GroupStatus::INACTIVE));
|
$group->setStatus((int) ($request->getData('status') ?? GroupStatus::INACTIVE));
|
||||||
$group->setDescription((string) ($request->getData('description') ?? ''));
|
$group->setDescription(Markdown::parse((string) ($request->getData('description') ?? '')));
|
||||||
|
$group->setDescriptionRaw((string) ($request->getData('description') ?? ''));
|
||||||
|
|
||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ class Group extends \phpOMS\Account\Group
|
||||||
*/
|
*/
|
||||||
protected $createdBy = 0;
|
protected $createdBy = 0;
|
||||||
|
|
||||||
|
protected $descriptionRaw = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
|
@ -81,4 +83,14 @@ class Group extends \phpOMS\Account\Group
|
||||||
{
|
{
|
||||||
$this->createdBy = $createdBy;
|
$this->createdBy = $createdBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setDescriptionRaw(string $description) /* : void */
|
||||||
|
{
|
||||||
|
$this->descriptionRaw = $description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescriptionRaw() : string
|
||||||
|
{
|
||||||
|
return $this->descriptionRaw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ class GroupMapper extends DataMapperAbstract
|
||||||
'group_name' => ['name' => 'group_name', 'type' => 'string', 'internal' => 'name'],
|
'group_name' => ['name' => 'group_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
'group_status' => ['name' => 'group_status', 'type' => 'int', 'internal' => 'status'],
|
'group_status' => ['name' => 'group_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
'group_desc' => ['name' => 'group_desc', 'type' => 'string', 'internal' => 'description'],
|
'group_desc' => ['name' => 'group_desc', 'type' => 'string', 'internal' => 'description'],
|
||||||
|
'group_desc_raw' => ['name' => 'group_desc_raw', 'type' => 'string', 'internal' => 'descriptionRaw'],
|
||||||
'group_created' => ['name' => 'group_created', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
'group_created' => ['name' => 'group_created', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user