X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FImport%2FDataSource%2FCSV.php;h=bf4e102ef90b890cabcba684412b822264db3bef;hb=e0ef6999bd13664d0f36fe9adb861b133494144d;hp=d6d8ccc003f8620044f7e335a1543bef7226c189;hpb=7dee6a13d167a1dd2b4bf1075252bcb7e324c7e5;p=civicrm-core.git diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index d6d8ccc003..bf4e102ef9 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -36,12 +36,35 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { CONST NUM_ROWS_TO_INSERT = 100; + /** + * Provides information about the data source + * + * @return array collection of info about this data source + * + * @access public + * + */ function getInfo() { return array('title' => ts('Comma-Separated Values (CSV)')); } + /** + * Function to set variables up before form is built + * + * @access public + */ function preProcess(&$form) {} + /** + * This is function is called by the form object to get the DataSource's + * form snippet. It should add all fields necesarry to get the data + * uploaded to the temporary table in the DB. + * + * @param $form + * + * @return void (operates directly on form argument) + * @access public + */ function buildQuickForm(&$form) { $form->add('hidden', 'hidden_dataSource', 'CRM_Import_DataSource_CSV'); @@ -61,6 +84,11 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { $form->addElement('checkbox', 'skipColumnHeader', ts('First row contains column headers')); } + /** + * Function to process the form + * + * @access public + */ function postProcess(&$params, &$db, &$form) { $file = $params['uploadFile']['name']; @@ -219,6 +247,11 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { } } +/** + * @param $string + * + * @return string + */ function civicrm_mysql_real_escape_string($string) { static $dao = NULL; if (!$dao) {