BugFix show PreStudent Variables instead of Person Variables in Msg

This commit is contained in:
Manfred Kindl
2020-02-12 09:40:19 +01:00
parent 4b3f6f109d
commit 98b2abeb51
3 changed files with 7 additions and 2 deletions
@@ -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');
+4 -1
View File
@@ -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 .= '<input type="hidden" name="persons[]" value="'.$receiver->person_id.'">'."\n";
$prestudenten .= '<input type="hidden" name="prestudenten[]" value="'.$receiver->prestudent_id.'">'."\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
);
@@ -163,6 +163,7 @@
</div>
<?php echo $persons; ?>
<?php echo $prestudenten; ?>
<?php echo $relationmessage_id; ?>
<?php echo $type; ?>