Merge branch 'release/3.7.0' of https://bitbucket.org/colosa/processmaker into bugfix/PMCORE-3366

This commit is contained in:
Henry Jordan
2021-09-24 20:18:40 +00:00
8 changed files with 45 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ export default {
data() { data() {
let that = this; let that = this;
return { return {
typeView: this.data.settings.view && this.data.settings.view.typeView typeView: this.data.settings && this.data.settings.view && this.data.settings.view.typeView
? this.data.settings.view.typeView ? this.data.settings.view.typeView
: "GRID", : "GRID",
random: 1, random: 1,

View File

@@ -3,7 +3,7 @@ export default {
data() { data() {
let that = this; let that = this;
return { return {
typeView: this.settings.view && this.settings.view.typeView typeView: this.settings && this.settings.view && this.settings.view.typeView
? this.settings.view.typeView ? this.settings.view.typeView
: "GRID", : "GRID",
random: 1, random: 1,

View File

@@ -3,7 +3,7 @@ export default {
data() { data() {
let that = this; let that = this;
return { return {
typeView: this.settings.view && this.settings.view.typeView typeView: this.settings && this.settings.view && this.settings.view.typeView
? this.settings.view.typeView ? this.settings.view.typeView
: "GRID", : "GRID",
random: 1, random: 1,

View File

@@ -3,7 +3,7 @@ export default {
data() { data() {
let that = this; let that = this;
return { return {
typeView: this.settings.view && this.settings.view.typeView typeView: this.settings && this.settings.view && this.settings.view.typeView
? this.settings.view.typeView ? this.settings.view.typeView
: "GRID", : "GRID",
random: 1, random: 1,

View File

@@ -21,6 +21,7 @@ use PMLicensedFeatures;
use ProcessMaker\Core\System; use ProcessMaker\Core\System;
use ProcessMaker\Model\AbeConfiguration as AbeConfigurationModel; use ProcessMaker\Model\AbeConfiguration as AbeConfigurationModel;
use ProcessMaker\Model\EmailServerModel; use ProcessMaker\Model\EmailServerModel;
use ProcessMaker\Model\Task;
use ProcessMaker\Plugins\PluginRegistry; use ProcessMaker\Plugins\PluginRegistry;
use Publisher; use Publisher;
use ResultSet; use ResultSet;
@@ -300,6 +301,8 @@ class ActionsByEmail
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE); $criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD); $criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
$criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID); $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::ABE_REQ_UID);
$criteria->addSelectColumn(AbeRequestsPeer::APP_UID); $criteria->addSelectColumn(AbeRequestsPeer::APP_UID);
$criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX); $criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX);
@@ -349,6 +352,19 @@ class ActionsByEmail
} }
} else { } else {
$data[$index]['USER'] = ''; $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'); $data[$index]['ABE_REQ_ANSWERED'] = ($data[$index]['ABE_REQ_ANSWERED'] == 1) ? G::LoadTranslation('ID_YES') : G::LoadTranslation('ID_NO');

View File

@@ -410,10 +410,11 @@ class Process extends Model
* @param string $category * @param string $category
* @param int $offset * @param int $offset
* @param int $limit * @param int $limit
* @param bool $paged
* *
* @return array * @return array
*/ */
public static function getProcessesForHome($text = null, $category = null, $offset = null, $limit = null) public static function getProcessesForHome($text = null, $category = null, $offset = null, $limit = null, $paged = true)
{ {
// Get base query // Get base query
$query = Process::query()->select(['PRO_ID', 'PRO_TITLE']); $query = Process::query()->select(['PRO_ID', 'PRO_TITLE']);
@@ -431,12 +432,15 @@ class Process extends Model
// Set "PRO_STATUS" condition // Set "PRO_STATUS" condition
$query->status('ACTIVE'); $query->status('ACTIVE');
// Set pagination if offset and limit are sent if ($paged) {
if (!is_null($offset) && !is_null($limit)) { // Set pagination if offset and limit are sent
$query->offset($offset); if (!is_null($offset) && !is_null($limit)) {
$query->limit($limit); $query->offset($offset);
$query->limit($limit);
}
} }
// Order by "PRO_TITLE" // Order by "PRO_TITLE"
$query->orderBy('PRO_TITLE'); $query->orderBy('PRO_TITLE');

View File

@@ -45,6 +45,18 @@ class Task extends Model
return $this->hasMany(Delegation::class, 'TAS_ID', 'TAS_ID'); 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 * Scope a query to only include self-service
* *
@@ -98,7 +110,7 @@ class Task extends Model
public function scopeExcludedTasks($query) public function scopeExcludedTasks($query)
{ {
$query->whereNotIn('TAS_TYPE', Task::$typesRunAutomatically) $query->whereNotIn('TAS_TYPE', Task::$typesRunAutomatically)
->whereNotIn('TAS_TYPE', Task::DUMMY_TASKS); ->whereNotIn('TAS_TYPE', Task::DUMMY_TASKS);
return $query; return $query;
} }
@@ -256,7 +268,7 @@ class Task extends Model
}); });
$res = $query->first(); $res = $query->first();
if(is_null($res)) { if (is_null($res)) {
return ""; return "";
} else { } else {
return $res->TAS_DEF_TITLE; return $res->TAS_DEF_TITLE;

View File

@@ -861,6 +861,7 @@ class Home extends Api
* @param string $category * @param string $category
* @param int $offset * @param int $offset
* @param int $limit * @param int $limit
* @param bool $paged
* *
* @return array * @return array
* *
@@ -869,7 +870,7 @@ class Home extends Api
* @access protected * @access protected
* @class AccessControl {@permission PM_CASES} * @class AccessControl {@permission PM_CASES}
*/ */
public function getProcesses($text = null, $category = null, int $offset = 0, int $limit = 15) public function getProcesses($text = null, $category = null, int $offset = 0, int $limit = 15, $paged = true)
{ {
try { try {
return Process::getProcessesForHome($text, $category, $offset, $limit); return Process::getProcessesForHome($text, $category, $offset, $limit);