diff --git a/admin_tickets.php b/admin_tickets.php index 54c7810d..c4d5e576 100644 --- a/admin_tickets.php +++ b/admin_tickets.php @@ -284,7 +284,7 @@ if ($page == 'tickets' } else { $now = time(); $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('ip', $_SERVER['REMOTE_ADDR'], true, true); $replyticket->Set('status', '1', true, true); @@ -303,7 +303,7 @@ if ($page == 'tickets' $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']); $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 { diff --git a/customer_tickets.php b/customer_tickets.php index d3f0d31a..2094262f 100644 --- a/customer_tickets.php +++ b/customer_tickets.php @@ -24,9 +24,7 @@ if (isset($_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"); $result = Database::pexecute_first($stmt, array("id" => $id, "customerid" => $userinfo['customerid'])); @@ -185,7 +183,7 @@ if($page == 'overview') { // 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']); - redirectTo($filename, Array('page' => $page, 's' => $s)); + redirectTo($filename, array('page' => $page, 's' => $s)); } } else { $categories = ''; @@ -252,7 +250,7 @@ if($page == 'overview') { standard_error(array('stringisempty', 'mymessage')); } else { $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('ip', $_SERVER['REMOTE_ADDR'], true, true); $replyticket->Set('status', '1', true, true); diff --git a/lib/classes/ticket/class.ticket.php b/lib/classes/ticket/class.ticket.php index ff107d15..5f742cae 100644 --- a/lib/classes/ticket/class.ticket.php +++ b/lib/classes/ticket/class.ticket.php @@ -177,8 +177,8 @@ class ticket { 'priority' => $this->Get('priority'), 'subject' => $this->Get('subject'), 'message' => $this->Get('message'), - 'dt' => $this->Get('dt'), - 'lastchange' => $this->Get('lastchange'), + 'dt' => time(), + 'lastchange' => time(), 'ip' => $this->Get('ip'), 'status' => $this->Get('status'), '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)); unset($tpl_seldata['tplsubject']); - $tpl_seldata['tplbody'] = $template_body; + $tpl_seldata['tplmailbody'] = $template_body; $result_stmt = Database::prepare(" SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "` @@ -337,7 +337,7 @@ class ticket { SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "` 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; try { $mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);