This commit is contained in:
Dennis Eichhorn 2024-01-02 23:34:19 +00:00
parent 65a785ce87
commit 9883f3c1f6
13 changed files with 45 additions and 37 deletions

View File

@ -72,7 +72,8 @@
"from": "Tasks",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1001101001,
"children": []
"children": [],
"status": 3
}
]
}

View File

@ -128,7 +128,7 @@ final class ApiController extends Controller
}
/**
* Method to create remeinder from request.
* Method to create reminder from request.
*
* @param RequestAbstract $request Request
*
@ -149,7 +149,7 @@ final class ApiController extends Controller
$unseen->reminderBy = new NullAccount($request->header->account);
$unseen->reminderAt = new \DateTime('now');
$remidner[] = $unseen;
$reminder[] = $unseen;
}
return $reminder;
@ -360,10 +360,10 @@ final class ApiController extends Controller
$task->descriptionRaw = $request->getDataString('plain') ?? '';
$task->setCreatedBy(new NullAccount($request->header->account));
$task->setStatus(TaskStatus::OPEN);
$task->setType(TaskType::SINGLE);
$task->setType($request->getDataInt('type') ?? TaskType::SINGLE);
$task->redirect = $request->getDataString('redirect') ?? '';
if (!$request->hasData('priority')) {
if ($request->hasData('due')) {
$task->due = $request->getDataDateTime('due');
} else {
$task->setPriority((int) $request->getData('priority'));

View File

@ -24,6 +24,7 @@ use Modules\Tasks\Models\TaskMapper;
use Modules\Tasks\Models\TaskSeen;
use Modules\Tasks\Models\TaskSeenMapper;
use Modules\Tasks\Models\TaskStatus;
use Modules\Tasks\Models\TaskType;
use Modules\Tasks\Views\TaskView;
use phpOMS\Account\PermissionType;
use phpOMS\Asset\AssetType;
@ -48,7 +49,7 @@ use phpOMS\Views\View;
final class BackendController extends Controller implements DashboardElementInterface
{
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -73,22 +74,21 @@ final class BackendController extends Controller implements DashboardElementInte
$mapperQuery = TaskMapper::getAnyRelatedToUser($request->header->account)
->with('tags')
->with('tags/title')
->with('createdBy')
->where('status', TaskStatus::OPEN, '!=')
->where('type', TaskType::SINGLE)
->where('tags/title/language', $response->header->l11n->language)
->sort('createdAt', OrderType::DESC)
->limit(25);
if ($request->getData('ptype') === 'p') {
$view->data['tasks'] = $mapperQuery->with('createdBy')
->where('id', $request->getDataInt('id') ?? 0, '<')
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '<')
->execute();
} elseif ($request->getData('ptype') === 'n') {
$view->data['tasks'] = $mapperQuery->with('createdBy')
->where('id', $request->getDataInt('id') ?? 0, '>')
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
->execute();
} else {
$view->data['tasks'] = $mapperQuery->with('createdBy')
->where('id', 0, '>')
$view->data['tasks'] = $mapperQuery->where('id', 0, '>')
->execute();
}
@ -97,6 +97,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view->data['task_media'][$task->id] = TaskMapper::has()
->with('media')
->where('id', $task->id)
->where('type', TaskType::SINGLE)
->execute();
}
@ -113,6 +114,7 @@ final class BackendController extends Controller implements DashboardElementInte
->with('tags')
->with('tags/title')
->where('tags/title/language', $response->header->l11n->language)
->where('type', TaskType::SINGLE)
->where('status', TaskStatus::OPEN)
->sort('createdAt', OrderType::DESC)
->query($openQuery)
@ -135,6 +137,7 @@ final class BackendController extends Controller implements DashboardElementInte
->with('tags')
->with('tags/title')
->where('tags/title/language', $response->header->l11n->language)
->where('type', TaskType::SINGLE)
->where('status', TaskStatus::OPEN)
->where('createdBy', $response->header->account, '=')
->sort('createdAt', OrderType::DESC)
@ -146,6 +149,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view->data['task_media'][$task->id] = TaskMapper::has()
->with('media')
->where('id', $task->id)
->where('type', TaskType::SINGLE)
->execute();
}
@ -170,6 +174,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view->data['task_media'][$task->id] = TaskMapper::has()
->with('media')
->where('id', $task->id)
->where('type', TaskType::SINGLE)
->execute();
}
@ -197,6 +202,7 @@ final class BackendController extends Controller implements DashboardElementInte
->sort('taskElements/createdAt', OrderType::DESC)
->limit(5)
->where('id', 0, '>')
->where('type', TaskType::SINGLE)
->where('tags/title/language', $response->header->l11n->language)
->execute();
@ -206,7 +212,7 @@ final class BackendController extends Controller implements DashboardElementInte
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -326,7 +332,7 @@ final class BackendController extends Controller implements DashboardElementInte
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -354,7 +360,7 @@ final class BackendController extends Controller implements DashboardElementInte
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response

View File

@ -17,7 +17,7 @@ namespace Modules\Tasks\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
* Permission category enum.
*
* @package Modules\Tasks\Models
* @license OMS License 2.0

View File

@ -104,9 +104,9 @@ class TaskAttributeValue implements \JsonSerializable
/**
* Localization
*
* @var null|BaseStringL11n
* @var string|BaseStringL11n
*/
public ?BaseStringL11n $l11n = null;
public string | BaseStringL11n $l11n = '';
/**
* Set l11n

View File

@ -329,6 +329,7 @@ final class TaskMapper extends DataMapperFactory
$query = new Builder(self::$db, true);
$query->innerJoin(TaskElementMapper::TABLE)
->on(self::TABLE . '_d1.task_id', '=', TaskElementMapper::TABLE . '.task_element_task')
->on(self::TABLE . '_d1.task_type', '=', TaskType::SINGLE)
->innerJoin(AccountRelationMapper::TABLE)
->on(TaskElementMapper::TABLE . '.task_element_id', '=', AccountRelationMapper::TABLE . '.task_account_task_element')
->where(AccountRelationMapper::TABLE . '.task_account_account', '=', $user)
@ -345,8 +346,8 @@ final class TaskMapper extends DataMapperFactory
WHERE
task.task_status != 1
AND (
task_account.task_account_account = $user
OR task.task_created_by = $user
task_account.task_account_account = {$user}
OR task.task_created_by = {$user}
)
LIMIT 25;
SQL;

View File

@ -21,7 +21,7 @@ use phpOMS\Uri\UriFactory;
<div id="news-dashboard" class="col-xs-12 col-md-6" draggable="true">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('News', 'News'); ?></div>
<table class="default">
<table class="default sticky">
<thead>
<td><?= $this->getHtml('Status', 'Tasks'); ?>
<td><?= $this->getHtml('Due/Priority', 'Tasks'); ?>

View File

@ -15,7 +15,7 @@ declare(strict_types=1);
return ['Tasks' => [
'Account' => 'الحساب',
'All' => 'الجميع',
'AverageAmount' => 'متوسط ​​المبلغ',
'AverageAmount' => "متوسط \u{200b}\u{200b}المبلغ",
'AverageProcessTime' => 'avg. وقت المعالجة',
'BCC' => 'bcc',
'By' => 'بواسطة',

View File

@ -22,7 +22,7 @@ $tasksList = $this->data['tasks'] ?? [];
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Tasks', 'Tasks'); ?></div>
<div class="slider">
<table class="default">
<table class="default sticky">
<thead>
<td><?= $this->getHtml('Status', 'Tasks'); ?>
<td><?= $this->getHtml('Due/Priority', 'Tasks'); ?>

View File

@ -23,7 +23,7 @@ echo $this->data['nav']->render(); ?>
<form>
<table class="layout wf-100">
<tr><td><label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<tr><td><span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="number" min="1" id="iAccount" name="account" placeholder="&#xf007; Guest" required></span>
<tr><td><span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="number" min="1" id="iAccount" name="account" placeholder="Guest" required></span>
<tr><td><label for="iFrom"><?= $this->getHtml('From'); ?></label>
<tr><td><input type="datetime-local" id="iFrom" name="from" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>">
<tr><td><label for="iTo"><?= $this->getHtml('To'); ?></label>

View File

@ -53,7 +53,7 @@ echo $this->data['nav']->render(); ?>
<div class="form-group">
<label for="iTitle"><?= $this->getHtml('Title'); ?></label>
<input type="text" id="iTitle" name="title" placeholder="&#xf040; <?= $this->getHtml('Title'); ?>" required>
<input type="text" id="iTitle" name="title" placeholder="<?= $this->getHtml('Title'); ?>" required>
</div>
<div class="form-group">
@ -80,7 +80,7 @@ echo $this->data['nav']->render(); ?>
<div class="form-group">
<label for="iMedia"><?= $this->getHtml('Media'); ?></label>
<div class="ipt-wrap wf-100">
<div class="ipt-first"><input type="text" id="iMedia" name="mediaFile" placeholder="&#xf15b; File"></div>
<div class="ipt-first"><input type="text" id="iMedia" name="mediaFile" placeholder="File"></div>
<div class="ipt-second"><button><?= $this->getHtml('Select'); ?></button></div>
</div>
</div>

View File

@ -29,8 +29,8 @@ echo $this->data['nav']->render(); ?>
<div class="tabview tab-2">
<div class="box">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('Overview'); ?></label></li>
<li><label for="c-tab-2"><?= $this->getHtml('Unread'); ?></label></li>
<li><label for="c-tab-1"><?= $this->getHtml('Overview'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Unread'); ?></label>
</ul>
</div>
<div class="tab-content">
@ -75,7 +75,7 @@ echo $this->data['nav']->render(); ?>
<?= $this->getHtml('P' . $task->getPriority()); ?>
<?php endif; ?>
</a>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">link</i>' : ''; ?>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">attachment</i>' : ''; ?>
<td data-label="<?= $this->getHtml('Title'); ?>">
<a href="<?= $url; ?>"><?= $this->printHtml($task->title); ?></a>
<td data-label="<?= $this->getHtml('Tag'); ?>">
@ -95,7 +95,7 @@ echo $this->data['nav']->render(); ?>
$task->createdBy->name1,
$task->createdBy->name2,
$task->createdBy->name3,
$task->createdBy->login ?? ''
$task->createdBy->login ?? '',
])
); ?>
</a>
@ -149,7 +149,7 @@ echo $this->data['nav']->render(); ?>
<?= $this->getHtml('P' . $task->getPriority()); ?>
<?php endif; ?>
</a>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">link</i>' : ''; ?>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">attachment</i>' : ''; ?>
<td data-label="<?= $this->getHtml('Title'); ?>">
<a href="<?= $url; ?>"><?= $this->printHtml($task->title); ?></a>
<td data-label="<?= $this->getHtml('Tag'); ?>">
@ -169,7 +169,7 @@ echo $this->data['nav']->render(); ?>
$task->createdBy->name1,
$task->createdBy->name2,
$task->createdBy->name3,
$task->createdBy->login ?? ''
$task->createdBy->login ?? '',
])
); ?>
</a>
@ -228,7 +228,7 @@ echo $this->data['nav']->render(); ?>
<?= $this->getHtml('P' . $task->getPriority()); ?>
<?php endif; ?>
</a>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">link</i>' : ''; ?>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">attachment</i>' : ''; ?>
<td data-label="<?= $this->getHtml('Title'); ?>">
<a href="<?= $url; ?>"><?= $this->printHtml($task->title); ?></a>
<td data-label="<?= $this->getHtml('Tag'); ?>">
@ -248,7 +248,7 @@ echo $this->data['nav']->render(); ?>
$task->createdBy->name1,
$task->createdBy->name2,
$task->createdBy->name3,
$task->createdBy->login ?? ''
$task->createdBy->login ?? '',
])
); ?>
</a>
@ -313,7 +313,7 @@ echo $this->data['nav']->render(); ?>
<?= $this->getHtml('P' . $task->getPriority()); ?>
<?php endif; ?>
</a>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">link</i>' : ''; ?>
<td><?= ($this->data['task_media'][$task->id] ?? false) === true ? '<i class="g-icon">attachment</i>' : ''; ?>
<td data-label="<?= $this->getHtml('Title'); ?>">
<a href="<?= $url; ?>"><?= $this->printHtml($task->title); ?></a>
<td data-label="<?= $this->getHtml('Tag'); ?>">
@ -333,7 +333,7 @@ echo $this->data['nav']->render(); ?>
$task->createdBy->name1,
$task->createdBy->name2,
$task->createdBy->name3,
$task->createdBy->login ?? ''
$task->createdBy->login ?? '',
])
); ?>
</a>

View File

@ -409,7 +409,7 @@ echo $this->data['nav']->render(); ?>
<div class="form-group">
<label for="iMedia"><?= $this->getHtml('Media'); ?></label>
<div class="ipt-wrap wf-100">
<div class="ipt-first"><input type="text" id="iMedia" placeholder="&#xf15b; File"></div>
<div class="ipt-first"><input type="text" id="iMedia" placeholder="File"></div>
<div class="ipt-second"><button><?= $this->getHtml('Select'); ?></button></div>
</div>
</div>