mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 08:38:45 +02:00
N°8772 - form controller
This commit is contained in:
@@ -18,14 +18,21 @@ class FormsController extends Controller
|
||||
{
|
||||
public const ROUTE_NAMESPACE = 'forms';
|
||||
|
||||
public function __construct($sViewPath = '', $sModuleName = 'core', $aAdditionalPaths = [])
|
||||
{
|
||||
$sModuleName = 'core';
|
||||
$sViewPath = APPROOT.'templates';
|
||||
parent::__construct($sViewPath, $sModuleName, $aAdditionalPaths);
|
||||
}
|
||||
|
||||
public function OperationDashletConfiguration()
|
||||
{
|
||||
try {
|
||||
$oRequest = $this->getRequest();
|
||||
$sId = $oRequest->query->get('dashlet_code');
|
||||
$sDashletId = $oRequest->query->get('dashlet_code');
|
||||
|
||||
// Get the form block from the service (and the compiler)
|
||||
$oFormBlock = FormBlockService::GetInstance()->GetFormBlockById($sId);
|
||||
$oFormBlock = FormBlockService::GetInstance()->GetFormBlockById($sDashletId);
|
||||
$oBuilder = $this->GetFormBuilder($oFormBlock, []);
|
||||
$oForm = $oBuilder->getForm();
|
||||
$oForm->handleRequest($oRequest);
|
||||
@@ -36,7 +43,7 @@ class FormsController extends Controller
|
||||
}
|
||||
|
||||
// Retrieve form data
|
||||
$aData = $oForm->getData();
|
||||
$aData = $oRequest->request->all($sDashletId);
|
||||
|
||||
// Compute blocks to redraw
|
||||
$aBlocksToRedraw = FormTypeHelper::ComputeBlocksToRedraw($oFormBlock, $oForm, $aData['_turbo_trigger']);
|
||||
|
||||
Reference in New Issue
Block a user