diff --git a/Controller/ApiController.php b/Controller/ApiController.php index f6836f2..20c23ab 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -36,16 +36,16 @@ use phpOMS\Utils\Parser\Markdown\Markdown; * @link https://orange-management.org * @since 1.0.0 * - * @todo Orange-Management/Modules#6 + * @todo Orange-Management/oms-Tasks#9 * Create task/calendar reference * Show tasks in calendars not just in user calendars but also in event calendars and project calendars?! * * @todo Orange-Management/Modules#33 * Repeating tasks should be implemented. - * At the same time this mans a fix to the due date needs to be implemented. + * At the same time this means a fix to the due date needs to be implemented. * Maybe simple calculate the time difference between first start and first due? * - * @todo Orange-Management/Modules#147 + * @todo Orange-Management/oms-Tasks#6 * Add tags * The user should be able to add a tag to a task and also decide on the color of the tag. * User means the creator of the task. @@ -244,7 +244,7 @@ final class ApiController extends Controller } /** - * @todo Orange-Management/Moudles#201 + * @todo Orange-Management/oms-Tasks#3 * Validate that the user is allowed to create a task element for a specific task */ @@ -338,7 +338,7 @@ final class ApiController extends Controller $this->updateModel($request->getHeader()->getAccount(), $old, $new, TaskElementMapper::class, 'taskelement'); /** - * @todo Orange-Management/Modules#205 + * @todo Orange-Management/oms-Tasks#2 * Update task status depending on the new task element or updated task element * The task status is not normalized and relates to the last task element. * Depending on the task status of the last task element also the task status should change. diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 7a4be5a..129539a 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -36,7 +36,7 @@ use phpOMS\Views\View; * @link https://orange-management.org * @since 1.0.0 * - * @todo Orange-Management/Modules#148 + * @todo Orange-Management/oms-Tasks#5 * Add a calender like task view * If you define tasks far into the future it can become very difficult to read and organize them. * For this purpose there should be a calendar view for them. @@ -52,7 +52,7 @@ final class BackendController extends Controller implements DashboardElementInte * * @return RenderableInterface Returns a renderable object * - * @todo Orange-Management/Modules#54 + * @todo Orange-Management/oms-Tasks#6 * Implement dashboard statistics * Currently on the dashboard there is only a placeholder for some stats. * These stats need to be implemented. @@ -71,9 +71,17 @@ final class BackendController extends Controller implements DashboardElementInte $view->setTemplate('/Modules/Tasks/Theme/Backend/task-dashboard'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001101001, $request, $response)); - $tasks = TaskMapper::getAny($request->getHeader()->getAccount()); - - $view->addData('tasks', $tasks); + if ($request->getData('ptype') === '-') { + $view->setData('tasks', + TaskMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) + ::getBeforePivot((int) ($request->getData('id') ?? 0), null, 25) + ); + } else { + $view->setData('tasks', + TaskMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) + ::getAfterPivot((int) ($request->getData('id') ?? 0), null, 25) + ); + } return $view; } @@ -200,7 +208,7 @@ final class BackendController extends Controller implements DashboardElementInte * * @return int Returns the amount of unread tasks * - * @todo Orange-Management/Modules#206 + * @todo Orange-Management/oms-Tasks#1 * Implement has seen feature * In order to allow a "user has seen task x" feature every task should have a user/account status for the different users (creator, cc, receiver). * diff --git a/Theme/Backend/task-dashboard.tpl.php b/Theme/Backend/task-dashboard.tpl.php index 60f3a3d..3cb8be6 100644 --- a/Theme/Backend/task-dashboard.tpl.php +++ b/Theme/Backend/task-dashboard.tpl.php @@ -13,9 +13,10 @@ declare(strict_types=1); use Modules\Tasks\Models\TaskPriority; +use phpOMS\Uri\UriFactory; /** - * @todo Orange-Management/Modules#176 + * @todo Orange-Management/oms-Tasks#4 * Batch handle tasks in the dashboard list * In the dashboard/list it should be possible to change the status of a task without going into it (changing it to done is the most important). * This could be done with a button but also touch sliding/swiping should be possible for mobile. @@ -26,25 +27,29 @@ use Modules\Tasks\Models\TaskPriority; * @var \phpOMS\Views\View $this * @var \Modules\Tasks\Models\Task[] $tasks */ -$tasks = $this->getData('tasks'); +$tasks = $this->getData('tasks') ?? []; + +$previous = empty($tasks) ? '{/prefix}task/dashboard' : '{/prefix}task/dashboard?{?}&id=' . \reset($tasks)->getId() . '&ptype=-'; +$next = empty($tasks) ? '{/prefix}task/dashboard' : '{/prefix}task/dashboard?{?}&id=' . \end($tasks)->getId() . '&ptype=+'; + echo $this->getData('nav')->render(); ?>
| = $this->getHtml('Status') ?> | = $this->getHtml('Due/Priority') ?> - | = $this->getHtml('Title') ?> + | = $this->getHtml('Title') ?> | = $this->getHtml('Creator') ?> | = $this->getHtml('Created') ?> | $task) : ++$c; - $url = \phpOMS\Uri\UriFactory::build('{/prefix}task/single?{?}&id=' . $task->getId()); + $url = UriFactory::build('{/prefix}task/single?{?}&id=' . $task->getId()); ?>
| @@ -71,6 +76,10 @@ echo $this->getData('nav')->render(); ?> | |||||
| = $this->getHtml('Empty', '0', '0'); ?> | |||||