Admin: Fix user & group import threw error "Class "admin_egw_record" not found"

This commit is contained in:
nathan 2024-05-02 10:43:09 -06:00
parent 8e42d4d274
commit e4601ce65a
2 changed files with 7 additions and 3 deletions

View File

@ -31,6 +31,8 @@ class admin_import_groups_csv extends importexport_basic_import_csv
*/ */
protected static $conditions = array( 'exists' ); protected static $conditions = array( 'exists' );
protected static $record_class = "admin_egw_group_record";
protected function import_record(importexport_iface_egw_record &$record, &$import_csv) protected function import_record(importexport_iface_egw_record &$record, &$import_csv)
{ {

View File

@ -29,6 +29,8 @@ class admin_import_users_csv extends importexport_basic_import_csv
*/ */
protected static $conditions = array( 'exists' ); protected static $conditions = array( 'exists' );
protected static $record_class = "admin_egw_user_record";
/** /**
* imports entries according to given definition object. * imports entries according to given definition object.
* @param resource $_stream * @param resource $_stream
@ -47,14 +49,14 @@ class admin_import_users_csv extends importexport_basic_import_csv
{ {
$success = false; $success = false;
// don't import empty records // don't import empty records
if(count(array_unique($record)) < 2) if(count(array_unique($record->get_record_array())) < 2)
{ {
return $success; return $success;
} }
if(strtolower($record['account_expires']) == 'never') if(strtolower($record->account_expires) == 'never')
{ {
$record['account_expires'] = -1; $record->account_expires = -1;
} }
if($this->definition->plugin_options['conditions']) if($this->definition->plugin_options['conditions'])