mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-29 01:09:02 +01:00
Support equal import condition
This commit is contained in:
parent
e7caf2a9f0
commit
c3e673b747
@ -21,7 +21,7 @@ class addressbook_import_contacts_csv extends importexport_basic_import_csv {
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected static $conditions = array( 'exists' );
|
protected static $conditions = array( 'exists', 'equal' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bocontacts
|
* @var bocontacts
|
||||||
@ -186,6 +186,22 @@ class addressbook_import_contacts_csv extends importexport_basic_import_csv {
|
|||||||
$success = ($this->action( $action['action'], $record->get_record_array(), $import_csv->get_current_position() ));
|
$success = ($this->action( $action['action'], $record->get_record_array(), $import_csv->get_current_position() ));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'equal':
|
||||||
|
// Match on field
|
||||||
|
$result = $this->equal($record, $condition, $matches);
|
||||||
|
if($result)
|
||||||
|
{
|
||||||
|
// Apply true action to any matching records found
|
||||||
|
$action = $condition['true'];
|
||||||
|
$success = ($this->action( $action['action'], $record->get_record_array(), $import_csv->get_current_position() ));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Apply false action if no matching records found
|
||||||
|
$action = $condition['false'];
|
||||||
|
$success = ($this->action( $action['action'], $record->get_record_array(), $import_csv->get_current_position() ));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// not supported action
|
// not supported action
|
||||||
default :
|
default :
|
||||||
|
@ -63,6 +63,7 @@ class addressbook_wizard_import_contacts_csv extends importexport_wizard_basic_i
|
|||||||
// Conditions
|
// Conditions
|
||||||
$this->conditions = array(
|
$this->conditions = array(
|
||||||
'exists' => lang('exists'),
|
'exists' => lang('exists'),
|
||||||
|
'equal' => '='
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user