PM-3301: 0018030: Weird display of emails in email event properties from dropdown
This commit is contained in:
@@ -26,6 +26,8 @@ class EmailEvent
|
|||||||
$criteria->clearSelectColumns();
|
$criteria->clearSelectColumns();
|
||||||
$criteria->addSelectColumn(\UsersPeer::USR_UID);
|
$criteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||||
$criteria->addSelectColumn(\UsersPeer::USR_EMAIL);
|
$criteria->addSelectColumn(\UsersPeer::USR_EMAIL);
|
||||||
|
$criteria->addAsColumn('UID', 'USR_UID');
|
||||||
|
$criteria->addAsColumn('EMAIL', 'USR_EMAIL');
|
||||||
$criteria->add(\UsersPeer::USR_STATUS, "ACTIVE");
|
$criteria->add(\UsersPeer::USR_STATUS, "ACTIVE");
|
||||||
$result = \UsersPeer::doSelectRS($criteria);
|
$result = \UsersPeer::doSelectRS($criteria);
|
||||||
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
@@ -43,6 +45,41 @@ class EmailEvent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the email server accounts of the current workspace
|
||||||
|
*
|
||||||
|
* return array
|
||||||
|
*/
|
||||||
|
public function getEmailEventServerAccounts()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$criteria = new \Criteria("workflow");
|
||||||
|
$criteria->clearSelectColumns();
|
||||||
|
$criteria->addSelectColumn(\EmailServerPeer::MESS_UID);
|
||||||
|
$criteria->addSelectColumn(\EmailServerPeer::MESS_FROM_MAIL);
|
||||||
|
$criteria->addSelectColumn(\EmailServerPeer::MESS_ACCOUNT);
|
||||||
|
$criteria->addAsColumn('UID', 'MESS_UID');
|
||||||
|
$result = \EmailServerPeer::doSelectRS($criteria);
|
||||||
|
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$result->next();
|
||||||
|
$accountsArray = array();
|
||||||
|
while ($aRow = $result->getRow()) {
|
||||||
|
if ($aRow['MESS_UID'] != null) {
|
||||||
|
if($aRow['MESS_FROM_MAIL'] == "") {
|
||||||
|
$aRow['EMAIL'] = $aRow['MESS_ACCOUNT'];
|
||||||
|
} else {
|
||||||
|
$aRow['EMAIL'] = $aRow['MESS_FROM_MAIL'];
|
||||||
|
}
|
||||||
|
$accountsArray[] = array_change_key_case($aRow, CASE_LOWER);
|
||||||
|
}
|
||||||
|
$result->next();
|
||||||
|
}
|
||||||
|
return $accountsArray;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Email-Event data
|
* Get the Email-Event data
|
||||||
* @var string $evn_uid. uid for activity
|
* @var string $evn_uid. uid for activity
|
||||||
|
|||||||
@@ -28,14 +28,19 @@ class EmailEvent extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @url GET /:prj_uid/email-event/accounts
|
* @url GET /:prj_uid/email-event/accounts/:from
|
||||||
*
|
*
|
||||||
* @param string $prj_uid {@min 1} {@max 32}
|
* @param string $prj_uid {@min 1} {@max 32}
|
||||||
|
* @param string $from
|
||||||
*/
|
*/
|
||||||
public function doGetEmailEventAccounts($prj_uid)
|
public function doGetEmailEventAccounts($prj_uid, $from = "emailUsers")
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$response = $this->EmailEvent->GetEmailEventAccounts();
|
if($from == "emailUsers") {
|
||||||
|
$response = $this->EmailEvent->GetEmailEventAccounts();
|
||||||
|
} else {
|
||||||
|
$response = $this->EmailEvent->getEmailEventServerAccounts();
|
||||||
|
}
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
|
|||||||
Reference in New Issue
Block a user