diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index b92692f17..7445a5064 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1784,13 +1784,12 @@ HTML if (!$oAttDef->IsExternalField()) { $bMandatory = 'false'; - if ((!$oAttDef->IsNullAllowed()) || ($iFlags & OPT_ATT_MANDATORY)) - { + if ((!$oAttDef->IsNullAllowed()) || ($iFlags & OPT_ATT_MANDATORY)) { $bMandatory = 'true'; } $sValidationSpan = ""; $sReloadSpan = ""; - $sHelpText = htmlentities($oAttDef->GetHelpOnEdition(), ENT_QUOTES, 'UTF-8'); + $sHelpText = utils::EscapeHtml($oAttDef->GetHelpOnEdition()); // mandatory field control vars $aEventsList = array(); // contains any native event (like change), plus 'validate' for the form submission @@ -2116,9 +2115,9 @@ EOF 'current_image_url' => $sUrl, 'default_image_url' => $sDefaultUrl, 'labels' => array( - 'reset_button' => htmlentities(Dict::S('UI:Button:ResetImage'), ENT_QUOTES, 'UTF-8'), - 'remove_button' => htmlentities(Dict::S('UI:Button:RemoveImage'), ENT_QUOTES, 'UTF-8'), - 'upload_button' => $sHelpText, + 'reset_button' => utils::EscapeHtml(Dict::S('UI:Button:ResetImage')), + 'remove_button' => utils::EscapeHtml(Dict::S('UI:Button:RemoveImage')), + 'upload_button' => !empty($sHelpText) ? $sHelpText : utils::EscapeHtml(Dict::S('UI:Button:UploadImage')), ), ); $sEditImageOptions = json_encode($aEditImage); diff --git a/css/backoffice/components/input/_input-image.scss b/css/backoffice/components/input/_input-image.scss index 4f7744e1e..2e5bca17f 100644 --- a/css/backoffice/components/input/_input-image.scss +++ b/css/backoffice/components/input/_input-image.scss @@ -34,6 +34,7 @@ $ibo-input-image--edit-buttons--elements-spacing: $ibo-input-image--edit-buttons bottom: 0; left: 0; right: 0; + width: 100%; opacity: 0; } } diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 13b8cc042..f2cfbc463 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -1455,6 +1455,7 @@ When associated with a trigger, each action is given an "order" number, specifyi 'UI:ToggleFullScreen' => 'Toggle Maximize / Minimize', 'UI:Button:ResetImage' => 'Recover the previous image', 'UI:Button:RemoveImage' => 'Remove the image', + 'UI:Button:UploadImage' => 'Upload an image from the disk', 'UI:UploadNotSupportedInThisMode' => 'The modification of images or files is not supported in this mode.', 'UI:Button:RemoveDocument' => 'Remove the document', diff --git a/js/edit_image.js b/js/edit_image.js index fd9f18f86..8560f4eb0 100644 --- a/js/edit_image.js +++ b/js/edit_image.js @@ -21,7 +21,7 @@ $(function() labels: { reset_button: 'Reset', remove_button: 'Remove', - upload_button: 'Upload' + upload_button: 'Upload', } }, @@ -56,7 +56,6 @@ $(function() const sDisabled = this.bLoadedEmpty ? 'disabled' : ''; const sLoadedDisabled = this.bLoadedEmpty ? 'yes' : 'no'; - const sUploadButtonTooltipAttribute = this.options.labels.upload_button !== '' ? 'data-tooltip-content="'+this.options.labels.upload_button+'"' : ''; let sCssClasses = "ibo-input-image--image-view attribute-image"; let sCssClassToAdd, sImageUrl; @@ -73,9 +72,12 @@ $(function()