From 4ea82dbf4932eece33ae601a202f79f801019609 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 19 Mar 2013 16:02:59 +0000 Subject: [PATCH] Reintegrated several fixes into branch 2.0: #682 Sort notifications #684 Issue with import/localized enum/reconciliation Reconciliation for SLT Unnecessary Dependance on service_id (user request) SVN:2.0[2640] --- core/bulkchange.class.inc.php | 11 ++++++++--- core/event.class.inc.php | 6 ++++++ .../datamodel.itop-request-mgmt-itil.xml | 1 - .../itop-request-mgmt/datamodel.itop-request-mgmt.xml | 1 - .../datamodel.itop-service-mgmt-provider.xml | 3 +++ .../itop-service-mgmt/datamodel.itop-service-mgmt.xml | 3 +++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index d034d8f89..85c1b53e7 100644 --- a/core/bulkchange.class.inc.php +++ b/core/bulkchange.class.inc.php @@ -297,7 +297,9 @@ class BulkChange foreach ($this->m_aExtKeys[$sAttCode] as $sForeignAttCode => $iCol) { // The foreign attribute is one of our reconciliation key - $oReconFilter->AddCondition($sForeignAttCode, $aRowData[$iCol], '='); + $oForeignAtt = MetaModel::GetAttributeDef($oExtKey->GetTargetClass(), $sForeignAttCode); + $value = $oForeignAtt->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues); + $oReconFilter->AddCondition($sForeignAttCode, $value); $aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]); } @@ -359,7 +361,9 @@ class BulkChange foreach ($aKeyConfig as $sForeignAttCode => $iCol) { // The foreign attribute is one of our reconciliation key - $oReconFilter->AddCondition($sForeignAttCode, $aRowData[$iCol], '='); + $oForeignAtt = MetaModel::GetAttributeDef($oExtKey->GetTargetClass(), $sForeignAttCode); + $value = $oForeignAtt->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues); + $oReconFilter->AddCondition($sForeignAttCode, $value, '='); $aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]); } $oExtObjects = new CMDBObjectSet($oReconFilter); @@ -824,7 +828,8 @@ class BulkChange { // The value is given in the data row $iCol = $this->m_aAttList[$sAttCode]; - $valuecondition = $aRowData[$iCol]; + $oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode); + $valuecondition = $oAttDef->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues); } if (is_null($valuecondition)) { diff --git a/core/event.class.inc.php b/core/event.class.inc.php index b022b1b44..261875da3 100644 --- a/core/event.class.inc.php +++ b/core/event.class.inc.php @@ -41,6 +41,7 @@ class Event extends DBObject implements iDisplay "db_key_field" => "id", "db_finalclass_field" => "realclass", "display_template" => "", + "order_by_default" => array('date' => false) ); MetaModel::Init_Params($aParams); //MetaModel::Init_InheritAttributes(); @@ -135,6 +136,7 @@ class EventNotification extends Event "db_key_field" => "id", "db_finalclass_field" => "", "display_template" => "", + "order_by_default" => array('date' => false) ); MetaModel::Init_Params($aParams); MetaModel::Init_InheritAttributes(); @@ -167,6 +169,7 @@ class EventNotificationEmail extends EventNotification "db_key_field" => "id", "db_finalclass_field" => "", "display_template" => "", + "order_by_default" => array('date' => false) ); MetaModel::Init_Params($aParams); MetaModel::Init_InheritAttributes(); @@ -204,6 +207,7 @@ class EventIssue extends Event "db_key_field" => "id", "db_finalclass_field" => "", "display_template" => "", + "order_by_default" => array('date' => false) ); MetaModel::Init_Params($aParams); MetaModel::Init_InheritAttributes(); @@ -303,6 +307,7 @@ class EventWebService extends Event "db_key_field" => "id", "db_finalclass_field" => "", "display_template" => "", + "order_by_default" => array('date' => false) ); MetaModel::Init_Params($aParams); MetaModel::Init_InheritAttributes(); @@ -337,6 +342,7 @@ class EventLoginUsage extends Event "db_table" => "priv_event_loginusage", "db_key_field" => "id", "db_finalclass_field" => "", + "order_by_default" => array('date' => false) ); MetaModel::Init_Params($aParams); MetaModel::Init_InheritAttributes(); diff --git a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml index ba90d4d23..6cbd611c4 100755 --- a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml +++ b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml @@ -298,7 +298,6 @@ id AND status NOT IN ('rejected','resolved','closed')]]> - parent_request_id UserRequest diff --git a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml index 6553b3f20..d8a4e4ac2 100755 --- a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml +++ b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml @@ -304,7 +304,6 @@ id AND status NOT IN ('rejected','resolved','closed')]]> - parent_request_id UserRequest diff --git a/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml b/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml index 6cb1c816a..61856f26e 100755 --- a/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml +++ b/datamodels/2.x/itop-service-mgmt-provider/datamodel.itop-service-mgmt-provider.xml @@ -1560,6 +1560,9 @@ + + + diff --git a/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml b/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml index a89ce1bc0..bd5060443 100755 --- a/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml +++ b/datamodels/2.x/itop-service-mgmt/datamodel.itop-service-mgmt.xml @@ -1555,6 +1555,9 @@ + + +