- Moved constants EMAIL_KONTAKT_TYPE and SENT_INFO_NEWLINE from config/constants.php to MessageLib

- Added function parseTemplate to helper helpers/hlp_common_helper.php
- Changed method getMessages of model models/system/Recipient_model.php
- Changed views/templates/mailHTML.php and views/templates/mailTXT.php
This commit is contained in:
Paolo
2019-06-13 14:09:56 +02:00
parent 2ef386c34e
commit a5b3f0ed88
5 changed files with 25 additions and 24 deletions
-5
View File
@@ -125,11 +125,6 @@ define('EMAIL_CONFIG_INDEX', 'mail');
| Messaging system constants
|--------------------------------------------------------------------------
*/
// Email kontakt type
define('EMAIL_KONTAKT_TYPE', 'email');
// tbl_msg_recipient->sentInfo separator
define('SENT_INFO_NEWLINE', '\n');
// Message statuses
define('MSG_STATUS_UNREAD', 0);
define('MSG_STATUS_READ', 1);
+13 -1
View File
@@ -241,7 +241,7 @@ function isDateWorkingDay($date, $days = null)
}
/**
* Parse the given given text using the given data parameter
* Parse the given text using the given data parameter
* Use the CI parser which performs simple text substitution for pseudo-variable
*/
function parseText($text, $data)
@@ -251,3 +251,15 @@ function parseText($text, $data)
return $ci->parser->parse_string($text, $data, true);
}
/**
* Parse the given template using the given data parameter
* Use the CI parser which performs simple text substitution for pseudo-variable
*/
function parseTemplate($template, $data)
{
$ci =& get_instance(); // get CI instance
$ci->load->library('parser'); // Loads CI parser library
return $ci->parser->parse($template, $data, true);
}
+3 -13
View File
@@ -205,7 +205,7 @@ class Recipient_model extends DB_Model
* @param limit specifies the number of messages to get
* @param message_id specifies a single message
*/
public function getMessages($kontaktType, $sent, $limit = null, $message_id = null)
public function getMessages($kontaktType, $limit = 1, $message_id = null)
{
$query = 'SELECT mm.message_id,
ks.kontakt as sender,
@@ -239,17 +239,7 @@ class Recipient_model extends DB_Model
$parametersArray = array($kontaktType, $kontaktType);
if (is_null($sent) || $sent == '')
{
$query .= ' WHERE mr.sent IS NULL';
}
else
{
array_push($parametersArray, $sent);
$query .= ' WHERE mr.sent = ?';
}
if (!is_null($message_id))
if (is_numeric($message_id))
{
array_push($parametersArray, $message_id);
$query .= ' AND mm.message_id = ?';
@@ -257,7 +247,7 @@ class Recipient_model extends DB_Model
$query .= ' ORDER BY mr.insertamum ASC';
if (!is_null($limit))
if (is_numeric($limit))
{
$query .= ' LIMIT ?';
array_push($parametersArray, $limit);
+3 -3
View File
@@ -1,12 +1,12 @@
<html>
<head>
<title>This is not the email template, this is a tribute</title>
<title>Notification of personal message reception</title>
</head>
<body>
<div class="container">
<h2>Neue Nachricht vorhanden</h2>
<h2>A new message is available</h2>
<div class="body">
<a href="{href}">Klicken Sie hier, um die Nachricht anzuzeigen</a>
<a href="{href}">Click here to view the message</a>
</div>
</div>
</body>
+6 -2
View File
@@ -1,3 +1,7 @@
Follow the following link to read the message.
Notification of personal message reception
{href}
A new message is available
Click here to view the message
{href}