mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
contract template obligation contract template dependency UI
This commit is contained in:
@@ -17,11 +17,11 @@ class ContractTemplateObligationDependencyCheck implements Rule
|
||||
* @return void
|
||||
*/
|
||||
|
||||
private $depend_template_contract_obligation_id;
|
||||
private $contract_template_obligation_id;
|
||||
|
||||
public function __construct($depend_template_contract_obligation_id = '')
|
||||
public function __construct($contract_template_obligation_id = '')
|
||||
{
|
||||
$this->depend_template_contract_obligation_id = $depend_template_contract_obligation_id;
|
||||
$this->contract_template_obligation_id = $contract_template_obligation_id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,16 +36,17 @@ class ContractTemplateObligationDependencyCheck implements Rule
|
||||
$this->attribute = $attribute;
|
||||
$value = is_array($value) ? $value : [$value];
|
||||
|
||||
if ($value[0] != $this->depend_template_contract_obligation_id[0]) {
|
||||
$contract_template_obligation_id = Hasher::decode('contract_template_obligations', $value[0]);
|
||||
if ($value[0] != $this->contract_template_obligation_id[0]) {
|
||||
$contract_template_obligation_id = Hasher::decode('contract_template_obligations', $this->contract_template_obligation_id[0]);
|
||||
$contract_template_obligation = ContractTemplateObligation::find($contract_template_obligation_id);
|
||||
$depend_contract_template_obligation_id = Hasher::decode('contract_template_obligations', $this->depend_template_contract_obligation_id[0]);
|
||||
|
||||
$depend_contract_template_obligation_id = Hasher::decode('contract_template_obligations', $value[0]);
|
||||
$depend_contract_template_obligation = ContractTemplateObligation::find($depend_contract_template_obligation_id);
|
||||
|
||||
$contract_template_obligation_dependency_structure = $contract_template_obligation->getContractTemplateObligationDependencyStructure([$contract_template_obligation->hash_id]);
|
||||
$contract_template_obligation_dependency_structure = $depend_contract_template_obligation->getContractTemplateObligationDependencyStructure([$depend_contract_template_obligation->hash_id]);
|
||||
|
||||
if (in_array($depend_contract_template_obligation->hash_id, $contract_template_obligation_dependency_structure)) {
|
||||
// return false;
|
||||
if (in_array($contract_template_obligation->hash_id, $contract_template_obligation_dependency_structure)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user