Skip to content

Commit 9aae13d

Browse files
committed
fix(issue): status conversion for ticket
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 62febc9 commit 9aae13d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

inc/issue.class.php

+7-9
Original file line numberDiff line numberDiff line change
@@ -582,16 +582,14 @@ public static function giveItem($itemtype, $option_id, $data, $num) {
582582
return $data['raw']['id'];
583583

584584
case "glpi_plugin_formcreator_issues.status":
585-
switch ($data['raw']['sub_itemtype']) {
586-
case Ticket::class:
587-
$status = Ticket::getStatus($data['raw']["ITEM_$num"]);
588-
return Ticket::getStatusIcon($data['raw']["ITEM_$num"])." ".$status;
589-
590-
case PluginFormcreatorFormAnswer::class:
591-
$elements = PluginFormcreatorFormAnswer::getStatuses();
592-
return PluginFormcreatorFormAnswer::getSpecificValueToDisplay('status', $data['raw']["ITEM_$num"])
593-
." ".__($elements[$data['raw']["ITEM_$num"]], 'formcreator');
585+
if ($data['raw']["ITEM_$num"] > 100) {
586+
// The status matches tle values of a FormAnswer
587+
$elements = PluginFormcreatorFormAnswer::getStatuses();
588+
return PluginFormcreatorFormAnswer::getSpecificValueToDisplay('status', $data['raw']["ITEM_$num"])
589+
." ".__($elements[$data['raw']["ITEM_$num"]], 'formcreator');
594590
}
591+
$status = Ticket::getStatus($data['raw']["ITEM_$num"]);
592+
return Ticket::getStatusIcon($data['raw']["ITEM_$num"])." ".$status;
595593
break;
596594
}
597595

0 commit comments

Comments
 (0)