mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 23:44:11 +01:00
Compare commits
6 Commits
feature/89
...
feature/75
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88c19e6624 | ||
|
|
ea86325566 | ||
|
|
000748228f | ||
|
|
a8ac86fca6 | ||
|
|
f08350a72c | ||
|
|
18f9f14dcd |
@@ -176,6 +176,10 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
|
||||
*/
|
||||
protected $sDisplayMode;
|
||||
protected $aFieldsMap;
|
||||
/**
|
||||
* @var array Store posted values in order to be used in GetAttributeFlag
|
||||
*/
|
||||
protected $aPostedValues = [];
|
||||
|
||||
/**
|
||||
* If true, bypass IsActionAllowedOnAttribute when writing this object
|
||||
@@ -3884,7 +3888,33 @@ HTML;
|
||||
return $aWriteableAttList;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* function to test if the posted value or if not exists the existing value matches the expected value
|
||||
* this is used to check the current value in GetAttributeFlag function (useful to manage dynamic readonly attributes)
|
||||
* @param $sAttCode
|
||||
*/
|
||||
public function GetCurrentValueInScreen($sAttCode)
|
||||
{
|
||||
if (array_key_exists($sAttCode, $this->aPostedValues)) {
|
||||
return $this->aPostedValues[$sAttCode];
|
||||
}
|
||||
return $this->Get($sAttCode);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function checks if the value of the attribute has been modified in screen
|
||||
* this is used to check if field has been modified in GetAttributeFlag function (useful to manage dynamic readonly attributes)
|
||||
* @param $sAttCode
|
||||
*/
|
||||
public function IsModifiedValueInScreen($sAttCode)
|
||||
{
|
||||
if (array_key_exists($sAttCode, $this->aPostedValues)) {
|
||||
return $this->aPostedValues[$sAttCode] != $this->Get($sAttCode);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the attribute flags depending on the object state
|
||||
*/
|
||||
public function GetFormAttributeFlags($sAttCode)
|
||||
@@ -4110,6 +4140,7 @@ HTML;
|
||||
|
||||
$aErrors = array();
|
||||
$aFinalValues = array();
|
||||
$this->aPostedValues = $aValues; // Store the values for later use (e.g. in getAttributeFlag)
|
||||
foreach($this->GetWriteableAttList(array_keys($aValues), $aErrors, $aAttFlags) as $sAttCode => $oAttDef)
|
||||
{
|
||||
$aFinalValues[$sAttCode] = $aValues[$sAttCode];
|
||||
|
||||
@@ -521,7 +521,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
|
||||
* $oCISet->RemoveItem(123456);
|
||||
* $oTicket->Set(‘functionalcis_list’, $oCISet);
|
||||
*/
|
||||
if (!ContextTag::Check(ContextTag::TAG_SETUP)) {
|
||||
if (ContextTag::Check(ContextTag::TAG_PORTAL) || ContextTag::Check(ContextTag::TAG_CONSOLE) ) {
|
||||
DeprecatedCallsLog::NotifyDeprecatedPhpMethod('old pattern - please get previous value of the linked set, modify it and set it back to the host object');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user