mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°5904 - Use attribute linked set edit mode to enable actions (#440)
* Add corresponding buttons depending on old edit mode (need to check with piR pour récuperer l'ancienne valeur. * N°5904 - Handle attribute linked set edit_mode * N°5904 Move calls to private jquery widget methods to public * N°5904 - Worker improvements add button on link tagset * Change itop set widget to new set block UI (5) * Change itop set widget to new set block UI (5) * Renommage variables JS avec le prefix combodo * Search dialog block id conflict with form id * add moved js files in iTopWebPage compatibility list --------- Co-authored-by: Stephen Abello <stephen.abello@combodo.com>
This commit is contained in:
@@ -18,6 +18,7 @@ use Combodo\iTop\Service\Base\ObjectRepository;
|
||||
use CoreCannotSaveObjectException;
|
||||
use DeleteException;
|
||||
use Dict;
|
||||
use Exception;
|
||||
use IssueLog;
|
||||
use iTopOwnershipLock;
|
||||
use iTopWebPage;
|
||||
@@ -90,6 +91,8 @@ class ObjectController extends AbstractController
|
||||
|
||||
/* Alerts the results */
|
||||
sPosting.done(function(data) {
|
||||
// fire event
|
||||
oForm.trigger('itop.form.submitted', [data]);
|
||||
if(data.success !== undefined && data.success === true) {
|
||||
oForm.closest('[data-role="ibo-modal"]').dialog('close');
|
||||
}
|
||||
@@ -151,6 +154,7 @@ JS;
|
||||
|
||||
$sClass = utils::ReadPostedParam('class', '', 'class');
|
||||
$sClassLabel = MetaModel::GetName($sClass);
|
||||
$sFormPrefix = utils::ReadPostedParam('formPrefix', '', FILTER_SANITIZE_STRING);
|
||||
$sTransactionId = utils::ReadPostedParam('transaction_id', '', 'transaction_id');
|
||||
$aErrors = array();
|
||||
$aWarnings = array();
|
||||
@@ -203,7 +207,7 @@ JS;
|
||||
$oObj->Set($sStateAttCode, $sTargetState);
|
||||
}
|
||||
}
|
||||
$aErrors = $oObj->UpdateObjectFromPostedForm();
|
||||
$aErrors = $oObj->UpdateObjectFromPostedForm($sFormPrefix);
|
||||
}
|
||||
if (isset($oObj) && is_object($oObj))
|
||||
{
|
||||
@@ -260,6 +264,7 @@ JS;
|
||||
// Nothing more to do
|
||||
if ($this->IsHandlingXmlHttpRequest()) {
|
||||
$aResult['success'] = true;
|
||||
$aResult['data'] = ['object' => ObjectRepository::ConvertObjectToArray($oObj, $sClass)];
|
||||
} else {
|
||||
ReloadAndDisplay($oPage, $oObj, 'create', $sMessage, 'ok');
|
||||
}
|
||||
@@ -543,8 +548,6 @@ JS;
|
||||
'js/forms-json-utils.js',
|
||||
'js/wizardhelper.js',
|
||||
'js/wizard.utils.js',
|
||||
'js/linkswidget.js',
|
||||
'js/linksdirectwidget.js',
|
||||
'js/extkeywidget.js',
|
||||
'js/jquery.blockUI.js',
|
||||
];
|
||||
@@ -589,4 +592,33 @@ JS;
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* OperationGet.
|
||||
*
|
||||
* @return JsonPage
|
||||
*/
|
||||
public function OperationGet(): JsonPage
|
||||
{
|
||||
$oPage = new JsonPage();
|
||||
$bSuccess = true;
|
||||
$aObjectData = null;
|
||||
|
||||
// Retrieve query params
|
||||
$sObjectClass = utils::ReadParam('object_class', '', false, utils::ENUM_SANITIZATION_FILTER_STRING);
|
||||
$sObjectKey = utils::ReadParam('object_key', '', false, utils::ENUM_SANITIZATION_FILTER_STRING);
|
||||
|
||||
// Retrieve object
|
||||
try {
|
||||
$oObject = MetaModel::GetObject($sObjectClass, $sObjectKey);
|
||||
$aObjectData = ObjectRepository::ConvertObjectToArray($oObject, $sObjectClass);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$bSuccess = false;
|
||||
}
|
||||
|
||||
return $oPage->SetData([
|
||||
'object' => $aObjectData,
|
||||
'success' => $bSuccess,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user