From c119859696fd4b8d39cec8c752cb957ade71bfa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Nov 2015 13:14:46 +0100 Subject: [PATCH] NEW The quick search box on left menu can also search into expense reports. --- htdocs/core/ajax/selectsearchbox.php | 4 ++++ htdocs/core/class/html.form.class.php | 1 + htdocs/langs/en_US/main.lang | 1 + htdocs/projet/activity/perweek.php | 1 + htdocs/theme/eldy/style.css.php | 6 ++++++ htdocs/theme/md/style.css.php | 6 ++++++ 6 files changed, 19 insertions(+) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 0f00086dbf7..21f0241e402 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -107,6 +107,10 @@ if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CON { $arrayresult['searchintocontract']=array('text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue)); } +if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) +{ + $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?sall='.urlencode($search_boxvalue)); +} /* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a9f66d80f22..10f5fc25695 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4562,6 +4562,7 @@ class Form },*/ cache: true }, + dropdownCssClass: "css-'.$htmlname.'", placeholder: "'.dol_escape_js($placeholder).'", escapeMarkup: function (markup) { return markup; }, // let our custom formatter work minimumInputLength: '.$minimumInputLength.', diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4837a966394..95a0a67a90e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -766,3 +766,4 @@ SearchIntoCustomerProposals=Customer proposals SearchIntoSupplierProposals=Supplier proposals SearchIntoInterventions=Interventions SearchIntoContracts=Contracts +SearchIntoExpenseReports=Expense reports \ No newline at end of file diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 6201c601d18..a8f531cc790 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $langs->load('projects'); +$langs->load('users'); $action=GETPOST('action'); $mode=GETPOST("mode"); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5bb00861ac2..c245fce73c8 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3533,6 +3533,12 @@ a span.select2-chosen { background: #FFFFFF; } +.select2-results { + max-height: 400px; +} +.css-searchselectcombo ul.select2-results { + max-height: none; +} .select2-container-multi.select2-container-disabled .select2-choices { background-color: #FFFFFF; background-image: none; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ab13c8a5f39..45a4f755a05 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3385,6 +3385,12 @@ a span.select2-chosen { background: #FFFFFF; } +.select2-results { + max-height: 400px; +} +.css-searchselectcombo ul.select2-results { + max-height: none; +} .select2-container-multi.select2-container-disabled .select2-choices { background-color: #FFFFFF; background-image: none;