Clean dead code

This commit is contained in:
Laurent Destailleur 2023-09-01 00:08:31 +02:00
parent f9f5affbd2
commit 40e739dab6
2 changed files with 4 additions and 19 deletions

View file

@ -449,8 +449,6 @@ if (empty($reshook)) {
if (!$error) {
// Log action in ticket logs table
$object->fetch_user($usertoassign);
//$log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs));
setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs');
header("Location: card.php?track_id=".$object->track_id);
@ -500,9 +498,6 @@ if (empty($reshook)) {
if ($_SESSION['email_customer'] == $object->origin_email || $_SESSION['email_customer'] == $object->thirdparty->email) {
$object->close($user);
// Log action in ticket logs table
//$log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']);
setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs');
$url = 'card.php?track_id='.GETPOST('track_id', 'alpha');
@ -589,9 +584,6 @@ if (empty($reshook)) {
if ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED) {
$res = $object->setStatut(Ticket::STATUS_ASSIGNED);
if ($res) {
// Log action in ticket logs table
//$log_action = $langs->trans('TicketLogReopen');
$url = 'card.php?track_id='.$object->track_id;
header("Location: ".$url);
exit();
@ -620,15 +612,13 @@ if (empty($reshook)) {
} elseif ($action == "set_message" && $user->rights->ticket->manage) {
if (!GETPOST('cancel')) {
$object->fetch('', '', GETPOST('track_id', 'alpha'));
$oldvalue_message = $object->message;
//$oldvalue_message = $object->message;
$fieldtomodify = GETPOST('message_initial', 'restricthtml');
$object->message = $fieldtomodify;
$ret = $object->update($user);
if ($ret > 0) {
//$log_action = $langs->trans('TicketInitialMessageModified')." \n";
// include the Diff class
include_once DOL_DOCUMENT_ROOT.'/core/class/utils_diff.class.php';
//include_once DOL_DOCUMENT_ROOT.'/core/class/utils_diff.class.php';
// output the result of comparing two files as plain text
//$log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message)));
@ -644,12 +634,9 @@ if (empty($reshook)) {
// Reopen ticket
if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) {
$new_status = GETPOST('new_status', 'int');
$old_status = $object->status;
//$old_status = $object->status;
$res = $object->setStatut($new_status);
if ($res) {
// Log action in ticket logs table
$log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status]));
$url = 'card.php?track_id='.$object->track_id;
header("Location: ".$url);
exit();
@ -694,8 +681,6 @@ if (empty($reshook)) {
$ret = $object->update($user);
if ($ret > 0) {
//$log_action = $langs->trans('TicketLogPropertyChanged', $oldvalue_label, $newvalue_label);
setEventMessages($langs->trans('TicketUpdated'), null, 'mesgs');
} else {
$error++;

View file

@ -1401,7 +1401,7 @@ class Ticket extends CommonObject
*/
public function getLibStatut($mode = 0)
{
return $this->libStatut($this->fk_statut, $mode, 0, $this->progress);
return $this->LibStatut($this->fk_statut, $mode, 0, $this->progress);
}