mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
Force the number of Tags in ormTagSet
This commit is contained in:
@@ -3359,7 +3359,7 @@ EOF
|
||||
$oTagSet = $this->Get($sAttCode);
|
||||
if (is_null($oTagSet))
|
||||
{
|
||||
$oTagSet = new ormTagSet(get_class($this), $sAttCode);
|
||||
$oTagSet = new ormTagSet(get_class($this), $sAttCode, $oAttDef->GetMaxItems());
|
||||
}
|
||||
$oTagSet->ApplyDelta($value);
|
||||
$this->Set($sAttCode, $oTagSet);
|
||||
|
||||
@@ -177,7 +177,7 @@ class WizardHelper
|
||||
else if ($oAttDef instanceof AttributeTagSet) // AttributeDate is derived from AttributeDateTime
|
||||
{
|
||||
$value = json_decode($value, true);
|
||||
$oTagSet = new ormTagSet(get_class($oObj), $sAttCode);
|
||||
$oTagSet = new ormTagSet(get_class($oObj), $sAttCode, $oAttDef->GetMaxItems());
|
||||
$oTagSet->SetValues($value['orig_value']);
|
||||
$oTagSet->ApplyDelta($value);
|
||||
$oObj->Set($sAttCode, $oTagSet);
|
||||
|
||||
@@ -1334,7 +1334,7 @@ abstract class DBObject implements iDisplay
|
||||
{
|
||||
if (is_string($toCheck))
|
||||
{
|
||||
$oTag = new ormTagSet(get_class($this), $sAttCode);
|
||||
$oTag = new ormTagSet(get_class($this), $sAttCode, $oAtt->GetMaxItems());
|
||||
try
|
||||
{
|
||||
$oTag->SetValues(explode(' ', $toCheck));
|
||||
|
||||
@@ -227,7 +227,7 @@ final class ormTagSet extends ormSet
|
||||
*/
|
||||
public function GetDelta(ormSet $oOtherTagSet)
|
||||
{
|
||||
$oTag = new ormTagSet($this->sClass, $this->sAttCode);
|
||||
$oTag = new ormTagSet($this->sClass, $this->sAttCode, 0);
|
||||
// Set the initial value
|
||||
$aOrigTagCodes = $this->GetValues();
|
||||
$oTag->SetValues($aOrigTagCodes);
|
||||
@@ -263,7 +263,7 @@ final class ormTagSet extends ormSet
|
||||
*/
|
||||
public function GetDeltaTags(ormTagSet $oOtherTagSet)
|
||||
{
|
||||
$oTag = new ormTagSet($this->sClass, $this->sAttCode);
|
||||
$oTag = new ormTagSet($this->sClass, $this->sAttCode, 0);
|
||||
// Set the initial value
|
||||
$aOrigTagCodes = $this->GetValues();
|
||||
$oTag->SetValues($aOrigTagCodes);
|
||||
|
||||
@@ -1140,7 +1140,7 @@ class ObjectFormManager extends FormManager
|
||||
$oTagSet = $this->oObject->Get($sAttCode);
|
||||
if (is_null($oTagSet))
|
||||
{
|
||||
$oTagSet = new ormTagSet(get_class($this->oObject), $sAttCode);
|
||||
$oTagSet = new ormTagSet(get_class($this->oObject), $sAttCode, $oAttDef->GetMaxItems());
|
||||
}
|
||||
$oTagSet->ApplyDelta(json_decode($value, true));
|
||||
$this->oObject->Set($sAttCode, $oTagSet);
|
||||
|
||||
Reference in New Issue
Block a user