Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/support/2.13.0' into support/2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Nov 7, 2023
2 parents b084ec0 + 56ddff2 commit 7b651fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {

$validationStatus = PluginFormcreatorCommon::getTicketStatusForIssue($item);

$issueName = $item->fields['name'] != '' ? addslashes($item->fields['name']) : '(' . $item->getID() . ')';
$issueName = $item->fields['name'] != ''
? $item->fields['name']
: '(' . $item->getID() . ')';
$issue = new PluginFormcreatorIssue();
$issue->getFromDBByCrit([
'AND' => [
Expand All @@ -547,15 +549,15 @@ function plugin_formcreator_hook_update_ticket(CommonDBTM $item) {
'id' => $issue->getID(),
'items_id' => $id,
'display_id' => "t_$id",
'itemtype' => 'Ticket',
'name' => $issueName,
'itemtype' => Ticket::class,
'name' => $DB->escape($issueName),
'status' => $validationStatus,
'date_creation' => $item->fields['date'],
'date_mod' => $item->fields['date_mod'],
'entities_id' => $item->fields['entities_id'],
'is_recursive' => '0',
'requester_id' => $requester,
'comment' => addslashes($item->fields['content']),
'comment' => $DB->escape($item->fields['content']),
'time_to_own' => $item->fields['time_to_own'],
'time_to_resolve' => $item->fields['time_to_resolve'],
'internal_time_to_own' => $item->fields['internal_time_to_own'],
Expand Down Expand Up @@ -686,7 +688,10 @@ function plugin_formcreator_hook_update_ticketvalidation(CommonDBTM $item) {
if ($issue->isNewItem()) {
return;
}
$issue->update(['status' => $status] + $issue->fields);
$issue->update([
'id' => $issue->getID(),
'status' => $status
]);
}

function plugin_formcreator_hook_update_itilFollowup($followup) {
Expand Down
2 changes: 1 addition & 1 deletion inc/field/glpiselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function getValueForTargetText($domain, $richText): ?string {
$itemtype = $this->getSubItemtype();
if ($itemtype == User::class) {
$DbUtil = new DbUtils();
return $DbUtil->getUserName($this->value);
return $DbUtil->getUserName($this->value, 0, true);
}

return parent::getValueForTargetText($domain, $richText);
Expand Down

0 comments on commit 7b651fc

Please sign in to comment.