NEW Show tips on search of string and numeric fields into lists

This commit is contained in:
Laurent Destailleur
2023-05-09 17:32:17 +02:00
parent 09120d3fa9
commit d2d62cd60f
2 changed files with 14 additions and 11 deletions

View File

@@ -1276,8 +1276,7 @@ if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUER
?> ?>
// Defined properties for JNotify // Defined properties for JNotify
$(document).ready(function() { $(document).ready(function() {
if (typeof $.jnotify == 'function') if (typeof $.jnotify == 'function') {
{
$.jnotify.setup({ $.jnotify.setup({
delay: 3000 // the default time to show each notification (in milliseconds) 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) , 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) , fadeSpeed: 1000 // the speed to fade messages out (in milliseconds)
, slideSpeed: 250 // the speed used to slide messages out (in milliseconds) , slideSpeed: 250 // the speed used to slide messages out (in milliseconds)
, classContainer: "jnotify-container" , classContainer: "jnotify-container"
, classNotification: "jnotify-notification" , classNotification: "jnotify-notification"
, classBackground: "jnotify-background" , classBackground: "jnotify-background"
, classClose: "jnotify-close" , classClose: "jnotify-close"
, classMessage: "jnotify-message" , classMessage: "jnotify-message"
, init: null // callback that occurs when the main jnotify container is created , 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) , 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 , beforeRemove: null // callback that occurs when before the notification starts to fade away
}); });
} }
}); });
<?php } ?> <?php } ?>
// Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup jQuery(document).ready(function() {
$(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 ) { 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"); console.log("Page is detected to be into an iframe, we hide by CSS the menus");
// The page is in an iframe // The page is in an iframe
@@ -1307,6 +1306,9 @@ $(document).ready(function() {
jQuery(".id-container").css('width', '100%'); 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', '<?php echo dol_escape_js($langs->transnoentities("SearchSyntaxTooltipForStringOrNum")) ?>');
}); });

View File

@@ -1229,3 +1229,4 @@ PublicVirtualCard=Virtual business card
TreeView=Tree view TreeView=Tree view
DropFileToAddItToObject=Drop a file to add it to this object DropFileToAddItToObject=Drop a file to add it to this object
UploadFileDragDropSuccess=The file(s) have been uploaded successfully 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