Skip to content

Commit

Permalink
fix(licence): user name display
Browse files Browse the repository at this point in the history
  • Loading branch information
Rom1-B committed Jan 21, 2025
1 parent 46d57da commit 99babf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Item_SoftwareLicense.php
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ function updateItemDropdown(itemtype_el) {
'glpi_softwarelicenses.name AS license',
'glpi_softwarelicenses.id AS vID',
'glpi_softwarelicenses.softwares_id AS softid',
"$users_table.name AS itemname",
User::getFriendlyNameFields('itemname'),
"$users_table.id AS iID",
new QueryExpression($DB::quoteValue(User::class), 'item_type'),
new QueryExpression($DB::quoteValue(''), "serial"),
Expand Down
4 changes: 2 additions & 2 deletions src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6735,8 +6735,8 @@ public static function getFriendlyNameFields(string $alias = "name")
$table = self::getTable();
return QueryFunction::if(
condition: [
"$table.$first" => ['<>' => ''],
"$table.$second" => ['<>' => '']
"$table.$first" => ['<>', ''],
"$table.$second" => ['<>', '']
],
true_expression: QueryFunction::concat(["$table.$first", new QueryExpression($DB::quoteValue(' ')), "$table.$second"]),
false_expression: $table . '.' . self::getNameField(),
Expand Down

0 comments on commit 99babf8

Please sign in to comment.