meraproject/themes/merakomis/dictionary/contractor/status/controller.php
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

56 lines
2.0 KiB
PHP

<?
namespace controller\themes\merakomis\dictionary\contractor\status;
use core\core\structure\eRowClick;
use ms\ms\structure\msControllerTable;
use themes\Merakomis;
use themes\merakomis\dictionary\contractor\Status;
use themes\merakomis\Emp;
use themes\merakomis\structure\merakomisControllerTable;
use themes\merakomis\structure\merakomisModuleTable;
class Api extends merakomisControllerTable {
/** @var merakomisModuleTable */
static $class = 'themes\merakomis\dictionary\contractor\Status';
public static function getForm() {
$res = [];
if(Emp::$IS_AUTH) {
$_POST[static::$class::$ID] = $_POST['id'];
$res = static::$class::getFormInfo($_POST);
$res['title'] = 'Редактор статуса контрагента';
}
echo je($res);
}
public static function getTableData($post = []) {
$post['options'][\ModuleTable::SORTABLE] = true;
$post['options'][\ModuleTable::ROW_CLICK] = eRowClick::NONE;
$post['options'][\Query::COUNT] = 0;
$post['options'][\Query::SORT] = [Status::$POS=>'ASC'];
//parent::getTableData($post); // TODO: Change the autogenerated stub
$post['getData'] = true;
$res = parent::getTableData($post);
//$res['title'] = ['title'=>'Контрагенты','subtitle'=>Merakomis::$CONTRACTOR_TABLE_SUBTITLE,'text'=>Merakomis::$CONTRACTOR_TABLE_TEXT];
//$res['title'] = ['title'=>$res['title'],'subtitle'=>Merakomis::$CONTRACTOR_STATUS_TABLE_SUBTITLE,'text'=>Merakomis::$CONTRACTOR_STATUS_TABLE_TEXT];
$res['title'] = [
'title' => $res['title'],
'edit' => true,
'subtitle' => Merakomis::$CONTRACTOR_STATUS_TABLE_SUBTITLE,
'text' => Merakomis::$CONTRACTOR_STATUS_TABLE_TEXT,
'subtitle_var' => Merakomis::$_CONTRACTOR_STATUS_TABLE_SUBTITLE,
'text_var' => Merakomis::$_CONTRACTOR_STATUS_TABLE_TEXT,
];
echo je($res);
}
}