mirror of
https://github.com/Karaka-Management/oms-Tasks.git
synced 2026-01-11 07:38:39 +00:00
fix responsible
This commit is contained in:
parent
854cad4c1d
commit
f524e490f4
|
|
@ -136,6 +136,9 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
->with('createdBy')
|
->with('createdBy')
|
||||||
->with('tags')
|
->with('tags')
|
||||||
->with('tags/title')
|
->with('tags/title')
|
||||||
|
->with('taskElements')
|
||||||
|
->with('taskElements/accRelation')
|
||||||
|
->with('taskElements/accRelation/relation')
|
||||||
->where('tags/title/language', $response->header->l11n->language)
|
->where('tags/title/language', $response->header->l11n->language)
|
||||||
->where('type', TaskType::SINGLE)
|
->where('type', TaskType::SINGLE)
|
||||||
->where('status', TaskStatus::OPEN)
|
->where('status', TaskStatus::OPEN)
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,31 @@ class Task implements \JsonSerializable
|
||||||
return $this->taskElements[$id] ?? new NullTaskElement();
|
return $this->taskElements[$id] ?? new NullTaskElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getResponsible() : array
|
||||||
|
{
|
||||||
|
$responsible = [];
|
||||||
|
foreach ($this->taskElements as $element) {
|
||||||
|
if (empty($element->accRelation)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$first = true;
|
||||||
|
|
||||||
|
foreach ($element->accRelation as $accRel) {
|
||||||
|
if ($accRel->duty === DutyType::TO) {
|
||||||
|
if ($first) {
|
||||||
|
$responsible = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$responsible[] = $accRel->relation;
|
||||||
|
$first = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $responsible;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -161,24 +161,18 @@ echo $this->data['nav']->render(); ?>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<td data-label="<?= $this->getHtml('Creator'); ?>">
|
<td><?php $responsibles = $task->getResponsible();
|
||||||
<a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $task->createdBy->id); ?>">
|
foreach ($responsibles as $responsible) : ?>
|
||||||
<?= $this->printHtml($this->renderUserName(
|
<a class="content" href="<?= UriFactory::build('{/base}/profile/view?for=' . $responsible->id); ?>">
|
||||||
'%3$s %2$s %1$s',
|
<?= $this->printHtml($responsible->name1); ?> <?= $this->printHtml($responsible->name2); ?>
|
||||||
[
|
</a>
|
||||||
$task->createdBy->name1,
|
<?php endforeach; ?>
|
||||||
$task->createdBy->name2,
|
|
||||||
$task->createdBy->name3,
|
|
||||||
$task->createdBy->login ?? '',
|
|
||||||
])
|
|
||||||
); ?>
|
|
||||||
</a>
|
|
||||||
<td data-label="<?= $this->getHtml('Created'); ?>">
|
<td data-label="<?= $this->getHtml('Created'); ?>">
|
||||||
<a href="<?= $url; ?>"><?= $this->printHtml($task->createdAt->format('Y-m-d H:i')); ?></a>
|
<a href="<?= $url; ?>"><?= $this->printHtml($task->createdAt->format('Y-m-d H:i')); ?></a>
|
||||||
<?php endforeach; if ($c == 0) : ?>
|
<?php endforeach; if ($c == 0) : ?>
|
||||||
<tr><td colspan="7" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
<tr><td colspan="7" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user