diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 2d7a2112f..9dda44bdf 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -114,6 +114,7 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage $this->add_dict_entries('UI:Search:'); $this->add_dict_entries('UI:Button:'); + $this->add_dict_entries('Error:'); if (!$this->IsPrintableVersion()) diff --git a/css/light-grey.css b/css/light-grey.css index db5c95928..0b9e6643f 100644 --- a/css/light-grey.css +++ b/css/light-grey.css @@ -899,6 +899,7 @@ input.dp-applied { .search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator .sfc_opc_multichoices .sfc_opc_mc_filter { position: relative; margin-top: 8px; + margin-bottom: 8px; } .search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator .sfc_opc_multichoices .sfc_opc_mc_filter input { width: 100%; @@ -918,9 +919,6 @@ input.dp-applied { /* -5px to compensate padding and keep aligned to the filter left side */ padding: 5px; } -.search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator .sfc_opc_multichoices .sfc_opc_mc_items .sfc_opc_mc_item:first-of-type { - margin-top: 8px; -} .search_form_handler .sf_criterion_area .search_form_criteria .sfc_form_group .sfc_fg_operators .sfc_fg_operator .sfc_opc_multichoices .sfc_opc_mc_items .sfc_opc_mc_item:hover { padding: 4px; /* Normal padding - border size */ diff --git a/css/light-grey.scss b/css/light-grey.scss index e16c189b4..28a435552 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -1010,6 +1010,7 @@ input.dp-applied { .sfc_opc_mc_filter{ position: relative; margin-top: 8px; + margin-bottom: 8px; input{ width: 100%; @@ -1030,9 +1031,6 @@ input.dp-applied { margin: 0px -5px 0px -5px; /* -5px to compensate padding and keep aligned to the filter left side */ padding: 5px; - &:first-of-type{ - margin-top: 8px; - } &:hover{ padding: 4px; /* Normal padding - border size */ background-color: $white; diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 534f5e6aa..0efb28ee5 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -1419,9 +1419,11 @@ When associated with a trigger, each action is given an "order" number, specifyi 'UI:Search:Criteria:Title:ExternalKey:Equals' => '%1$s %2$s', 'UI:Search:Criteria:Title:ExternalKey:In' => '%1$s: %2$s', 'UI:Search:Criteria:Title:ExternalKey:In:Many' => '%1$s: %2$s and %3$s others', + 'UI:Search:Criteria:Title:ExternalKey:In:All' => '%1$s: Any', // - Enum widget 'UI:Search:Criteria:Title:Enum:In' => '%1$s: %2$s', 'UI:Search:Criteria:Title:Enum:In:Many' => '%1$s: %2$s and %3$s others', + 'UI:Search:Criteria:Title:Enum:In:All' => '%1$s: Any', // - 'UI:Search:Value:Filter:Placeholder' => 'Filter...', 'UI:Search:Value:Toggler:CheckAllNone' => 'Check all / none', diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index aa0c8c2be..fadf34b1a 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -1221,12 +1221,16 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé 'UI:Search:Criteria:Title:String:StartsWith' => '%1$s commence par %2$s', 'UI:Search:Criteria:Title:String:EndsWith' => '%1$s fini par %2$s', // - External key widget - 'UI:Search:Criteria:Title:ExternalKey:Empty' => '%1$s est rempli', - 'UI:Search:Criteria:Title:ExternalKey:NotEmpty' => '%1$s n\'est pas rempli', + 'UI:Search:Criteria:Title:ExternalKey:Empty' => '%1$s est renseigné', + 'UI:Search:Criteria:Title:ExternalKey:NotEmpty' => '%1$s n\'est pas renseigné', 'UI:Search:Criteria:Title:ExternalKey:Equals' => '%1$s %2$s', + 'UI:Search:Criteria:Title:ExternalKey:In' => '%1$s: %2$s', + 'UI:Search:Criteria:Title:ExternalKey:In:Many' => '%1$s: %2$s et %3$s autres', + 'UI:Search:Criteria:Title:ExternalKey:In:All' => '%1$s: Indifférent', // - Enum widget 'UI:Search:Criteria:Title:Enum:In' => '%1$s : %2$s', 'UI:Search:Criteria:Title:Enum:In:Many' => '%1$s : %2$s et %3$s autres', + 'UI:Search:Criteria:Title:Enum:In:All' => '%1$s: Indifférent', // - 'UI:Search:Value:Filter:Placeholder' => 'Filter...', 'UI:Search:Value:Toggler:CheckAllNone' => 'Check all / none', diff --git a/js/search/search_form_criteria.js b/js/search/search_form_criteria.js index 455ed28a2..ae8269401 100644 --- a/js/search/search_form_criteria.js +++ b/js/search/search_form_criteria.js @@ -124,6 +124,12 @@ $(function() var sOpIdx = aSortable[iIdx][0]; this.operators[sOpIdx] = this.options.available_operators[sOpIdx]; } + + // Fallback operator in case the current operator is not available. Should not happen. + if(this.operators[this.options.operator] === undefined) + { + this.options.operator = Object.keys(this.operators)[0]; + } }, // - Bind external events _bindEvents: function() @@ -509,12 +515,10 @@ $(function() var oOpContentElem = $(''); oOpContentElem.val(this._getValuesAsText()); - - // Events // - Focus input on click (radio, label, ...) oOpElem.on('click', ':not(input[type="text"], select)', function(oEvent) { - //in order to prevent from the bubling of the event from inputs so their parents, we filter on oEvent.target, we could have stoped the bubling but it would have been a little agressive. + // Stopping propagation like this instead of oEvent.stopPropagation() as the event could be used by something. if ($(oEvent.target).is('input[type="text"], select')) { return; } @@ -584,7 +588,7 @@ $(function() // Values helpers - // - Convert values to a standard string + // - Return current values _getValues: function() { return this.options.values; diff --git a/js/search/search_form_criteria_enum.js b/js/search/search_form_criteria_enum.js index f7559858b..bb0d91a6d 100644 --- a/js/search/search_form_criteria_enum.js +++ b/js/search/search_form_criteria_enum.js @@ -170,7 +170,7 @@ $(function() }); // - Apply on check - oAllowedValuesElem.find('.sfc_opc_mc_item').on('click', function(){ + oAllowedValuesElem.find('.sfc_opc_mc_item').on('click', function(oEvent){ // Uncheck toggler oTogglersElem.find('input:checkbox').prop('checked', false); diff --git a/js/search/search_form_criteria_external_key.js b/js/search/search_form_criteria_external_key.js index 572bf87d7..ff31806be 100644 --- a/js/search/search_form_criteria_external_key.js +++ b/js/search/search_form_criteria_external_key.js @@ -9,11 +9,6 @@ $(function() // default options options: { - // Overload default operator - 'operator': 'IN', - // Available operators - 'available_operators': { - }, }, diff --git a/js/search/search_form_handler.js b/js/search/search_form_handler.js index 005fe35d1..5176cf51c 100644 --- a/js/search/search_form_handler.js +++ b/js/search/search_form_handler.js @@ -298,6 +298,7 @@ $(function() // Content part var oContentElem = $('
') .appendTo(this.elements.more_criterion); + // - Add list var oListElem = $('') .appendTo(oContentElem); @@ -313,6 +314,7 @@ $(function() .text(oField.label); oListElem.append(oFieldElem); } + // - Others if(this.options.search.fields.others !== undefined) { @@ -593,7 +595,11 @@ $(function() // - Called on form submit failures _onSubmitFailure: function(oData) { - this._setErrorMessage(oData.responseText); + // Fallback message in case the server send back only HTML markup. + var oErrorElem = $(oData.responseText); + var sErrorMessage = (oErrorElem.text() !== '') ? oErrorElem.text() : Dict.Format('Error:XHR:Fail', ''); + + this._setErrorMessage(sErrorMessage); }, // - Called after form submits _onSubmitAlways: function(oData)