Skip to content

Commit 83ea716

Browse files
committed
refactor(targetticket,targetchange): code style
1 parent b98f85a commit 83ea716

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

inc/targetchange.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ protected function getTargetTemplate(array $data): int {
621621
'FROM' => ITILCategory::getTable(),
622622
'WHERE' => ['id' => $data['itilcategories_id']]
623623
]);
624-
if ($row = $rows->current()) { // assign change template according to resulting change category
624+
if ($row = $rows->current()) {
625+
// assign change template according to resulting change category
625626
return $row[$targetTemplateFk];
626627
}
627628
}

inc/targetticket.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,14 +783,15 @@ protected function getTargetTemplate(array $data): int {
783783
'FROM' => ITILCategory::getTable(),
784784
'WHERE' => ['id' => $data['itilcategories_id']]
785785
]);
786-
if ($row = $rows->current()) { // assign ticket template according to resulting ticket category and ticket type
786+
if ($row = $rows->current()) {
787+
// assign ticket template according to resulting ticket category and ticket type
787788
return ($data['type'] == Ticket::INCIDENT_TYPE
788789
? $row["{$targetTemplateFk}_incident"]
789790
: $row["{$targetTemplateFk}_demand"]);
790791
}
791792
}
792793

793-
return $this->fields['tickettemplates_id'] ?? 0;
794+
return $this->fields[$targetTemplateFk] ?? 0;
794795
}
795796

796797
/**

0 commit comments

Comments
 (0)