mirror of
https://github.com/Karaka-Management/oms-Tasks.git
synced 2026-01-10 15:18:40 +00:00
fix templates
This commit is contained in:
parent
98d1d5404a
commit
4cc1911a74
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -162,17 +162,11 @@ 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)
|
||||
$mapperQuery = $isModerator
|
||||
? TaskMapper::getAll()
|
||||
: TaskMapper::getAnyRelatedToUser($request->header->account);
|
||||
|
||||
$view->data['tasks'] = $mapperQuery
|
||||
->with('tags')
|
||||
->with('tags/title')
|
||||
->with('createdBy')
|
||||
|
|
@ -180,19 +174,13 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
->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->where('id', $request->getDataInt('offset') ?? 0, '<')
|
||||
->limit(25)
|
||||
->paginate(
|
||||
'id',
|
||||
$request->getData('ptype'),
|
||||
$request->getDataInt('offset')
|
||||
)
|
||||
->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['task_media'] = [];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user