mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-06 10:08:43 +02:00
Compare commits
6 Commits
develop
...
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 $sDisplayMode;
|
||||||
protected $aFieldsMap;
|
protected $aFieldsMap;
|
||||||
|
/**
|
||||||
|
* @var array Store posted values in order to be used in GetAttributeFlag
|
||||||
|
*/
|
||||||
|
protected $aPostedValues = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true, bypass IsActionAllowedOnAttribute when writing this object
|
* If true, bypass IsActionAllowedOnAttribute when writing this object
|
||||||
@@ -3884,7 +3888,33 @@ HTML;
|
|||||||
return $aWriteableAttList;
|
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
|
* Compute the attribute flags depending on the object state
|
||||||
*/
|
*/
|
||||||
public function GetFormAttributeFlags($sAttCode)
|
public function GetFormAttributeFlags($sAttCode)
|
||||||
@@ -4110,6 +4140,7 @@ HTML;
|
|||||||
|
|
||||||
$aErrors = array();
|
$aErrors = array();
|
||||||
$aFinalValues = 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)
|
foreach($this->GetWriteableAttList(array_keys($aValues), $aErrors, $aAttFlags) as $sAttCode => $oAttDef)
|
||||||
{
|
{
|
||||||
$aFinalValues[$sAttCode] = $aValues[$sAttCode];
|
$aFinalValues[$sAttCode] = $aValues[$sAttCode];
|
||||||
|
|||||||
@@ -521,7 +521,7 @@ class ormLinkSet implements iDBObjectSetIterator, Iterator, SeekableIterator
|
|||||||
* $oCISet->RemoveItem(123456);
|
* $oCISet->RemoveItem(123456);
|
||||||
* $oTicket->Set(‘functionalcis_list’, $oCISet);
|
* $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');
|
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