Skip to content

Commit

Permalink
fix(issue): php warnings in service catalog
Browse files Browse the repository at this point in the history
also fixes compatibility with GLPI 9.3 and 9.4

Signed-off-by: btry <tbugier@teclib.com>
btry committed Jul 18, 2018

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 319bb46 commit 0754b5f
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions inc/form_answer.class.php
Original file line number Diff line number Diff line change
@@ -269,8 +269,7 @@ public static function getSpecificValueToDisplay($field, $values, array $options
switch ($field) {
case 'status' :
$output = '<img src="' . $CFG_GLPI['root_doc'] . '/plugins/formcreator/pics/' . $values[$field] . '.png"
alt="' . __($values[$field], 'formcreator') . '" title="' . __($values[$field], 'formcreator') . '" /> '
. __($values[$field], 'formcreator');
alt="' . __($values[$field], 'formcreator') . '" title="' . __($values[$field], 'formcreator') . '" /> ';
return $output;
break;
}
13 changes: 10 additions & 3 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
@@ -277,12 +277,16 @@ public function getTicketsForDisplay($options) {
return $item;
}

/**
/**
* Define search options for forms
*
* @return Array Array of fields to show in search engine and options for each fields
*/
public function getSearchOptionsNew() {
return $this->rawSearchOptions();
}

public function rawSearchOptions() {
$tab = [];

$tab[] = [
@@ -493,8 +497,11 @@ public static function giveItem($itemtype, $option_id, $data, $num) {
switch ($data['raw']['sub_itemtype']) {
case 'Ticket':
$status = Ticket::getStatus($data['raw']["ITEM_$num"]);
return "<img src='".Ticket::getStatusIconURL($data['raw']["ITEM_$num"])."'
alt=\"$status\" title=\"$status\">&nbsp;$status";
if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), '9.3') < 0) {
return "<img src='".Ticket::getStatusIconUrl($data['raw']["ITEM_$num"])."'
alt=\"$status\" title=\"$status\">&nbsp;$status";
}
return Ticket::getStatusIcon($data['raw']["ITEM_$num"]);
break;

case 'PluginFormcreatorForm_Answer':

0 comments on commit 0754b5f

Please sign in to comment.