mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Fix for import / update search for existing record. If new record key (ex ID) was not set, search matched all
This commit is contained in:
parent
8a102f94e8
commit
766391754c
@ -184,18 +184,21 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
|
||||
|
||||
if ( $_definition->plugin_options['conditions'] ) {
|
||||
foreach ( $_definition->plugin_options['conditions'] as $condition ) {
|
||||
$results = array();
|
||||
switch ( $condition['type'] ) {
|
||||
// exists
|
||||
case 'exists' :
|
||||
$results = $this->boinfolog->search(
|
||||
//array( $condition['string'] => $record[$condition['string']],),
|
||||
'',
|
||||
$_definition->plugin_options['update_cats'] == 'add' ? false : true,
|
||||
'', '', '', false, 'AND', false,
|
||||
array( $condition['string'] => $record[$condition['string']],)
|
||||
);
|
||||
if($record[$condition['string']]) {
|
||||
$results = $this->boinfolog->search(
|
||||
//array( $condition['string'] => $record[$condition['string']],),
|
||||
'',
|
||||
$_definition->plugin_options['update_cats'] == 'add' ? false : true,
|
||||
'', '', '', false, 'AND', false,
|
||||
array( $condition['string'] => $record[$condition['string']],)
|
||||
);
|
||||
}
|
||||
|
||||
if ( is_array( $results ) && count( array_keys( $results ) >= 1 ) ) {
|
||||
if ( is_array( $results ) && count( array_keys( $results )) >= 1) {
|
||||
// apply action to all records matching this exists condition
|
||||
$action = $condition['true'];
|
||||
foreach ( (array)$results as $contact ) {
|
||||
|
Loading…
Reference in New Issue
Block a user