Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| MailTemplateCreateCustomization | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
| readResponse | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package Zmsadmin |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
| 6 | **/ |
| 7 | |
| 8 | namespace BO\Zmsadmin\Helper; |
| 9 | |
| 10 | use BO\Zmsadmin\BaseController; |
| 11 | use BO\Zmsentities\Availability as Entity; |
| 12 | use BO\Zmsentities\Collection\AvailabilityList as Collection; |
| 13 | use BO\Zmsentities\Collection\ProcessList; |
| 14 | |
| 15 | class MailTemplateCreateCustomization extends BaseController |
| 16 | { |
| 17 | /** |
| 18 | * @SuppressWarnings(Param) |
| 19 | * @return \Psr\Http\Message\ResponseInterface |
| 20 | */ |
| 21 | public function readResponse( |
| 22 | \Psr\Http\Message\RequestInterface $request, |
| 23 | \Psr\Http\Message\ResponseInterface $response, |
| 24 | array $args |
| 25 | ) { |
| 26 | $validator = $request->getAttribute('validator'); |
| 27 | $input = $validator->getInput()->isJson()->getValue(); |
| 28 | |
| 29 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity(); |
| 30 | $providerId = $workstation->scope['provider']['id']; |
| 31 | |
| 32 | if (isset($args['id']) && !empty($args['id'])) { |
| 33 | $scope = \App::$http |
| 34 | ->readGetResult('/scope/' . $args['id'] . '/', ['resolveReferences' => 1]) |
| 35 | ->getEntity(); |
| 36 | |
| 37 | $providerId = $scope->provider->id; |
| 38 | } |
| 39 | |
| 40 | $template = \App::$http->readPostResult('/mailtemplates-create-customization/', array( |
| 41 | "providerId" => $providerId, |
| 42 | "templateName" => $input['templateName'], |
| 43 | "templateContent" => $input['templateContent'] |
| 44 | ))->getEntity(); |
| 45 | |
| 46 | return \BO\Slim\Render::withJson( |
| 47 | $response, |
| 48 | $template |
| 49 | ); |
| 50 | } |
| 51 | } |