meraproject/themes/merakomis/dictionary/contractor/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

50 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?
namespace controller\themes\merakomis\dictionary\contractor;
use core\core\structure\eRowClick;
use ms\ms\structure\msControllerTable;
use themes\Merakomis;
use themes\merakomis\dictionary\Contractor;
use themes\merakomis\Emp;
use themes\merakomis\structure\merakomisControllerTable;
class Api extends merakomisControllerTable {
static $class = 'themes\merakomis\dictionary\Contractor';
static function getData(){
$res = [];
if(Emp::$IS_AUTH) {
$C = Contractor::getByID(intval($_POST['id']));
$res = Contractor::format($C);
}
echo je($res);
}
public static function getTableData($post = [])
{
//$TITLE= ['title'=>'Контрагенты','subtitle'=>'Список контрагентов','text'=>'Сводная таблица всех наших контрагентов. Прежде чем ввести в карточку проекта контрагента, его необходимо добавить в эту таблицу, нажав кнопку «Добавить».'];
$post['options'][\ModuleTable::ROW_CLICK] = eRowClick::CUSTOM;
$post['getData'] = true;
$res = parent::getTableData($post);
$res['title'] = ['title'=>'Контрагенты','subtitle'=>Merakomis::$CONTRACTOR_TABLE_SUBTITLE,'text'=>Merakomis::$CONTRACTOR_TABLE_TEXT];
$res['title'] = [
'title' => 'Контрагенты',
'edit' => true,
'subtitle' => Merakomis::$CONTRACTOR_TABLE_SUBTITLE,
'text' => Merakomis::$CONTRACTOR_TABLE_TEXT,
'subtitle_var' => Merakomis::$_CONTRACTOR_TABLE_SUBTITLE,
'text_var' => Merakomis::$_CONTRACTOR_TABLE_TEXT,
];
echo je($res);
}
}