fix some ticket-system issues related with migrating to PDO
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -284,7 +284,7 @@ if ($page == 'tickets'
|
|||||||
} else {
|
} else {
|
||||||
$now = time();
|
$now = time();
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $settings, (int)$id);
|
||||||
$replyticket->Set('customerid', $mainticket->Get('customer'), true, true);
|
$replyticket->Set('customer', $mainticket->Get('customer'), true, true);
|
||||||
$replyticket->Set('lastchange', $now, true, true);
|
$replyticket->Set('lastchange', $now, true, true);
|
||||||
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||||
$replyticket->Set('status', '1', true, true);
|
$replyticket->Set('status', '1', true, true);
|
||||||
@@ -303,7 +303,7 @@ if ($page == 'tickets'
|
|||||||
$mainticket->Update();
|
$mainticket->Update();
|
||||||
$mainticket->sendMail((int)$mainticket->Get('customer'), 'new_reply_ticket_by_staff_subject', $lng['mails']['new_reply_ticket_by_staff']['subject'], 'new_reply_ticket_by_staff_mailbody', $lng['mails']['new_reply_ticket_by_staff']['mailbody']);
|
$mainticket->sendMail((int)$mainticket->Get('customer'), 'new_reply_ticket_by_staff_subject', $lng['mails']['new_reply_ticket_by_staff']['subject'], 'new_reply_ticket_by_staff_mailbody', $lng['mails']['new_reply_ticket_by_staff']['mailbody']);
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "answered ticket '" . $mainticket->Get('subject') . "'");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "answered ticket '" . $mainticket->Get('subject') . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ if (isset($_POST['id'])) {
|
|||||||
|
|
||||||
$id = intval($_POST['id']);
|
$id = intval($_POST['id']);
|
||||||
|
|
||||||
/*
|
//Check if the current user is allowed to see the current ticket.
|
||||||
* Check if the current user is allowed to see the current ticket.
|
|
||||||
*/
|
|
||||||
$stmt = Database::prepare("SELECT `id` FROM `panel_tickets` WHERE `id` = :id AND `customerid` = :customerid");
|
$stmt = Database::prepare("SELECT `id` FROM `panel_tickets` WHERE `id` = :id AND `customerid` = :customerid");
|
||||||
$result = Database::pexecute_first($stmt, array("id" => $id, "customerid" => $userinfo['customerid']));
|
$result = Database::pexecute_first($stmt, array("id" => $id, "customerid" => $userinfo['customerid']));
|
||||||
|
|
||||||
@@ -185,7 +183,7 @@ if($page == 'overview') {
|
|||||||
|
|
||||||
// Admin mail
|
// Admin mail
|
||||||
$newticket->sendMail(-1, 'new_ticket_by_customer_subject', $lng['mails']['new_ticket_by_customer']['subject'], 'new_ticket_by_customer_mailbody', $lng['mails']['new_ticket_by_customer']['mailbody']);
|
$newticket->sendMail(-1, 'new_ticket_by_customer_subject', $lng['mails']['new_ticket_by_customer']['subject'], 'new_ticket_by_customer_mailbody', $lng['mails']['new_ticket_by_customer']['mailbody']);
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$categories = '';
|
$categories = '';
|
||||||
@@ -252,7 +250,7 @@ if($page == 'overview') {
|
|||||||
standard_error(array('stringisempty', 'mymessage'));
|
standard_error(array('stringisempty', 'mymessage'));
|
||||||
} else {
|
} else {
|
||||||
$now = time();
|
$now = time();
|
||||||
$replyticket->Set('customerid', (int)$userinfo['customerid'], true, true);
|
$replyticket->Set('customer', (int)$userinfo['customerid'], true, true);
|
||||||
$replyticket->Set('lastchange', $now, true, true);
|
$replyticket->Set('lastchange', $now, true, true);
|
||||||
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||||
$replyticket->Set('status', '1', true, true);
|
$replyticket->Set('status', '1', true, true);
|
||||||
|
|||||||
@@ -177,8 +177,8 @@ class ticket {
|
|||||||
'priority' => $this->Get('priority'),
|
'priority' => $this->Get('priority'),
|
||||||
'subject' => $this->Get('subject'),
|
'subject' => $this->Get('subject'),
|
||||||
'message' => $this->Get('message'),
|
'message' => $this->Get('message'),
|
||||||
'dt' => $this->Get('dt'),
|
'dt' => time(),
|
||||||
'lastchange' => $this->Get('lastchange'),
|
'lastchange' => time(),
|
||||||
'ip' => $this->Get('ip'),
|
'ip' => $this->Get('ip'),
|
||||||
'status' => $this->Get('status'),
|
'status' => $this->Get('status'),
|
||||||
'lastreplier' => $this->Get('lastreplier'),
|
'lastreplier' => $this->Get('lastreplier'),
|
||||||
@@ -296,7 +296,7 @@ class ticket {
|
|||||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_subject), $replace_arr));
|
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_subject), $replace_arr));
|
||||||
|
|
||||||
unset($tpl_seldata['tplsubject']);
|
unset($tpl_seldata['tplsubject']);
|
||||||
$tpl_seldata['tplbody'] = $template_body;
|
$tpl_seldata['tplmailbody'] = $template_body;
|
||||||
|
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||||
@@ -337,7 +337,7 @@ class ticket {
|
|||||||
SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "`
|
SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||||
WHERE `adminid` = :adminid"
|
WHERE `adminid` = :adminid"
|
||||||
);
|
);
|
||||||
$admin = Database::pexecute_first($admin_stmt, array('adminid' => $userinfo['adminid']));
|
$admin = Database::pexecute_first($admin_stmt, array('adminid' => $this->userinfo['adminid']));
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
try {
|
try {
|
||||||
$mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);
|
$mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);
|
||||||
|
|||||||
Reference in New Issue
Block a user