diff --git a/Admin/Installer.php b/Admin/Installer.php index 950edcf..56a65e9 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -26,4 +26,11 @@ use phpOMS\Module\InstallerAbstract; */ final class Installer extends InstallerAbstract { + /** + * Path of the file + * + * @var string + * @since 1.0.0 + */ + public const PATH = __DIR__; } diff --git a/Admin/Status.php b/Admin/Status.php index a7b5dc8..c415ba4 100755 --- a/Admin/Status.php +++ b/Admin/Status.php @@ -26,4 +26,11 @@ use phpOMS\Module\StatusAbstract; */ final class Status extends StatusAbstract { + /** + * Path of the file + * + * @var string + * @since 1.0.0 + */ + public const PATH = __DIR__; } diff --git a/Admin/Uninstaller.php b/Admin/Uninstaller.php index 77156f3..7f81c38 100755 --- a/Admin/Uninstaller.php +++ b/Admin/Uninstaller.php @@ -24,6 +24,13 @@ use phpOMS\Module\UninstallerAbstract; * @link https://orange-management.org * @since 1.0.0 */ -final class Uninstaller extends UninstallerAbstract +final class Installer extends InstallerAbstract { + /** + * Path of the file + * + * @var string + * @since 1.0.0 + */ + public const PATH = __DIR__; } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index b3c0a5a..59f5ced 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -225,7 +225,7 @@ final class ApiController extends Controller $task->title = (string) ($request->getData('title') ?? $task->title); $task->description = Markdown::parse((string) ($request->getData('plain') ?? $task->descriptionRaw)); $task->descriptionRaw = (string) ($request->getData('plain') ?? $task->descriptionRaw); - $task->due = new \DateTime((string) ($request->getData('due') ?? $task->due->format('Y-m-d H:i:s'))); + $task->due = $request->getData('due') !== null ? new \DateTime((string) ($request->getData('due'))) : $task->due; $task->setStatus((int) ($request->getData('status') ?? $task->getStatus())); $task->setType((int) ($request->getData('type') ?? $task->getType())); $task->setPriority((int) ($request->getData('priority') ?? $task->getPriority())); @@ -428,7 +428,7 @@ final class ApiController extends Controller { /** @var TaskElement $element */ $element = TaskElementMapper::get((int) ($request->getData('id'))); - $element->due = new \DateTime((string) ($request->getData('due') ?? $element->due->format('Y-m-d H:i:s'))); + $element->due = $request->getData('due') !== null ? new \DateTime((string) ($request->getData('due'))) : $element->due; $element->setStatus((int) ($request->getData('status') ?? $element->getStatus())); $element->description = Markdown::parse((string) ($request->getData('plain') ?? $element->descriptionRaw)); $element->descriptionRaw = (string) ($request->getData('plain') ?? $element->descriptionRaw);