N°985 - Add applicable contexts on Trigger (fix MTP warnings)

This commit is contained in:
Eric
2020-01-21 12:01:42 +01:00
parent 083f8d69c2
commit beda8e2810
2 changed files with 27 additions and 5 deletions

View File

@@ -9694,6 +9694,21 @@ abstract class AttributeSet extends AttributeDBFieldVoid
return parent::GetAllowedValues($aArgs, $sContains);
}
/**
* Allowed different values for the set values are mandatory for this attribute to be modified
*
* @param array $aArgs
* @param string $sContains
*
* @return array|null
* @throws \CoreException
* @throws \OQLException
*/
public function GetPossibleValues($aArgs = array(), $sContains = '')
{
return $this->GetAllowedValues($aArgs, $sContains);
}
/**
* @param \ormSet $oValue
*
@@ -9708,7 +9723,7 @@ abstract class AttributeSet extends AttributeDBFieldVoid
$aJson = array();
// possible_values
$aAllowedValues = $this->GetAllowedValues($aArgs);
$aAllowedValues = $this->GetPossibleValues($aArgs);
$aSetKeyValData = array();
foreach($aAllowedValues as $sCode => $sLabel)
{
@@ -10054,13 +10069,20 @@ class AttributeEnumSet extends AttributeSet
{
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_STRING;
public function GetAllowedValues($aArgs = array(), $sContains = '')
public static function ListExpectedParams()
{
$aRawValues = parent::GetAllowedValues($aArgs, $sContains);
if (is_null($aRawValues))
return array_merge(parent::ListExpectedParams(), array('possible_values', 'is_null_allowed', 'max_items'));
}
public function GetPossibleValues($aArgs = array(), $sContains = '')
{
$oValSetDef = $this->Get('possible_values');
if (!$oValSetDef)
{
return null;
}
$aRawValues = $oValSetDef->GetValues($aArgs, $sContains);
$aLocalizedValues = array();
foreach($aRawValues as $sKey => $sValue)
{