bug fixes

This commit is contained in:
Dennis Eichhorn 2024-05-12 00:06:29 +00:00
parent 624670ce78
commit 4c47c96ad2
14 changed files with 40 additions and 32 deletions

View File

@ -9,5 +9,5 @@ jobs:
- uses: actions/first-interaction@v1 - uses: actions/first-interaction@v1
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
pr-message: 'Thank you for your pull request. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.'

View File

@ -34,6 +34,7 @@ return [
'dest' => '\Modules\Tasks\Controller\SearchController:searchGeneral', 'dest' => '\Modules\Tasks\Controller\SearchController:searchGeneral',
'verb' => RouteVerb::ANY, 'verb' => RouteVerb::ANY,
'active' => true, 'active' => true,
'order' => 2,
'permission' => [ 'permission' => [
'module' => SearchController::NAME, 'module' => SearchController::NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,

View File

@ -66,7 +66,7 @@ final class ApiAttributeController extends Controller
->where('id', (int) $request->getData('type')) ->where('id', (int) $request->getData('type'))
->execute(); ->execute();
if (!$type->repeatable) { if (!$type->isRepeatable) {
$attr = TaskAttributeMapper::count() $attr = TaskAttributeMapper::count()
->with('type') ->with('type')
->where('type/id', $type->id) ->where('type/id', $type->id)

View File

@ -201,13 +201,13 @@ final class ApiController extends Controller
*/ */
public function createNotifications(TaskElement $ele, int $type, RequestAbstract $request) : void public function createNotifications(TaskElement $ele, int $type, RequestAbstract $request) : void
{ {
$accChecked = []; $accChecked = [$ele->createdBy->id];
$grpChecked = []; //$grpChecked = [];
$task = TaskMapper::get() $task = TaskMapper::get()
->with('taskElements') ->with('taskElements')
->with('taskElements/accRelation') ->with('taskElements/accRelation')
->with('taskElements/grpRelation') //->with('taskElements/grpRelation')
->where('id', $ele->task) ->where('id', $ele->task)
->execute(); ->execute();
@ -225,6 +225,8 @@ final class ApiController extends Controller
continue; continue;
} }
$accChecked[] = $rel->relation->id;
$profile = ProfileMapper::count() $profile = ProfileMapper::count()
->where('account', $rel->relation->id) ->where('account', $rel->relation->id)
->executeCount(); ->executeCount();
@ -246,10 +248,10 @@ final class ApiController extends Controller
: $task->redirect; : $task->redirect;
$this->createModel($request->header->account, $notification, NotificationMapper::class, 'notification', $request->getOrigin()); $this->createModel($request->header->account, $notification, NotificationMapper::class, 'notification', $request->getOrigin());
$accChecked[] = $rel->relation->id;
} }
// Group relations // Group relations
/* Ignore groups since they are not directly mentioned
foreach ($element->grpRelation as $rel) { foreach ($element->grpRelation as $rel) {
if (\in_array($rel->relation->id, $grpChecked)) { if (\in_array($rel->relation->id, $grpChecked)) {
continue; continue;
@ -291,6 +293,7 @@ final class ApiController extends Controller
$grpChecked[] = $rel->relation->id; $grpChecked[] = $rel->relation->id;
} }
*/
} }
} }
@ -398,9 +401,11 @@ final class ApiController extends Controller
$task->priority = (int) $request->getData('priority'); $task->priority = (int) $request->getData('priority');
} }
/*
if ($request->hasData('tags')) { if ($request->hasData('tags')) {
$task->tags = $this->app->moduleManager->get('Tag', 'Api')->createTagsFromRequest($request); $task->tags = $this->app->moduleManager->get('Tag', 'Api')->createTagsFromRequest($request);
} }
*/
$element = new TaskElement(); $element = new TaskElement();
$element->addTo(new NullAccount($request->getDataInt('forward') ?? $request->header->account)); $element->addTo(new NullAccount($request->getDataInt('forward') ?? $request->header->account));

View File

@ -212,19 +212,22 @@ final class BackendController extends Controller implements DashboardElementInte
$view->setTemplate('/Modules/Tasks/Theme/Backend/dashboard-task'); $view->setTemplate('/Modules/Tasks/Theme/Backend/dashboard-task');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001101001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001101001, $request, $response);
/** @var \Modules\Tasks\Models\Task[] $tasks */ $limit = new \DateTime('now');
$tasks = TaskMapper::getAnyRelatedToUser($request->header->account) $limit->modify('+14 days');
$view->data['tasks'] = TaskMapper::getAnyRelatedToUser($request->header->account)
->with('tags') ->with('tags')
->with('tags/title') ->with('tags/title')
->sort('taskElements/createdAt', OrderType::DESC) ->sort('taskElements/createdAt', OrderType::DESC)
->limit(5)
->where('id', 0, '>') ->where('id', 0, '>')
->where('type', TaskType::SINGLE) ->where('type', TaskType::SINGLE)
->where('start', $limit->format('Y-m-d'), '<')
->where('due', $limit->format('Y-m-d'), '<')
->where('done', null)
->where('tags/title/language', $response->header->l11n->language) ->where('tags/title/language', $response->header->l11n->language)
->limit(5)
->execute(); ->execute();
$view->data['tasks'] = $tasks;
return $view; return $view;
} }

View File

@ -42,7 +42,7 @@ final class TaskAttributeTypeMapper extends DataMapperFactory
'task_attr_type_datatype' => ['name' => 'task_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], 'task_attr_type_datatype' => ['name' => 'task_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'task_attr_type_fields' => ['name' => 'task_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], 'task_attr_type_fields' => ['name' => 'task_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'task_attr_type_custom' => ['name' => 'task_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], 'task_attr_type_custom' => ['name' => 'task_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'task_attr_type_repeatable' => ['name' => 'task_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], 'task_attr_type_repeatable' => ['name' => 'task_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'],
'task_attr_type_internal' => ['name' => 'task_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'], 'task_attr_type_internal' => ['name' => 'task_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
'task_attr_type_pattern' => ['name' => 'task_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], 'task_attr_type_pattern' => ['name' => 'task_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'task_attr_type_required' => ['name' => 'task_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], 'task_attr_type_required' => ['name' => 'task_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],

View File

@ -417,8 +417,7 @@ final class TaskMapper extends DataMapperFactory
->andWhere(AccountRelationMapper::TABLE . '.task_account_account', '=', $user) ->andWhere(AccountRelationMapper::TABLE . '.task_account_account', '=', $user)
->andWhere(TaskSeenMapper::TABLE . '.task_seen_task', '=', null); ->andWhere(TaskSeenMapper::TABLE . '.task_seen_task', '=', null);
$sth = self::$db->con->prepare($query->toSql()); $sth = $query->execute();
$sth->execute();
$fetched = $sth->fetchAll(\PDO::FETCH_COLUMN); $fetched = $sth->fetchAll(\PDO::FETCH_COLUMN);
if ($fetched === false) { if ($fetched === false) {

View File

@ -19,7 +19,7 @@ use phpOMS\Uri\UriFactory;
?> ?>
<div id="news-dashboard" class="col-xs-12 col-md-6" draggable="true"> <div id="news-dashboard" class="col-xs-12 col-md-6" draggable="true">
<div class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('News', 'News'); ?></div> <div class="portlet-head"><?= $this->getHtml('News', 'News'); ?></div>
<table class="default sticky"> <table class="default sticky">
<thead> <thead>
@ -55,5 +55,5 @@ use phpOMS\Uri\UriFactory;
<?php endif; ?> <?php endif; ?>
</table> </table>
<div class="portlet-foot"></div> <div class="portlet-foot"></div>
</div> </section>
</div> </div>

View File

@ -13,7 +13,7 @@
declare(strict_types=1); declare(strict_types=1);
return ['Navigation' => [ return ['Navigation' => [
'Analysis' => 'Analyse', 'Analysis' => 'Auswertung',
'Create' => 'Erstellen', 'Create' => 'Erstellen',
'Tasks' => 'Aufgaben', 'Tasks' => 'Aufgaben',
]]; ]];

View File

@ -19,7 +19,7 @@ $tasksList = $this->data['tasks'] ?? [];
?> ?>
<div id="tasks-dashboard" class="col-xs-12 col-md-6" draggable="true"> <div id="tasks-dashboard" class="col-xs-12 col-md-6" draggable="true">
<div class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Tasks', 'Tasks'); ?></div> <div class="portlet-head"><?= $this->getHtml('Tasks', 'Tasks'); ?></div>
<div class="slider"> <div class="slider">
<table class="default sticky"> <table class="default sticky">
@ -59,5 +59,5 @@ $tasksList = $this->data['tasks'] ?? [];
<div class="portlet-foot"> <div class="portlet-foot">
<a class="button" href="<?= UriFactory::build('{/base}/task/dashboard?{?}'); ?>"><?= $this->getHtml('More', '0', '0'); ?></a> <a class="button" href="<?= UriFactory::build('{/base}/task/dashboard?{?}'); ?>"><?= $this->getHtml('More', '0', '0'); ?></a>
</div> </div>
</div> </section>
</div> </div>

View File

@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<div class="portlet"> <section class="portlet">
<form id="fTask" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task?{?}&csrf={$CSRF}'); ?>"> <form id="fTask" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task?{?}&csrf={$CSRF}'); ?>">
<div class="portlet-head"><?= $this->getHtml('Task'); ?></div> <div class="portlet-head"><?= $this->getHtml('Task'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
@ -69,11 +69,11 @@ echo $this->data['nav']->render(); ?>
<input type="hidden" name="type" value="<?= TaskType::SINGLE; ?>"> <input type="hidden" name="type" value="<?= TaskType::SINGLE; ?>">
</div> </div>
</form> </form>
</div> </section>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<div class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Media'); ?></div> <div class="portlet-head"><?= $this->getHtml('Media'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<form> <form>
@ -91,7 +91,7 @@ echo $this->data['nav']->render(); ?>
</div> </div>
</div> </div>
</form> </form>
</div> </section>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@ echo $this->data['nav']->render(); ?>
<div class="tab"> <div class="tab">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('YourOpen'); ?> (<?= \count($open); ?>)<i class="g-icon download btn end-xs">download</i></div> <div class="portlet-head"><?= $this->getHtml('YourOpen'); ?> (<?= \count($open); ?>)<i class="g-icon download btn end-xs">download</i></div>
<div class="slider"> <div class="slider">
<table id="taskList" class="default sticky"> <table id="taskList" class="default sticky">
@ -102,13 +102,13 @@ echo $this->data['nav']->render(); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>
</div> </section>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('OpenGiven'); ?> (<?= \count($this->data['given']); ?>)<i class="g-icon download btn end-xs">download</i></div> <div class="portlet-head"><?= $this->getHtml('OpenGiven'); ?> (<?= \count($this->data['given']); ?>)<i class="g-icon download btn end-xs">download</i></div>
<div class="slider"> <div class="slider">
<table id="taskList" class="default sticky"> <table id="taskList" class="default sticky">
@ -172,7 +172,7 @@ echo $this->data['nav']->render(); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </div>
</div> </section>
</div> </div>
</div> </div>
</div> </div>

View File

@ -26,7 +26,7 @@ echo $this->data['nav']->render(); ?>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('All'); ?><i class="g-icon download btn end-xs">download</i></div> <div class="portlet-head"><?= $this->getHtml('All'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider"> <div class="slider">
<table id="taskList" class="default sticky"> <table id="taskList" class="default sticky">
@ -101,6 +101,6 @@ echo $this->data['nav']->render(); ?>
<a class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a> <a class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a> <a class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div> </div>
</div> </section>
</div> </div>
</div> </div>

View File

@ -386,13 +386,13 @@ echo $this->data['nav']->render(); ?>
<div class="form-group wf-100"> <div class="form-group wf-100">
<div class="more-container wf-100"> <div class="more-container wf-100">
<input id="more-customer-sales" type="checkbox" name="more-container"> <input id="more-customer-sales" class="more" type="checkbox" name="more-container">
<label for="more-customer-sales"> <label class="more" for="more-customer-sales">
<span><?= $this->getHtml('Advanced'); ?></span> <span><?= $this->getHtml('Advanced'); ?></span>
<i class="g-icon expand">chevron_right</i> <i class="g-icon expand">chevron_right</i>
</label> </label>
<div class="form-group"> <div class="form-group more">
<label for="iPriority"><?= $this->getHtml('Priority'); ?></label> <label for="iPriority"><?= $this->getHtml('Priority'); ?></label>
<select id="iPriority" name="priority"> <select id="iPriority" name="priority">
<option value="<?= TaskPriority::NONE; ?>"<?= $task->priority === TaskPriority::NONE ? ' selected' : '';?>><?= $this->getHtml('P0'); ?> <option value="<?= TaskPriority::NONE; ?>"<?= $task->priority === TaskPriority::NONE ? ' selected' : '';?>><?= $this->getHtml('P0'); ?>