* logger added

* calendar view in maintenance
* $year filter support in xlsx and maintenance
This commit is contained in:
Danyi Dávid
2018-11-19 16:48:12 +01:00
parent b906e360bf
commit 4d52d4b575
13 changed files with 392 additions and 131 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Handler;
use ApiLibs\AbstractHandler\CrudHandler;
use App\Service\MaintenanceManagerService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
class MaintenanceCalendarHandler extends CrudHandler
{
/** @var MaintenanceManagerService */
private $maintenanceManagerService;
public function __construct(MaintenanceManagerService $maintenanceManagerService)
{
$this->maintenanceManagerService = $maintenanceManagerService;
}
/**
* Renew auth token
*
* @param ServerRequestInterface $request
* @return ResponseInterface
* @throws \PHPExcel_Exception
* @throws \PHPExcel_Reader_Exception
*/
public function getList(ServerRequestInterface $request): ResponseInterface
{
$year = (int)$request->getAttribute('year', date("Y"));
return new JsonResponse($this->maintenanceManagerService->getCalendarMaintenanceList($year));
}
}