Skip to content
Snippets Groups Projects
Commit 64ccc32e authored by Elmar Ludwig's avatar Elmar Ludwig Committed by David Siegfried
Browse files

drop unused help system settings, fixes #655

parent 75774bd4
No related branches found
No related tags found
No related merge requests found
...@@ -94,20 +94,6 @@ class Migrate extends Command ...@@ -94,20 +94,6 @@ class Migrate extends Command
} }
} }
if (count($count)) {
if (!\Config::get()->getValue('HELP_CONTENT_CURRENT_VERSION')) {
\Config::get()->create('HELP_CONTENT_CURRENT_VERSION', [
'value' => $version,
'is_default' => 0,
'type' => 'string',
'range' => 'global',
'section' => 'global',
'description' => _('Aktuelle Version der Helpbar-Einträge in Stud.IP'),
]);
} else {
\Config::get()->store('HELP_CONTENT_CURRENT_VERSION', $version);
}
}
$io->success('help content added for ' . count($count) . ' routes.'); $io->success('help content added for ' . count($count) . ' routes.');
return Command::SUCCESS; return Command::SUCCESS;
} }
......
...@@ -25,7 +25,7 @@ class HelpToursAndContent extends Migration ...@@ -25,7 +25,7 @@ class HelpToursAndContent extends Migration
'type' => 'string', 'type' => 'string',
'range' => 'global', 'range' => 'global',
'section' => 'global', 'section' => 'global',
'description' => _('Aktuelle Version der Helpbar-Einträge in Stud.IP') 'description' => 'Aktuelle Version der Helpbar-Einträge in Stud.IP'
]); ]);
} else { } else {
Config::get()->store('HELP_CONTENT_CURRENT_VERSION', $version); Config::get()->store('HELP_CONTENT_CURRENT_VERSION', $version);
......
<?php
class DropHelpSettings extends Migration
{
public function description()
{
return 'Drop unused help system settings';
}
public function up()
{
$settings = [
'EXTERNAL_HELP',
'EXTERNAL_HELP_LOCATIONID',
'EXTERNAL_HELP_URL',
'HELP_CONTENT_CURRENT_VERSION'
];
// remove config entries
$query = 'DELETE `config`, `config_values`
FROM `config` LEFT JOIN `config_values` USING (`field`)
WHERE `field` IN (?)';
DBManager::get()->execute($query, [$settings]);
}
public function down()
{
// create config entries
$query = 'INSERT INTO `config` (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`)
VALUES (:name, :value, :type, :range, :section, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)';
$statement = DBManager::get()->prepare($query);
$statement->execute([
':name' => 'EXTERNAL_HELP',
':description' => 'Schaltet das externe Hilfesystem ein',
':section' => '',
':range' => 'global',
':type' => 'boolean',
':value' => '1'
]);
$statement->execute([
':name' => 'EXTERNAL_HELP_LOCATIONID',
':description' => 'Eine eindeutige ID zur Identifikation der gewünschten Hilfeseiten, leer bedeutet Standardhilfe',
':section' => '',
':range' => 'global',
':type' => 'string',
':value' => 'default'
]);
$statement->execute([
':name' => 'EXTERNAL_HELP_URL',
':description' => 'URL Template für das externe Hilfesystem',
':section' => '',
':range' => 'global',
':type' => 'string',
':value' => 'https://hilfe.studip.de/index.php/%s'
]);
$statement->execute([
':name' => 'HELP_CONTENT_CURRENT_VERSION',
':description' => 'Aktuelle Version der Helpbar-Einträge in Stud.IP',
':section' => 'global',
':range' => 'global',
':type' => 'string',
':value' => '3.1'
]);
}
}
...@@ -59,9 +59,6 @@ class HelpContent extends SimpleORMap { ...@@ -59,9 +59,6 @@ class HelpContent extends SimpleORMap {
if (!$language) { if (!$language) {
$language = mb_substr(Config::get()->DEFAULT_LANGUAGE, 0, 2); $language = mb_substr(Config::get()->DEFAULT_LANGUAGE, 0, 2);
} }
$version = Config::get()->getValue('HELP_CONTENT_CURRENT_VERSION');
if (!$version)
return [];
$route = get_route($route); $route = get_route($route);
$query = "SELECT * $query = "SELECT *
FROM help_content FROM help_content
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment