mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-04 04:19:28 +00:00
- MessageLib: Better error messages when sending messages
- Added a new constant for the messaging system - Added a new phrase for the messaging system
This commit is contained in:
@@ -50,6 +50,7 @@ define('MSG_ERR_BODY_EMPTY', 41);
|
||||
define('MSG_ERR_TEMPLATE_NOT_FOUND', 42);
|
||||
define('MSG_ERR_DELIVERY_MESSAGE', 43);
|
||||
define('MSG_ERR_CONTACT_NOT_FOUND', 44);
|
||||
define('MSG_ERR_OU_CONTACTS_NOT_FOUND', 45);
|
||||
|
||||
define('MSG_ERR_INVALID_USER_ID', 100);
|
||||
define('MSG_ERR_INVALID_MSG_ID', 101);
|
||||
|
||||
@@ -24,4 +24,5 @@ $lang['message_' . MSG_STATUS_UPDATE] = 'Status updated';
|
||||
$lang['message_' . MSG_PARTICIPANT_ADDED] = 'Participant added';
|
||||
$lang['message_' . MSG_ERR_PARTICIPANT_EXISTS] = 'User is already participating in this thread';
|
||||
$lang['message_' . MSG_ERR_PARTICIPANT_NONSYSTEM] = 'This user id is not in the system';
|
||||
$lang['message_' . MSG_PARTICIPANT_REMOVED] = 'Participant removed from thread';
|
||||
$lang['message_' . MSG_PARTICIPANT_REMOVED] = 'Participant removed from thread';
|
||||
$lang['message_' . MSG_ERR_OU_CONTACTS_NOT_FOUND] = 'No receivers found for this organization unit';
|
||||
@@ -24,4 +24,5 @@ $lang['message_' . MSG_STATUS_UPDATE] = 'Status updated';
|
||||
$lang['message_' . MSG_PARTICIPANT_ADDED] = 'Participant added';
|
||||
$lang['message_' . MSG_ERR_PARTICIPANT_EXISTS] = 'User is already participating in this thread';
|
||||
$lang['message_' . MSG_ERR_PARTICIPANT_NONSYSTEM] = 'This user id is not in the system';
|
||||
$lang['message_' . MSG_PARTICIPANT_REMOVED] = 'Participant removed from thread';
|
||||
$lang['message_' . MSG_PARTICIPANT_REMOVED] = 'Participant removed from thread';
|
||||
$lang['message_' . MSG_ERR_OU_CONTACTS_NOT_FOUND] = 'No receivers found for this organization unit';
|
||||
@@ -217,6 +217,12 @@ class MessageLib
|
||||
// If everything went ok
|
||||
if (is_object($receivers) && $receivers->error == EXIT_SUCCESS && is_array($receivers->retval))
|
||||
{
|
||||
// If no receivers were found for this organization unit
|
||||
if (count($receivers->retval) == 0)
|
||||
{
|
||||
$result = $this->_error($receivers->retval, MSG_ERR_OU_CONTACTS_NOT_FOUND);
|
||||
}
|
||||
|
||||
// Looping on receivers
|
||||
for ($i = 0; $i < count($receivers->retval); $i++)
|
||||
{
|
||||
@@ -341,8 +347,16 @@ class MessageLib
|
||||
// If everything went ok
|
||||
if (is_object($receivers) && $receivers->error == EXIT_SUCCESS && is_array($receivers->retval))
|
||||
{
|
||||
// Load reveiver data to get its relative language
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
// If no receivers were found for this organization unit
|
||||
if (count($receivers->retval) == 0)
|
||||
{
|
||||
$result = $this->_error($receivers->retval, MSG_ERR_OU_CONTACTS_NOT_FOUND);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load reveiver data to get its relative language
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
}
|
||||
|
||||
// Looping on receivers
|
||||
for ($i = 0; $i < count($receivers->retval); $i++)
|
||||
|
||||
Reference in New Issue
Block a user