mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 02:18:28 +02: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
31fd9eddc6
commit
0d9f55b59e
@ -219,12 +219,15 @@ class timesheet_import_csv implements importexport_iface_import_plugin {
|
|||||||
|
|
||||||
if ( $_definition->plugin_options['conditions'] ) {
|
if ( $_definition->plugin_options['conditions'] ) {
|
||||||
foreach ( $_definition->plugin_options['conditions'] as $condition ) {
|
foreach ( $_definition->plugin_options['conditions'] as $condition ) {
|
||||||
|
$results = array();
|
||||||
switch ( $condition['type'] ) {
|
switch ( $condition['type'] ) {
|
||||||
// exists
|
// exists
|
||||||
case 'exists' :
|
case 'exists' :
|
||||||
$results = $this->bo->search(array($condition['string'] => $record[$condition['string']]));
|
if($record[$condition['string']]) {
|
||||||
|
$results = $this->bo->search(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
|
// apply action to all records matching this exists condition
|
||||||
$action = $condition['true'];
|
$action = $condition['true'];
|
||||||
foreach ( (array)$results as $result ) {
|
foreach ( (array)$results as $result ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user