mirror of
https://github.com/Karaka-Management/oms-HumanResourceTimeRecording.git
synced 2026-01-11 11:58:47 +00:00
fix templates
This commit is contained in:
parent
c74dfde014
commit
084f93c9ab
|
|
@ -149,18 +149,6 @@ class Session implements \JsonSerializable
|
||||||
$this->busy = $busyTime;
|
$this->busy = $busyTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all session elements
|
|
||||||
*
|
|
||||||
* @return SessionElement[]
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getSessionElements() : array
|
|
||||||
{
|
|
||||||
return $this->sessionElements;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare session elements
|
* Compare session elements
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="portlet">
|
<section class="portlet">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Status'); ?><i class="g-icon download btn end-xs">download</i></div>
|
<div class="portlet-head"><?= $this->getHtml('Status'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||||
<div class="slider">
|
<div class="slider">
|
||||||
<table id="employeeList" class="default sticky">
|
<table id="employeeList" class="default sticky">
|
||||||
|
|
@ -55,5 +55,6 @@ echo $this->data['nav']->render(); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,28 +14,34 @@ declare(strict_types=1);
|
||||||
|
|
||||||
/** @var \Modules\HumanResourceTimeRecording\Models\Session $session */
|
/** @var \Modules\HumanResourceTimeRecording\Models\Session $session */
|
||||||
$session = $this->data['session'];
|
$session = $this->data['session'];
|
||||||
$elements = $session->getSessionElements();
|
$elements = $session->sessionElements;
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box wf-100">
|
<section class="portlet">
|
||||||
|
<div class="portlet-head"><?= $session->start->format('Y-m-d'); ?></div>
|
||||||
<table id="sessionList" class="default sticky">
|
<table id="sessionList" class="default sticky">
|
||||||
<caption><?= $session->start->format('Y-m-d'); ?><i class="g-icon end-xs download btn">download</i></caption>
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $this->getHtml('Status'); ?>
|
<td><?= $this->getHtml('Status'); ?>
|
||||||
<td class="wf-100"><?= $this->getHtml('Time'); ?>
|
<td class="wf-100"><?= $this->getHtml('Time'); ?>
|
||||||
<td class="wf-100"><?= $this->getHtml('Date'); ?>
|
<td class="wf-100"><?= $this->getHtml('Date'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($elements as $element) : ?>
|
<?php
|
||||||
|
$c = 0;
|
||||||
|
foreach ($elements as $element) :
|
||||||
|
++$c;
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $this->getHtml('CS' . $element->getStatus()); ?>
|
<td><?= $this->getHtml('CS' . $element->status); ?>
|
||||||
<td><?= $element->datetime->format('H:i:s'); ?>
|
<td><?= $element->datetime->format('H:i:s'); ?>
|
||||||
<td><?= $element->datetime->format('Y-m-d'); ?>
|
<td><?= $element->datetime->format('Y-m-d'); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php if ($c === 0) : ?>
|
||||||
|
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -41,7 +41,7 @@ final class SessionTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals(0, $this->session->id);
|
self::assertEquals(0, $this->session->id);
|
||||||
self::assertEquals(0, $this->session->busy);
|
self::assertEquals(0, $this->session->busy);
|
||||||
self::assertEquals(0, $this->session->getBreak());
|
self::assertEquals(0, $this->session->getBreak());
|
||||||
self::assertEquals([], $this->session->getSessionElements());
|
self::assertEquals([], $this->session->sessionElements);
|
||||||
self::assertEquals(ClockingType::OFFICE, $this->session->type);
|
self::assertEquals(ClockingType::OFFICE, $this->session->type);
|
||||||
self::assertEquals(ClockingStatus::START, $this->session->getStatus());
|
self::assertEquals(ClockingStatus::START, $this->session->getStatus());
|
||||||
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->session->start->format('Y-m-d'));
|
self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->session->start->format('Y-m-d'));
|
||||||
|
|
@ -107,14 +107,6 @@ final class SessionTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals(7 * 60 * 60, $this->session->busy);
|
self::assertEquals(7 * 60 * 60, $this->session->busy);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
|
||||||
public function testSessionElementInputOutput() : void
|
|
||||||
{
|
|
||||||
$element = new SessionElement(null, new \DateTime('now'));
|
|
||||||
$this->session->addSessionElement($element);
|
|
||||||
self::assertCount(1, $this->session->getSessionElements());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
public function testSerialize() : void
|
public function testSerialize() : void
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user