Merged in bugfix/PMCORE-4084 (pull request #8663)
PMCORE-4084 Supervisor > multiple step > Previous and Next step buttons are not displayed Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -58,6 +58,7 @@ use ProcessMaker\Model\GroupUser;
|
||||
use ProcessMaker\Model\ListUnassigned;
|
||||
use ProcessMaker\Model\Triggers;
|
||||
use ProcessMaker\Model\ProcessUser;
|
||||
use ProcessMaker\Model\StepSupervisor;
|
||||
use ProcessMaker\Model\Task;
|
||||
use ProcessMaker\Model\User;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
@@ -4453,4 +4454,70 @@ class Cases
|
||||
// Return results
|
||||
return $dynaForms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objects that they have send it.
|
||||
* @param string $appUid
|
||||
* @param string $typeObject
|
||||
* @return array
|
||||
*/
|
||||
public function getStepsToRevise(string $appUid, string $typeObject): array
|
||||
{
|
||||
$application = ModelApplication::where('APP_UID', '=', $appUid)
|
||||
->first();
|
||||
$result = StepSupervisor::where('PRO_UID', '=', $application['PRO_UID'])->
|
||||
where('STEP_TYPE_OBJ', '=', $typeObject)->
|
||||
orderBy('STEP_POSITION', 'ASC')->
|
||||
get()->
|
||||
toArray();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all url steps to revise.
|
||||
* @param string $appUid
|
||||
* @param int $delIndex
|
||||
* @return array
|
||||
*/
|
||||
public function getAllUrlStepsToRevise(string $appUid, int $delIndex): array
|
||||
{
|
||||
$result = [];
|
||||
$dynaformStep = $this->getStepsToRevise($appUid, 'DYNAFORM');
|
||||
$i = 0;
|
||||
foreach ($dynaformStep as $step) {
|
||||
$url = "cases_StepToRevise?"
|
||||
. "type=DYNAFORM&"
|
||||
. "ex={$i}&"
|
||||
. "PRO_UID={$step["PRO_UID"]}&"
|
||||
. "DYN_UID={$step['STEP_UID_OBJ']}&"
|
||||
. "APP_UID={$appUid}&"
|
||||
. "position={$step['STEP_POSITION']}&"
|
||||
. "DEL_INDEX={$delIndex}";
|
||||
$result[] = [
|
||||
'uid' => $step['STEP_UID_OBJ'],
|
||||
'url' => $url
|
||||
];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$inputDocumentStep = $this->getStepsToRevise($appUid, 'INPUT_DOCUMENT');
|
||||
$i = 0;
|
||||
foreach ($inputDocumentStep as $step) {
|
||||
$url = "cases_StepToReviseInputs?"
|
||||
. "type=INPUT_DOCUMENT&"
|
||||
. "ex={$i}&"
|
||||
. "PRO_UID={$step["PRO_UID"]}&"
|
||||
. "INP_DOC_UID={$step['STEP_UID_OBJ']}&"
|
||||
. "APP_UID={$appUid}&"
|
||||
. "position={$step['STEP_POSITION']}&"
|
||||
. "DEL_INDEX={$delIndex}";
|
||||
$result[] = [
|
||||
'uid' => $step['STEP_UID_OBJ'],
|
||||
'url' => $url
|
||||
];
|
||||
$i++;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
17
workflow/engine/src/ProcessMaker/Model/StepSupervisor.php
Normal file
17
workflow/engine/src/ProcessMaker/Model/StepSupervisor.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use App\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class StepSupervisor extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'STEP_SUPERVISOR';
|
||||
protected $primaryKey = 'STEP_UID';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user