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
with:
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.'

View File

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

View File

@ -66,7 +66,7 @@ final class ApiAttributeController extends Controller
->where('id', (int) $request->getData('type'))
->execute();
if (!$type->repeatable) {
if (!$type->isRepeatable) {
$attr = TaskAttributeMapper::count()
->with('type')
->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
{
$accChecked = [];
$grpChecked = [];
$accChecked = [$ele->createdBy->id];
//$grpChecked = [];
$task = TaskMapper::get()
->with('taskElements')
->with('taskElements/accRelation')
->with('taskElements/grpRelation')
//->with('taskElements/grpRelation')
->where('id', $ele->task)
->execute();
@ -225,6 +225,8 @@ final class ApiController extends Controller
continue;
}
$accChecked[] = $rel->relation->id;
$profile = ProfileMapper::count()
->where('account', $rel->relation->id)
->executeCount();
@ -246,10 +248,10 @@ final class ApiController extends Controller
: $task->redirect;
$this->createModel($request->header->account, $notification, NotificationMapper::class, 'notification', $request->getOrigin());
$accChecked[] = $rel->relation->id;
}
// Group relations
/* Ignore groups since they are not directly mentioned
foreach ($element->grpRelation as $rel) {
if (\in_array($rel->relation->id, $grpChecked)) {
continue;
@ -291,6 +293,7 @@ final class ApiController extends Controller
$grpChecked[] = $rel->relation->id;
}
*/
}
}
@ -398,9 +401,11 @@ final class ApiController extends Controller
$task->priority = (int) $request->getData('priority');
}
/*
if ($request->hasData('tags')) {
$task->tags = $this->app->moduleManager->get('Tag', 'Api')->createTagsFromRequest($request);
}
*/
$element = new TaskElement();
$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->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001101001, $request, $response);
/** @var \Modules\Tasks\Models\Task[] $tasks */
$tasks = TaskMapper::getAnyRelatedToUser($request->header->account)
$limit = new \DateTime('now');
$limit->modify('+14 days');
$view->data['tasks'] = TaskMapper::getAnyRelatedToUser($request->header->account)
->with('tags')
->with('tags/title')
->sort('taskElements/createdAt', OrderType::DESC)
->limit(5)
->where('id', 0, '>')
->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)
->limit(5)
->execute();
$view->data['tasks'] = $tasks;
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_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_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_pattern' => ['name' => 'task_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'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(TaskSeenMapper::TABLE . '.task_seen_task', '=', null);
$sth = self::$db->con->prepare($query->toSql());
$sth->execute();
$sth = $query->execute();
$fetched = $sth->fetchAll(\PDO::FETCH_COLUMN);
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 class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('News', 'News'); ?></div>
<table class="default sticky">
<thead>
@ -55,5 +55,5 @@ use phpOMS\Uri\UriFactory;
<?php endif; ?>
</table>
<div class="portlet-foot"></div>
</div>
</section>
</div>

View File

@ -13,7 +13,7 @@
declare(strict_types=1);
return ['Navigation' => [
'Analysis' => 'Analyse',
'Analysis' => 'Auswertung',
'Create' => 'Erstellen',
'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 class="portlet">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Tasks', 'Tasks'); ?></div>
<div class="slider">
<table class="default sticky">
@ -59,5 +59,5 @@ $tasksList = $this->data['tasks'] ?? [];
<div class="portlet-foot">
<a class="button" href="<?= UriFactory::build('{/base}/task/dashboard?{?}'); ?>"><?= $this->getHtml('More', '0', '0'); ?></a>
</div>
</div>
</section>
</div>

View File

@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
<div class="row">
<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}'); ?>">
<div class="portlet-head"><?= $this->getHtml('Task'); ?></div>
<div class="portlet-body">
@ -69,11 +69,11 @@ echo $this->data['nav']->render(); ?>
<input type="hidden" name="type" value="<?= TaskType::SINGLE; ?>">
</div>
</form>
</div>
</section>
</div>
<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-body">
<form>
@ -91,7 +91,7 @@ echo $this->data['nav']->render(); ?>
</div>
</div>
</form>
</div>
</section>
</div>
</div>

View File

@ -32,7 +32,7 @@ echo $this->data['nav']->render(); ?>
<div class="tab">
<div class="row">
<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="slider">
<table id="taskList" class="default sticky">
@ -102,13 +102,13 @@ echo $this->data['nav']->render(); ?>
<?php endif; ?>
</table>
</div>
</div>
</section>
</div>
</div>
<div class="row">
<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="slider">
<table id="taskList" class="default sticky">
@ -172,7 +172,7 @@ echo $this->data['nav']->render(); ?>
<?php endif; ?>
</table>
</div>
</div>
</section>
</div>
</div>
</div>

View File

@ -26,7 +26,7 @@ echo $this->data['nav']->render(); ?>
<div class="row">
<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="slider">
<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($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
</div>
</section>
</div>
</div>

View File

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