Skip to content

Commit

Permalink
Drop unused language field
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed May 17, 2022
1 parent 42697d7 commit fa3ecdc
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ function showForm($ID, $options = []) {
echo "</td>";
echo "</tr>";

echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Language', 'useditemsexport') . "</td>";
echo "<td>";
self::dropdownLanguage($this->fields["language"]);
echo "</td>";
echo "</tr>";

$this->showFormButtons($options);
}

Expand Down Expand Up @@ -121,28 +114,6 @@ function dropdownFormat($value) {
['value' => $value]);
}

/**
* Show dropdown Language (fr, en, it, etc...)
* @param value (current preselected value)
* @return nothing (display dropdown)
*/
function dropdownLanguage($value) {
global $CFG_GLPI;

$supported_languages = ['ca','cs','da','de','en','es','fr','it','nl','pt','tr'];

$languages = [];
foreach ($CFG_GLPI['languages'] as $lang => $datas) {
$short_code = substr($lang, 0, 2);
if (in_array($short_code, $supported_languages)) {
$languages[$short_code] = $datas[0];
}
}

Dropdown::showFromArray("language", $languages,
['value' => $value]);
}

/**
* Load configuration plugin in GLPi Session
*
Expand Down Expand Up @@ -178,14 +149,14 @@ static function install(Migration $migration) {
`is_active` TINYINT NOT NULL DEFAULT 1,
`orientation` VARCHAR(1) NOT NULL DEFAULT 'P',
`format` VARCHAR(2) NOT NULL DEFAULT 'A4',
`language` VARCHAR(2) NOT NULL DEFAULT 'fr',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;";
$DB->query($query) or die ($DB->error());

$query = "INSERT INTO `$table` (id) VALUES (1)";
$DB->query($query) or die ($DB->error());
}
$migration->dropField($table, 'language'); // useless field removed in 2.5.1

$migration->displayMessage("Create useditemsexport dir");
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/useditemsexport')) {
Expand Down

0 comments on commit fa3ecdc

Please sign in to comment.