mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
N°985 - Add applicable contexts on Trigger (Add portal contexts)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user