Skip to content

Commit

Permalink
Issue #1146 bugfix form priority cond of workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yisaka117 committed Apr 20, 2022
1 parent 9a6ca20 commit 36d08e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ConditionItems/WorkflowItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ protected function getWorkflow() : ?Model\Workflow

protected function getWorkflowStatus(Condition $condition) : ?string
{
return Model\WorkflowStatus::getWorkflowStatusName($condition->condition_value);
$this->custom_table = $condition->getCustomTable();
$workflow = $this->getWorkflow();

return collect($condition->condition_value)->map(function ($v) use($workflow) {
return Model\WorkflowStatus::getWorkflowStatusName($v, $workflow);
})->implode(",");
//return Model\WorkflowStatus::getWorkflowStatusName($condition->condition_value);
}
}
12 changes: 12 additions & 0 deletions src/Model/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ class Condition extends ModelBase
protected $condition_type_key = 'condition_type';
protected $condition_column_key = 'target_column_id';

public function getCustomTable()
{
if ($this->morph_type == 'custom_form_priority') {
$parent_table = CustomFormPriority::find($this->morph_id);
if (isset($parent_table)) {
return $parent_table->custom_form->custom_table;
}
}
return null;
}

public function getConditionTargetAttribute()
{
return $this->getConditionTarget();
Expand Down Expand Up @@ -52,6 +63,7 @@ public function getConditionTextAttribute()
return null;
}

//$this->condition_item->setCustomTable($parent_table->custom_form->custom_table);
return $this->condition_item->getConditionLabel($this) . ' : ' . $this->condition_item->getConditionText($this);
}

Expand Down

0 comments on commit 36d08e2

Please sign in to comment.