fix templates

This commit is contained in:
Dennis Eichhorn 2024-04-17 17:45:07 +00:00
parent 98d1d5404a
commit 4cc1911a74
3 changed files with 39 additions and 34 deletions

View File

@ -33,6 +33,19 @@
"default_value": "",
"values": []
},
{
"name": "bill",
"l11n": {
"en": "Bill",
"de": "Beleg"
},
"value_type": "int",
"is_custom_allowed": true,
"validation_pattern": "",
"is_required": false,
"default_value": "",
"values": []
},
{
"name": "lot_external",
"l11n": {
@ -102,7 +115,7 @@
{
"name": "measure",
"l11n": {
"en": "measure",
"en": "Measure",
"de": "Maßnahme"
},
"value_type": 1,

View File

@ -197,7 +197,7 @@ final class ApiController extends Controller
*
* @since 1.0.0
*/
private function createNotifications(TaskElement $ele, int $type, RequestAbstract $request) : void
public function createNotifications(TaskElement $ele, int $type, RequestAbstract $request) : void
{
$accChecked = [];
$grpChecked = [];
@ -239,7 +239,9 @@ final class ApiController extends Controller
$notification->type = $type;
$notification->category = PermissionCategory::TASK;
$notification->element = $task->id;
$notification->redirect = '{/base}/task/view?{?}&id=' . $element->task;
$notification->redirect = empty($task->redirect)
? '{/base}/task/view?{?}&id=' . $element->task
: $task->redirect;
$this->createModel($request->header->account, $notification, NotificationMapper::class, 'notification', $request->getOrigin());
$accChecked[] = $rel->relation->id;
@ -277,7 +279,9 @@ final class ApiController extends Controller
$notification->type = $type;
$notification->category = PermissionCategory::TASK;
$notification->element = $task->id;
$notification->redirect = '{/base}/task/view?{?}&id=' . $element->task;
$notification->redirect = empty($task->redirect)
? '{/base}/task/view?{?}&id=' . $element->task
: $task->redirect;
$this->createModel($request->header->account, $notification, NotificationMapper::class, 'notification', $request->getOrigin());
$accChecked[] = $account->id;

View File

@ -162,37 +162,25 @@ final class BackendController extends Controller implements DashboardElementInte
$view->setTemplate('/Modules/Tasks/Theme/Backend/task-list');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001101001, $request, $response);
if ($isModerator) {
$mapperQuery = TaskMapper::getAll()
->with('tags')
->with('tags/title')
->with('createdBy')
->where('status', TaskStatus::OPEN, '!=')
->where('type', TaskType::SINGLE)
->sort('createdAt', OrderType::DESC)
->limit(25);
} else {
$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);
}
$mapperQuery = $isModerator
? TaskMapper::getAll()
: TaskMapper::getAnyRelatedToUser($request->header->account);
if ($request->getData('ptype') === 'p') {
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '<')
->executeGetArray();
} elseif ($request->getData('ptype') === 'n') {
$view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '>')
->executeGetArray();
} else {
$view->data['tasks'] = $mapperQuery->where('id', 0, '>')
->executeGetArray();
}
$view->data['tasks'] = $mapperQuery
->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)
->paginate(
'id',
$request->getData('ptype'),
$request->getDataInt('offset')
)
->executeGetArray();
$view->data['task_media'] = [];