mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°3207 - Global search: Add possibility to open history items in a new tab
This commit is contained in:
@@ -107,18 +107,22 @@ class GlobalSearchHelper
|
||||
$aHistoryEntries = appUserPreferences::GetPref(static::USER_PREF_CODE, []);
|
||||
static::TruncateHistory($aHistoryEntries);
|
||||
|
||||
for($iIdx = 0; $iIdx < count($aHistoryEntries); $iIdx++)
|
||||
{
|
||||
// Add HTML label if missing
|
||||
if(!isset($aHistoryEntries[$iIdx]['label_html']))
|
||||
{
|
||||
$aHistoryEntries[$iIdx]['label_html'] = utils::EscapeHtml($aHistoryEntries[$iIdx]['query']);
|
||||
for($iIdx = 0; $iIdx < count($aHistoryEntries); $iIdx++){
|
||||
$sRawQuery = $aHistoryEntries[$iIdx]['query'];
|
||||
|
||||
// Make icon URL absolute
|
||||
if(isset($aHistoryEntries[$iIdx]['icon_url'])){
|
||||
$aHistoryEntries[$iIdx]['icon_url'] = utils::GetAbsoluteUrlAppRoot().$aHistoryEntries[$iIdx]['icon_url'];
|
||||
}
|
||||
|
||||
// Set absolute URL
|
||||
if(isset($aHistoryEntries[$iIdx]['icon_url']))
|
||||
{
|
||||
$aHistoryEntries[$iIdx]['icon_url'] = utils::GetAbsoluteUrlAppRoot().$aHistoryEntries[$iIdx]['icon_url'];
|
||||
// Add HTML label if missing
|
||||
if(!isset($aHistoryEntries[$iIdx]['label_html'])) {
|
||||
$aHistoryEntries[$iIdx]['label_html'] = utils::EscapeHtml($sRawQuery);
|
||||
}
|
||||
|
||||
// Add URL
|
||||
if(!isset($aHistoryEntries[$iIdx]['target_url'])){
|
||||
$aHistoryEntries[$iIdx]['target_url'] = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=full_text&text='.urlencode($sRawQuery);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class QuickCreateHelper
|
||||
$aHistoryEntries[$iIdx]['label_html'] = utils::EscapeHtml(MetaModel::GetName($sClass));
|
||||
}
|
||||
|
||||
// Add url
|
||||
// Add URL
|
||||
if(!isset($aHistoryEntries[$iIdx]['target_url']))
|
||||
{
|
||||
$aHistoryEntries[$iIdx]['target_url'] = DBObject::ComputeStandardUIPage($sClass).'?operation=new&class='.$sClass;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
{% elseif oUIBlock.GetLastQueries()|length > 0 %}
|
||||
{% for aQuery in oUIBlock.GetLastQueries() %}
|
||||
<a href="#" class="ibo-global-search--compartment-element" data-role="ibo-global-search--compartment-element" data-query-raw="{{ aQuery.query }}" title="{{ aQuery.query }}">
|
||||
<a href="{{ aQuery.target_url }}" class="ibo-global-search--compartment-element" data-role="ibo-global-search--compartment-element" data-query-raw="{{ aQuery.query }}" title="{{ aQuery.query }}">
|
||||
{% if aQuery.icon_url is defined %}
|
||||
<img src="{{ aQuery.icon_url}}" class="ibo-global-search--compartment-element-image">
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user