Skip to content

Commit

Permalink
Merge branch 'release/2.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Dec 7, 2018
2 parents be1122e + 4e376f3 commit a87559a
Show file tree
Hide file tree
Showing 14 changed files with 369 additions and 117 deletions.
248 changes: 165 additions & 83 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions fields/field.constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

$GO_FIELDS['groups_id']['name'] = __("Group");
$GO_FIELDS['groups_id']['input_type'] = 'dropdown';
$GO_FIELDS['groups_id']['condition'] = '`is_itemgroup`';
$GO_FIELDS['groups_id']['condition'] = ['is_itemgroup' => 1];

$GO_FIELDS['manufacturers_id']['name'] = __("Manufacturer");
$GO_FIELDS['manufacturers_id']['input_type'] = 'dropdown';
Expand All @@ -143,4 +143,4 @@

$GO_FIELDS['groups_id_tech']['name'] = __("Group in charge of the hardware");
$GO_FIELDS['groups_id_tech']['input_type'] = 'dropdown';
$GO_FIELDS['groups_id_tech']['condition'] = '`is_assign`';
$GO_FIELDS['groups_id_tech']['condition'] = ['is_assign' => 1];
4 changes: 4 additions & 0 deletions genericobject.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<author>Walid Nouh</author>
</authors>
<versions>
<version>
<num>2.7.0</num>
<compatibility>9.4</compatibility>
</version>
<version>
<num>2.6.2</num>
<compatibility>9.3</compatibility>
Expand Down
2 changes: 1 addition & 1 deletion hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function plugin_genericobject_uninstall() {
function plugin_datainjection_populate_genericobject() {
global $INJECTABLE_TYPES;
$type = new PluginGenericobjectType();
foreach ($type->find("`use_plugin_datainjection`='1' AND `is_active`='1'") as $data) {
foreach ($type->find(['use_plugin_datainjection' => 1, 'is_active' => 1]) as $data) {
if (class_exists($data ['itemtype']."Injection")) {
$INJECTABLE_TYPES[$data ['itemtype']."Injection"] = 'genericobject';
}
Expand Down
15 changes: 7 additions & 8 deletions inc/object.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,17 +1027,16 @@ function transfer($new_entity) {
continue;
} else {
$tmp = [];
$where = "";
$where = [];
if ($dropdown instanceof CommonTreeDropdown) {
$tmp['completename'] = $dropdown->fields['completename'];
$where = "`completename`='".
Toolbox::addslashes_deep($tmp['completename'])."'";
$tmp['completename'] = $dropdown->fields['completename'];
$where['completename'] = Toolbox::addslashes_deep($tmp['completename']);
} else {
$tmp['name'] = $dropdown->fields['name'];
$where = "`name`='".Toolbox::addslashes_deep($tmp['name'])."'";
$tmp['name'] = $dropdown->fields['name'];
$where['name'] = Toolbox::addslashes_deep($tmp['name']);
}
$tmp['entities_id'] = $new_entity;
$where .= " AND `entities_id`='".$tmp['entities_id']."'";
$tmp['entities_id'] = $new_entity;
$where['entities_id'] = $tmp['entities_id'];
//There's a dropdown value in the target entity
if ($found = $dropdown->find($where)) {
$myfound = array_pop($found);
Expand Down
6 changes: 3 additions & 3 deletions inc/type.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ public static function removeDataInjectionModels($itemtype) {
//Delete if exists datainjection models
if ($plugin->isInstalled("datainjection") && $plugin->isActivated("datainjection")) {
$model = new PluginDatainjectionModel();
foreach ($model->find("`itemtype`='$itemtype'") as $data) {
foreach ($model->find(['itemtype' => $itemtype]) as $data) {
$model->delete($data);
}
}
Expand All @@ -1498,7 +1498,7 @@ public static function removeDataInjectionModels($itemtype) {
*/
public static function deleteLoans($itemtype) {
$reservation_item = new ReservationItem();
foreach ($reservation_item->find("`itemtype`='$itemtype'") as $data) {
foreach ($reservation_item->find(['itemtype' => $itemtype]) as $data) {
$reservation_item->delete($data);
}
}
Expand Down Expand Up @@ -1533,7 +1533,7 @@ public static function deleteNotepad($itemtype) {
*/
static function deleteNetworking($itemtype) {
$networkport = new NetworkPort();
foreach ($networkport->find("`itemtype`='$itemtype'") as $port) {
foreach ($networkport->find(['itemtype' => $itemtype]) as $port) {
$networkport->delete($port);
}
}
Expand Down
Binary file added locales/fi_FI.mo
Binary file not shown.
166 changes: 166 additions & 0 deletions locales/fi_FI.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Markku Vepsä, 2018
msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Genericobject\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-22 13:21+0000\n"
"PO-Revision-Date: 2018-11-13 19:30+0000\n"
"Last-Translator: Markku Vepsä\n"
"Language-Team: Finnish (Finland) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/fi_FI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: fi_FI\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: front/type.php:38 front/object.php:33 inc/profile.class.php:287
#: inc/type.class.php:66
msgid "Type of objects"
msgstr "Kohteiden tyyppi"

#: front/type.form.php:73 front/familylist.php:33 front/familylist.php:41
#: index.php:58 inc/object_item.class.php:109 inc/profile.class.php:39
#: inc/type.class.php:289 inc/type.class.php:415 setup.php:193
msgid "Objects management"
msgstr "Kohteiden hallinta"

#: front/field.form.php:41
msgid "Field(s) deleted successfully"
msgstr "Kenttä/kentät poistettu onnistuneesti"

#: front/field.form.php:51
msgid "Field added successfully"
msgstr "Kenttä lisätty onnistuneesti"

#: front/commondropdown.php:11 front/commontreedropdown.form.php:36
#: front/commondropdown.form.php:36
msgid "The requested dropdown does not exists"
msgstr "Pyydettyä alasvetovalikkoa ei ole olemassa"

#: front/familylist.php:37 index.php:68
msgid "Empty family"
msgstr "Tyhjä perhe"

#: inc/profile.class.php:141
msgid "General"
msgstr "Yleinen"

#: inc/profile.class.php:147
msgid "Objects"
msgstr "Kohteet"

#: inc/profile.class.php:149
msgid "(No types defined yet)"
msgstr "(Tyyppejä ei ole vielä määritelty)"

#: inc/field.class.php:64
msgid "Fields associated with the object"
msgstr "Kohteeseen liittyvät kentät"

#: inc/field.class.php:70
msgid "Label"
msgstr "Etiketti"

#: inc/field.class.php:71
msgid "Name in DB"
msgstr "Nimi tietokannassa"

#: inc/field.class.php:126
msgid "Add new field"
msgstr "Lisää uusi kenttä"

#: inc/field.class.php:317
msgid "Read-only field"
msgstr "Vain luku kenttä"

#: inc/type.class.php:153
msgid "Type name is missing"
msgstr "Tyyppinimi puuttuu"

#: inc/type.class.php:159
msgid "Type name must be longer"
msgstr "Tyyppinimen on oltava pidempi"

#: inc/type.class.php:165
msgid ""
"Types 'field', 'object' and 'type' are reserved. Please choose another one"
msgstr "Tyypit \"kenttä\", \"kohde\" ja \"tyyppi\" ovat varattuja. Valitse joku toinen"

#: inc/type.class.php:172
msgid "Type must start with a letter"
msgstr "Tyypin täytyy alkaa kirjaimella"

#: inc/type.class.php:179
msgid "A type already exists with the same name"
msgstr "Samanniminen tyyppi on jo olemassa"

#: inc/type.class.php:376 inc/type.class.php:505 inc/typefamily.class.php:36
msgid "Family of type of objects"
msgstr "Kohteiden tyypin perhe"

#: inc/type.class.php:466
msgid "Internal identifier"
msgstr "Sisäinen tunniste"

#: inc/type.class.php:520
msgid "Behaviour"
msgstr "Käyttäytyminen"

#: inc/type.class.php:539
msgid "Network connections"
msgstr "Verkkoyhteydet"

#: inc/type.class.php:543
msgid "injection file plugin"
msgstr "Tiedoston tuonti -liitännäinen"

#: inc/type.class.php:545
msgid "geninventorynumber plugin"
msgstr "Inventaarinumeron luonti liitännäinen"

#: inc/type.class.php:546
msgid "order plugin"
msgstr "Tilaus -liitännäinen"

#: inc/type.class.php:547
msgid "item's uninstallation plugin"
msgstr "Kohteen poisto -liitännäinen"

#: inc/type.class.php:548
msgid "simcard plugin"
msgstr "SIM-kortti -liitännäinen"

#: inc/type.class.php:700
msgid "Regenerate files"
msgstr "Luo tiedostot uudelleen"

#: inc/type.class.php:713
msgid "Link to other objects"
msgstr "Linkki muihin kohteisiin"

#. TRANS: %1$s is itemtype name
#: inc/type.class.php:2017
#, php-format
msgid "Unable to load the class %1$s."
msgstr "Ei voida ladata luokkaa %1$s."

#. TRANS: %1$s is itemtype name
#: inc/type.class.php:2019
#, php-format
msgid ""
"You probably have garbage data in your database for this plugin and missing "
"files in %1$s"
msgstr "Tietokannassa on ongelma liittyen liitännäiseen ja puuttuvia tiedostoja %1$s"

#: inc/object.class.php:471
msgid "Object preview"
msgstr "Kohteen esikatselu"

#: inc/object.class.php:751
msgid "You must configure rights to enable the preview"
msgstr "Oikeudet on määritettävä, jotta esikatselu voidaan ottaa käyttöön"
Binary file modified locales/it_IT.mo
Binary file not shown.
11 changes: 6 additions & 5 deletions locales/it_IT.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Pierfrancesco Passerini <[email protected]>, 2018
# Salvatore Russo <[email protected]>, 2016
# Giudy <[email protected]>, 2018
msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Genericobject\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-22 13:21+0000\n"
"PO-Revision-Date: 2018-06-21 11:16+0000\n"
"Last-Translator: Giudy <[email protected]>\n"
"PO-Revision-Date: 2018-09-25 13:46+0000\n"
"Last-Translator: Pierfrancesco Passerini <[email protected]>\n"
"Language-Team: Italian (Italy) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/it_IT/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -32,7 +33,7 @@ msgstr "Gestione degli Oggetti"

#: front/field.form.php:41
msgid "Field(s) deleted successfully"
msgstr "Campo(i) rimosso/i con successo"
msgstr "Campi rimossi con successo"

#: front/field.form.php:51
msgid "Field added successfully"
Expand Down Expand Up @@ -94,7 +95,7 @@ msgstr "I tipi 'field', 'object' e 'type' sono riservati. Sceglierne un altro"

#: inc/type.class.php:172
msgid "Type must start with a letter"
msgstr "Il nome del tipo deve cominciare con una lettera"
msgstr "Il nome del tipo deve iniziare con una lettera"

#: inc/type.class.php:179
msgid "A type already exists with the same name"
Expand Down Expand Up @@ -156,7 +157,7 @@ msgstr "Impossibile caricare la classe %1$s ."
msgid ""
"You probably have garbage data in your database for this plugin and missing "
"files in %1$s"
msgstr ""
msgstr "Per questo plugin hai, probabilmente, dei dati inutili nel tuo database e file mancanti in %1$s"

#: inc/object.class.php:471
msgid "Object preview"
Expand Down
2 changes: 1 addition & 1 deletion locales/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# polar147 <[email protected]>, 2017
# Andrei Bernardo Simoni <[email protected]>, 2017
# Arthur Ramos Schaefer <[email protected]>, 2017
msgid ""
msgstr ""
Expand Down
Binary file modified locales/sv_SE.mo
Binary file not shown.
22 changes: 11 additions & 11 deletions locales/sv_SE.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Johan Hörnqvist <[email protected]>, 2018
# jchan <[email protected]>, 2018
msgid ""
msgstr ""
"Project-Id-Version: GLPI Plugin - Genericobject\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-22 13:21+0000\n"
"PO-Revision-Date: 2018-09-06 22:04+0000\n"
"Last-Translator: Johan Hörnqvist <[email protected]>\n"
"PO-Revision-Date: 2018-09-10 09:31+0000\n"
"Last-Translator: jchan <[email protected]>\n"
"Language-Team: Swedish (Sweden) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/sv_SE/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -31,7 +31,7 @@ msgstr "Hantera tillgångar"

#: front/field.form.php:41
msgid "Field(s) deleted successfully"
msgstr "Attribut raderat"
msgstr "Fältet(en) raderades"

#: front/field.form.php:51
msgid "Field added successfully"
Expand Down Expand Up @@ -60,7 +60,7 @@ msgstr "(Inga typer har skapats ännu)"

#: inc/field.class.php:64
msgid "Fields associated with the object"
msgstr "Attribut kopplade till tillgången"
msgstr "Fält kopplade till tillgången"

#: inc/field.class.php:70
msgid "Label"
Expand All @@ -72,15 +72,15 @@ msgstr "Namn i DB"

#: inc/field.class.php:126
msgid "Add new field"
msgstr "Lägg till nytt attribut"
msgstr "Lägg till nytt fält"

#: inc/field.class.php:317
msgid "Read-only field"
msgstr "Skrivskyddat attribut"
msgstr "Skrivskyddat fält"

#: inc/type.class.php:153
msgid "Type name is missing"
msgstr "Typnamnet saknas"
msgstr "Typnamn saknas"

#: inc/type.class.php:159
msgid "Type name must be longer"
Expand All @@ -89,7 +89,7 @@ msgstr "Typnamnet måste vara längre"
#: inc/type.class.php:165
msgid ""
"Types 'field', 'object' and 'type' are reserved. Please choose another one"
msgstr "Typnamnen 'attribut', 'objekt' och 'typ' är reserverade av systemet. Var vänlig välj ett annat namn."
msgstr "Typnamnen 'fält, 'objekt' och 'typ' är reserverade av systemet. Var vänlig välj ett annat namn."

#: inc/type.class.php:172
msgid "Type must start with a letter"
Expand All @@ -101,7 +101,7 @@ msgstr "Typnamnet existerar redan"

#: inc/type.class.php:376 inc/type.class.php:505 inc/typefamily.class.php:36
msgid "Family of type of objects"
msgstr "Tillhör typfamilj"
msgstr "Ingår i typfamilj"

#: inc/type.class.php:466
msgid "Internal identifier"
Expand Down Expand Up @@ -155,7 +155,7 @@ msgstr "Kunde inte läsa in klass %1$s-"
msgid ""
"You probably have garbage data in your database for this plugin and missing "
"files in %1$s"
msgstr "Du har troligtvis skräpdata i databasen för denna plug-in och saknade filer i %1$s"
msgstr "Du har troligtvis skräpdata i databasen för denna plug-in och saknar filer i %1$s"

#: inc/object.class.php:471
msgid "Object preview"
Expand Down
Loading

0 comments on commit a87559a

Please sign in to comment.