Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 21 additions & 40 deletions src/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,6 @@
* --------------------------------------------------------------------------
*/

/*
-------------------------------------------------------------------------
LICENSE

This file is part of Transferticketentity plugin for GLPI.

Transferticketentity is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Transferticketentity is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Reports. If not, see <http://www.gnu.org/licenses/>.

@category Ticket
@package Transferticketentity
@author Yannick Comba, Xavier Caillaud, Infotel
@copyright 2015-2026 Transferticketentity team
@license AGPL License 3.0 or (at your option) any later version
https://www.gnu.org/licenses/gpl-3.0.html
@link https://github.com/pluginsGLPI/transferticketentity/
--------------------------------------------------------------------------
*/

namespace GlpiPlugin\Transferticketentity;

use Ajax;
Expand Down Expand Up @@ -715,19 +686,29 @@ public function launchTicketTransfer($params)

$ticket = new \Ticket();
$ticket->getFromDB($params['id_ticket']);
Session::addMessageAfterRedirect(
__(
"Successful transfer for ticket",
"transferticketentity",
) . $ticket->getLink(),
true,
INFO,
);

if ($ticket->getID() > 0) {
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . (int) $ticket->getID());
if ($ticket->can($ticket->getID(), READ)) {
Session::addMessageAfterRedirect(
__(
"Successful transfer for ticket",
"transferticketentity",
) . $ticket->getLink(),
true,
INFO,
);

if ($ticket->getID() > 0) {
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . (int) $ticket->getID());
} else {
Html::back();
}
} else {
Html::back();
Session::addMessageAfterRedirect(
__("Successful transfer for ticket", "transferticketentity"),
true,
INFO,
);
Html::redirect(\Ticket::getSearchURL());
}
}
}
Expand Down
Loading