diff --git a/datamodels/2.x/installation.xml b/datamodels/2.x/installation.xml
index 5f1048422..330736741 100755
--- a/datamodels/2.x/installation.xml
+++ b/datamodels/2.x/installation.xml
@@ -21,7 +21,8 @@
combodo-db-tools
itop-core-update
itop-hub-connector
- combodo-backoffice-darkmoon-theme
+ combodo-backoffice-darkmoon-theme
+ itop-themes-compat
true
diff --git a/datamodels/2.x/itop-themes-compat/README.md b/datamodels/2.x/itop-themes-compat/README.md
new file mode 100644
index 000000000..3d0e44fb5
--- /dev/null
+++ b/datamodels/2.x/itop-themes-compat/README.md
@@ -0,0 +1,2 @@
+# Extension Light grey and Test red themes compatibility
+
diff --git a/datamodels/2.x/itop-themes-compat/assets/css/compat.scss b/datamodels/2.x/itop-themes-compat/assets/css/compat.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/datamodels/2.x/itop-themes-compat/assets/css/css-variables.scss b/datamodels/2.x/itop-themes-compat/assets/css/css-variables.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/datamodels/2.x/itop-themes-compat/datamodel.itop-themes-compat.xml b/datamodels/2.x/itop-themes-compat/datamodel.itop-themes-compat.xml
new file mode 100644
index 000000000..492c47447
--- /dev/null
+++ b/datamodels/2.x/itop-themes-compat/datamodel.itop-themes-compat.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+ itop-themes-compat/assets/css/css-variables.scss
+
+
+ itop-themes-compat/assets/css/compat.scss
+ itop-themes-compat/assets/css/compat.scss
+ ../css/backoffice/main.scss
+
+
+
+
+ #C53030
+ #F7FAFC
+ "THIS IS A TEST INSTANCE"
+
+
+ itop-themes-compat/assets/css/css-variables.scss
+
+
+ itop-themes-compat/assets/css/compat.scss
+ itop-themes-compat/assets/css/compat.scss
+
+
+
+
+
diff --git a/datamodels/2.x/itop-themes-compat/en.dict.itop-themes-compat.php b/datamodels/2.x/itop-themes-compat/en.dict.itop-themes-compat.php
new file mode 100644
index 000000000..49f12deeb
--- /dev/null
+++ b/datamodels/2.x/itop-themes-compat/en.dict.itop-themes-compat.php
@@ -0,0 +1,11 @@
+ 'Light Grey (deprecated)',
+));
diff --git a/datamodels/2.x/itop-themes-compat/model.itop-themes-compat.php b/datamodels/2.x/itop-themes-compat/model.itop-themes-compat.php
new file mode 100644
index 000000000..ccc1b539e
--- /dev/null
+++ b/datamodels/2.x/itop-themes-compat/model.itop-themes-compat.php
@@ -0,0 +1,17 @@
+ 'Light grey and Test red themes compatibility',
+ 'category' => 'business',
+
+ // Setup
+ //
+ 'dependencies' => array(
+ 'itop-structure/3.0.1',
+ ),
+ 'mandatory' => false,
+ 'visible' => true,
+
+ // Components
+ //
+ 'datamodel' => array(
+ 'model.itop-themes-compat.php', // Contains the PHP code generated by the "compilation" of datamodel.itop-themes-compat.xml
+ ),
+ 'webservice' => array(
+
+ ),
+ 'data.struct' => array(
+ // add your 'structure' definition XML files here,
+ ),
+ 'data.sample' => array(
+ // add your sample data XML files here,
+ ),
+
+ // Documentation
+ //
+ 'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
+ 'doc.more_information' => '', // hyperlink to more information, if any
+
+ // Default settings
+ //
+ 'settings' => array(
+ // Module specific settings go here, if any
+ ),
+ )
+);
+
+
+?>
diff --git a/setup/itopdesignformat.class.inc.php b/setup/itopdesignformat.class.inc.php
index c8f13b536..925b5a090 100644
--- a/setup/itopdesignformat.class.inc.php
+++ b/setup/itopdesignformat.class.inc.php
@@ -667,8 +667,6 @@ class iTopDesignFormat
*/
protected function From16To15($oFactory)
{
- $oXPath = new DOMXPath($this->oDocument);
-
// Remove AttributeTagSet nodes
//
$sPath = "/itop_design/classes/class/fields/field[@xsi:type='AttributeTagSet']";
@@ -805,15 +803,7 @@ class iTopDesignFormat
$oNode->appendChild($oCodeNode);
}
- // N°3516 Remove legacy backoffice theme
- // Remove completely light-grey theme
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="light-grey"]');
-
// Update test-red theme
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="test-red"]/imports/import[@id="css-variables"]');
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="test-red"]/stylesheets/stylesheet[@id="jqueryui"]');
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="test-red"]/stylesheets/stylesheet[@id="main"]');
-
$oNodeList = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="backoffice-environment-banner-background-color"]');
foreach ($oNodeList as $oNode) {
$oNode->setAttribute('id', 'ibo-page-banner--background-color');
@@ -829,21 +819,6 @@ class iTopDesignFormat
$oNode->setAttribute('id', 'ibo-page-banner--text-content');
}
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="test-red"]/stylesheets/stylesheet[@id="environment-banner"]');
- // Add new stylesheets
- $oStyleSheetsNode = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/stylesheets')->item(0);
- if ($oStyleSheetsNode) {
- $oStyleSheetNode = $oStyleSheetsNode->ownerDocument->createElement("stylesheet");
- $oStyleSheetNode->setAttribute('id', 'environment-banner');
- $oStyleSheetNode->appendChild(new DOMText('../css/backoffice/themes/page-banner.scss'));
- $oStyleSheetsNode->appendChild($oStyleSheetNode);
-
- $oStyleSheetNode = $oStyleSheetsNode->ownerDocument->createElement("stylesheet");
- $oStyleSheetNode->setAttribute('id', 'fullmoon');
- $oStyleSheetNode->appendChild(new DOMText('../css/backoffice/main.scss'));
- $oStyleSheetsNode->appendChild($oStyleSheetNode);
- }
-
// Add new attribute to theme import nodes
$oNodeList = $oXPath->query('/itop_design/branding/themes/theme/imports/import');
foreach ($oNodeList as $oNode) {
@@ -923,24 +898,27 @@ class iTopDesignFormat
// N°3516 Bring back legacy themes
// Update test-red theme
- $oNodeList = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="ibo-page-banner--background-color"]');
- foreach ($oNodeList as $oNode) {
- $oNode->setAttribute('id', 'backoffice-environment-banner-background-color');
+ if (!$oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="backoffice-environment-banner-background-color"]')->item(0)) {
+ $oNodeList = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="ibo-page-banner--background-color"]');
+ foreach ($oNodeList as $oNode) {
+ $oNode->setAttribute('id', 'backoffice-environment-banner-background-color');
+ }
}
- $oNodeList = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="ibo-page-banner--text-color"]');
- foreach ($oNodeList as $oNode) {
- $oNode->setAttribute('id', 'backoffice-environment-banner-text-color');
+ if (!$oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="backoffice-environment-banner-text-color"]')->item(0)) {
+ $oNodeList = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="ibo-page-banner--text-color"]');
+ foreach ($oNodeList as $oNode) {
+ $oNode->setAttribute('id', 'backoffice-environment-banner-text-color');
+ }
}
- $oNodeList = $oXPath->query( '/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="ibo-page-banner--text-content"]');
- foreach ($oNodeList as $oNode) {
- $oNode->setAttribute('id', 'backoffice-environment-banner-text-content');
+ if (!$oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="backoffice-environment-banner-text-content"]')->item(0)) {
+ $oNodeList = $oXPath->query('/itop_design/branding/themes/theme[@id="test-red"]/variables/variable[@id="ibo-page-banner--text-content"]');
+ foreach ($oNodeList as $oNode) {
+ $oNode->setAttribute('id', 'backoffice-environment-banner-text-content');
+ }
}
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="test-red"]/stylesheets/stylesheet[@id="environment-banner"]');
- $this->RemoveNodeFromXPath('/itop_design/branding/themes/theme[@id="test-red"]/stylesheets/stylesheet[@id="fullmoon"]');
-
// Add new attribute to theme import nodes
$oNodeList = $oXPath->query('/itop_design/branding/themes/theme/imports/import');