egroupware_official/importexport/setup
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
..
default_records.inc.php Using static translation methods 2009-04-28 16:05:04 +00:00
etemplates.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
export_contact.definition the mappings from old export framework can be importet now 2006-11-16 11:05:42 +00:00
setup.inc.php Fixed install problems with missing php dom extension, 2008-10-14 08:42:09 +00:00
tables_current.inc.php changed export ui to be focused on definitions 2006-11-16 11:04:09 +00:00
tables_update.inc.php updated application versions 1.4 and dependencies accordingly (API is still 1.3.xxx 'til the first RC) 2007-04-30 09:10:36 +00:00