mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
- Renamed view system/messages/messageHTML to system/messages/htmlRead
- Renamed view system/messages/messageWriteReply to system/messages/htmlWriteReply - Removed views system/messages/messageReplySent and system/messages/messageForm - Moved logic from controller ViewMessage to model CL/Messages_model - Added new constants CFG_REDIRECT_VIEW_MESSAGE_URL to MessageLib - Removed public method getPersonData from model system/MessageToken_model - Changed query in method system/Recipient_model->getMessage to include column tbl_msg_recipient.sent - Added new public method prepareHtmlRead to model CL/Messages_model - Changed constant REPLY_BODY_FORMAT of model CL/Messages_model - Added new constant NO_AUTH_UID to model CL/Messages_model - Added new public method prepareHtmlWriteReply to model CL/Messages_model - Changed public method sendReply of model CL/Messages_model - Added new private method _getReplyBody to model CL/Messages_model - Changed method _personLog of model CL/Messages_model to manage not authenticated users
This commit is contained in:
@@ -16,14 +16,10 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Handles sending messages with token
|
||||
* NOTE: in this controller is not possible to include/call everything
|
||||
* that automatically call the authentication system, like the most of models or libraries
|
||||
* NOTE: it extends FHC_Controller instead of Auth_Controller because authentication is not needed
|
||||
*/
|
||||
class ViewMessage extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -32,121 +28,48 @@ class ViewMessage extends FHC_Controller
|
||||
$this->config->load('message');
|
||||
|
||||
// Load model MessageToken_model, not calling the authentication system
|
||||
$this->load->model('system/MessageToken_model', 'MessageTokenModel');
|
||||
$this->load->model('CL/Messages_model', 'CLMessagesModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Using the MessageTokenModel instead of MessageLib to allow
|
||||
* viewing the message without prompting the login
|
||||
* Display a message in read mode only using the specified token
|
||||
*/
|
||||
public function toHTML($token)
|
||||
{
|
||||
$msg = $this->MessageTokenModel->getMessageByToken($token);
|
||||
|
||||
if ($msg->error)
|
||||
{
|
||||
show_error(getData($msg));
|
||||
}
|
||||
|
||||
if (is_array(getData($msg)) && count(getData($msg)) > 0)
|
||||
{
|
||||
$setReadMessageStatusByToken = $this->MessageTokenModel->setReadMessageStatusByToken($token);
|
||||
|
||||
if (isError($setReadMessageStatusByToken))
|
||||
{
|
||||
show_error($msg->$setReadMessageStatusByToken);
|
||||
}
|
||||
|
||||
$sender_id = getData($msg)[0]->sender_id;
|
||||
$receiver_id = getData($msg)[0]->receiver_id;
|
||||
$sender = $this->MessageTokenModel->getSenderData($sender_id);
|
||||
|
||||
// To decide how to change the redirection
|
||||
$isEmployee = $this->MessageTokenModel->isEmployee($receiver_id);
|
||||
if (!is_bool($isEmployee) && isError($isEmployee))
|
||||
{
|
||||
show_error($isEmployee);
|
||||
}
|
||||
|
||||
if($this->config->item('redirect_view_message_url') != '')
|
||||
$href = $this->config->item('message_server').$this->config->item('redirect_view_message_url').$token;
|
||||
else
|
||||
$href = '';
|
||||
|
||||
$data = array (
|
||||
'sender_id' => $sender_id,
|
||||
'sender' => getData($sender)[0],
|
||||
'message' => getData($msg)[0],
|
||||
'isEmployee' => $isEmployee,
|
||||
'href' => $href
|
||||
);
|
||||
|
||||
$this->load->view('system/messages/messageHTML.php', $data);
|
||||
}
|
||||
// Loads the view to read a received message using its token as identifier
|
||||
$this->load->view('system/messages/htmlRead', $this->CLMessagesModel->prepareHtmlRead($token));
|
||||
}
|
||||
|
||||
/**
|
||||
* write the reply
|
||||
* Write a reply message to a received one using its token as identifier
|
||||
*/
|
||||
public function writeReply()
|
||||
{
|
||||
$token = $this->input->get('token');
|
||||
$token = $this->input->get('token'); // gets received message token
|
||||
|
||||
if (isEmptyString($token))
|
||||
{
|
||||
show_error('No token supplied');
|
||||
}
|
||||
|
||||
$msg = null;
|
||||
|
||||
// Get message data if possible
|
||||
$msg = $this->MessageTokenModel->getMessageByToken($token);
|
||||
if (!hasData($msg))
|
||||
{
|
||||
show_error('No message found');
|
||||
}
|
||||
|
||||
$msg = getData($msg)[0];
|
||||
|
||||
// Get variables
|
||||
$receiverData = $this->MessageTokenModel->getPersonData($msg->sender_id);
|
||||
if (!hasData($receiverData))
|
||||
{
|
||||
show_error('No sender found');
|
||||
}
|
||||
|
||||
$data = array (
|
||||
'receivers' => getData($receiverData),
|
||||
'message' => $msg,
|
||||
'token' => $token
|
||||
);
|
||||
|
||||
$this->load->view('system/messages/messageWriteReply', $data);
|
||||
// Loads the view to write a reply message
|
||||
$this->load->view('system/messages/htmlWriteReply', $this->CLMessagesModel->prepareHtmlWriteReply($token));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a reply
|
||||
* Send a reply message (no templates are used)
|
||||
*/
|
||||
public function sendReply()
|
||||
{
|
||||
$subject = $this->input->post('subject');
|
||||
$body = $this->input->post('body');
|
||||
$persons = $this->input->post('persons');
|
||||
$receiver_id = $this->input->post('receiver_id');
|
||||
$relationmessage_id = $this->input->post('relationmessage_id');
|
||||
$token = $this->input->post('token');
|
||||
|
||||
if (!isset($relationmessage_id) || $relationmessage_id == '' || !isset($token) || $token == '')
|
||||
$sendReply = $this->CLMessagesModel->sendReply($receiver_id, $subject, $body, $relationmessage_id, $token);
|
||||
if (isSuccess($sendReply))
|
||||
{
|
||||
show_error('Error while sending reply');
|
||||
$this->load->view('system/messages/htmlSuccess');
|
||||
}
|
||||
|
||||
$sendReply = $this->CLMessagesModel->sendReply($subject, $body, $persons, $relationmessage_id, $token);
|
||||
if (isError($sendReply))
|
||||
else
|
||||
{
|
||||
show_error(getData($sendReply));
|
||||
$this->load->view('system/messages/htmlError');
|
||||
}
|
||||
|
||||
$this->load->view('system/messages/messageReplySent');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class MessageLib
|
||||
const CFG_MESSAGE_SERVER = 'message_server';
|
||||
const CFG_MESSAGE_HTML_VIEW_URL = 'message_html_view_url';
|
||||
const CFG_OU_RECEIVERS = 'ou_receivers';
|
||||
const CFG_REDIRECT_VIEW_MESSAGE_URL = 'redirect_view_message_url';
|
||||
|
||||
// Templates names
|
||||
const NOTICE_TEMPLATE_HTML = 'MessageMailHTML';
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
class Messages_model extends CI_Model
|
||||
{
|
||||
const REPLY_SUBJECT_PREFIX = 'Re: ';
|
||||
const REPLY_BODY_PREFIX = '<br><br>-------------------------------------------------------------------------------';
|
||||
const REPLY_BODY_FORMAT = '<br><br><blockquote><i>On %s %s %s wrote:</i></blockquote><blockquote style="border-left:2px solid; padding-left: 8px">%s</blockquote>';
|
||||
|
||||
const NO_AUTH_UID = 'online'; // hard coded uid if no authentication is performed
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -34,6 +36,87 @@ class Messages_model extends CI_Model
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/htmlRead using a token that identifies a single message
|
||||
*/
|
||||
public function prepareHtmlRead($token)
|
||||
{
|
||||
if (isEmptyString($token)) show_error('The given token is not valid');
|
||||
|
||||
// Retrieves message using the given token
|
||||
$messageResult = $this->MessageTokenModel->getMessageByToken($token);
|
||||
if (isError($messageResult)) show_error(getData($messageResult));
|
||||
if (!hasData($messageResult)) show_error('No message found with the given token');
|
||||
|
||||
$message = getData($messageResult)[0]; // Found message data
|
||||
|
||||
// Set message as read
|
||||
$srmsbtResult = $this->MessageTokenModel->setReadMessageStatusByToken($token);
|
||||
if (isError($srmsbtResult)) show_error(getData($srmsbtResult));
|
||||
|
||||
// Retrieves message sender information
|
||||
$senderResult = $this->MessageTokenModel->getSenderData($message->sender_id);
|
||||
if (isError($senderResult)) show_error(getData($senderResult));
|
||||
if (!hasData($senderResult)) show_error('No sender information found');
|
||||
|
||||
$sender = getData($senderResult)[0]; // Found sender data
|
||||
|
||||
// Check if the receiver is an employee
|
||||
$isEmployee = false; // not by default
|
||||
$isEmployeeResult = $this->MessageTokenModel->isEmployee($message->receiver_id);
|
||||
if (isError($isEmployeeResult)) show_error(getData($isEmployeeResult));
|
||||
if (hasData($isEmployeeResult)) $isEmployee = true;
|
||||
|
||||
// If the sender is an employee and are present configurations to reply
|
||||
$hrefReply = '';
|
||||
if ($isEmployee && !isEmptyString($this->config->item(MessageLib::CFG_REDIRECT_VIEW_MESSAGE_URL)))
|
||||
{
|
||||
$hrefReply = $this->config->item(MessageLib::CFG_MESSAGE_SERVER).
|
||||
$this->config->item(MessageLib::CFG_REDIRECT_VIEW_MESSAGE_URL).
|
||||
$token;
|
||||
}
|
||||
|
||||
return array (
|
||||
'sender' => $sender,
|
||||
'message' => $message,
|
||||
'hrefReply' => $hrefReply
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/htmlWriteReply using a token that identifies a single message
|
||||
*/
|
||||
public function prepareHtmlWriteReply($token)
|
||||
{
|
||||
if (isEmptyString($token)) show_error('The given token is not valid');
|
||||
|
||||
// Retrieves message using the given token
|
||||
$messageResult = $this->MessageTokenModel->getMessageByToken($token);
|
||||
if (isError($messageResult)) show_error(getData($messageResult));
|
||||
if (!hasData($messageResult)) show_error('No message found with the given token');
|
||||
|
||||
$message = getData($messageResult)[0]; // Found message data
|
||||
|
||||
// Retrieves message sender information
|
||||
$senderResult = $this->MessageTokenModel->getSenderData($message->sender_id);
|
||||
if (isError($senderResult)) show_error(getData($senderResult));
|
||||
if (!hasData($senderResult)) show_error('No sender information found');
|
||||
|
||||
$sender = getData($senderResult)[0]; // Found sender data
|
||||
|
||||
$replySubject = self::REPLY_SUBJECT_PREFIX.$message->subject;
|
||||
$replyBody = $this->_getReplyBody($message->body, $sender->vorname, $sender->nachname, $message->sent);
|
||||
|
||||
return array (
|
||||
'receiver' => $sender->vorname.' '.$sender->nachname, // yep! the sender of the sent message is the receiver of the reply message
|
||||
'subject' => $replySubject,
|
||||
'body' => $replyBody,
|
||||
'receiver_id' => $message->sender_id,
|
||||
'relationmessage_id' => $message->message_id,
|
||||
'token' => $token
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares data for the view system/messages/htmlWriteTemplate using person ids as main parameter
|
||||
* Wrap method to _prepareHtmlWriteTemplate
|
||||
@@ -158,62 +241,45 @@ class Messages_model extends CI_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a reply to a message accessed using a token
|
||||
* Send a reply to a single recipient for a message identified by a token (no templates are used)
|
||||
*/
|
||||
public function sendReply($subject, $body, $persons, $relationmessage_id, $token)
|
||||
public function sendReply($receiver_id, $subject, $body, $relationmessage_id, $token)
|
||||
{
|
||||
$relationmsg = $this->MessageTokenModel->getMessageByToken($token);
|
||||
if (!hasData($relationmsg) || $relationmessage_id !== getData($relationmsg)[0]->message_id)
|
||||
// Retrieves message sender information
|
||||
$senderResult = $this->MessageTokenModel->getSenderData($receiver_id);
|
||||
if (isError($senderResult)) show_error(getData($senderResult));
|
||||
if (!hasData($senderResult)) show_error('No sender information found');
|
||||
|
||||
$sender = getData($senderResult)[0]; // Found sender data
|
||||
|
||||
$messageResult = $this->MessageTokenModel->getMessageByToken($token);
|
||||
if (isError($messageResult)) show_error(getData($messageResult));
|
||||
// Security check! It is possible to reply only to a received message!!
|
||||
if (!hasData($messageResult) || $relationmessage_id != getData($messageResult)[0]->message_id)
|
||||
{
|
||||
show_error('Error while sending reply');
|
||||
show_error('An error occurred while sending your message, please contact the site administrator');
|
||||
}
|
||||
|
||||
// Get sender (receiver of previous msg)
|
||||
$sender_id = getData($relationmsg)[0]->receiver_id;
|
||||
$sender_id = getData($messageResult)[0]->receiver_id;
|
||||
|
||||
// Get message data of persons
|
||||
$data = $this->MessageTokenModel->getPersonData($persons);
|
||||
if (hasData($data))
|
||||
{
|
||||
for ($i = 0; $i < count(getData($data)); $i++)
|
||||
{
|
||||
$dataArray = (array)getData($data)[$i];
|
||||
$message = $this->messagelib->sendMessageUser(
|
||||
$receiver_id, // receiverPersonId
|
||||
$subject, // subject
|
||||
$body, // body
|
||||
$sender_id, // sender_id, the receiver of the previous message is the sender of the current one
|
||||
null, // senderOU
|
||||
$relationmessage_id, // relationmessage_id
|
||||
MSG_PRIORITY_NORMAL // priority
|
||||
);
|
||||
|
||||
$msg = $this->messagelib->sendMessageUser(
|
||||
$dataArray['person_id'], // receiverPersonId
|
||||
$subject, // subject
|
||||
$body, // body
|
||||
$sender_id, // sender_id
|
||||
null, // senderOU
|
||||
$relationmessage_id, // relationmessage_id
|
||||
MSG_PRIORITY_NORMAL // priority
|
||||
);
|
||||
if (isError($message)) return $message;
|
||||
if (!hasData($message)) return error('No messages were saved in database');
|
||||
|
||||
if (isError($msg)) return $msg;
|
||||
// Write log entry
|
||||
$personLog = $this->_personLog($sender_id, $receiver_id, getData($message)[0]);
|
||||
if (isError($personLog)) return $personLog;
|
||||
|
||||
// Logs person data
|
||||
$personLog = $this->personloglib->log(
|
||||
$sender_id,
|
||||
'Action',
|
||||
array(
|
||||
'name' => 'Message sent',
|
||||
'message' => 'Message sent from person '.$sender_id.' to '.$dataArray['person_id'].', messageid '.getData($msg),
|
||||
'success' => 'true'
|
||||
),
|
||||
'kommunikation',
|
||||
'core',
|
||||
null,
|
||||
'online'
|
||||
);
|
||||
|
||||
// Unpark bewerber after he sends message
|
||||
$personLog = $this->personloglib->unPark($sender_id);
|
||||
|
||||
if (isError($personLog)) return $personLog;
|
||||
}
|
||||
}
|
||||
|
||||
return success('Reply sent');
|
||||
return success('Messages sent successfully');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -339,7 +405,11 @@ class Messages_model extends CI_Model
|
||||
*/
|
||||
private function _personLog($sender_id, $receiver_id, $message_id)
|
||||
{
|
||||
$_personLog = $this->personloglib->log(
|
||||
// In case the message is accessed via ViewMessage controller -> no authentication
|
||||
// If no authentication is performed then use a hard coded uid
|
||||
$loggedUserUID = function_exists('getAuthUID') ? getAuthUID() : self::NO_AUTH_UID;
|
||||
|
||||
return $this->personloglib->log(
|
||||
$receiver_id,
|
||||
'Action',
|
||||
array(
|
||||
@@ -350,10 +420,19 @@ class Messages_model extends CI_Model
|
||||
'kommunikation',
|
||||
'core',
|
||||
null,
|
||||
getAuthUID()
|
||||
$loggedUserUID
|
||||
);
|
||||
}
|
||||
|
||||
return $_personLog;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _getReplyBody($body, $receiverName, $receiverSurname, $sentDate)
|
||||
{
|
||||
return sprintf(
|
||||
self::REPLY_BODY_FORMAT,
|
||||
date_format(date_create($sentDate), 'd.m.Y H:i'), $receiverName, $receiverSurname, $body
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -407,7 +486,7 @@ class Messages_model extends CI_Model
|
||||
$message = getData($messageResult)[0];
|
||||
|
||||
$replySubject = self::REPLY_SUBJECT_PREFIX.$message->subject;
|
||||
$replyBody = self::REPLY_BODY_PREFIX.$message->body;
|
||||
$replyBody = $this->_getReplyBody($message->body, $receiver->Vorname, $receiver->Nachname, $message->sent);
|
||||
$relationmessage = '<input type="hidden" name="relationmessage_id" value="'.$message_id.'">';
|
||||
}
|
||||
|
||||
|
||||
@@ -152,45 +152,7 @@ class MessageToken_model extends DB_Model
|
||||
LEFT JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
|
||||
WHERE p.person_id = ?';
|
||||
|
||||
$result = $this->db->query($sql, array($person_id));
|
||||
|
||||
// If no errors occurred
|
||||
if ($result)
|
||||
{
|
||||
return success($result->result());
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of a person
|
||||
*/
|
||||
public function getPersonData($person_id)
|
||||
{
|
||||
$sql = 'SELECT person_id,
|
||||
vorname as "Vorname",
|
||||
nachname as "Nachname",
|
||||
anrede as "Anrede",
|
||||
titelpost as "TitelPost",
|
||||
titelpre as "TitelPre",
|
||||
vornamen as "Vornamen"
|
||||
FROM public.tbl_person
|
||||
WHERE person_id %s ?';
|
||||
|
||||
$result = $this->db->query(sprintf($sql, is_array($person_id) ? 'IN' : '='), array($person_id));
|
||||
|
||||
// If no errors occurred
|
||||
if ($result)
|
||||
{
|
||||
return success($result->result());
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error());
|
||||
}
|
||||
return $this->execQuery($sql, array($person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,30 +167,7 @@ class MessageToken_model extends DB_Model
|
||||
WHERE p.person_id = ?
|
||||
AND b.aktiv = TRUE';
|
||||
|
||||
$result = $this->db->query($sql, array($person_id));
|
||||
|
||||
// If no errors occurred
|
||||
if ($result)
|
||||
{
|
||||
// If data are present
|
||||
if (is_array($result->result()) && count($result->result()) > 0)
|
||||
{
|
||||
$personresults = $result->result();
|
||||
$person = $personresults[0];
|
||||
|
||||
// If it is an employee
|
||||
if ($person->mitarbeiter_uid != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error());
|
||||
}
|
||||
return $this->execQuery($sql, array($person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,8 @@ class Recipient_model extends DB_Model
|
||||
ks.kontakt,
|
||||
p.nachname,
|
||||
p.vorname,
|
||||
b.uid
|
||||
b.uid,
|
||||
mr.sent
|
||||
FROM public.tbl_msg_recipient mr INNER JOIN public.tbl_msg_message mm USING (message_id)
|
||||
INNER JOIN public.tbl_person p ON (mm.person_id = p.person_id)
|
||||
LEFT JOIN public.tbl_benutzer b ON (mr.person_id = b.person_id)
|
||||
|
||||
+18
-5
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
@@ -10,7 +10,7 @@
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageReply.css')
|
||||
)
|
||||
);
|
||||
?>
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
@@ -24,7 +24,9 @@
|
||||
<div class="col-xs-12">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading text-center">
|
||||
|
||||
<?php echo $message->subject; ?>
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-condensed table-bordered" id="msgtable" align="center">
|
||||
@@ -33,7 +35,9 @@
|
||||
<b>From:</b>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<?php echo $sender->vorname.' '.$sender->nachname; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -41,7 +45,9 @@
|
||||
<b>Subject:</b>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<?php echo $message->subject; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -49,7 +55,9 @@
|
||||
<b>Message:</b>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<?php echo $message->body; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -57,11 +65,15 @@
|
||||
<div class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<?php if ($isEmployee === false && $href != ''): ?>
|
||||
<button class="btn btn-default" id="replybutton" onclick="location.href='<?php echo $href; ?>';">
|
||||
|
||||
<?php if (!isEmptyString($hrefReply)): ?>
|
||||
|
||||
<button class="btn btn-default" id="replybutton" onclick="location.href='<?php echo $hrefReply; ?>';">
|
||||
<i class="fa fa-reply"></i> Reply
|
||||
</button>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -72,4 +84,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'MessageReply',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageWrite.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/messageWriteReply.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Send message</h3>
|
||||
</div>
|
||||
</div>
|
||||
<form id="sendForm" method="post" action="<?php echo site_url('/ViewMessage/sendReply'); ?>">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfieldcol-left">
|
||||
<label>Receiver:</label>
|
||||
</div>
|
||||
<div class="col-lg-11 msgfieldcol-right">
|
||||
|
||||
<?php echo $receiver; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfield msgfieldcol-left">
|
||||
<label>Subject:</label>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7">
|
||||
<input id="subject" class="form-control" type="text" value="<?php echo $subject; ?>" name="subject">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label>Message:</label>
|
||||
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-right">
|
||||
<button id="sendButton" class="btn btn-default" type="button">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="receiver_id" value="<?php echo $receiver_id; ?>">
|
||||
<input type="hidden" name="relationmessage_id" value="<?php echo $relationmessage_id; ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
@@ -1,81 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfieldcol-left">
|
||||
<label>Receiver:</label>
|
||||
</div>
|
||||
<div class="col-lg-11 msgfieldcol-right">
|
||||
<?php
|
||||
for ($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
// Every 10 recipients a new line
|
||||
if ($i > 1 && $i % 10 == 0)
|
||||
{
|
||||
echo '<br>';
|
||||
}
|
||||
echo $receiver->Vorname." ".$receiver->Nachname."; ";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1 msgfield msgfieldcol-left">
|
||||
<label>Subject:</label>
|
||||
</div>
|
||||
<?php
|
||||
$subject = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$subject = 'Re: '.$message->subject;
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-7">
|
||||
<input id="subject" class="form-control" type="text" value="<?php echo $subject; ?>"
|
||||
name="subject">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-<?php echo isset($variables) ? 10 : 12 ?>">
|
||||
<label>Message:</label>
|
||||
<?php
|
||||
$body = '';
|
||||
if (isset($message))
|
||||
{
|
||||
if (isset($receivers[0]))
|
||||
$body .= '<p></p><p></p><blockquote><i>On '.date_format(date_create($message->sent), 'd.m.Y H:i').' '.$receivers[0]->Vorname.' '.$receivers[0]->Nachname.' wrote:'.'</i></blockquote>';
|
||||
$body .= '<blockquote style="border-left:2px solid; padding-left: 8px">';
|
||||
$body .= $message->body.'</blockquote>';
|
||||
}
|
||||
?>
|
||||
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($variables)):
|
||||
?>
|
||||
<div class="col-lg-2">
|
||||
<div class="form-group">
|
||||
<label>Fields:</label>
|
||||
<select id="variables" class="form-control" size="14" multiple="multiple">
|
||||
<?php
|
||||
foreach ($variables as $key => $val)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-<?php echo isset($variables) ? 10 : 12 ?> text-right">
|
||||
<button id="sendButton" class="btn btn-default" type="button">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'MessageSent',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageSent.css')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-6">
|
||||
<h3 class="page-header text-right">Thank you for getting in touch!</h3>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<h3 class="page-header">Danke für die Kontaktaufnahme!</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-right">
|
||||
Message sent successfully!
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Nachricht erfolgreich versandt!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-right">
|
||||
<span class="rwd-line">
|
||||
Thank you for your message.
|
||||
</span>
|
||||
<span class="rwd-line">
|
||||
We will get back to you shortly.
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<span class="rwd-line">
|
||||
Herzlichen Dank für Ihre Nachricht.
|
||||
</span>
|
||||
<span class="rwd-line">
|
||||
Wir werden uns schnellstmöglich um Ihr Anliegen kümmern.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-right" style="border-right: 1px">
|
||||
You can safely close this window.
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Sie können dieses Fenster schließen.
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-right">
|
||||
Your InfoCenter@FHTW Team
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Ihr InfoCenter@FHTW Team
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<p class="signatureblock">
|
||||
Fachhochschule Technikum Wien | University of Applied Sciences Technikum Wien
|
||||
<br>Hoechstaedtplatz 6, 1200 Wien, AUSTRIA
|
||||
<br><a class="signatureblocklink" href="https://www.technikum-wien.at">www.technikum-wien.at</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'MessageReply',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('public/css/sbadmin2/admintemplate_contentonly.css', 'public/css/messaging/messageWrite.css'),
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/messaging/messageWriteReply.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<?php
|
||||
$href = site_url('/ViewMessage/sendReply');
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Send message</h3>
|
||||
</div>
|
||||
</div>
|
||||
<form id="sendForm" method="post" action="<?php echo $href; ?>">
|
||||
<?php
|
||||
$this->load->view('system/messages/messageForm.php');
|
||||
|
||||
for ($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
$receiverid = $receiver->person_id;
|
||||
$fieldname = 'persons[]';
|
||||
|
||||
echo '<input type="hidden" name="'.$fieldname.'" value="'.$receiverid.'">'."\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($message))
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="relationmessage_id" value="<?php echo $message->message_id; ?>">
|
||||
<?php
|
||||
}
|
||||
if (isset($token))
|
||||
{
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view("templates/FHC-Footer"); ?>
|
||||
Reference in New Issue
Block a user