Browse Source

Add recursivity to install profiles mechanism and a default "production" profile - refs #1483

Yannick Warnier 9 years ago
parent
commit
8316506e8c
3 changed files with 18 additions and 2 deletions
  1. 4 0
      main/install/install.lib.php
  2. 3 2
      main/install/profiles/hr.json
  3. 11 0
      main/install/profiles/prod.json

+ 4 - 0
main/install/install.lib.php

@@ -2567,6 +2567,9 @@ function installProfileSettings(
         return false;
     }
     $settings = $params->params;
+    if (!empty($params->parent)) {
+        $res = installProfileSettings($params->parent);
+    }
     foreach ($settings as $id => $param) {
         $sql = "UPDATE settings_current
                 SET selected_value = '".$param->selected_value."'
@@ -2576,4 +2579,5 @@ function installProfileSettings(
         }
         Database::query($sql);
     }
+    return true;
 }

+ 3 - 2
main/install/profiles/hr.json

@@ -1,11 +1,12 @@
 {
     "id": 1,
     "name": "HR",
+    "parent": "prod",
     "params": [
         {
-          "variable": "show_link_bug_notification",
+          "variable": "allow_skills_tool",
           "subkey": "",
-          "selected_value": "false"
+          "selected_value": "true"
         }
     ]
 }

+ 11 - 0
main/install/profiles/prod.json

@@ -0,0 +1,11 @@
+{
+    "id": 1,
+    "name": "Production",
+    "params": [
+        {
+          "variable": "show_link_bug_notification",
+          "subkey": "",
+          "selected_value": "false"
+        }
+    ]
+}