forked from extern/egroupware
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
766391754c
commit
31fd9eddc6
@ -144,15 +144,18 @@ class resources_import_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->bo->so->search(
|
||||
array( $condition['string'] => $record[$condition['string']]),
|
||||
False
|
||||
);
|
||||
if($record[$condition['string']]) {
|
||||
$results = $this->bo->so->search(
|
||||
array( $condition['string'] => $record[$condition['string']]),
|
||||
False
|
||||
);
|
||||
}
|
||||
|
||||
if ( is_array( $results ) && count( array_keys( $results ) >= 1 ) ) {
|
||||
if ( is_array( $results ) && count( array_keys( $results )) >= 1) {
|
||||
// apply action to all contacts matching this exists condition
|
||||
$action = $condition['true'];
|
||||
foreach ( (array)$results as $resource ) {
|
||||
|
Loading…
Reference in New Issue
Block a user