mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-02 20:19:27 +01:00
Better fix to handle non-exact search matching
This commit is contained in:
parent
0482bfb898
commit
7c50df4d57
@ -134,6 +134,11 @@ class admin_import_groups_csv implements importexport_iface_import_plugin {
|
||||
'query_type' => $condition['string']
|
||||
));
|
||||
}
|
||||
// Search looks in the given field, but doesn't do an exact match
|
||||
foreach ( (array)$accounts as $key => $account )
|
||||
{
|
||||
if($account[$condition['string']] != $record[$condition['string']]) unset($accounts[$key]);
|
||||
}
|
||||
if ( is_array( $accounts ) && count( $accounts ) >= 1 ) {
|
||||
$account = current($accounts);
|
||||
// apply action to all contacts matching this exists condition
|
||||
|
@ -152,18 +152,16 @@ class admin_import_users_csv implements importexport_iface_import_plugin {
|
||||
'query_type' => $condition['string']
|
||||
));
|
||||
}
|
||||
// Search looks in the given field, but doesn't do an exact match
|
||||
foreach ( (array)$accounts as $key => $account )
|
||||
{
|
||||
if($account[$condition['string']] != $record[$condition['string']]) unset($accounts[$key]);
|
||||
}
|
||||
if ( is_array( $accounts ) && count( $accounts ) >= 1 ) {
|
||||
// apply action to all contacts matching this exists condition
|
||||
$action = $condition['true'];
|
||||
foreach ( (array)$accounts as $account ) {
|
||||
if($account[$condition['string']] == $record[$condition['string']]) {
|
||||
$record['account_id'] = $account['account_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// It didn't match after all
|
||||
$action = $condition['false'];
|
||||
}
|
||||
$success = $this->action( $action['action'], $record, $import_csv->get_current_position() );
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user