mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°1455 - obsolescence: show hint in the search bar
This commit is contained in:
@@ -757,7 +757,7 @@ input.dp-applied {
|
||||
.search_form_handler:not(.closed) .sf_title .sft_short {
|
||||
display: none;
|
||||
}
|
||||
.search_form_handler:not(.closed) .sf_title .sft_hint, .search_form_handler:not(.closed) .sf_title .sft_toggler {
|
||||
.search_form_handler:not(.closed) .sf_title .sft_hint, .search_form_handler:not(.closed) .sf_title .sfobs_hint, .search_form_handler:not(.closed) .sf_title .sft_toggler {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.search_form_handler:not(.closed) .sf_title .sft_toggler {
|
||||
@@ -784,7 +784,7 @@ input.dp-applied {
|
||||
.search_form_handler.closed .sf_title .sft_long {
|
||||
display: none;
|
||||
}
|
||||
.search_form_handler.closed .sf_title .sft_hint {
|
||||
.search_form_handler.closed .sf_title .sft_hint, .search_form_handler.closed .sf_title .sfobs_hint {
|
||||
display: none;
|
||||
}
|
||||
.search_form_handler:not(.no_auto_submit) .sft_hint {
|
||||
@@ -796,6 +796,18 @@ input.dp-applied {
|
||||
.search_form_handler.no_auto_submit .sfc_fg_search {
|
||||
display: none;
|
||||
}
|
||||
.search_form_handler.no_auto_submit .sft_hint {
|
||||
display: inline-block;
|
||||
}
|
||||
.search_form_handler:not(.hide_obsolete_data) .sfobs_hint {
|
||||
display: none;
|
||||
}
|
||||
.search_form_handler.hide_obsolete_data .sfobs_hint {
|
||||
display: inline-block;
|
||||
}
|
||||
.search_form_handler.hide_obsolete_data.no_auto_submit .sfobs_hint {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.search_form_handler .sf_title {
|
||||
transition: opacity 0.3s, background-color 0.3s, color 0.3s linear;
|
||||
padding: 8px 10px;
|
||||
@@ -804,7 +816,7 @@ input.dp-applied {
|
||||
background-color: #1c94c4;
|
||||
cursor: pointer;
|
||||
}
|
||||
.search_form_handler .sf_title .sft_hint {
|
||||
.search_form_handler .sf_title .sft_hint, .search_form_handler .sf_title .sfobs_hint {
|
||||
font-size: 8pt;
|
||||
font-style: italic;
|
||||
}
|
||||
@@ -3189,3 +3201,13 @@ input:checked + .slider:before {
|
||||
font-size: 12px;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
.clearboth {
|
||||
clear: both;
|
||||
}
|
||||
/* font-awesome 4 to 5 BC fix */
|
||||
.pull-right {
|
||||
float: right;
|
||||
}
|
||||
.pull-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -855,6 +855,7 @@ input.dp-applied {
|
||||
}
|
||||
|
||||
.sft_hint,
|
||||
.sfobs_hint,
|
||||
.sft_toggler{
|
||||
margin-top: 4px;
|
||||
}
|
||||
@@ -884,7 +885,8 @@ input.dp-applied {
|
||||
.sft_long{
|
||||
display: none;
|
||||
}
|
||||
.sft_hint{
|
||||
.sft_hint,
|
||||
.sfobs_hint{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -902,6 +904,27 @@ input.dp-applied {
|
||||
.sfc_fg_search{
|
||||
display: none;
|
||||
}
|
||||
.sft_hint{
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&:not(.hide_obsolete_data){
|
||||
.sfobs_hint{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&.hide_obsolete_data{
|
||||
.sfobs_hint{
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
&.hide_obsolete_data.no_auto_submit{
|
||||
.sfobs_hint{
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.sf_title{
|
||||
@@ -911,7 +934,8 @@ input.dp-applied {
|
||||
color: #ffffff;
|
||||
background-color: $complement-color;
|
||||
cursor: pointer;
|
||||
.sft_hint{
|
||||
.sft_hint,
|
||||
.sfobs_hint{
|
||||
font-size: 8pt;
|
||||
font-style: italic;
|
||||
}
|
||||
@@ -3684,3 +3708,11 @@ input:checked + .slider:before {
|
||||
font-size: 12px;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.clearboth {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* font-awesome 4 to 5 BC fix */
|
||||
.pull-right { float: right; }
|
||||
.pull-left { float: left; }
|
||||
|
||||
@@ -1442,7 +1442,8 @@ When associated with a trigger, each action is given an "order" number, specifyi
|
||||
|
||||
// Search form
|
||||
'UI:Search:Toggle' => 'Minimize / Expand',
|
||||
'UI:Search:AutoSubmit:DisabledHint' => 'Auto submit has been disabled for this class',
|
||||
'UI:Search:AutoSubmit:DisabledHint' => '<i class="fas fa-sync fa-1x"></i> Auto submit has been disabled for this class',
|
||||
'UI:Search:Obsolescence:DisabledHint' => '<span class="fas fa-eye-slash fa-1x"></span> Due to your preferences, you don\'t see obsolete data',
|
||||
'UI:Search:NoAutoSubmit:ExplainText' => 'Add some criterion on the search box or click the search button to view the objects.',
|
||||
'UI:Search:Criterion:MoreMenu:AddCriteria' => 'Add new criteria',
|
||||
// - Add new criteria button
|
||||
|
||||
@@ -1422,7 +1422,8 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé
|
||||
|
||||
// Search form
|
||||
'UI:Search:Toggle' => 'Réduire / Ouvrir',
|
||||
'UI:Search:AutoSubmit:DisabledHint' => 'La soumission automatique a été desactivée pour cette classe',
|
||||
'UI:Search:AutoSubmit:DisabledHint' => '<i class="fas fa-sync fa-1x"></i> La soumission automatique a été desactivée pour cette classe',
|
||||
'UI:Search:Obsolescence:DisabledHint' => '<span class="fas fa-eye-slash fa-1x"></span> Conformément à vos préférences utilisateur, vous ne voyez pas les données obsolètes',
|
||||
'UI:Search:NoAutoSubmit:ExplainText' => 'Ajoutez des critères dans le formulaire de recherche ou cliquez sur le bouton rechercher pour voir les objets.',
|
||||
'UI:Search:Criterion:MoreMenu:AddCriteria' => 'Ajouter un critère',
|
||||
// - Add new criteria button
|
||||
|
||||
@@ -15,6 +15,7 @@ $(function()
|
||||
'endpoint': null,
|
||||
'init_opened': false,
|
||||
'auto_submit': true,
|
||||
'show_obsolete_data' : true,
|
||||
'search': {
|
||||
'base_oql': '',
|
||||
'class_name': null,
|
||||
@@ -325,6 +326,12 @@ $(function()
|
||||
{
|
||||
this.element.addClass('no_auto_submit');
|
||||
}
|
||||
// - Show obsolete data option
|
||||
if(this.options.show_obsolete_data === false)
|
||||
{
|
||||
this.element.addClass('hide_obsolete_data');
|
||||
}
|
||||
|
||||
// - Message area
|
||||
this.elements.message_area = this.element.find('.sf_message');
|
||||
this._cleanMessageArea();
|
||||
|
||||
@@ -171,7 +171,12 @@ class SearchForm
|
||||
$sHtml .= "<form id=\"fs_{$sSearchFormId}\" action=\"{$sAction}\" class=\"{$sStyle}\">\n"; // Don't use $_SERVER['SCRIPT_NAME'] since the form may be called asynchronously (from ajax.php)
|
||||
$sHtml .= "<h2 class=\"sf_title\"><span class=\"sft_long\">" . Dict::Format('UI:SearchFor_Class_Objects', $sClassesCombo) . "</span><span class=\"sft_short\">" . Dict::S('UI:SearchToggle') . "</span>";
|
||||
$sHtml .= "<a class=\"sft_toggler fas fa-caret-down pull-right\" href=\"#\" title=\"" . Dict::S('UI:Search:Toggle') . "\"></a>";
|
||||
$sHtml .= "<span class=\"pull-right\">";
|
||||
$sHtml .= "<span class=\"sfobs_hint pull-right\">" . Dict::S('UI:Search:Obsolescence:DisabledHint') . "</span>";
|
||||
$sHtml .= "<br class='clearboth' />";
|
||||
$sHtml .= "<span class=\"sft_hint pull-right\">" . Dict::S('UI:Search:AutoSubmit:DisabledHint') . "</span>";
|
||||
$sHtml .= "</span>";
|
||||
$sHtml .= "<br class='clearboth' />";
|
||||
$sHtml .= "</h2>\n";
|
||||
$sHtml .= "<div id=\"fs_{$sSearchFormId}_message\" class=\"sf_message header_message\"></div>\n";
|
||||
$sHtml .= "<div id=\"fs_{$sSearchFormId}_criterion_outer\">\n</div>\n";
|
||||
@@ -247,6 +252,8 @@ class SearchForm
|
||||
$sDateFormat = substr($sDateTimeFormat, 0, $iDateTimeSeparatorPos);
|
||||
$sTimeFormat = substr($sDateTimeFormat, $iDateTimeSeparatorPos + 1);
|
||||
|
||||
$bShowObsoleteData = \appUserPreferences::GetPref('show_obsolete_data', MetaModel::GetConfig()->Get('obsolescence.show_obsolete_data'));// ? What to do when true == utils::IsArchiveMode()
|
||||
|
||||
$aSearchParams = array(
|
||||
'criterion_outer_selector' => "#fs_{$sSearchFormId}_criterion_outer",
|
||||
'result_list_outer_selector' => "#{$aExtraParams['result_list_outer_selector']}",
|
||||
@@ -255,6 +262,7 @@ class SearchForm
|
||||
'init_opened' => $bOpen,
|
||||
'auto_submit' => $bAutoSubmit,
|
||||
'list_params' => $aListParams,
|
||||
'show_obsolete_data' => $bShowObsoleteData,
|
||||
'search' => array(
|
||||
'has_hidden_criteria' => (array_key_exists('hidden_criteria', $aListParams) && !empty($aListParams['hidden_criteria'])),
|
||||
'fields' => $aFields,
|
||||
|
||||
Reference in New Issue
Block a user