diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 70a287dc4..31a7d813b 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1130,7 +1130,7 @@ class Config ], 'quick_create.enabled' => [ 'type' => 'bool', - 'description' => 'Whether or not the global search is enabled', + 'description' => 'Whether or not the quick create is enabled', 'default' => true, 'value' => true, 'source_of_value' => '', @@ -1138,15 +1138,23 @@ class Config ], 'quick_create.max_autocomplete_results' => [ 'type' => 'integer', - 'description' => 'Max. number of elements returned by the autocomplete.', + 'description' => 'Max. number of elements returned by the autocomplete', 'default' => 10, 'value' => 10, 'source_of_value' => '', 'show_in_conf_sample' => false, ], + 'quick_create.show_history' => [ + 'type' => 'bool', + 'description' => 'Whether or not to display the elements in the history', + 'default' => true, + 'value' => true, + 'source_of_value' => '', + 'show_in_conf_sample' => false, + ], 'quick_create.max_history_results' => [ 'type' => 'integer', - 'description' => 'Max. number of elements in the history.', + 'description' => 'Max. number of elements in the history', 'default' => 10, 'value' => 10, 'source_of_value' => '', diff --git a/dictionaries/ui/components/en.dictionary.itop.quick-create.php b/dictionaries/ui/components/en.dictionary.itop.quick-create.php index 27fa215d2..1e2c7f223 100644 --- a/dictionaries/ui/components/en.dictionary.itop.quick-create.php +++ b/dictionaries/ui/components/en.dictionary.itop.quick-create.php @@ -23,4 +23,5 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Component:QuickCreate:Input:Placeholder' => 'Select object type...', 'UI:Component:QuickCreate:Recents:Title' => 'Recents', 'UI:Component:QuickCreate:LastClasses:NoClass:Placeholder' => 'You haven\'t create any object yet', + 'UI:Component:QuickCreate:HistoryDisabled' => 'History is disabled', )); \ No newline at end of file diff --git a/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php b/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php index 5aa7251bf..95c861c8a 100644 --- a/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php +++ b/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php @@ -55,6 +55,8 @@ class QuickCreate extends UIBlock protected $aLastClasses; /** @var int $iMaxAutocompleteResults Max. number of elements returned by the autocomplete */ protected $iMaxAutocompleteResults; + /** @var bool $bShowHistory Whether or not to display the elements in the history */ + protected $bShowHistory; /** @var int $iMaxHistoryResults Max. number of elements in the history */ protected $iMaxHistoryResults; @@ -73,6 +75,7 @@ class QuickCreate extends UIBlock $this->aAvailableClasses = UserRights::GetAllowedClasses(UR_ACTION_CREATE, array('bizmodel'), true); $this->aLastClasses = $aLastClasses; $this->iMaxAutocompleteResults = (int) MetaModel::GetConfig()->Get('quick_create.max_autocomplete_results'); + $this->bShowHistory = (bool) MetaModel::GetConfig()->Get('quick_create.show_history'); $this->iMaxHistoryResults = (int) MetaModel::GetConfig()->Get('quick_create.max_history_results'); } @@ -119,6 +122,15 @@ class QuickCreate extends UIBlock return $this->iMaxAutocompleteResults; } + /** + * @see $bShowHistory + * @return bool + */ + public function GetShowHistory(): bool + { + return $this->bShowHistory; + } + /** * @see $iMaxHistoryResults * @return int diff --git a/templates/base/components/quick-create/layout.html.twig b/templates/base/components/quick-create/layout.html.twig index 87270403c..8cdf150fc 100644 --- a/templates/base/components/quick-create/layout.html.twig +++ b/templates/base/components/quick-create/layout.html.twig @@ -20,7 +20,11 @@ {{ 'UI:Component:QuickCreate:Recents:Title'|dict_s }}