Skip to content

Commit 1f78037

Browse files
committed
fix(question): subtype plural and appliance in bad group
1 parent eac5d77 commit 1f78037

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

inc/question.class.php

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,52 +1193,54 @@ public static function dropdownDropdownSubType(string $name, array $options = []
11931193
}
11941194

11951195
public static function dropdownObjectSubType(string $name, array $options = []): void {
1196+
$plural = Session::getPluralNumber();
1197+
11961198
$optgroup = [
11971199
__("Assets") => [
1198-
Computer::class => Computer::getTypeName(2),
1199-
Monitor::class => Monitor::getTypeName(2),
1200-
Software::class => Software::getTypeName(2),
1201-
NetworkEquipment::class => Networkequipment::getTypeName(2),
1202-
Peripheral::class => Peripheral::getTypeName(2),
1203-
Printer::class => Printer::getTypeName(2),
1204-
CartridgeItem::class => CartridgeItem::getTypeName(2),
1205-
ConsumableItem::class => ConsumableItem::getTypeName(2),
1206-
Phone::class => Phone::getTypeName(2),
1207-
Line::class => Line::getTypeName(2),
1208-
PassiveDCEquipment::class => PassiveDCEquipment::getTypeName(2),
1209-
Appliance::class => Appliance::getTypeName(2),
1200+
Computer::class => Computer::getTypeName($plural),
1201+
Monitor::class => Monitor::getTypeName($plural),
1202+
Software::class => Software::getTypeName($plural),
1203+
NetworkEquipment::class => Networkequipment::getTypeName($plural),
1204+
Peripheral::class => Peripheral::getTypeName($plural),
1205+
Printer::class => Printer::getTypeName($plural),
1206+
CartridgeItem::class => CartridgeItem::getTypeName($plural),
1207+
ConsumableItem::class => ConsumableItem::getTypeName($plural),
1208+
Phone::class => Phone::getTypeName($plural),
1209+
Line::class => Line::getTypeName($plural),
1210+
PassiveDCEquipment::class => PassiveDCEquipment::getTypeName($plural),
12101211
],
12111212
__("Assistance") => [
1212-
Ticket::class => Ticket::getTypeName(2),
1213-
Problem::class => Problem::getTypeName(2),
1214-
Change::class => Change::getTypeName(2),
1215-
TicketRecurrent::class => TicketRecurrent::getTypeName(2)
1213+
Ticket::class => Ticket::getTypeName($plural),
1214+
Problem::class => Problem::getTypeName($plural),
1215+
Change::class => Change::getTypeName($plural),
1216+
TicketRecurrent::class => TicketRecurrent::getTypeName($plural),
12161217
],
12171218
__("Management") => [
1218-
Budget::class => Budget::getTypeName(2),
1219-
Supplier::class => Supplier::getTypeName(2),
1220-
Contact::class => Contact::getTypeName(2),
1221-
Contract::class => Contract::getTypeName(2),
1222-
Document::class => Document::getTypeName(2),
1223-
Project::class => Project::getTypeName(2),
1224-
Certificate::class => Certificate::getTypeName(2)
1219+
Budget::class => Budget::getTypeName($plural),
1220+
Supplier::class => Supplier::getTypeName($plural),
1221+
Contact::class => Contact::getTypeName($plural),
1222+
Contract::class => Contract::getTypeName($plural),
1223+
Document::class => Document::getTypeName($plural),
1224+
Project::class => Project::getTypeName($plural),
1225+
Certificate::class => Certificate::getTypeName($plural),
1226+
Appliance::class => Appliance::getTypeName($plural),
12251227
],
12261228
__("Tools") => [
12271229
Reminder::class => __("Notes"),
12281230
RSSFeed::class => __("RSS feed")
12291231
],
12301232
__("Administration") => [
1231-
User::class => User::getTypeName(2),
1232-
Group::class => Group::getTypeName(2),
1233-
Entity::class => Entity::getTypeName(2),
1234-
Profile::class => Profile::getTypeName(2)
1233+
User::class => User::getTypeName($plural),
1234+
Group::class => Group::getTypeName($plural),
1235+
Entity::class => Entity::getTypeName($plural),
1236+
Profile::class => Profile::getTypeName($plural),
12351237
],
12361238
];
12371239
if ((new Plugin())->isActivated('appliances')) {
1238-
$optgroup[__("Assets")][PluginAppliancesAppliance::class] = PluginAppliancesAppliance::getTypeName(2) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
1240+
$optgroup[__("Assets")][PluginAppliancesAppliance::class] = PluginAppliancesAppliance::getTypeName($plural) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
12391241
}
12401242
if ((new Plugin())->isActivated('databases')) {
1241-
$optgroup[__("Assets")][PluginDatabasesDatabase::class] = PluginDatabasesDatabase::getTypeName(2) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
1243+
$optgroup[__("Assets")][PluginDatabasesDatabase::class] = PluginDatabasesDatabase::getTypeName($plural) . ' (' . _n('Plugin', 'Plugins', 1) . ')';
12421244
}
12431245

12441246
// Get additional itemtypes from plugins

0 commit comments

Comments
 (0)