From d2d62cd60f2ef7aa2d0df7aaec05f01295311db2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 May 2023 17:32:17 +0200 Subject: [PATCH] NEW Show tips on search of string and numeric fields into lists --- htdocs/core/js/lib_head.js.php | 24 +++++++++++++----------- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 051aa2a702f..c602d13cbf7 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1276,8 +1276,7 @@ if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUER ?> // Defined properties for JNotify $(document).ready(function() { - if (typeof $.jnotify == 'function') - { + if (typeof $.jnotify == 'function') { $.jnotify.setup({ delay: 3000 // the default time to show each notification (in milliseconds) , sticky: false // determines if the message should be considered "sticky" (user must manually close notification) @@ -1286,20 +1285,20 @@ $(document).ready(function() { , fadeSpeed: 1000 // the speed to fade messages out (in milliseconds) , slideSpeed: 250 // the speed used to slide messages out (in milliseconds) , classContainer: "jnotify-container" - , classNotification: "jnotify-notification" - , classBackground: "jnotify-background" - , classClose: "jnotify-close" - , classMessage: "jnotify-message" - , init: null // callback that occurs when the main jnotify container is created - , create: null // callback that occurs when when the note is created (occurs just before appearing in DOM) - , beforeRemove: null // callback that occurs when before the notification starts to fade away + , classNotification: "jnotify-notification" + , classBackground: "jnotify-background" + , classClose: "jnotify-close" + , classMessage: "jnotify-message" + , init: null // callback that occurs when the main jnotify container is created + , create: null // callback that occurs when when the note is created (occurs just before appearing in DOM) + , beforeRemove: null // callback that occurs when before the notification starts to fade away }); } }); -// Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup -$(document).ready(function() { +jQuery(document).ready(function() { + // Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup if (window.location && window.location.pathname.indexOf("externalsite/frametop.php") == -1 && window.location !== window.parent.location ) { console.log("Page is detected to be into an iframe, we hide by CSS the menus"); // The page is in an iframe @@ -1307,6 +1306,9 @@ $(document).ready(function() { jQuery(".id-container").css('width', '100%'); } + + // Code to set tooltip on search field + jQuery('table.liste tr.liste_titre_filter td.liste_titre input[name^="search"][type=text]:not("maxwidthdate")').attr('title', 'transnoentities("SearchSyntaxTooltipForStringOrNum")) ?>'); }); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index e4263d1a217..bd7dfe887b5 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1229,3 +1229,4 @@ PublicVirtualCard=Virtual business card TreeView=Tree view DropFileToAddItToObject=Drop a file to add it to this object UploadFileDragDropSuccess=The file(s) have been uploaded successfully +SearchSyntaxTooltipForStringOrNum=For searching inside text fields, you can use the characters ^ or $ to make a 'start or end with' search or use the ! to make a 'does not contains' test. You can use the | between two strings instead of a space for a 'OR' condition instead of 'AND'. For numeric values, you can use the operator <, >, <= or >= before the value to filter using a mathematical comparison \ No newline at end of file