diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cab9f5e..ad8944e 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,9 +12,7 @@ If you have a good idea for improvement feel free to create a new issue with all ### Issues -Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the `Project.md` file in the `Docs` repository. - -The issue information can be used to provide additional information such as priority, difficulty and type. For your first issue try to find a issue marked `[d:first]` or `[d:beginner]`. +Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the code marked with `@todo` or in the [PROJECT.md](https://github.com/Orange-Management/Docs/blob/master/Project/PROJECT.md) file. ### Code Style diff --git a/Models/NullSessionElement.php b/Models/NullSessionElement.php index 4ff9378..150019a 100755 --- a/Models/NullSessionElement.php +++ b/Models/NullSessionElement.php @@ -24,7 +24,7 @@ namespace Modules\HumanResourceTimeRecording\Models; */ final class NullSessionElement extends SessionElement { - /** + /** * Constructor * * @param int $id Model id diff --git a/Models/SessionElement.php b/Models/SessionElement.php index d05cbdd..3c468b7 100755 --- a/Models/SessionElement.php +++ b/Models/SessionElement.php @@ -61,8 +61,8 @@ class SessionElement implements \JsonSerializable, ArrayableInterface /** * Constructor. * - * @param Session $session Session id - * @param null|\DateTime $datetime DateTime of the session element + * @param Session $session Session id + * @param null|\DateTime $datetime DateTime of the session element * * @since 1.0.0 */ @@ -116,10 +116,10 @@ class SessionElement implements \JsonSerializable, ArrayableInterface public function toArray() : array { return [ - 'id' => $this->id, - 'status' => $this->status, + 'id' => $this->id, + 'status' => $this->status, 'datetime' => $this->datetime, - 'session' => $this->session, + 'session' => $this->session, ]; } diff --git a/Models/SessionMapper.php b/Models/SessionMapper.php index 59aca33..7d45021 100755 --- a/Models/SessionMapper.php +++ b/Models/SessionMapper.php @@ -143,7 +143,7 @@ final class SessionMapper extends DataMapperAbstract $dt = new SmartDateTime('now'); $dt->smartModify(0, 0, -32); - $depth = 2; + $depth = 3; $query = self::getQuery(); $query->where(self::$table . '_d' . $depth . '.hr_timerecording_session_employee', '=', $employee) ->andWhere(self::$table . '_d' . $depth . '.hr_timerecording_session_start', '>', $dt) diff --git a/Theme/Backend/private-session.tpl.php b/Theme/Backend/private-session.tpl.php index 2bb6765..4467a94 100755 --- a/Theme/Backend/private-session.tpl.php +++ b/Theme/Backend/private-session.tpl.php @@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>
- +
getStart()->format('Y-m-d'); ?>start->format('Y-m-d'); ?>
getHtml('Status'); ?> @@ -32,8 +32,8 @@ echo $this->getData('nav')->render(); ?>
getHtml('CS' . $element->getStatus()); ?> - getDatetime()->format('H:i:s'); ?> - getDatetime()->format('Y-m-d'); ?> + datetime->format('H:i:s'); ?> + datetime->format('Y-m-d'); ?>
diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 3a2c199..313fe2f 100644 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -16,6 +16,7 @@ namespace Modules\HumanResourceTimeRecording\tests\Controller; use Model\CoreSettings; use Modules\Admin\Models\AccountPermission; +use Modules\HumanResourceTimeRecording\Models\ClockingStatus; use phpOMS\Account\Account; use phpOMS\Account\AccountManager; use phpOMS\Account\PermissionType; @@ -29,10 +30,8 @@ use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Module\ModuleAbstract; use phpOMS\Module\ModuleManager; use phpOMS\Router\WebRouter; -use phpOMS\System\MimeType; use phpOMS\Uri\HttpUri; use phpOMS\Utils\TestUtils; -use Modules\HumanResourceTimeRecording\Models\ClockingStatus; /** * @testdox Modules\HumanResourceTimeRecording\tests\Controller\ApiControllerTest: HumanResourceTimeRecording api controller @@ -73,7 +72,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $permission = new AccountPermission(); $permission->setUnit(1); - $permission->setApp('backend'); + $permission->setApp('api'); $permission->setPermission( PermissionType::READ | PermissionType::CREATE diff --git a/tests/Models/SessionElementTest.php b/tests/Models/SessionElementTest.php index a5f80e2..f675e76 100755 --- a/tests/Models/SessionElementTest.php +++ b/tests/Models/SessionElementTest.php @@ -70,7 +70,7 @@ final class SessionElementTest extends \PHPUnit\Framework\TestCase self::assertEquals( [ - 'id' => 0, + 'id' => 0, 'status' => ClockingStatus::END, ], $serialized diff --git a/tests/Models/SessionMapperTest.php b/tests/Models/SessionMapperTest.php index edafc91..45201aa 100755 --- a/tests/Models/SessionMapperTest.php +++ b/tests/Models/SessionMapperTest.php @@ -46,7 +46,7 @@ final class SessionMapperTest extends \PHPUnit\Framework\TestCase self::assertEquals($session->getType(), $sessionR->getType()); self::assertGreaterThan(0, \count(SessionMapper::getLastSessionsFromAllEmployees())); - self::assertEquals(null, SessionMapper::getMostPlausibleOpenSessionForEmployee(9999)); + self::assertNull(SessionMapper::getMostPlausibleOpenSessionForEmployee(9999)); // @todo implement //self::assertGreaterThan(0, \count(SessionMapper::getSessionListForEmployee(1, (new \DateTime('now'))->modify('+1 month')))); diff --git a/tests/Models/SessionTest.php b/tests/Models/SessionTest.php index c0a6d1f..70c334f 100755 --- a/tests/Models/SessionTest.php +++ b/tests/Models/SessionTest.php @@ -121,8 +121,8 @@ final class SessionTest extends \PHPUnit\Framework\TestCase $element->setStatus(ClockingStatus::END); $this->session->addSessionElement($element); - self::assertEquals(2*60*60, $this->session->getBreak()); - self::assertEquals(7*60*60, $this->session->getBusy()); + self::assertEquals(2 * 60 * 60, $this->session->getBreak()); + self::assertEquals(7 * 60 * 60, $this->session->getBusy()); } /**