tpl fixes, dont use printHtml for none-string types

This commit is contained in:
Dennis Eichhorn 2020-12-06 11:13:19 +01:00
parent 8ffb44f4a6
commit 3a96d97d0a
3 changed files with 12 additions and 12 deletions

View File

@ -42,10 +42,10 @@ echo $this->getData('nav')->render(); ?>
<?php $c = 0; foreach ($departments as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}hr/department/single?{?}&id=' . $value->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td data-label="<?= $this->getHtml('Employees'); ?>">
<td data-label="<?= $this->getHtml('Parent'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->parent->getName()); ?></a>
<td data-label="<?= $this->getHtml('Parent'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->parent->name); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -38,13 +38,13 @@ echo $this->getData('nav')->render(); ?>
<?php $c = 0; foreach ($employees as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}humanresource/staff/profile?{?}&id=' . $value->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml(
\sprintf('%3$s %2$s %1$s', $value->profile->account->name1, $value->profile->account->name2, $value->profile->account->name3)
); ?></a>
<td><?= $this->printHtml($value->getNewestHistory()->getUnit()->getName()); ?>
<td><?= $this->printHtml($value->getNewestHistory()->getPosition()->getName()); ?>
<td><?= $this->printHtml($value->getNewestHistory()->getDepartment()->getName()); ?>
<td><?= $this->printHtml($value->getNewestHistory()->getUnit()->name); ?>
<td><?= $this->printHtml($value->getNewestHistory()->getPosition()->name); ?>
<td><?= $this->printHtml($value->getNewestHistory()->getDepartment()->name); ?>
<td><?= !($value->getNewestHistory() instanceof NullEmployeeHistory) ? $this->getHtml('Active') : $this->getHtml('Inactive'); ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>

View File

@ -59,13 +59,13 @@ echo $this->getData('nav')->render(); ?>
<table class="list">
<tr>
<th><?= $this->getHtml('Position'); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->getPosition()->getName()); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->getPosition()->name); ?>
<tr>
<th><?= $this->getHtml('Department'); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->getDepartment()->getName()); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->getDepartment()->name); ?>
<tr>
<th><?= $this->getHtml('Unit'); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->getUnit()->getName()); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->getUnit()->name); ?>
<tr>
<th><?= $this->getHtml('Birthday'); ?>
<td itemprop="birthDate">06.09.1934
@ -119,9 +119,9 @@ echo $this->getData('nav')->render(); ?>
<?php foreach ($history as $hist) : ?>
<tr><td><?= $hist->getStart()->format('Y-m-d'); ?>
<td><?= $hist->getEnd() === null ? '' : $hist->getEnd()->format('Y-m-d'); ?>
<td><?= $this->printHtml($hist->getUnit()->getName()); ?>
<td><?= $this->printHtml($hist->getDepartment()->getName()); ?>
<td><?= $this->printHtml($hist->getPosition()->getName()); ?>
<td><?= $this->printHtml($hist->getUnit()->name); ?>
<td><?= $this->printHtml($hist->getDepartment()->name); ?>
<td><?= $this->printHtml($hist->getPosition()->name); ?>
<?php endforeach; ?>
</table>
</div>