Skip to content

Commit

Permalink
refactor: remove dead code
Browse files Browse the repository at this point in the history
remove backward compatibility code with no longer supported versins of GLPI

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Aug 22, 2019
1 parent 2535f4a commit d9c9828
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
6 changes: 0 additions & 6 deletions inc/common.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ public static function setNotification($enable) {
$CFG_GLPI['use_notifications'] = $enable ? '1' : '0';
}

public static function getGlpiVersion() {
return defined('GLPI_PREVER')
? GLPI_PREVER
: GLPI_VERSION;
}

/**
* Get Link Name
*
Expand Down
23 changes: 7 additions & 16 deletions inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,22 +745,13 @@ public function save(PluginFormcreatorFormAnswer $formanswer) {
'content' => $message,
'_do_not_compute_takeintoaccount' => true
];
if (class_exists(ITILFollowup::class)) {
// GLPI 9.4+
$followUpInput += [
'items_id' => $ticketID,
'itemtype' => Ticket::class,
];
$ticketFollowup = new ITILFollowup();
$ticketFollowup->add($followUpInput);
} else {
// GLPI < 9.4
$followUpInput += [
'tickets_id' => $ticketID,
];
$ticketFollowup = new TicketFollowup();
$ticketFollowup->add($followUpInput);
}
// GLPI 9.4+
$followUpInput += [
'items_id' => $ticketID,
'itemtype' => Ticket::class,
];
$ticketFollowup = new ITILFollowup();
$ticketFollowup->add($followUpInput);

// Restore mail notification setting
PluginFormcreatorCommon::setNotification($use_mailing);
Expand Down

0 comments on commit d9c9828

Please sign in to comment.