- Fixed query method getMessages in model models/system/Recipient_model.php

- Changed interface method sendMessages of job jobs/MailJob.php
- Added function terminateWithError to helper helpers/hlp_common_helper.php
- Changed method overrideConfigs of library MailLib
- Removed method getConfigs from library MailLib
- Added public method getEmailNumberToSent to library MailLib
- Changed method sendAllNotices of library MessageLib
- Renamed private method _sendNotice to _sendOneNotice in library MessageLib
- Added new private methods _loadDbNoticeEmailTemplate, _loadFsNoticeEmailTemplate and _sendNotice to library MessageLib
- Changed method _getNoticeBody in library MessageLib
- Removed methods _getNoticeHTMLBody and _getNoticeTXTBody from in library MessageLib
This commit is contained in:
Paolo
2019-06-13 18:23:24 +02:00
parent 8135c6275e
commit 0ef94aacda
5 changed files with 202 additions and 326 deletions
@@ -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, $limit = 1, $message_id = null)
public function getMessages($kontaktType, $message_id = null, $limit = 1)
{
$query = 'SELECT mm.message_id,
ks.kontakt as sender,
@@ -219,10 +219,10 @@ class Recipient_model extends DB_Model
mr.sentinfo
FROM public.tbl_msg_recipient mr INNER JOIN public.tbl_msg_message mm USING (message_id)
LEFT JOIN (
SELECT person_id, kontakt FROM public.tbl_kontakt WHERE kontakttyp = ?
SELECT person_id, kontakt FROM public.tbl_kontakt WHERE zustellung = true AND kontakttyp = ?
) ks ON (ks.person_id = mm.person_id)
LEFT JOIN (
SELECT person_id, kontakt FROM public.tbl_kontakt WHERE kontakttyp = ?
SELECT person_id, kontakt FROM public.tbl_kontakt WHERE zustellung = true AND kontakttyp = ?
) kr ON (kr.person_id = mr.person_id)
LEFT JOIN (
SELECT b.person_id,
@@ -235,14 +235,15 @@ class Recipient_model extends DB_Model
m.mitarbeiter_uid
FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
WHERE b.aktiv = TRUE
) ms ON (ms.person_id = mm.person_id)';
) ms ON (ms.person_id = mm.person_id)
WHERE mr.sent IS NULL';
$parametersArray = array($kontaktType, $kontaktType);
if (is_numeric($message_id))
{
array_push($parametersArray, $message_id);
$query .= ' WHERE mm.message_id = ?';
$query .= ' AND mm.message_id = ?';
}
$query .= ' ORDER BY mr.insertamum ASC';