Skip to content

Commit

Permalink
Merge branch 'release/2.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed May 25, 2018
2 parents 7da94ce + 9a2d88e commit 02d848c
Show file tree
Hide file tree
Showing 12 changed files with 543 additions and 31 deletions.
4 changes: 4 additions & 0 deletions genericobject.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<author>Walid Nouh</author>
</authors>
<versions>
<version>
<num>2.5.1</num>
<compatibility>9.2</compatibility>
</version>
<version>
<num>2.5.0</num>
<compatibility>9.2</compatibility>
Expand Down
21 changes: 10 additions & 11 deletions inc/profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,22 @@ static function showForItemtype($type) {
echo "</strong></th></tr>";

echo "<tr><td class='genericobject_type_profiles'>";
$rights = [];
foreach (getAllDatasFromTable(getTableForItemtype("Profile")) as $profile) {
$prof = new Profile();
$prof->getFromDB($profile['id']);
$right = self::getProfileforItemtype($profile['id'], $itemtype);
$label = $profile['name'];
$rights[] = [
'label' => $label,
'itemtype' => $itemtype,
'field' => self::getProfileNameForItemtype($itemtype),
'html_field' => "profile_" . $profile['id'],
$rights = [
[
'label' => $profile['name'],
'itemtype' => $itemtype,
'field' => self::getProfileNameForItemtype($itemtype),
'html_field' => "profile_" . $profile['id'],
]
];
$prof->displayRightsChoiceMatrix(
$rights
);
}

$prof->displayRightsChoiceMatrix(
$rights
);
echo "</td></tr>";
echo "<input type='hidden' name='itemtype' value='".$itemtype."'>";

Expand Down
31 changes: 20 additions & 11 deletions inc/type.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1003,15 +1003,24 @@ public static function addLocales($name, $itemtype) {
if (!is_dir($locale_dir)) {
@ mkdir($locale_dir, 0755, true);
}
$locale_file = $name.".".$_SESSION['glpilanguage'];
self::addFileFromTemplate(['NAME' => $name,
'CLASSNAME' => self::getClassByName($name)],
self::LOCALE_TEMPLATE, $locale_dir,
$locale_file);

$locale_files = [
$name . '.' . $_SESSION['glpilanguage'],
];
if ($CFG_GLPI['language'] != $_SESSION['glpilanguage']) {
$locale_file = $name.".".$CFG_GLPI['language'];
self::addFileFromTemplate(['CLASSNAME' => $name], self::LOCALE_TEMPLATE, $locale_dir,
$locale_file);
$locale_files[] = $name . '.' . $CFG_GLPI['language'];
}

foreach ($locale_files as $locale_file) {
self::addFileFromTemplate(
[
'NAME' => $name,
'CLASSNAME' => self::getClassByName($name),
],
self::LOCALE_TEMPLATE,
$locale_dir,
$locale_file
);
}
}

Expand Down Expand Up @@ -1947,6 +1956,9 @@ static function install(Migration $migration) {
$migration->addField($table, "use_plugin_simcard", "bool");
$migration->migrationOneTable($table);

//If files are missing, recreate them!
self::checkClassAndFilesForItemType();

// Migrate notepad data
$allGenericObjectTypes = PluginGenericobjectType::getTypes(true);

Expand Down Expand Up @@ -2003,9 +2015,6 @@ static function install(Migration $migration) {
}

self::singularTypes();

//If files are missing, recreate them!
self::checkClassAndFilesForItemType();
}


Expand Down
Binary file added locales/cs_CZ.mo
Binary file not shown.
167 changes: 167 additions & 0 deletions locales/cs_CZ.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Pavel Borecki <[email protected]>, 2018
# Walid Nouh, 2015
msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Genericobject\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-13 14:17+0100\n"
"PO-Revision-Date: 2018-03-27 05:51+0000\n"
"Last-Translator: Pavel Borecki <[email protected]>\n"
"Language-Team: Czech (Czech Republic) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs_CZ\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"

#: setup.php:188 index.php:58 front/type.form.php:73 front/familylist.php:33
#: front/familylist.php:41 inc/profile.class.php:39
#: inc/object_item.class.php:109 inc/type.class.php:285 inc/type.class.php:368
msgid "Objects management"
msgstr "Správa objektů"

#: index.php:68 front/familylist.php:37
msgid "Empty family"
msgstr "Prázdná rodina"

#: front/commontreedropdown.form.php:36 front/commondropdown.php:11
#: front/commondropdown.form.php:36
msgid "The requested dropdown does not exists"
msgstr "Požadovaná rozbalovací nabídka neexistuje"

#: front/type.php:38 front/object.php:33 inc/profile.class.php:288
#: inc/type.class.php:66
msgid "Type of objects"
msgstr "Typ objektů"

#: front/field.form.php:41
msgid "Field(s) deleted successfully"
msgstr "Kolonky úspěšně smazány"

#: front/field.form.php:51
msgid "Field added successfully"
msgstr "Kolonka úspěšně přidána"

#: inc/field.class.php:64
msgid "Fields associated with the object"
msgstr "Kolonky přiřazené k objektu"

#: inc/field.class.php:70
msgid "Label"
msgstr "Štítek"

#: inc/field.class.php:71
msgid "Name in DB"
msgstr "Název v databázi"

#: inc/field.class.php:126
msgid "Add new field"
msgstr "Přidat novou kolonku"

#: inc/field.class.php:317
msgid "Read-only field"
msgstr "Kolonka pouze pro čtení"

#: inc/typefamily.class.php:36 inc/type.class.php:339 inc/type.class.php:458
msgid "Family of type of objects"
msgstr "Rodina typu objektů"

#: inc/profile.class.php:142
msgid "General"
msgstr "Obecné"

#: inc/profile.class.php:148
msgid "Objects"
msgstr "Objekty"

#: inc/profile.class.php:150
msgid "(No types defined yet)"
msgstr "(Doposud nebyly určené žádné typy)"

#: inc/object.class.php:471
msgid "Object preview"
msgstr "Náhled objektu"

#: inc/object.class.php:751
msgid "You must configure rights to enable the preview"
msgstr "Pro zapnutí náhledu je třeba nastavit oprávnění"

#: inc/type.class.php:153
msgid "Type name is missing"
msgstr "Název typu chybí"

#: inc/type.class.php:159
msgid "Type name must be longer"
msgstr "Je třeba, aby název typu byl delší"

#: inc/type.class.php:165
msgid ""
"Types 'field', 'object' and 'type' are reserved. Please choose another one"
msgstr "Typy „field“ (kolonka), „object“ (objekt) a „type“ (typ) jsou vyhrazené (už je nemůžete použít). Zvolte jiný"

#: inc/type.class.php:172
msgid "Type must start with a letter"
msgstr "Je třeba, aby typ začínal písmenem"

#: inc/type.class.php:179
msgid "A type already exists with the same name"
msgstr "Typ se stejným názvem už existuje"

#: inc/type.class.php:419
msgid "Internal identifier"
msgstr "Vnitřní identifikátor"

#: inc/type.class.php:473
msgid "Behaviour"
msgstr "Chování"

#: inc/type.class.php:492
msgid "Network connections"
msgstr "Síťová připojení"

#: inc/type.class.php:496
msgid "injection file plugin"
msgstr "zásuvný modul vkládání souborů"

#: inc/type.class.php:498
msgid "geninventorynumber plugin"
msgstr "zásuvný modul vytváření inventárních čísel"

#: inc/type.class.php:499
msgid "order plugin"
msgstr "zásuvný modul správa objednávek"

#: inc/type.class.php:500
msgid "item's uninstallation plugin"
msgstr "zásuvný modul odinstalace položek"

#: inc/type.class.php:501
msgid "simcard plugin"
msgstr "zásuvný modul sim karty"

#: inc/type.class.php:653
msgid "Regenerate files"
msgstr "Znovu vytvořit soubory"

#: inc/type.class.php:666
msgid "Link to other objects"
msgstr "Propojit s ostatními objekty"

#. TRANS: %1$s is itemtype name
#: inc/type.class.php:1958
#, php-format
msgid "Unable to load the class %1$s."
msgstr "Nedaří se načíst třídu %1$s."

#. TRANS: %1$s is itemtype name
#: inc/type.class.php:1960
#, php-format
msgid ""
"You probably have garbage data in your database for this plugin and missing "
"files in %1$s"
msgstr "Nejspíš ve své databázi máte pro tento modul v nepořádku data a chybí soubory v %1$s"
Binary file added locales/pl_PL.mo
Binary file not shown.
Loading

0 comments on commit 02d848c

Please sign in to comment.