egroupware_official/importexport/inc
Nathan Gray 54b4454d51 Add some base classes to make it easier for other applications to implement importing CSVs
To use them, you need to create two files in the app/importexport directory, 'class.import_appname_csv.inc.php' and 'class.wizzard_import_appname_csv.inc.php'.
The minimum required files are shown below, but they can be modified as needed to override the basics and add capabilities.


class.import_appname_csv.inc.php:
<?php

        require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.basic_import_csv.inc.php');

        class import_appname_csv extends basic_import_csv {

                protected function import_record(&$record, &$import_csv) {
			// Handle one record here.  Handle conditions and call action() as appropriate.
			// See basic_import_csv.
                }

                protected function action($action, Array $record, $record_num = 0) {
			// Take the given action (none, insert, delete, update) etc.  as understood for your app.
			// See basic_import_csv.
                }
        }
?>

class.wizzard_import_appname_csv.inc.php:
<?php

        require_once(EGW_INCLUDE_ROOT . '/appname/importexport/class.import_appname_csv.inc.php');
        require_once(EGW_INCLUDE_ROOT . '/importexport/inc/class.wizzard_basic_import_csv.inc.php');

        class wizzard_import_appname_csv extends wizzard_basic_import_csv {
		public function __construct() {
			$this->mapping_fields = array(
				// List of destination fields available in appname
				'field' => lang('name')
			);
			$this->conditions = array(
				// List of conditions supported by import_appname_csv
				'field' => lang('name')
			);
			$this->actions = array(
				// List of actions supported by import_appname_csv
				'field' => lang('name')
			);
		}
        }
?>
2010-03-10 16:31:25 +00:00
..
.class.bodefinitions.inc.php.swp initial import of my importexport work, 2006-11-10 15:30:01 +00:00
class.arrayxml.inc.php - reworked conversions backend in importexport_helper_functions 2007-06-09 15:36:30 +00:00
class.basic_import_csv.inc.php Add some base classes to make it easier for other applications to implement importing CSVs 2010-03-10 16:31:25 +00:00
class.bodefinitions.inc.php Some more work toward completion: 2010-02-25 23:13:18 +00:00
class.definition.inc.php php5.2 fixes 2007-08-30 15:46:31 +00:00
class.export_csv.inc.php php5.2 fixes 2007-08-30 15:46:31 +00:00
class.iface_egw_record.inc.php php5.2+ requires the interfaces also to declare the default params (or not to use them in implementations) 2007-04-15 11:40:12 +00:00
class.iface_export_plugin.inc.php - reworked conversions backend in importexport_helper_functions 2007-06-09 15:36:30 +00:00
class.iface_export_record.inc.php - reworked conversions backend in importexport_helper_functions 2007-06-09 15:36:30 +00:00
class.iface_import_plugin.inc.php Add support for reporting how many of which action (insert, update) were done when importing 2010-03-03 16:28:45 +00:00
class.iface_import_record.inc.php - reworked conversions backend in importexport_helper_functions 2007-06-09 15:36:30 +00:00
class.import_csv.inc.php php5.2 fixes 2007-08-30 15:46:31 +00:00
class.import_export_helper_functions.inc.php Some more work toward completion: 2010-02-25 23:13:18 +00:00
class.importexport_admin_prefs_sidebox_hooks.inc.php Change import wizard popup size, shuffle around sidebox menu to have links to import & export dialogs 2010-03-03 19:34:05 +00:00
class.importexport_import_ui.inc.php Add support for reporting how many of which action (insert, update) were done when importing 2010-03-03 16:28:45 +00:00
class.importexport_schedule_ui.inc.php Add support for reporting how many of which action (insert, update) were done when importing 2010-03-03 16:28:45 +00:00
class.uidefinitions.inc.php Improve popup size 2010-03-01 23:26:38 +00:00
class.uiexport.inc.php Some more work toward completion: 2010-02-25 23:13:18 +00:00
class.wizzard_basic_import_csv.inc.php Add some base classes to make it easier for other applications to implement importing CSVs 2010-03-10 16:31:25 +00:00