egroupware/importexport
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
..
doc massive improvements for the imports 2007-06-07 22:08:38 +00:00
inc Add some base classes to make it easier for other applications to implement importing CSVs 2010-03-10 16:31:25 +00:00
js Some more work toward completion: 2010-02-25 23:13:18 +00:00
lang Recover history from rev 28562 2009-12-02 19:47:02 +00:00
setup Add some base classes to make it easier for other applications to implement importing CSVs 2010-03-10 16:31:25 +00:00
templates/default A slightly prettier image for the side of the wizard 2010-03-03 18:16:46 +00:00
importexport_cli.php changing old PHPGW_API_INC to EGW_API_INC in cli, adding a read function to bodefinitions, Still you cannot view or edit definitions with UI 2009-09-09 08:07:32 +00:00