mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-18 03:38:20 +02:00
Compare commits
1 Commits
feature/99
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c07317dc71 |
@@ -3983,6 +3983,27 @@ HTML;
|
|||||||
$sTagSetJson = utils::ReadPostedParam("attr_{$sFormPrefix}{$sAttCode}", null, 'raw_data');
|
$sTagSetJson = utils::ReadPostedParam("attr_{$sFormPrefix}{$sAttCode}", null, 'raw_data');
|
||||||
if ($sTagSetJson !== null) { // bulk modify, direct linked set not handled
|
if ($sTagSetJson !== null) { // bulk modify, direct linked set not handled
|
||||||
$value = json_decode($sTagSetJson, true);
|
$value = json_decode($sTagSetJson, true);
|
||||||
|
if ($this->IsNew()) {
|
||||||
|
if (is_array($value['orig_value'])) {
|
||||||
|
foreach ($value['orig_value'] as $val) {
|
||||||
|
if (!in_array($val, $value['removed'])) {
|
||||||
|
$value['added'][] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$aCurrentValues = $this->Get($sAttCode)->GetValues();
|
||||||
|
foreach ($value['orig_value'] as $val) {
|
||||||
|
if (!in_array($val, $aCurrentValues) && !in_array($val, $value['removed']) && !in_array($val, $value['added'])) {
|
||||||
|
$value['added'][] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($aCurrentValues as $val) {
|
||||||
|
if (!in_array($val, $value['orig_value']) && !in_array($val, $value['removed']) && !in_array($val, $value['added'])) {
|
||||||
|
$value['removed'][] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user