* [MOD] Implemented in-line client/category creation from account view

* [FIX] Minor bugfixes
This commit is contained in:
nuxsmin
2018-01-22 23:51:50 +01:00
parent 0ed17a8f46
commit 2beb9c8bd3
9 changed files with 122 additions and 66 deletions

View File

@@ -27,7 +27,10 @@ namespace SP\Modules\Web\Controllers;
use SP\Controller\RequestControllerTrait;
use SP\Core\SessionUtil;
use SP\DataModel\DataModelInterface;
use SP\Mvc\View\Components\SelectItemAdapter;
use SP\Services\Account\AccountService;
use SP\Services\Category\CategoryService;
use SP\Services\Client\ClientService;
use SP\Util\Json;
/**
@@ -74,6 +77,24 @@ class ItemsController
Json::returnJson($this->JsonResponse);
}
/**
* @throws \SP\Core\Dic\ContainerException
* @throws \SP\Core\Exceptions\SPException
*/
public function clientsAction()
{
Json::returnRawJson((new SelectItemAdapter((new ClientService())->getAllForUser()))->getJsonItemsFromModel());
}
/**
* @throws \SP\Core\Dic\ContainerException
* @throws \SP\Core\Exceptions\SPException
*/
public function categoriesAction()
{
Json::returnRawJson((new SelectItemAdapter((new CategoryService())->getAllBasic()))->getJsonItemsFromModel());
}
/**
* Preparar los elementos para devolverlos
*