SF Bug #3003777 - Multivalue attributes with hundred of values hangs on modify
This commit is contained in:
parent
c23db377c2
commit
2ea1fc6314
@ -71,15 +71,16 @@ if (count($request['template']->getLDAPmodify(true))) {
|
|||||||
if (! $attribute->getOldValues())
|
if (! $attribute->getOldValues())
|
||||||
printf('<span style="color: green">[%s]</span>',_('attribute doesnt exist'));
|
printf('<span style="color: green">[%s]</span>',_('attribute doesnt exist'));
|
||||||
|
|
||||||
|
$dv = $attribute->getRemovedValues();
|
||||||
foreach ($attribute->getOldValues() as $key => $value) {
|
foreach ($attribute->getOldValues() as $key => $value) {
|
||||||
# For multiple values, we'll highlight the changed ones
|
# For multiple values, we'll highlight the changed ones
|
||||||
if ((count($attribute->getOldValues()) > 5) && in_array($value,$attribute->getRemovedValues()) && count($attribute->getValues()))
|
if ($x = ((count($attribute->getOldValues()) > 5) && count($attribute->getValues()) && in_array($value,$dv)))
|
||||||
echo '<span style="color:#880000; background:#FFFFA0">';
|
echo '<span style="color:#880000; background:#FFFFA0">';
|
||||||
|
|
||||||
$request['page']->draw('OldValue',$attribute,$key);
|
$request['page']->draw('OldValue',$attribute,$key);
|
||||||
|
|
||||||
# For multiple values, close the highlighting
|
# For multiple values, close the highlighting
|
||||||
if ((count($attribute->getOldValues()) > 5) && in_array($value,$attribute->getRemovedValues()) && count($attribute->getValues()))
|
if ($x)
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
|
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
@ -93,15 +94,16 @@ if (count($request['template']->getLDAPmodify(true))) {
|
|||||||
if (! $attribute->getValueCount() || $attribute->isForceDelete())
|
if (! $attribute->getValueCount() || $attribute->isForceDelete())
|
||||||
printf('<span style="color: red">[%s]</span>',_('attribute deleted'));
|
printf('<span style="color: red">[%s]</span>',_('attribute deleted'));
|
||||||
|
|
||||||
|
$dv = $attribute->getAddedValues();
|
||||||
foreach ($attribute->getValues() as $key => $value) {
|
foreach ($attribute->getValues() as $key => $value) {
|
||||||
# For multiple values, we'll highlight the changed ones
|
# For multiple values, we'll highlight the changed ones
|
||||||
if ((count($attribute->getValues()) > 5) && in_array($value,$attribute->getAddedValues()))
|
if ($x = ((count($attribute->getValues()) > 5) && count($attribute->getOldValues()) && in_array($value,$dv)))
|
||||||
echo '<span style="color:#004400; background:#FFFFA0">';
|
echo '<span style="color:#004400; background:#FFFFA0">';
|
||||||
|
|
||||||
$request['page']->draw('CurrentValue',$attribute,$key);
|
$request['page']->draw('CurrentValue',$attribute,$key);
|
||||||
|
|
||||||
# For multiple values, close the highlighting
|
# For multiple values, close the highlighting
|
||||||
if ((count($attribute->getValues()) > 5) && in_array($value,$attribute->getAddedValues()))
|
if ($x)
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
|
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
@ -838,13 +838,7 @@ class Attribute {
|
|||||||
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
|
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
|
||||||
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
|
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
|
||||||
|
|
||||||
$return = array();
|
return array_diff($this->getOldValues(),$this->getValues());
|
||||||
|
|
||||||
foreach ($this->getOldValues() as $value)
|
|
||||||
if (! in_array($value,$this->getValues()))
|
|
||||||
array_push($return,$value);
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -854,13 +848,7 @@ class Attribute {
|
|||||||
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
|
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
|
||||||
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
|
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
|
||||||
|
|
||||||
$return = array();
|
return array_diff($this->getValues(),$this->getOldValues());
|
||||||
|
|
||||||
foreach ($this->getValues() as $value)
|
|
||||||
if (! in_array($value,$this->getOldValues()))
|
|
||||||
array_push($return,$value);
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user