mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°6071 - Prefill Tagset in transition displayed but not saved
This commit is contained in:
@@ -4263,9 +4263,30 @@ HTML;
|
|||||||
case 'Set':
|
case 'Set':
|
||||||
case 'TagSet':
|
case 'TagSet':
|
||||||
$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 ($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;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user