diff --git a/application/config/constants.php b/application/config/constants.php index e1c5906c3..ce917b5a3 100644 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -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); diff --git a/application/helpers/hlp_common_helper.php b/application/helpers/hlp_common_helper.php index 45a36914c..025834ed2 100644 --- a/application/helpers/hlp_common_helper.php +++ b/application/helpers/hlp_common_helper.php @@ -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); +} diff --git a/application/models/system/Recipient_model.php b/application/models/system/Recipient_model.php index 654a9a883..74a1c3256 100644 --- a/application/models/system/Recipient_model.php +++ b/application/models/system/Recipient_model.php @@ -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); diff --git a/application/views/templates/mailHTML.php b/application/views/templates/mailHTML.php index c2e072f68..32d544c5a 100644 --- a/application/views/templates/mailHTML.php +++ b/application/views/templates/mailHTML.php @@ -1,12 +1,12 @@
-