mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
remove due to own table in 17.1 no longer needed migration of (private) custome-fields
This commit is contained in:
parent
a1fa2246af
commit
dcb78d9776
@ -179,9 +179,6 @@ class admin_cmd_change_account_id extends admin_cmd
|
||||
{
|
||||
foreach($GLOBALS['egw_info']['apps'] as $app => $data)
|
||||
{
|
||||
$total += ($changed = Api\Storage\Customfields::change_account_ids($app, $this->change));
|
||||
if ($changed) echo "$app:\t$changed id's in definition of private custom fields changed\n";
|
||||
|
||||
$total += ($changed = Api\Framework\Favorites::change_account_ids($app, $this->change));
|
||||
if ($changed) echo "$app:\t$changed id's in favorites or index-state changed\n";
|
||||
}
|
||||
|
@ -479,42 +479,6 @@ class Customfields implements \IteratorAggregate
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change account_id's of private custom-fields
|
||||
*
|
||||
* @param string $app
|
||||
* @param array $ids2change from-id => to-id pairs
|
||||
* @return integer number of changed ids
|
||||
*/
|
||||
public static function change_account_ids($app, array $ids2change)
|
||||
{
|
||||
$total = 0;
|
||||
if (($cfs = self::get($app, true)))
|
||||
{
|
||||
foreach($cfs as &$data)
|
||||
{
|
||||
if ($data['private'])
|
||||
{
|
||||
$changed = 0;
|
||||
foreach($data['private'] as &$id)
|
||||
{
|
||||
if (isset($ids2change[$id]))
|
||||
{
|
||||
$id = $ids2change[$id];
|
||||
++$changed;
|
||||
}
|
||||
}
|
||||
if ($changed)
|
||||
{
|
||||
self::update($data);
|
||||
$total += $changed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return names of custom fields containing account-ids
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user