From 10116e98245771f2f6e3e63d92befef10f42d534 Mon Sep 17 00:00:00 2001 From: Manthan Surkar Date: Thu, 14 May 2020 13:36:37 +0200 Subject: [PATCH] Informing the user about the HEX conversion scheme of Integers Signed-off-by: Manthan Surkar --- js/messages.php | 2 ++ js/table/change.js | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/js/messages.php b/js/messages.php index d2e5fc3d6b..8a555a23a7 100644 --- a/js/messages.php +++ b/js/messages.php @@ -504,6 +504,8 @@ $javascriptMessages = [ 'strYes' => __('Yes'), 'strCopyEncryptionKey' => __('Do you want to copy encryption key?'), 'strEncryptionKey' => __('Encryption key'), + /* l10n: Tip for HEX conversion of Integers */ + 'HexConversionInfo' => __('The HEX function will treat the integer as a string while calculating the hexadecimal value'), /* For Tip to be shown on Time field */ 'strMysqlAllowedValuesTipTime' => __( diff --git a/js/table/change.js b/js/table/change.js index 53d6742a43..c5be232e4a 100644 --- a/js/table/change.js +++ b/js/table/change.js @@ -279,6 +279,18 @@ function verificationsAfterFieldChange (urlField, multiEdit, theType) { }); } + if (target.value === 'HEX' && theType.substring(0,3) === 'int') { + // Add note when HEX function is selected on a int + var newHexInfo = '

' + Messages.HexConversionInfo + '

'; + if (!$('#note' + target.id).length) { + $thisInput.after(newHexInfo); + } + } else { + $('#note' + target.id) + .prev('br') + .remove(); + $('#note' + target.id).remove(); + } // Unchecks the corresponding "NULL" control $('input[name=\'fields_null[multi_edit][' + multiEdit + '][' + urlField + ']\']').prop('checked', false);