N°985 - Add applicable contexts on Trigger (Add portal contexts)

This commit is contained in:
Eric
2020-01-24 17:43:59 +01:00
parent 5485897bbb
commit cc4e1ea104
5 changed files with 92 additions and 30 deletions

View File

@@ -10090,15 +10090,20 @@ class AttributeEnumSet extends AttributeSet
return array_merge(parent::ListExpectedParams(), array('possible_values', 'is_null_allowed', 'max_items'));
}
public function GetPossibleValues($aArgs = array(), $sContains = '')
private function GetRawValues($aArgs = array(), $sContains = '')
{
$oValSetDef = $this->Get('possible_values');
if (!$oValSetDef)
{
return null;
return array();
}
$aRawValues = $oValSetDef->GetValues($aArgs, $sContains);
return $oValSetDef->GetValues($aArgs, $sContains);
}
public function GetPossibleValues($aArgs = array(), $sContains = '')
{
$aRawValues = $this->GetRawValues($aArgs, $sContains);
$aLocalizedValues = array();
foreach($aRawValues as $sKey => $sValue)
{
@@ -10110,6 +10115,12 @@ class AttributeEnumSet extends AttributeSet
public function GetValueLabel($sValue)
{
$aValues = $this->GetRawValues();
if (isset($aValues[$sValue]))
{
$sValue = $aValues[$sValue];
}
if (is_null($sValue))
{
// Unless a specific label is defined for the null value of this enum, use a generic "undefined" label
@@ -10193,6 +10204,37 @@ class AttributeEnumSet extends AttributeSet
}
class AttributeContextSet extends AttributeEnumSet
{
public function GetPossibleValues($aArgs = array(), $sContains = '')
{
$oValSetDef = $this->Get('possible_values');
if (!$oValSetDef)
{
return null;
}
return $oValSetDef->GetValues($aArgs, $sContains);
}
public function GetValueLabel($sValue)
{
$aValues = $this->GetPossibleValues();
if (in_array($sValue, $aValues))
{
return $aValues[$sValue];
}
return Dict::S('Enum:Undefined');
}
public function GetValueDescription($sValue)
{
return '';
}
}
class AttributeClassAttCodeSet extends AttributeSet
{
const SEARCH_WIDGET_TYPE = self::SEARCH_WIDGET_TYPE_STRING;