diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e61d00796b7c8d02f63e5408033e62231c4315..cb15cfcc89acae3f8471fcee65e69dd4812845b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Version 1.119 (not yet released) +* Added Is Exposed to Field Output Handlers. * Added Fallback Field Output Handler. # Version 1.118 diff --git a/CRM/Dataprocessor/BAO/DataProcessor.php b/CRM/Dataprocessor/BAO/DataProcessor.php index c6978fbafb0b0644d08bc75f358665a0065258db..801a081cac2cf58b051c2e3d645c81cfdb6bbc25 100644 --- a/CRM/Dataprocessor/BAO/DataProcessor.php +++ b/CRM/Dataprocessor/BAO/DataProcessor.php @@ -113,6 +113,7 @@ class CRM_Dataprocessor_BAO_DataProcessor extends CRM_Dataprocessor_DAO_DataProc $outputHandler = $factory->getOutputHandlerByName($field['type']); if ($outputHandler) { $outputHandler->setDataProcessor($dataProcessorClass); + $outputHandler->setIsExposed($field['is_exposed']); try { $outputHandler->initialize($field['name'], $field['title'], $field['configuration']); $dataProcessorClass->addOutputFieldHandlers($outputHandler); diff --git a/CRM/Dataprocessor/DAO/DataProcessor.php b/CRM/Dataprocessor/DAO/DataProcessor.php index d99e3c395f078191512b381ef71d7cfa2fa16e4c..790fa811019cf60d6af65598cbcf1fd050adafe3 100644 --- a/CRM/Dataprocessor/DAO/DataProcessor.php +++ b/CRM/Dataprocessor/DAO/DataProcessor.php @@ -6,7 +6,7 @@ * * Generated from dataprocessor/xml/schema/CRM/Dataprocessor/DataProcessor.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:213cb152fad35d4274a989aae622ed3c) + * (GenCodeChecksum:408f563ffe49f973ca26a24c8e17b40e) */ use CRM_Dataprocessor_ExtensionUtil as E; @@ -149,6 +149,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'title' => E::ts('ID'), 'description' => E::ts('Unique DataProcessor ID'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.id', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -164,6 +170,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.name', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -178,6 +190,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.title', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -192,6 +210,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.type', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -204,6 +228,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.configuration', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -217,6 +247,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => E::ts('Is active'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.is_active', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -229,6 +265,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Description'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.description', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -243,6 +285,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.storage_type', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -255,6 +303,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Storage Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.storage_configuration', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -268,6 +322,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_INT, 'title' => E::ts('Status'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.status', 'default' => '0', 'table_name' => 'civicrm_data_processor', @@ -283,6 +343,12 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor.source_file', 'table_name' => 'civicrm_data_processor', 'entity' => 'DataProcessor', @@ -296,37 +362,6 @@ class CRM_Dataprocessor_DAO_DataProcessor extends CRM_Core_DAO { return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/CRM/Dataprocessor/DAO/DataProcessorField.php b/CRM/Dataprocessor/DAO/DataProcessorField.php index b341c09b39b747a2035897d41660308d709458d6..51e38684995c4b29625a7a0a5620f33fde4fa535 100644 --- a/CRM/Dataprocessor/DAO/DataProcessorField.php +++ b/CRM/Dataprocessor/DAO/DataProcessorField.php @@ -6,7 +6,7 @@ * * Generated from dataprocessor/xml/schema/CRM/Dataprocessor/DataProcessorField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:99136ce889e617531556da8175f04ceb) + * (GenCodeChecksum:9513d8dff12fff19074757207c0dfb73) */ use CRM_Dataprocessor_ExtensionUtil as E; @@ -91,6 +91,13 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { */ public $configuration; + /** + * @var bool|string + * (SQL type: tinyint) + * Note that values will be retrieved from the database as a string. + */ + public $is_exposed; + /** * Class constructor. */ @@ -109,21 +116,6 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { return $plural ? E::ts('Data Processor Fields') : E::ts('Data Processor Field'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'data_processor_id', 'civicrm_data_processor', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * @@ -138,6 +130,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'title' => E::ts('ID'), 'description' => E::ts('Unique DataProcessorField ID'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.id', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -152,6 +150,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'title' => E::ts('Data Processor ID'), 'description' => E::ts('FK to Data Processor'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.data_processor_id', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -165,6 +169,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_INT, 'title' => E::ts('Weight'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.weight', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -179,6 +189,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.name', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -193,6 +209,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.title', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -207,6 +229,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.type', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -219,6 +247,12 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_field.configuration', 'table_name' => 'civicrm_data_processor_field', 'entity' => 'DataProcessorField', @@ -227,43 +261,31 @@ class CRM_Dataprocessor_DAO_DataProcessorField extends CRM_Core_DAO { 'serialize' => self::SERIALIZE_JSON, 'add' => NULL, ], + 'is_exposed' => [ + 'name' => 'is_exposed', + 'type' => CRM_Utils_Type::T_BOOLEAN, + 'title' => E::ts('Is exposed'), + 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], + 'where' => 'civicrm_data_processor_field.is_exposed', + 'default' => '1', + 'table_name' => 'civicrm_data_processor_field', + 'entity' => 'DataProcessorField', + 'bao' => 'CRM_Dataprocessor_DAO_DataProcessorField', + 'localizable' => 0, + 'add' => NULL, + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/CRM/Dataprocessor/DAO/DataProcessorFilter.php b/CRM/Dataprocessor/DAO/DataProcessorFilter.php index 07e68be91f3c4670a83ef380089fc5b93bb1524c..073b422501e4250dc8c77ea2d3987de52e2b313f 100644 --- a/CRM/Dataprocessor/DAO/DataProcessorFilter.php +++ b/CRM/Dataprocessor/DAO/DataProcessorFilter.php @@ -6,7 +6,7 @@ * * Generated from dataprocessor/xml/schema/CRM/Dataprocessor/DataProcessorFilterHandler.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e34ec9fc51c33dab37f96be0e023ee7d) + * (GenCodeChecksum:0bec9ca27a1543c58fa6e52cdd3ff528) */ use CRM_Dataprocessor_ExtensionUtil as E; @@ -137,22 +137,6 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { return $plural ? E::ts('Data Processor Filters') : E::ts('Data Processor Filter'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'data_processor_id', 'civicrm_data_processor', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'collection_id', 'civicrm_data_processor_filter_collection', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * @@ -167,6 +151,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'title' => E::ts('ID'), 'description' => E::ts('Unique DataProcessorFilter ID'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.id', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -181,6 +171,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'title' => E::ts('Data Processor ID'), 'description' => E::ts('FK to Data Processor'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.data_processor_id', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -194,6 +190,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_INT, 'title' => E::ts('Weight'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.weight', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -208,6 +210,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.name', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -222,6 +230,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.title', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -236,6 +250,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.type', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -248,6 +268,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => E::ts('Is required'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.is_required', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -260,6 +286,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => E::ts('Is exposed'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.is_exposed', 'default' => '1', 'table_name' => 'civicrm_data_processor_filter', @@ -273,6 +305,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.configuration', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -286,6 +324,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Default Filter Value'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.filter_value', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -298,6 +342,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { 'name' => 'collection_id', 'type' => CRM_Utils_Type::T_INT, 'title' => E::ts('Filter Collection Id'), + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter.collection_id', 'table_name' => 'civicrm_data_processor_filter', 'entity' => 'DataProcessorFilter', @@ -312,37 +362,6 @@ class CRM_Dataprocessor_DAO_DataProcessorFilter extends CRM_Core_DAO { return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/CRM/Dataprocessor/DAO/DataProcessorFilterCollection.php b/CRM/Dataprocessor/DAO/DataProcessorFilterCollection.php index 4e6d75adcec99d0e2395a6f71e34775b72b42480..72b67d06da7d7bcd8b9721983ec9cda92bcc690b 100644 --- a/CRM/Dataprocessor/DAO/DataProcessorFilterCollection.php +++ b/CRM/Dataprocessor/DAO/DataProcessorFilterCollection.php @@ -6,7 +6,7 @@ * * Generated from dataprocessor/xml/schema/CRM/Dataprocessor/DataProcessorFilterCollection.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cea8a3eba0bd0c539da972a018429649) + * (GenCodeChecksum:3c4c74e46acd9b9dffd549d17293d118) */ use CRM_Dataprocessor_ExtensionUtil as E; @@ -123,21 +123,6 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { return $plural ? E::ts('Data Processor Filter Collections') : E::ts('Data Processor Filter Collection'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'data_processor_id', 'civicrm_data_processor', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * @@ -152,6 +137,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'title' => E::ts('ID'), 'description' => E::ts('Unique DataProcessorFilterCollection ID'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.id', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -166,6 +157,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'title' => E::ts('Data Processor ID'), 'description' => E::ts('FK to Data Processor'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.data_processor_id', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -179,6 +176,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_INT, 'title' => E::ts('Weight'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.weight', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -193,6 +196,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.name', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -207,6 +216,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.title', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -219,6 +234,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Description'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.description', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -233,6 +254,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.condition', 'default' => 'AND', 'table_name' => 'civicrm_data_processor_filter_collection', @@ -248,6 +275,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.link_condition', 'default' => 'AND', 'table_name' => 'civicrm_data_processor_filter_collection', @@ -261,6 +294,12 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => E::ts('Show Collapsed'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_filter_collection.show_collapsed', 'table_name' => 'civicrm_data_processor_filter_collection', 'entity' => 'DataProcessorFilterCollection', @@ -274,37 +313,6 @@ class CRM_Dataprocessor_DAO_DataProcessorFilterCollection extends CRM_Core_DAO { return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/CRM/Dataprocessor/DAO/DataProcessorOutput.php b/CRM/Dataprocessor/DAO/DataProcessorOutput.php index 2ba21ffef9a9287272dc12e9f777bfaacdf5c7ab..89b8a66107ea041354b8d86c782dbe797f22f3d4 100644 --- a/CRM/Dataprocessor/DAO/DataProcessorOutput.php +++ b/CRM/Dataprocessor/DAO/DataProcessorOutput.php @@ -6,7 +6,7 @@ * * Generated from dataprocessor/xml/schema/CRM/Dataprocessor/DataProcessorOutput.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:615b6516fbf3067ca50f94d86b056ed7) + * (GenCodeChecksum:e9f8b631a630c9b50d2eef236d5dc7a0) */ use CRM_Dataprocessor_ExtensionUtil as E; @@ -109,21 +109,6 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { return $plural ? E::ts('Data Processor Outputs') : E::ts('Data Processor Output'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'data_processor_id', 'civicrm_data_processor', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * @@ -138,6 +123,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'title' => E::ts('ID'), 'description' => E::ts('Unique DataProcessorOutput ID'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.id', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -152,6 +143,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'title' => E::ts('Data Processor ID'), 'description' => E::ts('FK to Data Processor'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.data_processor_id', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -167,6 +164,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.type', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -179,6 +182,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.configuration', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -194,6 +203,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.permission', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -208,6 +223,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.api_entity', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -222,6 +243,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.api_action', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -236,6 +263,12 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_output.api_count_action', 'table_name' => 'civicrm_data_processor_output', 'entity' => 'DataProcessorOutput', @@ -249,37 +282,6 @@ class CRM_Dataprocessor_DAO_DataProcessorOutput extends CRM_Core_DAO { return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/CRM/Dataprocessor/DAO/DataProcessorSource.php b/CRM/Dataprocessor/DAO/DataProcessorSource.php index ce78c797179b243f689d5ad4dd6d020a58bf9f92..6212a7fc6a4b42841f7473128670104f2e0db5c3 100644 --- a/CRM/Dataprocessor/DAO/DataProcessorSource.php +++ b/CRM/Dataprocessor/DAO/DataProcessorSource.php @@ -6,7 +6,7 @@ * * Generated from dataprocessor/xml/schema/CRM/Dataprocessor/DataProcessorSource.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:51c15acc3945b46f0af29a03cb5bdd3a) + * (GenCodeChecksum:e91b055f903a8a154900634aa039e331) */ use CRM_Dataprocessor_ExtensionUtil as E; @@ -123,21 +123,6 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { return $plural ? E::ts('Data Processor Sources') : E::ts('Data Processor Source'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'data_processor_id', 'civicrm_data_processor', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * @@ -152,6 +137,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'title' => E::ts('ID'), 'description' => E::ts('Unique DataProcessorSource ID'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.id', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -166,6 +157,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'title' => E::ts('Data Processor ID'), 'description' => E::ts('FK to Data Processor'), 'required' => TRUE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.data_processor_id', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -179,6 +176,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_INT, 'title' => E::ts('Weight'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.weight', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -193,6 +196,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.name', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -207,6 +216,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.title', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -221,6 +236,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'required' => TRUE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.type', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -233,6 +254,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.configuration', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -248,6 +275,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'required' => FALSE, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.join_type', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -260,6 +293,12 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_TEXT, 'title' => E::ts('Join Configuration'), 'required' => FALSE, + 'usage' => [ + 'import' => FALSE, + 'export' => FALSE, + 'duplicate_matching' => FALSE, + 'token' => FALSE, + ], 'where' => 'civicrm_data_processor_source.join_configuration', 'table_name' => 'civicrm_data_processor_source', 'entity' => 'DataProcessorSource', @@ -274,37 +313,6 @@ class CRM_Dataprocessor_DAO_DataProcessorSource extends CRM_Core_DAO { return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/CRM/Dataprocessor/Form/Field.php b/CRM/Dataprocessor/Form/Field.php index a9e539497d7afc1159b390d977c39ee91f26c6de..6f5a6c7b0983d96b5ae4ee5bd4863c51de7016d7 100644 --- a/CRM/Dataprocessor/Form/Field.php +++ b/CRM/Dataprocessor/Form/Field.php @@ -88,6 +88,7 @@ class CRM_Dataprocessor_Form_Field extends CRM_Core_Form { if ($this->_action != CRM_Core_Action::DELETE) { $this->add('text', 'name', E::ts('Name'), array('size' => CRM_Utils_Type::HUGE), FALSE); $this->add('text', 'title', E::ts('Title'), array('size' => CRM_Utils_Type::HUGE), TRUE); + $this->add('checkbox', 'is_exposed', E::ts('Field is exposed to the user')); $this->add('select', 'type', E::ts('Select Field'), $this->outputHandlers, true, array( 'style' => 'min-width:250px', @@ -127,6 +128,11 @@ class CRM_Dataprocessor_Form_Field extends CRM_Core_Form { $defaults['name'] = $this->field['name']; } } + if ($this->_action == CRM_Core_Action::ADD) { + $defaults['is_exposed'] = 1; + } elseif (isset($this->field['is_exposed'])) { + $defaults['is_exposed'] = $this->field['is_exposed']; + } return $defaults; } @@ -156,6 +162,7 @@ class CRM_Dataprocessor_Form_Field extends CRM_Core_Form { $params['title'] = $values['title']; $params['type'] = $values['type']; $params['data_processor_id'] = $this->dataProcessorId; + $params['is_exposed'] = isset($values['is_exposed']) && $values['is_exposed'] ? 1 : 0; if ($this->id) { $params['id'] = $this->id; } @@ -170,4 +177,4 @@ class CRM_Dataprocessor_Form_Field extends CRM_Core_Form { parent::postProcess(); } -} \ No newline at end of file +} diff --git a/CRM/Dataprocessor/Upgrader.php b/CRM/Dataprocessor/Upgrader.php index 6c5d4ba303d455024e365be717255ce4286aaedc..d2f9f8e9aa77ad3f4e6b8fa1d571971fc018536e 100644 --- a/CRM/Dataprocessor/Upgrader.php +++ b/CRM/Dataprocessor/Upgrader.php @@ -72,6 +72,14 @@ class CRM_Dataprocessor_Upgrader extends CRM_Dataprocessor_Upgrader_Base { return TRUE; } + public function upgrade_1004() { + CRM_Core_DAO::executeQuery(" + ALTER TABLE `civicrm_data_processor_field` + ADD COLUMN `is_exposed` tinyint NULL DEFAULT 1; + "); + return TRUE; + } + /** * Look up extension dependency error messages and display as Core Session Status * diff --git a/Civi/DataProcessor/DataFlow/AbstractDataFlow.php b/Civi/DataProcessor/DataFlow/AbstractDataFlow.php index cd5051ea35ef9dfa3b738606456ed3916993c8b8..e58e76b6030e58f59ab8e03b6e463808b600bc90 100644 --- a/Civi/DataProcessor/DataFlow/AbstractDataFlow.php +++ b/Civi/DataProcessor/DataFlow/AbstractDataFlow.php @@ -29,6 +29,11 @@ abstract class AbstractDataFlow { */ protected $outputFieldHandlers; + /** + * @var \Civi\DataProcessor\FieldOutputHandler\AbstractFieldOutputHandler[] + */ + protected $exposedOutputFieldHandlers; + /** * @var false|int */ @@ -181,6 +186,11 @@ abstract class AbstractDataFlow { foreach($this->outputFieldHandlers as $outputFieldHandler) { $formattedRecord = $outputFieldHandler->postFormat($formattedRecord); } + foreach($this->outputFieldHandlers as $outputFieldHandler) { + if (!$outputFieldHandler->isExposed()) { + unset($formattedRecord[$outputFieldHandler->getOutputFieldSpecification()->alias]); + } + } return $formattedRecord; } @@ -239,7 +249,18 @@ abstract class AbstractDataFlow { /** * @return \Civi\DataProcessor\FieldOutputHandler\AbstractFieldOutputHandler[] */ - public function getOutputFieldHandlers() { + public function getOutputFieldHandlers(bool $restrictToExposed = true) { + if ($restrictToExposed) { + if (empty($this->exposedOutputFieldHandlers)) { + $this->exposedOutputFieldHandlers = []; + foreach ($this->outputFieldHandlers as $outputFieldHandler) { + if ($outputFieldHandler->isExposed()) { + $this->exposedOutputFieldHandlers[] = $outputFieldHandler; + } + } + } + return $this->exposedOutputFieldHandlers; + } return $this->outputFieldHandlers; } diff --git a/Civi/DataProcessor/FieldOutputHandler/AbstractFieldOutputHandler.php b/Civi/DataProcessor/FieldOutputHandler/AbstractFieldOutputHandler.php index 4bdc8ba8149fa2ff0ea56d93e641448fc26de39b..89bf61e23ca3eb3f000b27cde7c111b4634e5280 100644 --- a/Civi/DataProcessor/FieldOutputHandler/AbstractFieldOutputHandler.php +++ b/Civi/DataProcessor/FieldOutputHandler/AbstractFieldOutputHandler.php @@ -20,6 +20,11 @@ abstract class AbstractFieldOutputHandler { */ protected $dataProcessor; + /** + * @var bool + */ + protected $isExposed = TRUE; + /** * Returns the data type of this field * @@ -62,6 +67,14 @@ abstract class AbstractFieldOutputHandler { return $this->dataProcessor; } + public function setIsExposed(bool $isExposed) { + $this->isExposed = $isExposed; + } + + public function isExposed(): bool { + return $this->isExposed; + } + /** * Initialize the processor * diff --git a/Civi/DataProcessor/FieldOutputHandler/FallbackFieldOutputHandler.php b/Civi/DataProcessor/FieldOutputHandler/FallbackFieldOutputHandler.php index c756c336b20d988dcf8c36cf6c68159c81a16bd9..170c5fbeed3b165d2e69772b853441fb77074d2d 100644 --- a/Civi/DataProcessor/FieldOutputHandler/FallbackFieldOutputHandler.php +++ b/Civi/DataProcessor/FieldOutputHandler/FallbackFieldOutputHandler.php @@ -170,7 +170,7 @@ class FallbackFieldOutputHandler extends AbstractFieldOutputHandler { $return = []; $dataProcessor = civicrm_api3('DataProcessor', 'getsingle', array('id' => $dataProcessorId)); $dataProcessorClass = \CRM_Dataprocessor_BAO_DataProcessor::dataProcessorToClass($dataProcessor); - $outputFieldHandlers = $dataProcessorClass->getDataFlow()->getOutputFieldHandlers(); + $outputFieldHandlers = $dataProcessorClass->getDataFlow()->getOutputFieldHandlers(FALSE); foreach ($outputFieldHandlers as $outputFieldHandler) { if ($outputFieldHandler->getOutputFieldSpecification()->alias != $this->getOutputFieldSpecification()->alias) { $return[$outputFieldHandler->getOutputFieldSpecification()->alias] = $outputFieldHandler->getOutputFieldSpecification()->title; diff --git a/sql/auto_install.sql b/sql/auto_install.sql index c2df4b12f449ea33fa1adf448b32df80c1a5a819..81513e8ad9c5fdda4666994e63c4cc96af3cdd4a 100644 --- a/sql/auto_install.sql +++ b/sql/auto_install.sql @@ -25,6 +25,7 @@ DROP TABLE IF EXISTS `civicrm_data_processor_field`; DROP TABLE IF EXISTS `civicrm_data_processor`; SET FOREIGN_KEY_CHECKS=1; + -- /******************************************************* -- * -- * Create new tables @@ -48,8 +49,7 @@ CREATE TABLE `civicrm_data_processor` ( `storage_configuration` text NULL, `status` int unsigned NULL DEFAULT 0, `source_file` varchar(255) NULL, - PRIMARY KEY (`id`) -) + PRIMARY KEY (`id`)) ENGINE=InnoDB; -- /******************************************************* @@ -65,9 +65,9 @@ CREATE TABLE `civicrm_data_processor_field` ( `title` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `configuration` text NULL, + `is_exposed` tinyint NULL DEFAULT 1, PRIMARY KEY (`id`), - CONSTRAINT FK_civicrm_data_processor_field_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE -) + CONSTRAINT FK_civicrm_data_processor_field_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE) ENGINE=InnoDB; -- /******************************************************* @@ -86,8 +86,7 @@ CREATE TABLE `civicrm_data_processor_filter_collection` ( `link_condition` varchar(255) NULL DEFAULT 'AND', `show_collapsed` tinyint NOT NULL, PRIMARY KEY (`id`), - CONSTRAINT FK_civicrm_data_processor_filter_collection_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE -) + CONSTRAINT FK_civicrm_data_processor_filter_collection_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE) ENGINE=InnoDB; -- /******************************************************* @@ -109,8 +108,7 @@ CREATE TABLE `civicrm_data_processor_filter` ( `collection_id` int unsigned, PRIMARY KEY (`id`), CONSTRAINT FK_civicrm_data_processor_filter_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE, - CONSTRAINT FK_civicrm_data_processor_filter_collection_id FOREIGN KEY (`collection_id`) REFERENCES `civicrm_data_processor_filter_collection`(`id`) ON DELETE SET NULL -) + CONSTRAINT FK_civicrm_data_processor_filter_collection_id FOREIGN KEY (`collection_id`) REFERENCES `civicrm_data_processor_filter_collection`(`id`) ON DELETE SET NULL) ENGINE=InnoDB; -- /******************************************************* @@ -128,8 +126,7 @@ CREATE TABLE `civicrm_data_processor_output` ( `api_action` varchar(255) NULL, `api_count_action` varchar(255) NULL, PRIMARY KEY (`id`), - CONSTRAINT FK_civicrm_data_processor_output_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE -) + CONSTRAINT FK_civicrm_data_processor_output_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE) ENGINE=InnoDB; -- /******************************************************* @@ -148,6 +145,5 @@ CREATE TABLE `civicrm_data_processor_source` ( `join_type` varchar(255) NULL, `join_configuration` text NULL, PRIMARY KEY (`id`), - CONSTRAINT FK_civicrm_data_processor_source_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE -) + CONSTRAINT FK_civicrm_data_processor_source_data_processor_id FOREIGN KEY (`data_processor_id`) REFERENCES `civicrm_data_processor`(`id`) ON DELETE CASCADE) ENGINE=InnoDB; diff --git a/sql/auto_uninstall.sql b/sql/auto_uninstall.sql index 6137f8e1828550f7285383f2c689bda5c2259630..f32a88bd2269f73e7dc91031b86dc9283196c55c 100644 --- a/sql/auto_uninstall.sql +++ b/sql/auto_uninstall.sql @@ -8,9 +8,11 @@ -- -- Generated from drop.tpl -- DO NOT EDIT. Generated by CRM_Core_CodeGen ----- /******************************************************* +-- +-- /******************************************************* +-- * +-- * Clean up the existing tables -- * --- * Clean up the existing tables-- * -- *******************************************************/ SET FOREIGN_KEY_CHECKS=0; @@ -22,4 +24,4 @@ DROP TABLE IF EXISTS `civicrm_data_processor_filter_collection`; DROP TABLE IF EXISTS `civicrm_data_processor_field`; DROP TABLE IF EXISTS `civicrm_data_processor`; -SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file +SET FOREIGN_KEY_CHECKS=1; diff --git a/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Fields.tpl b/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Fields.tpl index 23025d0092ff6750b513bcff984decd3762aadc5..e97d8d433ce042bf720c6defcb8b350bca6decf6 100644 --- a/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Fields.tpl +++ b/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Fields.tpl @@ -9,7 +9,7 @@ </tr> {foreach from=$fields item=field} <tr> - <td>{$field.title} <br /><span class="description">{$field.name}</span></td> + <td>{if empty($field.is_exposed)}<span class="crm-i fa-eye-slash"> </span>{/if}{$field.title} <br /><span class="description">{$field.name}</span></td> <td style="width: 60px">{if ($field.weight && !is_numeric($field.weight))}{$field.weight}{/if}</td> <td class="right nowrap" style="width: 100px;"> <div class="crm-configure-actions"> diff --git a/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Filters.tpl b/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Filters.tpl index 454e02d6b4ff87c17154f31a8c888f59621c06e9..8e6463c7ef3f26c81e1120fb243804b3452bfb1a 100644 --- a/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Filters.tpl +++ b/templates/CRM/Dataprocessor/Form/DataProcessorBlocks/Filters.tpl @@ -12,6 +12,7 @@ {foreach from=$filters item=filter} <tr> <td> + {if empty($filter.is_exposed)}<span class="crm-i fa-eye-slash"> </span>{/if} {$filter.title} {if ($filter.is_required)} <span class="crm-marker">*</span> diff --git a/templates/CRM/Dataprocessor/Form/Field.tpl b/templates/CRM/Dataprocessor/Form/Field.tpl index 27245ca6d33a024f42c32f31121e9fc2fc073921..6ceac9be98797b2e8efe0d52150e7652beb2d86e 100644 --- a/templates/CRM/Dataprocessor/Form/Field.tpl +++ b/templates/CRM/Dataprocessor/Form/Field.tpl @@ -24,6 +24,11 @@ {include file=$configuration_template} {/if} </div> + <div class="crm-section"> + <div class="label">{$form.is_exposed.label}</div> + <div class="content">{$form.is_exposed.html}</div> + <div class="clear"></div> + </div> <div class="crm-section"> <div class="label">{$form.title.label}</div> <div class="content"> diff --git a/xml/schema/CRM/Dataprocessor/DataProcessorField.xml b/xml/schema/CRM/Dataprocessor/DataProcessorField.xml index c9a2880f6aa36a4f83bbff0b19bb6bc13939c7b3..4957afe2e4c4056b185b547470066fef13d58717 100644 --- a/xml/schema/CRM/Dataprocessor/DataProcessorField.xml +++ b/xml/schema/CRM/Dataprocessor/DataProcessorField.xml @@ -60,6 +60,13 @@ <length>255</length> <serialize>JSON</serialize> </field> + <field> + <name>is_exposed</name> + <title>Is exposed</title> + <type>boolean</type> + <required>false</required> + <default>1</default> + </field> <foreignKey> <name>data_processor_id</name> <table>civicrm_data_processor</table>