summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUdo Walter2020-01-17 00:45:55 +0100
committerUdo Walter2020-01-17 00:45:55 +0100
commit837ace277ea3c0fe254175372e5fe71098e47636 (patch)
tree5c0ef7608f90cad76f3aa4fedee5b91758f06e88
parent[sysconfig] Screensaver: Add a full fledged back button experience (diff)
downloadslx-admin-837ace277ea3c0fe254175372e5fe71098e47636.tar.gz
slx-admin-837ace277ea3c0fe254175372e5fe71098e47636.tar.xz
slx-admin-837ace277ea3c0fe254175372e5fe71098e47636.zip
[systemconfig] Add warning to the assign step at the end of module creation if other modules would be replaced because the module is unique
-rw-r--r--modules-available/sysconfig/addmodule.inc.php22
-rw-r--r--modules-available/sysconfig/lang/de/template-tags.json1
-rw-r--r--modules-available/sysconfig/lang/en/template-tags.json1
-rw-r--r--modules-available/sysconfig/templates/assign.html14
4 files changed, 35 insertions, 3 deletions
diff --git a/modules-available/sysconfig/addmodule.inc.php b/modules-available/sysconfig/addmodule.inc.php
index b4a84537..91fee45d 100644
--- a/modules-available/sysconfig/addmodule.inc.php
+++ b/modules-available/sysconfig/addmodule.inc.php
@@ -177,9 +177,29 @@ class AddModule_Assign extends AddModule_Base
protected function renderInternal()
{
- $data = ['edit' => $this->edit->id(), 'configs' => SysConfig::getAll()];
+ $data = ['configs' => SysConfig::getAll()];
if (count($data['configs']) === 0)
Util::redirect('?do=SysConfig');
+
+ $moduleType = $this->edit->moduleType();
+ if (ConfigModule::getList()[$moduleType]['unique']) {
+ $modules = Database::queryAll('SELECT configtgz_module.moduleid as moduleid, configtgz_module.title as title, configtgz_x_module.configid as configid'
+ . ' FROM configtgz_module INNER JOIN configtgz_x_module ON configtgz_module.moduleid = configtgz_x_module.moduleid'
+ . ' WHERE configtgz_module.moduletype = :moduletype',
+ array('moduletype' => $moduleType));
+
+ $modulesByConfigId = [];
+ foreach ($modules as $module) {
+ $modulesByConfigId[$module['configid']] = $module;
+ }
+
+ foreach ($data['configs'] as &$config) {
+ if (!isset($modulesByConfigId[$config['configid']])) continue;
+ $config['replaces'] = $modulesByConfigId[$config['configid']]['title'];
+ }
+ }
+
+ $data['edit'] = $this->edit->id();
Render::addDialog(Dictionary::translate('lang_moduleAssign'), false, 'assign', $data);
}
diff --git a/modules-available/sysconfig/lang/de/template-tags.json b/modules-available/sysconfig/lang/de/template-tags.json
index f42ce0f4..ac6e5ec8 100644
--- a/modules-available/sysconfig/lang/de/template-tags.json
+++ b/modules-available/sysconfig/lang/de/template-tags.json
@@ -99,6 +99,7 @@
"lang_rebuildLong": "Modul oder Konfiguration neu generieren. Das entsprechende Modul bzw. Konfiguration ist aktuell und sollte nicht neu generiert werden m\u00fcssen.",
"lang_rebuildOutdatedLong": "Modul oder Konfiguration neu generieren. Das entsprechende Modul bzw. Konfiguration ist veraltet oder nicht vorhanden.",
"lang_redirectionWarning": "ACHTUNG: Diese Funktion ist experimentell. Sie biegt nach dem Starten mittels openslx.exe die ausgew\u00e4hlten Verzeichnisse auf das Home-Verzeichnis des angemeldeten Benutzers um (getestet mit Windows 7 und 10). Da hierzu undokumentierte Windows-Einstellungen zur Laufzeit ge\u00e4ndert werden ist nicht garantiert, dass diese Methode in sp\u00e4teren Versionen\/Updates von Windows noch funktioniert. Wir empfehlen, stattdessen die Verzeichnisse - sofern gew\u00fcnscht - bereits in der Vorlage auf den oben konfigurierten Laufwerksbuchstaben des Home-Verzeichnisses umzukonfigurieren.",
+ "lang_replaces": "Ersetzt Modul: ",
"lang_restartWizard": "Wizard neu starten",
"lang_rootKey": "root pubkey (\u00f6ffentlicher Schl\u00fcssel)",
"lang_rootKeyInfo": "Tragen Sie hier den \u00f6ffentlichen Schl\u00fcssel eines Schl\u00fcsselpaars ein, mit dem Sie sich als root-Benutzer an den Clients anmelden wollen. Lassen Sie das Feld leer, um diese Funktion nicht zu verwenden.",
diff --git a/modules-available/sysconfig/lang/en/template-tags.json b/modules-available/sysconfig/lang/en/template-tags.json
index cbdda4ac..9aeb6e0a 100644
--- a/modules-available/sysconfig/lang/en/template-tags.json
+++ b/modules-available/sysconfig/lang/en/template-tags.json
@@ -99,6 +99,7 @@
"lang_rebuildLong": "Rebuild module or configuration.",
"lang_rebuildOutdatedLong": "Rebuild module or configuration. The module\/configuration is outdated or missing and should be regenerated.",
"lang_redirectionWarning": "WARNING: This feature is experimental. It remaps the selected folders after the VM booted (via openslx.exe) to the logged in user's home drive. This might cause problems with applications that start before the paths are patched, as they will see the old unpatched settings. Please note that this is usign undocumented or unsupported techniques to achieve this goal. It is not guaranteed that this method will work in future versions or updates of Windows. If you want to reliably remap these directories, you might want to change their locations in the VM before uploading it.",
+ "lang_replaces": "Replaces module: ",
"lang_restartWizard": "Restart wizard",
"lang_rootKey": "root pubkey",
"lang_rootKeyInfo": "Here you can add the public key of a keypair that you want to use for authentication as root-user. Leave this field blank to disable the feature.",
diff --git a/modules-available/sysconfig/templates/assign.html b/modules-available/sysconfig/templates/assign.html
index b3e3d267..9e83f965 100644
--- a/modules-available/sysconfig/templates/assign.html
+++ b/modules-available/sysconfig/templates/assign.html
@@ -11,11 +11,21 @@
<label></label>
</div>
</span>
- <label class="form-control" for="config{{configid}}">{{title}}</label>
+ <label class="form-control config-label" for="config{{configid}}">
+ <span>{{title}}</span>
+ {{#replaces}}<span class="text-danger">{{lang_replaces}} {{.}}</span>{{/replaces}}
+ </label>
</div>
{{/configs}}
<div class="text-right" style="margin-top: 12px">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
</div>
-</form> \ No newline at end of file
+</form>
+
+<style>
+ .config-label {
+ display: flex !important;
+ justify-content: space-between !important;
+ }
+</style> \ No newline at end of file