* @since Version 3.0 */ class cmsBuys { public cmsBuysController $controller; public function __construct($uriData) { $DIR = __DIR__ ?: dirname(__FILE__); $this->controller = new cmsBuysController($uriData, $DIR, basename($DIR)); } public function run() { switch (getV('action')) { case 'selfSave': if (getV('id') && $this->controller->oUser->chkPermission('CMS_APP_BUYS_EDIT', false, false)) { cJSON::sendok($this->controller->saveRecordData(getV('id'), getP('fields'))); } cJSON::senderror(); case 'getDropDownData': cJSON::sendok($this->controller->getDropDownData(getV('data'))); case 'loadClassification': cJSON::sendok($this->controller->loadClassification(getV('id'))); case 'getProductsByPartnerId': cJSON::sendok($this->controller->getProductsByPartnerId(getV('id'))); default: $this->controller->run(); break; } } }