From 31aaf0961e0315005982752e423fa09cc3e1c36e Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 1 Jun 2018 16:34:28 +0100 Subject: [PATCH] Make all form task inherit from Core_Form_Task otherwise export can fail when accessed from advanced search because properties are inaccessible --- CRM/Activity/Form/Task.php | 33 +++------------------------------ CRM/Campaign/Form/Task.php | 30 +----------------------------- CRM/Contact/Form/Task.php | 2 +- CRM/Contribute/Form/Task.php | 33 +++------------------------------ CRM/Event/Form/Task.php | 27 +++------------------------ CRM/Export/Form/Select.php | 16 +--------------- CRM/Grant/Form/Task.php | 27 +++------------------------ CRM/Mailing/Form/Task.php | 26 +++----------------------- CRM/Member/Form/Task.php | 34 +++------------------------------- CRM/Pledge/Form/Task.php | 26 +++----------------------- 10 files changed, 24 insertions(+), 230 deletions(-) diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index 254579876b01..3ec9429bee13 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -32,37 +32,10 @@ */ /** - * Class for activity task actions. + * Class for activity form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Activity_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; - - /** - * The array that holds all the contact ids. - * - * @var array - */ - public $_contactIds; +class CRM_Activity_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the member ids. diff --git a/CRM/Campaign/Form/Task.php b/CRM/Campaign/Form/Task.php index 5d7bbd6a9bd9..a7e464ad83a7 100644 --- a/CRM/Campaign/Form/Task.php +++ b/CRM/Campaign/Form/Task.php @@ -34,35 +34,7 @@ /** * This class generates form components for relationship. */ -class CRM_Campaign_Form_Task extends CRM_Core_Form { - - /** - * The additional clause that we restrict the search. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The task being performed - * - * @var int - */ - protected $_task; - - /** - * The array that holds all the contact ids - * - * @var array - */ - public $_contactIds; - - /** - * The array that holds all the component ids - * - * @var array - */ - protected $_componentIds; +class CRM_Campaign_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the voter ids diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 5136641e3b70..d445b761c744 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -34,7 +34,7 @@ /** * This class generates form components for search-result tasks. */ -class CRM_Contact_Form_Task extends CRM_Core_Form { +class CRM_Contact_Form_Task extends CRM_Core_Form_Task { /** * The task being performed diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index b84be9865a9e..70cf6325cef0 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -32,30 +32,10 @@ */ /** - * This class generates form components for relationship. + * Class for contribute form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Contribute_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; +class CRM_Contribute_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the contribution ids. @@ -64,13 +44,6 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { */ protected $_contributionIds; - /** - * The array that holds all the contact ids. - * - * @var array - */ - public $_contactIds; - /** * The array that holds all the mapping contribution and contact ids. * diff --git a/CRM/Event/Form/Task.php b/CRM/Event/Form/Task.php index 263a644cba8c..00331ddb28d7 100644 --- a/CRM/Event/Form/Task.php +++ b/CRM/Event/Form/Task.php @@ -34,31 +34,10 @@ */ /** - * This class generates task actions for CiviEvent - * + * Class for event form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Event_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; +class CRM_Event_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the participant ids. diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 3e36b238ca93..64998a52c708 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -36,7 +36,7 @@ /** * This class gets the name of the file to upload */ -class CRM_Export_Form_Select extends CRM_Core_Form { +class CRM_Export_Form_Select extends CRM_Core_Form_Task { /** * Various Contact types. @@ -70,20 +70,6 @@ class CRM_Export_Form_Select extends CRM_Core_Form { public $_componentTable; - /** - * Must be set to entity table name (eg. civicrm_participant) by child class - * - * @var string - */ - static $tableName = NULL; - - /** - * Must be set to entity shortname (eg. event) - * - * @var string - */ - static $entityShortname = NULL; - /** * Build all the data structures needed to build the form. * diff --git a/CRM/Grant/Form/Task.php b/CRM/Grant/Form/Task.php index 51f505428ee2..fc1e831f98b3 100644 --- a/CRM/Grant/Form/Task.php +++ b/CRM/Grant/Form/Task.php @@ -34,31 +34,10 @@ */ /** - * This class generates task actions for CiviEvent - * + * Class for grant form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Grant_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; +class CRM_Grant_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the grant ids. diff --git a/CRM/Mailing/Form/Task.php b/CRM/Mailing/Form/Task.php index 68ff661c5656..c241e191dc6f 100644 --- a/CRM/Mailing/Form/Task.php +++ b/CRM/Mailing/Form/Task.php @@ -32,30 +32,10 @@ */ /** - * This class generates form components for relationship + * Class for mailing form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Mailing_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; +class CRM_Mailing_Form_Task extends CRM_Core_Form_Task { /** * Build all the data structures needed to build the form. diff --git a/CRM/Member/Form/Task.php b/CRM/Member/Form/Task.php index 009b67f201f7..a093365a0e2e 100644 --- a/CRM/Member/Form/Task.php +++ b/CRM/Member/Form/Task.php @@ -34,38 +34,10 @@ */ /** - * Class for civimember task actions - * + * Class for member form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Member_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; - - /** - * The array that holds all the contact ids. - * - * @var array - */ - public $_contactIds; +class CRM_Member_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the member ids. diff --git a/CRM/Pledge/Form/Task.php b/CRM/Pledge/Form/Task.php index 092fece3a3e0..dd5946e5c7a1 100644 --- a/CRM/Pledge/Form/Task.php +++ b/CRM/Pledge/Form/Task.php @@ -32,30 +32,10 @@ */ /** - * This class generates task actions for CiviEvent. + * Class for pledge form task actions. + * FIXME: This needs refactoring to properly inherit from CRM_Core_Form_Task and share more functions. */ -class CRM_Pledge_Form_Task extends CRM_Core_Form { - - /** - * The task being performed. - * - * @var int - */ - protected $_task; - - /** - * The additional clause that we restrict the search with. - * - * @var string - */ - protected $_componentClause = NULL; - - /** - * The array that holds all the component ids. - * - * @var array - */ - protected $_componentIds; +class CRM_Pledge_Form_Task extends CRM_Core_Form_Task { /** * The array that holds all the pledge ids.