Skip to content

Commit be1122e

Browse files
committed
Merge branch 'release/2.6.2'
2 parents 2003590 + 819564c commit be1122e

File tree

6 files changed

+192
-8
lines changed

6 files changed

+192
-8
lines changed

genericobject.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<author>Walid Nouh</author>
2525
</authors>
2626
<versions>
27+
<version>
28+
<num>2.6.2</num>
29+
<compatibility>9.3</compatibility>
30+
</version>
2731
<version>
2832
<num>2.6.1</num>
2933
<compatibility>9.3</compatibility>

inc/object.class.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,18 @@ function rawSearchOptions() {
760760
$index_exceptions = ['name' => 1, 'id' => 2, 'comment' => 16, 'date_mod' => 19,
761761
'entities_id' => 80, 'is_recursive' => 86, 'notepad' => 90,
762762
'date_creation' => 121];
763+
764+
// Don't use indexes blacklisted by other item types in plugin DataInjection.
765+
$plugin = new Plugin();
766+
if ($plugin->isActivated("datainjection")
767+
&& class_exists('PluginDatainjectionCommonInjectionLib')) {
768+
$blacklisted_indexes = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(
769+
get_called_class() //A class that extends PluginGenericobjectObject
770+
);
771+
} else {
772+
$blacklisted_indexes = [];
773+
}
774+
763775
$index = 3;
764776

765777
$options = [];
@@ -771,6 +783,9 @@ function rawSearchOptions() {
771783

772784
$table = getTableForItemType(get_called_class());
773785

786+
// Prevent usage of reserved and blacklisted indexes
787+
$taken_indexes = array_merge($index_exceptions, $blacklisted_indexes);
788+
774789
foreach (PluginGenericobjectSingletonObjectField::getInstance(get_called_class())
775790
as $field => $values
776791
) {
@@ -787,14 +802,17 @@ function rawSearchOptions() {
787802
$currentindex = $index;
788803
if (isset($index_exceptions[$field])) {
789804
$currentindex = $index_exceptions[$field];
790-
} else if (in_array($currentindex, $index_exceptions)) {
791-
//If this index is reserved, jump to next
792-
$currentindex++;
805+
} else {
806+
//If this index is reserved, jump to next available one.
807+
while (in_array($currentindex, $taken_indexes)) {
808+
$currentindex++;
809+
}
793810
}
794811

795812
$option = [
796813
'id' => $currentindex,
797814
];
815+
$taken_indexes[] = $option['id'];
798816

799817
$item = new $this->objecttype->fields['itemtype'];
800818

locales/sv_SE.mo

2.96 KB
Binary file not shown.

locales/sv_SE.po

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
#
5+
# Translators:
6+
# Johan Hörnqvist <jhornqvist@gmail.com>, 2018
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: GLPI Plugin - Genericobject\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2018-06-22 13:21+0000\n"
12+
"PO-Revision-Date: 2018-09-06 22:04+0000\n"
13+
"Last-Translator: Johan Hörnqvist <jhornqvist@gmail.com>\n"
14+
"Language-Team: Swedish (Sweden) (http://www.transifex.com/teclib/glpi-project-plugin-genericobject/language/sv_SE/)\n"
15+
"MIME-Version: 1.0\n"
16+
"Content-Type: text/plain; charset=UTF-8\n"
17+
"Content-Transfer-Encoding: 8bit\n"
18+
"Language: sv_SE\n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#: front/type.php:38 front/object.php:33 inc/profile.class.php:287
22+
#: inc/type.class.php:66
23+
msgid "Type of objects"
24+
msgstr "Typ av tillgång"
25+
26+
#: front/type.form.php:73 front/familylist.php:33 front/familylist.php:41
27+
#: index.php:58 inc/object_item.class.php:109 inc/profile.class.php:39
28+
#: inc/type.class.php:289 inc/type.class.php:415 setup.php:193
29+
msgid "Objects management"
30+
msgstr "Hantera tillgångar"
31+
32+
#: front/field.form.php:41
33+
msgid "Field(s) deleted successfully"
34+
msgstr "Attribut raderat"
35+
36+
#: front/field.form.php:51
37+
msgid "Field added successfully"
38+
msgstr "Attribut tillagt"
39+
40+
#: front/commondropdown.php:11 front/commontreedropdown.form.php:36
41+
#: front/commondropdown.form.php:36
42+
msgid "The requested dropdown does not exists"
43+
msgstr "Den begärda rullmenyn saknas"
44+
45+
#: front/familylist.php:37 index.php:68
46+
msgid "Empty family"
47+
msgstr "Tom familj"
48+
49+
#: inc/profile.class.php:141
50+
msgid "General"
51+
msgstr "Allmänt"
52+
53+
#: inc/profile.class.php:147
54+
msgid "Objects"
55+
msgstr "Tillgångar"
56+
57+
#: inc/profile.class.php:149
58+
msgid "(No types defined yet)"
59+
msgstr "(Inga typer har skapats ännu)"
60+
61+
#: inc/field.class.php:64
62+
msgid "Fields associated with the object"
63+
msgstr "Attribut kopplade till tillgången"
64+
65+
#: inc/field.class.php:70
66+
msgid "Label"
67+
msgstr "Etikett"
68+
69+
#: inc/field.class.php:71
70+
msgid "Name in DB"
71+
msgstr "Namn i DB"
72+
73+
#: inc/field.class.php:126
74+
msgid "Add new field"
75+
msgstr "Lägg till nytt attribut"
76+
77+
#: inc/field.class.php:317
78+
msgid "Read-only field"
79+
msgstr "Skrivskyddat attribut"
80+
81+
#: inc/type.class.php:153
82+
msgid "Type name is missing"
83+
msgstr "Typnamnet saknas"
84+
85+
#: inc/type.class.php:159
86+
msgid "Type name must be longer"
87+
msgstr "Typnamnet måste vara längre"
88+
89+
#: inc/type.class.php:165
90+
msgid ""
91+
"Types 'field', 'object' and 'type' are reserved. Please choose another one"
92+
msgstr "Typnamnen 'attribut', 'objekt' och 'typ' är reserverade av systemet. Var vänlig välj ett annat namn."
93+
94+
#: inc/type.class.php:172
95+
msgid "Type must start with a letter"
96+
msgstr "Typnamnet måste börja med en bokstav"
97+
98+
#: inc/type.class.php:179
99+
msgid "A type already exists with the same name"
100+
msgstr "Typnamnet existerar redan"
101+
102+
#: inc/type.class.php:376 inc/type.class.php:505 inc/typefamily.class.php:36
103+
msgid "Family of type of objects"
104+
msgstr "Tillhör typfamilj"
105+
106+
#: inc/type.class.php:466
107+
msgid "Internal identifier"
108+
msgstr "Internt namn"
109+
110+
#: inc/type.class.php:520
111+
msgid "Behaviour"
112+
msgstr "Beteende"
113+
114+
#: inc/type.class.php:539
115+
msgid "Network connections"
116+
msgstr "Nätverksanslutningar"
117+
118+
#: inc/type.class.php:543
119+
msgid "injection file plugin"
120+
msgstr "Injection file plug-in"
121+
122+
#: inc/type.class.php:545
123+
msgid "geninventorynumber plugin"
124+
msgstr "Geninventorynumber plug-in"
125+
126+
#: inc/type.class.php:546
127+
msgid "order plugin"
128+
msgstr "Order plug-in"
129+
130+
#: inc/type.class.php:547
131+
msgid "item's uninstallation plugin"
132+
msgstr "Item's uninstallation plug-in"
133+
134+
#: inc/type.class.php:548
135+
msgid "simcard plugin"
136+
msgstr "Simcard plug-in"
137+
138+
#: inc/type.class.php:700
139+
msgid "Regenerate files"
140+
msgstr "Skapa filer på nytt"
141+
142+
#: inc/type.class.php:713
143+
msgid "Link to other objects"
144+
msgstr "Länka till andra tillgångar"
145+
146+
#. TRANS: %1$s is itemtype name
147+
#: inc/type.class.php:2017
148+
#, php-format
149+
msgid "Unable to load the class %1$s."
150+
msgstr "Kunde inte läsa in klass %1$s-"
151+
152+
#. TRANS: %1$s is itemtype name
153+
#: inc/type.class.php:2019
154+
#, php-format
155+
msgid ""
156+
"You probably have garbage data in your database for this plugin and missing "
157+
"files in %1$s"
158+
msgstr "Du har troligtvis skräpdata i databasen för denna plug-in och saknade filer i %1$s"
159+
160+
#: inc/object.class.php:471
161+
msgid "Object preview"
162+
msgstr "Förhandsgranska tillgång"
163+
164+
#: inc/object.class.php:751
165+
msgid "You must configure rights to enable the preview"
166+
msgstr "Du måste konfigurera rättigheter för att aktivera förhandsgranskning"

objects/locale.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,4 @@
2525
@since 2009
2626
---------------------------------------------------------------------- */
2727

28-
/**
29-
* This file is automatically managed by genericobject plugin. Do not edit it !
30-
*/
31-
3228
$LANG['genericobject']['%%CLASSNAME%%'][0]="%%NAME%%";

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
----------------------------------------------------------------------
3636
*/
3737

38-
define ('PLUGIN_GENERICOBJECT_VERSION', '2.6.1');
38+
define ('PLUGIN_GENERICOBJECT_VERSION', '2.6.2');
3939

4040
// Minimal GLPI version, inclusive
4141
define("PLUGIN_GENERICOBJECT_MIN_GLPI", "9.3");

0 commit comments

Comments
 (0)