Skip to content

Commit

Permalink
fix(formanswer): display of status shall show a label
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 9, 2020
1 parent e1b3d46 commit d3e5904
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,20 @@ public function rawSearchOptions() {
*/
public static function getSpecificValueToDisplay($field, $values, array $options = []) {
if (!is_array($values)) {
$language = $_SESSION["glpilanguage"];
Session::loadLanguage('en_GB');
$elements = self::getStatuses();
Session::loadLanguage($language);
$values = [$field => $elements[$values]];
$values = [$field => $values];
}
switch ($field) {
case 'status' :
$output = '<img src="' . FORMCREATOR_ROOTDOC . '/pics/' . strtolower($values[$field]) . '.png"
alt="' . __($values[$field], 'formcreator') . '" title="' . __($values[$field], 'formcreator') . '" /> ';
return $output;
if (!isAPI()) {
$language = $_SESSION["glpilanguage"];
Session::loadLanguage('en_GB');
$elements = self::getStatuses();
Session::loadLanguage($language);
$values = [$field => $elements[$values[$field]]];
$output = '<img src="' . FORMCREATOR_ROOTDOC . '/pics/' . strtolower($values[$field]) . '.png"
alt="' . __($values[$field], 'formcreator') . '" title="' . __($values[$field], 'formcreator') . '" /> ';
return $output;
}
break;
}
return parent::getSpecificValueToDisplay($field, $values, $options);
Expand Down

0 comments on commit d3e5904

Please sign in to comment.