mirror of
https://github.com/Karaka-Management/oms-Tasks.git
synced 2026-02-13 13:18:40 +00:00
draft add functionality
This commit is contained in:
parent
70d2f68a9d
commit
bf59fb632e
|
|
@ -807,7 +807,6 @@ class Task implements \JsonSerializable
|
||||||
'priority' => $this->priority,
|
'priority' => $this->priority,
|
||||||
'due' => $this->due,
|
'due' => $this->due,
|
||||||
'done' => $this->done,
|
'done' => $this->done,
|
||||||
'elements' => $this->taskElements,
|
|
||||||
'tags' => $this->tags,
|
'tags' => $this->tags,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,31 +32,30 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 col-xs-12">
|
<div class="col-md-6 col-xs-12">
|
||||||
<div id="task" class="portlet"
|
<div id="task" class="portlet"
|
||||||
data-ui-content="#task"
|
data-update-content="#task"
|
||||||
data-ui-element="#task .portlet-head, #task .task-content"
|
data-update-element="#task .portlet-head, #task .task-content"
|
||||||
|
data-update-tpl="#headTpl, #contentTpl"
|
||||||
data-tag="form"
|
data-tag="form"
|
||||||
data-method="POST"
|
data-method="POST"
|
||||||
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task?id={?id}&csrf={$CSRF}'); ?>">
|
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task?id={?id}&csrf={$CSRF}'); ?>">
|
||||||
<template><!-- todo: this needs to be here for the form js to work (edit). find a way to remove these. maybe check if add functionality is available. --></template>
|
<?php if ($task->isEditable()) : ?>
|
||||||
<template><!-- todo: this needs to be here for the form js to work (edit). find a way to remove these. maybe check if add functionality is available. --></template>
|
<template id="headTpl">
|
||||||
<template>
|
<div class="portlet-head"><input type="text" data-tpl-text="/title" data-tpl-value="/title" data-value="" name="title"></div>
|
||||||
<div class="portlet-head"><input type="text" data-tpl-text="/title" data-tpl-value="/title" data-value="" name="title"></div>
|
</template>
|
||||||
</template>
|
<template id="contentTpl">
|
||||||
<template>
|
<div class="task-content">
|
||||||
<div class="task-content">
|
<!-- todo: bind js after adding template -->
|
||||||
<!-- todo: handle different value/markdown paths how??? no idea -->
|
<?= $this->getData('editor')->render('task-edit'); ?>
|
||||||
<!-- todo: bind js after adding template -->
|
<?= $this->getData('editor')->getData('text')->render(
|
||||||
<!-- todo: adding this multiple times doesn't work because the id and tab names collide, this needs to be adjusted dynamically in js!!! how? no idea yet. -->
|
'task-edit',
|
||||||
<?= $this->getData('editor')->render('task-edit'); ?>
|
'plain',
|
||||||
<?= $this->getData('editor')->getData('text')->render(
|
'taskElementEdit',
|
||||||
'task-edit',
|
'', '',
|
||||||
'plain',
|
'{/base}/api/task?id={?id}', '{/base}/api/task?id={?id}',
|
||||||
'taskElementEdit',
|
); ?>
|
||||||
'', '',
|
</div>
|
||||||
'{/base}/api/task?id={?id}', '{/base}/api/task?id={?id}',
|
</template>
|
||||||
); ?>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="portlet-head" data-tpl-text="/title" data-tpl-value="/title" data-value=""><?= $this->printHtml($task->getTitle()); ?></div>
|
<div class="portlet-head" data-tpl-text="/title" data-tpl-value="/title" data-value=""><?= $this->printHtml($task->getTitle()); ?></div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<span id="task-status-badge" class="floatRight nobreak tag task-status-<?= $this->printHtml($task->getStatus()); ?>">
|
<span id="task-status-badge" class="floatRight nobreak tag task-status-<?= $this->printHtml($task->getStatus()); ?>">
|
||||||
|
|
@ -105,26 +104,26 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="elements">
|
<div id="elements">
|
||||||
<!-- todo: this doesn't work because single taskelements cannot be identified somehow we need to work with ids of elements, implement a counter for the current element or implement a nearest() function instead of the this.closest() -->
|
<template id="elementTpl">
|
||||||
<?php if ($task->isEditable()) : ?>
|
<section id="taskelmenet-0" class="box wf-100 taskElement"
|
||||||
<template>
|
data-update-content="#elements"
|
||||||
<section id="taskelmenet-0" class="box wf-100 taskelement"
|
data-update-element=".taskElement .taskElement-content"
|
||||||
data-ui-content="#elements"
|
|
||||||
data-ui-element=".taskelement .taskelement-content"
|
|
||||||
data-tag="form"
|
data-tag="form"
|
||||||
data-method="POST"
|
data-method="POST"
|
||||||
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
|
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
|
||||||
<div class="inner pAlignTable">
|
<div class="inner pAlignTable">
|
||||||
<div class="vC wf-100">
|
<div class="vC wf-100">
|
||||||
<!-- created by --> - <!-- created at -->
|
<span data-tpl-text="{/base}/api/task/element?id={$id}" data-tpl-text-path="/0/response/createdBy/name/0"></span>
|
||||||
|
-
|
||||||
|
<span data-tpl-text="{/base}/api/task/element?id={$id}" data-tpl-text-path="/0/response/createdAt/date"></span>
|
||||||
</div>
|
</div>
|
||||||
<span class="vC tag task-status-0">
|
<span class="vC tag task-status-0">
|
||||||
<!-- status-->
|
<!-- status-->
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inner taskelement-content">
|
<div class="inner taskElement-content">
|
||||||
<article data-tpl-text="/content" data-tpl-value="{/api}task?id={?id}" data-tpl-value-path="/0/response/description" data-value=""></article>
|
<article data-tpl-text="{/base}/api/task/element?id={$id}" data-tpl-text-path="/0/response/description" data-value=""></article>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
|
|
@ -144,30 +143,28 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
<template>
|
<?php if ($task->isEditable()) : ?>
|
||||||
<div class="inner taskelement-content">
|
<template id="taskElementContentTpl">
|
||||||
<!-- todo: handle different value/markdown paths how??? no idea -->
|
<div class="inner taskElement-content">
|
||||||
<!-- todo: bind js after adding template -->
|
<!-- todo: bind js after adding template -->
|
||||||
<!-- todo: adding this multiple times doesn't work because the id and tab names collide, this needs to be adjusted dynamically in js!!! how? no idea yet. -->
|
<?= $this->getData('editor')->render('task-edit'); ?>
|
||||||
<?= $this->getData('editor')->render('task-edit'); ?>
|
<?= $this->getData('editor')->getData('text')->render(
|
||||||
<?= $this->getData('editor')->getData('text')->render(
|
'task-edit',
|
||||||
'task-edit',
|
'plain',
|
||||||
'plain',
|
'taskElementEdit',
|
||||||
'taskElementEdit',
|
'', '',
|
||||||
'', '',
|
'/content', '{/api}task?id={?id}'
|
||||||
'/content', '{/api}task?id={?id}'
|
); ?>
|
||||||
); ?>
|
</div>
|
||||||
<!--<textarea data-tpl-text="/content" data-tpl-value="/content" data-value=""></textarea>-->
|
</template>
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $c = 0; $previous = null;
|
<?php $c = 0; $previous = null;
|
||||||
foreach ($elements as $key => $element) : ++$c;
|
foreach ($elements as $key => $element) : ++$c;
|
||||||
if ($element->getDescription() !== '') :
|
if ($element->getDescription() !== '') :
|
||||||
?>
|
?>
|
||||||
<section id="taskelmenet-<?= $c; ?>" class="box wf-100 taskelement"
|
<section id="taskelmenet-<?= $c; ?>" class="box wf-100 taskElement"
|
||||||
data-ui-content="#elements"
|
data-update-content="#elements"
|
||||||
data-ui-element=".taskelement .taskelement-content"
|
data-update-element=".taskElement .taskElement-content"
|
||||||
data-tag="form"
|
data-tag="form"
|
||||||
data-method="POST"
|
data-method="POST"
|
||||||
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
|
data-uri="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
|
||||||
|
|
@ -181,8 +178,8 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($element->getDescription() !== '') : ?>
|
<?php if ($element->getDescription() !== '') : ?>
|
||||||
<div class="inner taskelement-content">
|
<div class="inner taskElement-content">
|
||||||
<article data-tpl-text="/content" data-tpl-value="{/api}task?id={?id}" data-tpl-value-path="/0/response/description" data-value=""><?= $element->getDescription(); ?></article>
|
<article data-tpl-text="/content" data-tpl-value="{/api}task/element?id={?id}" data-tpl-value-path="/0/response/description" data-value=""><?= $element->getDescription(); ?></article>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
@ -251,7 +248,13 @@ echo $this->getData('nav')->render(); ?>
|
||||||
|
|
||||||
<div class="col-md-6 col-xs-12">
|
<div class="col-md-6 col-xs-12">
|
||||||
<div class="portlet">
|
<div class="portlet">
|
||||||
<form id="taskElementCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
|
<form
|
||||||
|
id="taskElementCreate" method="PUT"
|
||||||
|
action="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>"
|
||||||
|
data-add-content="#elements"
|
||||||
|
data-add-element=".taskElement-content"
|
||||||
|
data-add-tpl="#elementTpl"
|
||||||
|
>
|
||||||
<div class="portlet-head"><?= $this->getHtml('Message') ?></div>
|
<div class="portlet-head"><?= $this->getHtml('Message') ?></div>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<table class="layout wf-100" style="table-layout: fixed">
|
<table class="layout wf-100" style="table-layout: fixed">
|
||||||
|
|
@ -298,7 +301,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-foot">
|
<div class="portlet-foot">
|
||||||
<input type="submit" id="iTaskElementCreateButton" name="taskElementCreateButton" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
<input class="add" data-form="" type="submit" id="iTaskElementCreateButton" name="taskElementCreateButton" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||||
<input type="hidden" name="task" value="<?= $this->printHtml($this->request->getData('id')); ?>"><input type="hidden" name="type" value="1">
|
<input type="hidden" name="task" value="<?= $this->printHtml($this->request->getData('id')); ?>"><input type="hidden" name="type" value="1">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user