diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d0dab..9fe84c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 1.3.0 - 2020-06-08 ### Added - AGPL license file. ### Changed - Diaeresis in Dutch translation. - Code cleanup +- Import of objects with Geolocation field is now possible ### Removed - Support for iTop 2.3 and 2.4 in order to use php 5.6 diff --git a/main.sv-geolocation.php b/main.sv-geolocation.php index 0557852..51d08d1 100644 --- a/main.sv-geolocation.php +++ b/main.sv-geolocation.php @@ -131,6 +131,31 @@ public function GetAsHTMLForHistory($sValue, $oHostObject = null, $bLocalize = t { return (string) $sValue; } + + public function GetImportColumns() + { + $aColumns = array(); + $aColumns[$this->GetCode()] = 'VARCHAR(25)'.CMDBSource::GetSqlStringColumnDefinition(); + + return $aColumns; + } + + /** + * @param array $aCols + * @param string $sPrefix + * @return ormGeolocation|null + * @throws MissingColumnException + */ + public function FromImportToValue($aCols, $sPrefix = '') + { + if (!isset($aCols[$sPrefix])) + { + $sAvailable = implode(', ', array_keys($aCols)); + throw new MissingColumnException("Missing column '$sPrefix' from {$sAvailable}"); + } + + return $this->MakeRealValue($aCols[$sPrefix], null); + } /** * @return int Width of the map diff --git a/module.sv-geolocation.php b/module.sv-geolocation.php index 7c20558..f85c769 100644 --- a/module.sv-geolocation.php +++ b/module.sv-geolocation.php @@ -5,7 +5,7 @@ SetupWebPage::AddModule( __FILE__, // Path to the current file, all other file names are relative to the directory containing this file - 'sv-geolocation/1.2.0', + 'sv-geolocation/1.3.0', array( // Identification //