diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php
index 6da6d6985..4689c1c21 100644
--- a/application/cmdbabstract.class.inc.php
+++ b/application/cmdbabstract.class.inc.php
@@ -106,7 +106,11 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
{
// Assumption: $aData['datasource'] will not be null because the data source id is always set...
$sApplicationURL = $aData['datasource']->GetApplicationUrl($this, $aData['replica']);
+ $sLink = '';
+ if (!empty($sApplicationURL))
+ {
$sLink = "".$aData['datasource']->GetName()."";
+ }
if ($aData['replica']->Get('status_dest_creator') == 1)
{
$sTip .= "
The object was created by the external data source $sLink
";
@@ -1062,6 +1066,18 @@ EOF
$aAllowedValues = MetaModel::GetAllowedValues_flt($sClassName, $sFilterCode, $aExtraParams);
if ($aAllowedValues != null)
{
+ $oAttDef = MetaModel::GetAttributeDef($sClassName, $sFilterCode);
+
+ if ($oAttDef->IsExternalKey())
+ {
+ $iFieldSize = $oAttDef->GetMaxSize();
+ $iMaxComboLength = $oAttDef->GetMaximumComboLength();
+ $oWidget = new UIExtKeyWidget($sFilterCode, $sClassName, $oAttDef->GetLabel(), $aAllowedValues, $sFilterValue, 'search_'.$sFilterCode, false, '', '', '');
+ $sHtml .= " ";
+ $sHtml .= $oWidget->Display($oPage, $aExtraParams, true /* bSearchMode */);
+ }
+ else
+ {
//Enum field or external key, display a combo
$sValue = "\n";
$sHtml .= " $sValue\n";
+ }
unset($aExtraParams[$sFilterCode]);
}
else
diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php
index 6ebe4684c..a0376d4e4 100644
--- a/application/ui.extkeywidget.class.inc.php
+++ b/application/ui.extkeywidget.class.inc.php
@@ -92,12 +92,24 @@ class UIExtKeyWidget
* @param Hash $aArgs Extra context arguments
* @return string The HTML fragment to be inserted into the page
*/
- public function Display(WebPage $oPage, $aArgs = array())
+ public function Display(WebPage $oPage, $aArgs = array(), $bSearchMode = false)
{
- $bCreate = (!MetaModel::IsAbstract($this->sTargetClass)) && (UserRights::IsActionAllowed($this->sTargetClass, UR_ACTION_BULK_MODIFY) && $this->oAttDef->AllowTargetCreation());
+ $oPage->add_linked_script('../js/extkeywidget.js');
+ $oPage->add_linked_script('../js/forms-json-utils.js');
+
+ $bCreate = (!$bSearchMode) && (!MetaModel::IsAbstract($this->sTargetClass)) && (UserRights::IsActionAllowed($this->sTargetClass, UR_ACTION_BULK_MODIFY) && $this->oAttDef->AllowTargetCreation());
$sMessage = Dict::S('UI:Message:EmptyList:UseSearchForm');
+ $sAttrFieldPrefix = ($bSearchMode) ? '' : 'attr_';
$sHTMLValue = ""; // no wrap
+ if($bSearchMode)
+ {
+ $sWizHelper = 'null';
+ }
+ else
+ {
+ $sWizHelper = 'oWizardHelper'.$this->sFormPrefix;
+ }
if (count($this->aAllowedValues) < $this->oAttDef->GetMaximumComboLength())
{
// Few choices, use a normal 'select'
@@ -106,8 +118,15 @@ class UIExtKeyWidget
$sHelpText = $this->oAttDef->GetHelpOnEdition();
// In case there are no valid values, the select will be empty, thus blocking the user from validating the form
- $sHTMLValue = "