From 304a32b0d1b4daacc16b31e08f367920fc1a7f22 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 16 Sep 2015 10:15:43 +0200 Subject: [PATCH] Fix fatal error, fix email sending. --- plugin/ticket/src/ticket.class.php | 15 +++++++++++++++ plugin/ticket/src/ticket_details.php | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/plugin/ticket/src/ticket.class.php b/plugin/ticket/src/ticket.class.php index 1975be768b..99875fcf56 100755 --- a/plugin/ticket/src/ticket.class.php +++ b/plugin/ticket/src/ticket.class.php @@ -194,6 +194,8 @@ class TicketManager ' . $content . ' '; + + // Send email to "other area" email api_mail_html( $plugin->get_lang('VirtualSupport'), $email, @@ -204,6 +206,19 @@ class TicketManager array(), $data_files ); + + // Send email to user + api_mail_html( + $plugin->get_lang('VirtualSupport'), + $user['email'], + $plugin->get_lang('IncidentResentToVirtualSupport'), + $helpDeskMessage, + $user['firstname'].' '.$user['lastname'], + $personalEmail, + array(), + $data_files + ); + $studentMessage = sprintf($plugin->get_lang('YourQuestionWasSentToTheResponableAreaX'), $email, $email); $studentMessage .= sprintf($plugin->get_lang('YourAnswerToTheQuestionWillBeSentToX'), $personalEmail); self::insert_message( diff --git a/plugin/ticket/src/ticket_details.php b/plugin/ticket/src/ticket_details.php index 4b154d55c5..0dcbe3e104 100755 --- a/plugin/ticket/src/ticket_details.php +++ b/plugin/ticket/src/ticket_details.php @@ -368,6 +368,9 @@ if (!isset($_POST['compose'])) { } } } + + Display::display_footer(); + } else { $ticket_id = $_POST['ticket_id']; $content = $_POST['content']; @@ -377,6 +380,7 @@ if (!isset($_POST['compose'])) { $user_id = api_get_user_id(); TicketManager::insert_message($ticket_id, $subject, $content, $file_attachments, $user_id, 'NOL', $mensajeconfirmacion); header("location:" . api_get_self() . "?ticket_id=" . $ticket_id); + exit; } function show_form_send_message() @@ -459,5 +463,3 @@ function show_form_send_message() $form->display(); } - -Display::display_footer();