From 98b2abeb51833c189346c0e920cf43b39c77b306 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Wed, 12 Feb 2020 09:40:19 +0100 Subject: [PATCH] BugFix show PreStudent Variables instead of Person Variables in Msg --- application/controllers/system/messages/Messages.php | 3 ++- application/models/CL/Messages_model.php | 5 ++++- application/views/system/messages/htmlWriteTemplate.php | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/messages/Messages.php b/application/controllers/system/messages/Messages.php index 513eee634..0124e704c 100644 --- a/application/controllers/system/messages/Messages.php +++ b/application/controllers/system/messages/Messages.php @@ -57,9 +57,10 @@ class Messages extends Auth_Controller $subject = $this->input->post('subject'); $body = $this->input->post('body'); $persons = $this->input->post('persons'); + $prestudenten = $this->input->post('prestudenten'); $relationmessage_id = $this->input->post('relationmessage_id'); - $sendImplicitTemplate = $this->CLMessagesModel->sendImplicitTemplate($persons, $subject, $body, $relationmessage_id); + $sendImplicitTemplate = $this->CLMessagesModel->sendImplicitTemplate($prestudenten, $subject, $body, $relationmessage_id); if (isSuccess($sendImplicitTemplate)) { $this->load->view('system/messages/htmlSuccess'); diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index 3c8217e73..399a16144 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -337,7 +337,7 @@ class Messages_model extends CI_Model if (!is_numeric($sender_id)) show_error('The current logged user person_id is not defined'); // Retrieves message vars data for the given user/s - $msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($persons); + $msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($persons); if (isError($msgVarsData)) show_error(getError($msgVarsData)); if (!hasData($msgVarsData)) show_error('No recipients were given'); @@ -684,6 +684,7 @@ class Messages_model extends CI_Model $recipientsArray = array(); $recipientsList = ''; $persons = ''; + $prestudenten = ''; foreach (getData($info) as $receiver) { $recipient = new stdClass(); @@ -702,6 +703,7 @@ class Messages_model extends CI_Model $recipientsArray[] = $recipient; $recipientsList .= $receiver->Vorname.' '.$receiver->Nachname.'; '; $persons .= ''."\n"; + $prestudenten .= ''."\n"; } // --------------------------------------------------------------------------------------- @@ -779,6 +781,7 @@ class Messages_model extends CI_Model 'senderIsAdmin' => getData($senderIsAdmin), 'recipientsArray' => $recipientsArray, 'persons' => $persons, + 'prestudenten' => $prestudenten, 'relationmessage_id' => $relationmessage, 'type' => $type ); diff --git a/application/views/system/messages/htmlWriteTemplate.php b/application/views/system/messages/htmlWriteTemplate.php index d26ec534c..b4a6af283 100644 --- a/application/views/system/messages/htmlWriteTemplate.php +++ b/application/views/system/messages/htmlWriteTemplate.php @@ -163,6 +163,7 @@ +