diff --git a/application/nicewebpage.class.inc.php b/application/nicewebpage.class.inc.php index 890ec2763..d0b4fa44b 100644 --- a/application/nicewebpage.class.inc.php +++ b/application/nicewebpage.class.inc.php @@ -58,6 +58,8 @@ class NiceWebPage extends WebPage $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_numeric.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_enum.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_external_key.js'); + $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_date_abstract.js'); + $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_date.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria_date_time.js'); $this->add_dict_entries('UI:Combo'); diff --git a/css/light-grey.css b/css/light-grey.css index f9257acf1..2320e188b 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -990,6 +990,12 @@ input.dp-applied { .search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group.advanced .sfc_fg_more { display: none; } +.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group.advanced .hide_on_advanced { + display: none; +} +.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group:not(.advanced) .hide_on_less { + display: none; +} .search_form_handler .sf_criterion_area .search_form_criteria.search_form_criteria_raw .sfc_title { cursor: initial; } diff --git a/css/light-grey.scss b/css/light-grey.scss index 63e543877..b253edfe9 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -1126,6 +1126,16 @@ input.dp-applied { .sfc_fg_more{ display: none; } + + .hide_on_advanced { + display: none; + } + } + + &:not(.advanced) { + .hide_on_less { + display: none; + } } } @@ -1168,6 +1178,9 @@ input.dp-applied { } } } + + + } /* More criterion */ diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 49c776d6b..ac3d939cc 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -1444,5 +1444,11 @@ When associated with a trigger, each action is given an "order" number, specifyi // - Widget other translations 'UI:Search:Criteria:DateTime:From' => 'From', + 'UI:Search:Criteria:DateTime:FromTime' => 'From', 'UI:Search:Criteria:DateTime:Until' => 'Until', + 'UI:Search:Criteria:DateTime:UntilTime' => 'Until', + 'UI:Search:Criteria:DateTime:PlaceholderFrom' => 'Any date', + 'UI:Search:Criteria:DateTime:PlaceholderFromTime' => 'Any date', + 'UI:Search:Criteria:DateTime:PlaceholderUntil' => 'Any date', + 'UI:Search:Criteria:DateTime:PlaceholderUntilTime' => 'Any date', )); diff --git a/js/search/search_form_handler.js b/js/search/search_form_handler.js index d4bcf11f5..975ddaba3 100644 --- a/js/search/search_form_handler.js +++ b/js/search/search_form_handler.js @@ -338,15 +338,27 @@ $(function() // Prevent propagation to parents and therefore multiple attempts to close it oEvent.stopPropagation(); + oEventTargetElem = $(oEvent.target); + // If not more menu, close all criterion - if($(oEvent.target).closest('.sf_more_criterion').length > 0) + if(oEventTargetElem.closest('.sf_more_criterion').length > 0) { me._closeAllCriterion(); } else { + //if using the datetimepicker, do not close anything + if (oEventTargetElem.closest('#ui-datepicker-div, .ui-datepicker-prev, .ui-datepicker-next').length > 0 ) + { + //no closing in this case + } + // //if the context is not document, then we have encountered a bug : the css ::after elements do have a context on click and thus, we cannot check if they are inside a #ui-datepicker-div + // else if (typeof oEventTargetElem.context != 'undefined' && $(oEventTargetElem.context).is('.ui-icon')) + // { + // //no closing in this case (bugfix) + // } // If criteria, close more menu & all criterion but me - if($(oEvent.target).closest('.search_form_criteria').length > 0) + else if(oEventTargetElem.closest('.search_form_criteria').length > 0) { me._closeMoreCriterion(); // All criterion but me is already handle by the criterion, no callback needed.