First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
557
sites/all/modules/civicrm/CRM/Campaign/DAO/Campaign.php
Normal file
557
sites/all/modules/civicrm/CRM/Campaign/DAO/Campaign.php
Normal file
|
@ -0,0 +1,557 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Campaign/Campaign.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:02b05b18f25c40f15b6992e2f853f5da)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Campaign_DAO_Campaign constructor.
|
||||
*/
|
||||
class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_campaign';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* Unique Campaign ID.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Name of the Campaign.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* Title of the Campaign.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* Full description of Campaign.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* Date and time that Campaign starts.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $start_date;
|
||||
/**
|
||||
* Date and time that Campaign ends.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $end_date;
|
||||
/**
|
||||
* Campaign Type ID.Implicit FK to civicrm_option_value where option_group = campaign_type
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $campaign_type_id;
|
||||
/**
|
||||
* Campaign status ID.Implicit FK to civicrm_option_value where option_group = campaign_status
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $status_id;
|
||||
/**
|
||||
* Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $external_identifier;
|
||||
/**
|
||||
* Optional parent id for this Campaign.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $parent_id;
|
||||
/**
|
||||
* Is this Campaign enabled or disabled/cancelled?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* FK to civicrm_contact, who created this Campaign.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $created_id;
|
||||
/**
|
||||
* Date and time that Campaign was created.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $created_date;
|
||||
/**
|
||||
* FK to civicrm_contact, who recently edited this Campaign.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $last_modified_id;
|
||||
/**
|
||||
* Date and time that Campaign was edited last time.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $last_modified_date;
|
||||
/**
|
||||
* General goals for Campaign.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $goal_general;
|
||||
/**
|
||||
* The target revenue for this campaign.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $goal_revenue;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_campaign';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
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() , 'parent_id', 'civicrm_campaign', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'last_modified_id', 'civicrm_contact', '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
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign ID') ,
|
||||
'description' => 'Unique Campaign ID.',
|
||||
'required' => true,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'name' => array(
|
||||
'name' => 'name',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Campaign Name') ,
|
||||
'description' => 'Name of the Campaign.',
|
||||
'required' => true,
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.name',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'title' => array(
|
||||
'name' => 'title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Campaign Title') ,
|
||||
'description' => 'Title of the Campaign.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.title',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Campaign Description') ,
|
||||
'description' => 'Full description of Campaign.',
|
||||
'rows' => 8,
|
||||
'cols' => 60,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'start_date' => array(
|
||||
'name' => 'start_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Campaign Start Date') ,
|
||||
'description' => 'Date and time that Campaign starts.',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.start_date',
|
||||
'headerPattern' => '/^start|(s(tart\s)?date)$/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'end_date' => array(
|
||||
'name' => 'end_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Campaign End Date') ,
|
||||
'description' => 'Date and time that Campaign ends.',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.end_date',
|
||||
'headerPattern' => '/^end|(e(nd\s)?date)$/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'campaign_type_id' => array(
|
||||
'name' => 'campaign_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign Type') ,
|
||||
'description' => 'Campaign Type ID.Implicit FK to civicrm_option_value where option_group = campaign_type',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.campaign_type_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'campaign_type',
|
||||
'optionEditPath' => 'civicrm/admin/options/campaign_type',
|
||||
)
|
||||
) ,
|
||||
'status_id' => array(
|
||||
'name' => 'status_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign Status') ,
|
||||
'description' => 'Campaign status ID.Implicit FK to civicrm_option_value where option_group = campaign_status',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.status_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'campaign_status',
|
||||
'optionEditPath' => 'civicrm/admin/options/campaign_status',
|
||||
)
|
||||
) ,
|
||||
'external_identifier' => array(
|
||||
'name' => 'external_identifier',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Campaign External ID') ,
|
||||
'description' => 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.',
|
||||
'maxlength' => 32,
|
||||
'size' => CRM_Utils_Type::MEDIUM,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.external_identifier',
|
||||
'headerPattern' => '/external\s?id/i',
|
||||
'dataPattern' => '/^\d{11,}$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'parent_id' => array(
|
||||
'name' => 'parent_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Parent Campaign') ,
|
||||
'description' => 'Optional parent id for this Campaign.',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_campaign.parent_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
|
||||
'html' => array(
|
||||
'type' => 'EntityRef',
|
||||
) ,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Campaign Active?') ,
|
||||
'description' => 'Is this Campaign enabled or disabled/cancelled?',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'created_id' => array(
|
||||
'name' => 'created_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign Created By') ,
|
||||
'description' => 'FK to civicrm_contact, who created this Campaign.',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'created_date' => array(
|
||||
'name' => 'created_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Campaign Created Date') ,
|
||||
'description' => 'Date and time that Campaign was created.',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'last_modified_id' => array(
|
||||
'name' => 'last_modified_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign Modified By') ,
|
||||
'description' => 'FK to civicrm_contact, who recently edited this Campaign.',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'last_modified_date' => array(
|
||||
'name' => 'last_modified_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Campaign Modified Date') ,
|
||||
'description' => 'Date and time that Campaign was edited last time.',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'goal_general' => array(
|
||||
'name' => 'goal_general',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Campaign Goals') ,
|
||||
'description' => 'General goals for Campaign.',
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'RichTextEditor',
|
||||
) ,
|
||||
) ,
|
||||
'goal_revenue' => array(
|
||||
'name' => 'goal_revenue',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Goal Revenue') ,
|
||||
'description' => 'The target revenue for this campaign.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_campaign',
|
||||
'entity' => 'Campaign',
|
||||
'bao' => 'CRM_Campaign_BAO_Campaign',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
);
|
||||
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).
|
||||
*/
|
||||
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
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'campaign', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'campaign', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_campaign_type_id' => array(
|
||||
'name' => 'UI_campaign_type_id',
|
||||
'field' => array(
|
||||
0 => 'campaign_type_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_campaign::0::campaign_type_id',
|
||||
) ,
|
||||
'UI_campaign_status_id' => array(
|
||||
'name' => 'UI_campaign_status_id',
|
||||
'field' => array(
|
||||
0 => 'status_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_campaign::0::status_id',
|
||||
) ,
|
||||
'UI_external_identifier' => array(
|
||||
'name' => 'UI_external_identifier',
|
||||
'field' => array(
|
||||
0 => 'external_identifier',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_campaign::1::external_identifier',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
246
sites/all/modules/civicrm/CRM/Campaign/DAO/CampaignGroup.php
Normal file
246
sites/all/modules/civicrm/CRM/Campaign/DAO/CampaignGroup.php
Normal file
|
@ -0,0 +1,246 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:16989135f9745e57028278a41cc303ea)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Campaign_DAO_CampaignGroup constructor.
|
||||
*/
|
||||
class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_campaign_group';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* Campaign Group id.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Foreign key to the activity Campaign.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $campaign_id;
|
||||
/**
|
||||
* Type of Group.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $group_type;
|
||||
/**
|
||||
* Name of table where item being referenced is stored.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $entity_table;
|
||||
/**
|
||||
* Entity id of referenced table.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $entity_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_campaign_group';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
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() , 'campaign_id', 'civicrm_campaign', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
|
||||
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
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign Group ID') ,
|
||||
'description' => 'Campaign Group id.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_campaign_group',
|
||||
'entity' => 'CampaignGroup',
|
||||
'bao' => 'CRM_Campaign_DAO_CampaignGroup',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'campaign_id' => array(
|
||||
'name' => 'campaign_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign') ,
|
||||
'description' => 'Foreign key to the activity Campaign.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_campaign_group',
|
||||
'entity' => 'CampaignGroup',
|
||||
'bao' => 'CRM_Campaign_DAO_CampaignGroup',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_campaign',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'group_type' => array(
|
||||
'name' => 'group_type',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Campaign Group Type') ,
|
||||
'description' => 'Type of Group.',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_campaign_group',
|
||||
'entity' => 'CampaignGroup',
|
||||
'bao' => 'CRM_Campaign_DAO_CampaignGroup',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
|
||||
)
|
||||
) ,
|
||||
'entity_table' => array(
|
||||
'name' => 'entity_table',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Entity Table') ,
|
||||
'description' => 'Name of table where item being referenced is stored.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_campaign_group',
|
||||
'entity' => 'CampaignGroup',
|
||||
'bao' => 'CRM_Campaign_DAO_CampaignGroup',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'entity_id' => array(
|
||||
'name' => 'entity_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Entity ID') ,
|
||||
'description' => 'Entity id of referenced table.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_campaign_group',
|
||||
'entity' => 'CampaignGroup',
|
||||
'bao' => 'CRM_Campaign_DAO_CampaignGroup',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
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).
|
||||
*/
|
||||
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
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'campaign_group', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'campaign_group', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
529
sites/all/modules/civicrm/CRM/Campaign/DAO/Survey.php
Normal file
529
sites/all/modules/civicrm/CRM/Campaign/DAO/Survey.php
Normal file
|
@ -0,0 +1,529 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Campaign/Survey.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:55aa9d31d08f8b5353d42dde1278b7f2)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Campaign_DAO_Survey constructor.
|
||||
*/
|
||||
class CRM_Campaign_DAO_Survey extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_survey';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* Survey id.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Title of the Survey.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* Foreign key to the Campaign.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $campaign_id;
|
||||
/**
|
||||
* Implicit FK to civicrm_option_value where option_group = activity_type
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $activity_type_id;
|
||||
/**
|
||||
* Recontact intervals for each status.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $recontact_interval;
|
||||
/**
|
||||
* Script instructions for volunteers to use for the survey.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $instructions;
|
||||
/**
|
||||
* Number of days for recurrence of release.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $release_frequency;
|
||||
/**
|
||||
* Maximum number of contacts to allow for survey.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $max_number_of_contacts;
|
||||
/**
|
||||
* Default number of contacts to allow for survey.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $default_number_of_contacts;
|
||||
/**
|
||||
* Is this survey enabled or disabled/cancelled?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Is this default survey?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_default;
|
||||
/**
|
||||
* FK to civicrm_contact, who created this Survey.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $created_id;
|
||||
/**
|
||||
* Date and time that Survey was created.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $created_date;
|
||||
/**
|
||||
* FK to civicrm_contact, who recently edited this Survey.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $last_modified_id;
|
||||
/**
|
||||
* Date and time that Survey was edited last time.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $last_modified_date;
|
||||
/**
|
||||
* Used to store option group id.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $result_id;
|
||||
/**
|
||||
* Bypass the email verification.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $bypass_confirm;
|
||||
/**
|
||||
* Title for Thank-you page (header title tag, and display at the top of the page).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $thankyou_title;
|
||||
/**
|
||||
* text and html allowed. displayed above result on success page
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $thankyou_text;
|
||||
/**
|
||||
* Can people share the petition through social media?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_share;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_survey';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
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() , 'campaign_id', 'civicrm_campaign', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'last_modified_id', 'civicrm_contact', '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
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Survey ID') ,
|
||||
'description' => 'Survey id.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'title' => array(
|
||||
'name' => 'title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Survey Title') ,
|
||||
'description' => 'Title of the Survey.',
|
||||
'required' => true,
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_survey.title',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'campaign_id' => array(
|
||||
'name' => 'campaign_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Survey Campaign ID') ,
|
||||
'description' => 'Foreign key to the Campaign.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_campaign',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'activity_type_id' => array(
|
||||
'name' => 'activity_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Activity Type') ,
|
||||
'description' => 'Implicit FK to civicrm_option_value where option_group = activity_type',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_survey.activity_type_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'activity_type',
|
||||
'optionEditPath' => 'civicrm/admin/options/activity_type',
|
||||
)
|
||||
) ,
|
||||
'recontact_interval' => array(
|
||||
'name' => 'recontact_interval',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Follow up Interval') ,
|
||||
'description' => 'Recontact intervals for each status.',
|
||||
'rows' => 20,
|
||||
'cols' => 80,
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'instructions' => array(
|
||||
'name' => 'instructions',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Instructions') ,
|
||||
'description' => 'Script instructions for volunteers to use for the survey.',
|
||||
'rows' => 20,
|
||||
'cols' => 80,
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'release_frequency' => array(
|
||||
'name' => 'release_frequency',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Survey Hold Duration') ,
|
||||
'description' => 'Number of days for recurrence of release.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'max_number_of_contacts' => array(
|
||||
'name' => 'max_number_of_contacts',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Maximum number of contacts') ,
|
||||
'description' => 'Maximum number of contacts to allow for survey.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'default_number_of_contacts' => array(
|
||||
'name' => 'default_number_of_contacts',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Default number of contacts') ,
|
||||
'description' => 'Default number of contacts to allow for survey.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Survey Is Active') ,
|
||||
'description' => 'Is this survey enabled or disabled/cancelled?',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_default' => array(
|
||||
'name' => 'is_default',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Default Survey') ,
|
||||
'description' => 'Is this default survey?',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'created_id' => array(
|
||||
'name' => 'created_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Survey Created By') ,
|
||||
'description' => 'FK to civicrm_contact, who created this Survey.',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'created_date' => array(
|
||||
'name' => 'created_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Campaign Created Date') ,
|
||||
'description' => 'Date and time that Survey was created.',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'last_modified_id' => array(
|
||||
'name' => 'last_modified_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Survey Modified') ,
|
||||
'description' => 'FK to civicrm_contact, who recently edited this Survey.',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'last_modified_date' => array(
|
||||
'name' => 'last_modified_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Survey Modified On') ,
|
||||
'description' => 'Date and time that Survey was edited last time.',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'result_id' => array(
|
||||
'name' => 'result_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Survey Result') ,
|
||||
'description' => 'Used to store option group id.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'bypass_confirm' => array(
|
||||
'name' => 'bypass_confirm',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('No Email Verification') ,
|
||||
'description' => 'Bypass the email verification.',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'thankyou_title' => array(
|
||||
'name' => 'thankyou_title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Thank-you Title') ,
|
||||
'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'thankyou_text' => array(
|
||||
'name' => 'thankyou_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Thank-you Text') ,
|
||||
'description' => 'text and html allowed. displayed above result on success page',
|
||||
'rows' => 8,
|
||||
'cols' => 60,
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'is_share' => array(
|
||||
'name' => 'is_share',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is shared through social media') ,
|
||||
'description' => 'Can people share the petition through social media?',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_survey',
|
||||
'entity' => 'Survey',
|
||||
'bao' => 'CRM_Campaign_BAO_Survey',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
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).
|
||||
*/
|
||||
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
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'survey', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'survey', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_activity_type_id' => array(
|
||||
'name' => 'UI_activity_type_id',
|
||||
'field' => array(
|
||||
0 => 'activity_type_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_survey::0::activity_type_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue