Merged in bugfix/PMCORE-952-A (pull request #8174)
PMCORE-952-A Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
e059fb8bc9
@@ -21,6 +21,7 @@ use PMLicensedFeatures;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\AbeConfiguration as AbeConfigurationModel;
|
||||
use ProcessMaker\Model\EmailServerModel;
|
||||
use ProcessMaker\Model\Task;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use Publisher;
|
||||
use ResultSet;
|
||||
@@ -300,6 +301,8 @@ class ActionsByEmail
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_MAILSERVER_OR_MAILCURRENT);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_EMAIL_SERVER_UID);
|
||||
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_UID);
|
||||
$criteria->addSelectColumn(AbeRequestsPeer::APP_UID);
|
||||
$criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX);
|
||||
@@ -349,6 +352,19 @@ class ActionsByEmail
|
||||
}
|
||||
} else {
|
||||
$data[$index]['USER'] = '';
|
||||
if ($data[$index]['ABE_MAILSERVER_OR_MAILCURRENT'] == 1) {
|
||||
$emailServer = new EmailServer();
|
||||
$dataEmailServer = $emailServer->getEmailServer($data[$index]['ABE_EMAIL_SERVER_UID']);
|
||||
$data[$index]['USER'] = $dataEmailServer['MESS_FROM_NAME'];
|
||||
}
|
||||
if ($data[$index]['ABE_MAILSERVER_OR_MAILCURRENT'] == 0) {
|
||||
$delegation = new AppDelegation();
|
||||
$previousTask = $delegation->getPreviousDelegationValidTask($data[$index]['APP_UID'], $data[$index]['DEL_INDEX']);
|
||||
if (in_array($previousTask['TAS_TYPE'], Task::DUMMY_TASKS)) {
|
||||
$res = Task::getTask($previousTask['TAS_ID']);
|
||||
$data[$index]['USER'] = $res->TAS_TITLE . ' (' . $previousTask['TAS_TYPE'] . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data[$index]['ABE_REQ_ANSWERED'] = ($data[$index]['ABE_REQ_ANSWERED'] == 1) ? G::LoadTranslation('ID_YES') : G::LoadTranslation('ID_NO');
|
||||
|
||||
@@ -45,6 +45,18 @@ class Task extends Model
|
||||
return $this->hasMany(Delegation::class, 'TAS_ID', 'TAS_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the task by taskId
|
||||
*
|
||||
* @param int $tasId
|
||||
* @return \ProcessMaker\Model\Task
|
||||
*/
|
||||
public static function getTask($tasId)
|
||||
{
|
||||
$query = Task::query()->select()->where('TAS_ID', $tasId);
|
||||
return $query->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include self-service
|
||||
*
|
||||
@@ -98,7 +110,7 @@ class Task extends Model
|
||||
public function scopeExcludedTasks($query)
|
||||
{
|
||||
$query->whereNotIn('TAS_TYPE', Task::$typesRunAutomatically)
|
||||
->whereNotIn('TAS_TYPE', Task::DUMMY_TASKS);
|
||||
->whereNotIn('TAS_TYPE', Task::DUMMY_TASKS);
|
||||
|
||||
return $query;
|
||||
}
|
||||
@@ -256,7 +268,7 @@ class Task extends Model
|
||||
});
|
||||
|
||||
$res = $query->first();
|
||||
if(is_null($res)) {
|
||||
if (is_null($res)) {
|
||||
return "";
|
||||
} else {
|
||||
return $res->TAS_DEF_TITLE;
|
||||
|
||||
Reference in New Issue
Block a user