Guillermo - path get-mail-templates [skip ci]

This commit is contained in:
AntonyAntonio 2017-01-03 19:36:26 -03:00
parent fefe274d63
commit 1a600f4c61
5 changed files with 64 additions and 0 deletions

View File

@ -6,6 +6,7 @@ require_once 'system/add-department.php';
require_once 'system/edit-department.php'; require_once 'system/edit-department.php';
require_once 'system/delete-department.php'; require_once 'system/delete-department.php';
require_once 'system/get-logs.php'; require_once 'system/get-logs.php';
require_once 'system/get-mail-templates.php';
$systemControllerGroup = new ControllerGroup(); $systemControllerGroup = new ControllerGroup();
$systemControllerGroup->setGroupPath('/system'); $systemControllerGroup->setGroupPath('/system');
@ -17,5 +18,6 @@ $systemControllerGroup->addController(new AddDepartmentController);
$systemControllerGroup->addController(new EditDepartmentController); $systemControllerGroup->addController(new EditDepartmentController);
$systemControllerGroup->addController(new DeleteDepartmentController); $systemControllerGroup->addController(new DeleteDepartmentController);
$systemControllerGroup->addController(new GetLogsController); $systemControllerGroup->addController(new GetLogsController);
$systemControllerGroup->addController(new GetMailTemplatesController);
$systemControllerGroup->finalize(); $systemControllerGroup->finalize();

View File

@ -0,0 +1,18 @@
<?php
use Respect\Validation\Validator as DataValidator;
class EditMailController extends Controller {
const PATH = '/edit-mail';
public function validations() {
return [
'permission' => 'staff_3',
'requestData' => []
];
}
public function handler() {
Response::respondSuccess();
}
}

View File

@ -0,0 +1,18 @@
<?php
use Respect\Validation\Validator as DataValidator;
class GetMailTemplatesController extends Controller {
const PATH = '/get-mail-templates';
public function validations() {
return [
'permission' => 'staff_3',
'requestData' => []
];
}
public function handler() {
Response::respondSuccess(MailTemplate::getAll()->toArray());
}
}

View File

@ -0,0 +1,18 @@
<?php
use Respect\Validation\Validator as DataValidator;
class RecoverMailTemplateController extends Controller {
const PATH = '/recover-mail-template';
public function validations() {
return [
'permission' => 'staff_3',
'requestData' => []
];
}
public function handler() {
Response::respondSuccess();
}
}

View File

@ -46,4 +46,12 @@ class MailTemplate extends DataStore {
return $compiledString; return $compiledString;
} }
public function toArray() {
return [
'type' => $this->type,
'subject' => $this->subject,
'language' => $this->language,
'body' => $this->body,
];
}
} }