N°6154 N°6219 - Relations Read - tooltip, confirmation title and message (#486)

N°6154 - n:n Read - tooltip, confirmation title and message on Add-Edit-Remove
N°6219 - 1:n Read: tooltip, modal title and message on Add-Edit-Remove-Delete
This commit is contained in:
bdalsass
2023-04-28 14:43:53 +02:00
committed by GitHub
parent 269c1bf005
commit de35d941c1
28 changed files with 461 additions and 254 deletions

View File

@@ -81,6 +81,7 @@ class AjaxRenderController
$aObj[$sAlias."/_key_"] = $aObject[$sAlias]->GetKey();
$aObj[$sAlias."/_key_/raw"] = $aObject[$sAlias]->GetKey();
$aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink();
$aObj[$sAlias."/friendlyname"] = $aObject[$sAlias]->Get('friendlyname');
// N°5943 Protection against $aColumnsLoad having less class aliases than $aClassAliases, this is in case the method's consumer isn't passing data correctly
if (false === array_key_exists($sAlias, $aColumnsLoad)) {

View File

@@ -219,6 +219,7 @@ JS
$bPrintable = utils::ReadParam('printable', '0') === '1';
$sClass = utils::ReadParam('class', '', false, 'class');
$sId = utils::ReadParam('id', '');
$sFormTitle = utils::ReadPostedParam('form_title', null, utils::ENUM_SANITIZATION_FILTER_STRING);
// Check parameters
if (utils::IsNullOrEmptyString($sClass) || utils::IsNullOrEmptyString($sId))
@@ -243,6 +244,11 @@ JS
$aFormExtraParams = array('wizard_container' => 1);
FormHelper::UpdateFlagsFromContext($oObj, $aFormExtraParams);
// Allow form title customization
if (!utils::IsNullOrEmptyString($sFormTitle)) {
$aFormExtraParams['form_title'] = $sFormTitle;
}
if ($this->IsHandlingXmlHttpRequest()) {
$oPage = new AjaxPage('');
$aFormExtraParams['js_handlers'] = [];

View File

@@ -11,6 +11,7 @@ use cmdbAbstractObject;
use Combodo\iTop\Application\Helper\FormHelper;
use Combodo\iTop\Application\UI\Base\Component\Form\FormUIBlockFactory;
use Combodo\iTop\Controller\AbstractController;
use Combodo\iTop\Service\Links\LinkSetModel;
use Combodo\iTop\Service\Router\Router;
use Combodo\iTop\Service\Base\ObjectRepository;
use Exception;
@@ -198,17 +199,30 @@ class LinkSetController extends AbstractController
}
});
}
JS
;
JS;
// Form title
/** @var \AttributeLinkedSet $oLinksetDef */
$oLinksetDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
$oHostObj = MetaModel::GetObject($sClass, $sId);
$sFormTitle = $oLinksetDef->SearchSpecificLabel('UI:Links:Add:Modal:Title', '', true,
$sClass,
$oHostObj->Get('friendlyname'),
$oLinksetDef->GetLabel(),
LinkSetModel::GetTargetClass($oLinksetDef));
$aExtraParams = [
'noRelations' => true,
'hide_transitions' => true,
'formPrefix' => $sAttCode,
'fieldsFlags' => $aFieldFlags,
'noRelations' => true,
'hide_transitions' => true,
'formPrefix' => $sAttCode,
'fieldsFlags' => $aFieldFlags,
'forceFieldsSubmission' => [
$sExtKeyToMe
$sExtKeyToMe,
],
'js_handlers' => [
'form_title' => $sFormTitle,
'custom_button' => \Dict::S('UI:Button:Add'),
'js_handlers' => [
'form_on_submit' => $sFormOnSubmitJsCode,
'cancel_button_on_click' =>
<<<JS