Merged in bugfix/PMCORE-2703 (pull request #7777)
PMCORE-2703 After to execute the convert-old-web-entries command the Dynaform is duplicated Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
e9bb560eaa
@@ -11,6 +11,7 @@ use G;
|
||||
use ProcessMaker\BusinessModel\Process as BusinessModelProcess;
|
||||
use ProcessMaker\BusinessModel\Validator as BusinessModelValidator;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\Step as StepModel;
|
||||
use ProcessMaker\Project\Workflow;
|
||||
use ProcessMaker\Util\Common;
|
||||
use ProcessPeer;
|
||||
@@ -554,20 +555,22 @@ class WebEntryEvent
|
||||
|
||||
if (!isset($arrayData['WE_TYPE']) || $arrayData['WE_TYPE'] === 'SINGLE') {
|
||||
//Task - Step
|
||||
$stepModel = StepModel::getByProcessTaskAndStepType($projectUid, $this->webEntryEventWebEntryTaskUid, 'DYNAFORM', $dynaFormUid);
|
||||
$step = new Step();
|
||||
|
||||
$stepUid = $step->create(array(
|
||||
"PRO_UID" => $projectUid,
|
||||
"TAS_UID" => $this->webEntryEventWebEntryTaskUid
|
||||
));
|
||||
if (!empty($dynaFormUid)) {
|
||||
$result = $step->update(array(
|
||||
"STEP_UID" => $stepUid,
|
||||
"STEP_TYPE_OBJ" => "DYNAFORM",
|
||||
"STEP_UID_OBJ" => $dynaFormUid,
|
||||
"STEP_POSITION" => 1,
|
||||
"STEP_MODE" => "EDIT"
|
||||
if (empty($stepModel)) {
|
||||
$stepUid = $step->create(array(
|
||||
"PRO_UID" => $projectUid,
|
||||
"TAS_UID" => $this->webEntryEventWebEntryTaskUid
|
||||
));
|
||||
if (!empty($dynaFormUid)) {
|
||||
$result = $step->update(array(
|
||||
"STEP_UID" => $stepUid,
|
||||
"STEP_TYPE_OBJ" => "DYNAFORM",
|
||||
"STEP_UID_OBJ" => $dynaFormUid,
|
||||
"STEP_POSITION" => 1,
|
||||
"STEP_MODE" => "EDIT"
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,18 @@ class Step extends Model
|
||||
{
|
||||
protected $table = "STEP";
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get object step by process, task, object type and his Uid.
|
||||
*/
|
||||
public static function getByProcessTaskAndStepType($proUid, $tasUid, $stepTypeObj, $stepUidObj)
|
||||
{
|
||||
$step = self::where('PRO_UID', '=', $proUid)
|
||||
->where('TAS_UID', '=', $tasUid)
|
||||
->where('STEP_TYPE_OBJ', '=', $stepTypeObj)
|
||||
->where('STEP_UID_OBJ', '=', $stepUidObj)
|
||||
->get()
|
||||
->first();
|
||||
return $step;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user