From f532671f395863b78e4d6942454f883edbd33ac7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 9 Jun 2013 09:42:32 -0700 Subject: [PATCH] Create parent for Import/Form/Preview CRM-11254 ---------------------------------------- * CRM-11254: Create parent class for import http://issues.civicrm.org/jira/browse/CRM-11254 --- CRM/Activity/Import/Form/Preview.php | 39 +------------ CRM/Contact/Import/Form/Preview.php | 12 +--- CRM/Contribute/Import/Form/Preview.php | 39 +------------ CRM/Event/Import/Form/Preview.php | 39 +------------ CRM/Import/Form/Preview.php | 79 ++++++++++++++++++++++++++ CRM/Member/Import/Form/Preview.php | 39 +------------ 6 files changed, 84 insertions(+), 163 deletions(-) create mode 100644 CRM/Import/Form/Preview.php diff --git a/CRM/Activity/Import/Form/Preview.php b/CRM/Activity/Import/Form/Preview.php index 3db91cce24..27828a77a6 100644 --- a/CRM/Activity/Import/Form/Preview.php +++ b/CRM/Activity/Import/Form/Preview.php @@ -37,7 +37,7 @@ * This class previews the uploaded file and returns summary * statistics */ -class CRM_Activity_Import_Form_Preview extends CRM_Core_Form { +class CRM_Activity_Import_Form_Preview extends CRM_Import_Form_Preview { /** * Function to set variables up before form is built @@ -103,43 +103,6 @@ class CRM_Activity_Import_Form_Preview extends CRM_Core_Form { } } - /** - * Function to actually build the form - * - * @return None - * @access public - */ - public function buildQuickForm() { - - $this->addButtons(array( - array( - 'type' => 'back', - 'name' => ts('<< Previous'), - ), - array( - 'type' => 'next', - 'name' => ts('Import Now >>'), - 'spacing' => '          ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - } - - /** - * Return a descriptive name for the page, used in wizard header - * - * @return string - * @access public - */ - public function getTitle() { - return ts('Preview'); - } - /** * Process the mapped fields and map it into the uploaded file * preview the file and extract some summary statistics diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index 0aa8c109ff..f483caf6d4 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -37,7 +37,7 @@ * This class previews the uploaded file and returns summary * statistics */ -class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { +class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { /** * Function to set variables up before form is built @@ -234,16 +234,6 @@ class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { return empty($errors) ? TRUE : $errors; } - /** - * Return a descriptive name for the page, used in wizard header - * - * @return string - * @access public - */ - public function getTitle() { - return ts('Preview'); - } - /** * Process the mapped fields and map it into the uploaded file * preview the file and extract some summary statistics diff --git a/CRM/Contribute/Import/Form/Preview.php b/CRM/Contribute/Import/Form/Preview.php index 7c6dc2c86b..439815f51d 100644 --- a/CRM/Contribute/Import/Form/Preview.php +++ b/CRM/Contribute/Import/Form/Preview.php @@ -37,7 +37,7 @@ * This class previews the uploaded file and returns summary * statistics */ -class CRM_Contribute_Import_Form_Preview extends CRM_Core_Form { +class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview { /** * Function to set variables up before form is built @@ -104,43 +104,6 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Core_Form { } } - /** - * Function to actually build the form - * - * @return None - * @access public - */ - public function buildQuickForm() { - - $this->addButtons(array( - array( - 'type' => 'back', - 'name' => ts('<< Previous'), - ), - array( - 'type' => 'next', - 'name' => ts('Import Now >>'), - 'spacing' => '          ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - } - - /** - * Return a descriptive name for the page, used in wizard header - * - * @return string - * @access public - */ - public function getTitle() { - return ts('Preview'); - } - /** * Process the mapped fields and map it into the uploaded file * preview the file and extract some summary statistics diff --git a/CRM/Event/Import/Form/Preview.php b/CRM/Event/Import/Form/Preview.php index 29be2c8d8c..0d3d338373 100644 --- a/CRM/Event/Import/Form/Preview.php +++ b/CRM/Event/Import/Form/Preview.php @@ -37,7 +37,7 @@ * This class previews the uploaded file and returns summary * statistics */ -class CRM_Event_Import_Form_Preview extends CRM_Core_Form { +class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview { /** * Function to set variables up before form is built @@ -103,43 +103,6 @@ class CRM_Event_Import_Form_Preview extends CRM_Core_Form { } } - /** - * Function to actually build the form - * - * @return None - * @access public - */ - public function buildQuickForm() { - - $this->addButtons(array( - array( - 'type' => 'back', - 'name' => ts('<< Previous'), - ), - array( - 'type' => 'next', - 'name' => ts('Import Now >>'), - 'spacing' => '          ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - } - - /** - * Return a descriptive name for the page, used in wizard header - * - * @return string - * @access public - */ - public function getTitle() { - return ts('Preview'); - } - /** * Process the mapped fields and map it into the uploaded file * preview the file and extract some summary statistics diff --git a/CRM/Import/Form/Preview.php b/CRM/Import/Form/Preview.php new file mode 100644 index 0000000000..22709246d9 --- /dev/null +++ b/CRM/Import/Form/Preview.php @@ -0,0 +1,79 @@ +addButtons(array( + array( + 'type' => 'back', + 'name' => ts('<< Previous'), + ), + array( + 'type' => 'next', + 'name' => ts('Import Now >>'), + 'spacing' => '          ', + 'isDefault' => TRUE, + ), + array( + 'type' => 'cancel', + 'name' => ts('Cancel'), + ), + ) + ); + } + +} diff --git a/CRM/Member/Import/Form/Preview.php b/CRM/Member/Import/Form/Preview.php index 9c1636f375..9eb51de4c8 100644 --- a/CRM/Member/Import/Form/Preview.php +++ b/CRM/Member/Import/Form/Preview.php @@ -37,7 +37,7 @@ * This class previews the uploaded file and returns summary * statistics */ -class CRM_Member_Import_Form_Preview extends CRM_Core_Form { +class CRM_Member_Import_Form_Preview extends CRM_Import_Form_Preview { /** * Function to set variables up before form is built @@ -103,43 +103,6 @@ class CRM_Member_Import_Form_Preview extends CRM_Core_Form { } } - /** - * Function to actually build the form - * - * @return None - * @access public - */ - public function buildQuickForm() { - - $this->addButtons(array( - array( - 'type' => 'back', - 'name' => ts('<< Previous'), - ), - array( - 'type' => 'next', - 'name' => ts('Import Now >>'), - 'spacing' => '          ', - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - } - - /** - * Return a descriptive name for the page, used in wizard header - * - * @return string - * @access public - */ - public function getTitle() { - return ts('Preview'); - } - /** * Process the mapped fields and map it into the uploaded file * preview the file and extract some summary statistics -- 2.25.1