*
* Generated from xml/schema/CRM/ACL/ACL.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d91adfb9ffb0a514d42f6828f1b95033)
+ * (GenCodeChecksum:f75eaa0ee87675c14a224ec22b2c30a7)
*/
/**
* Database access object for the ACL entity.
*/
class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/ACL/ACLCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0427e4f02009f7a66cf34ae18ef397aa)
+ * (GenCodeChecksum:cbf36d56ce734a5f7ceeb2071b68ebf8)
*/
/**
* Database access object for the ACLCache entity.
*/
class CRM_ACL_DAO_ACLCache extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/ACL/EntityRole.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2e8133b4c385feaa934b2d14ea40f971)
+ * (GenCodeChecksum:d985c951ef9a8872008576b41c1f2b9c)
*/
/**
* Database access object for the EntityRole entity.
*/
class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:99193964db864f9ec91b02b2bbc2d8f4)
+ * (GenCodeChecksum:acbed5c46fa2f00de06493210358c684)
*/
/**
* Database access object for the Activity entity.
*/
class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Activity/ActivityContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b458f04c2195968dbc9d49f35f7abb70)
+ * (GenCodeChecksum:777598f3625dfeaf37a81de282808c60)
*/
/**
* Database access object for the ActivityContact entity.
*/
class CRM_Activity_DAO_ActivityContact extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Batch/Batch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:062be2c63f724430f3a380c015fd6a02)
+ * (GenCodeChecksum:8169fc2f338afc4a163214c0018030be)
*/
/**
* Database access object for the Batch entity.
*/
class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Batch/EntityBatch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:645843a03d3f8e9194ddd2bd79abf5c7)
+ * (GenCodeChecksum:6b6bd1337d9011c2a262de0e62c1e8e1)
*/
/**
* Database access object for the EntityBatch entity.
*/
class CRM_Batch_DAO_EntityBatch extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Campaign/Campaign.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6b53e3fb452807fce31fc81bb2b09b38)
+ * (GenCodeChecksum:cfa77579eb9b91b31b6c5618b52c6e87)
*/
/**
* Database access object for the Campaign entity.
*/
class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a4fa6a19ef72119a316417521e209cd4)
+ * (GenCodeChecksum:74c02a4708ef706860d023c1635b98c4)
*/
/**
* Database access object for the CampaignGroup entity.
*/
class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Campaign/Survey.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:80b92f90300f8e432ddd68e95d22b622)
+ * (GenCodeChecksum:e955546c8081852591bc08b1fdee4213)
*/
/**
* Database access object for the Survey entity.
*/
class CRM_Campaign_DAO_Survey extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.2';
/**
* Static instance to hold the table name.
$this->add('wysiwyg', 'goal_general', ts('Campaign Goals'), ['rows' => 2, 'cols' => 40]);
$this->add('text', 'goal_revenue', ts('Revenue Goal'), ['size' => 8, 'maxlength' => 12]);
$this->addRule('goal_revenue', ts('Please enter a valid money value (e.g. %1).',
- [1 => CRM_Utils_Money::format('99.99', ' ')]
+ [1 => CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency(99.99)]
), 'money');
// is this Campaign active
*
* Generated from xml/schema/CRM/Case/Case.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ec6804103883c17fff63061e06d3e591)
+ * (GenCodeChecksum:8b18140da75bbf971a143c205f2af1cd)
*/
/**
* Database access object for the Case entity.
*/
class CRM_Case_DAO_Case extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Case/CaseActivity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d2ef4c48307f130ba531ff5c4bfb38d6)
+ * (GenCodeChecksum:974d18e84d3416c98293bedd66c3384c)
*/
/**
* Database access object for the CaseActivity entity.
*/
class CRM_Case_DAO_CaseActivity extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Case/CaseContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4a71399455a593008da4849db726f7b9)
+ * (GenCodeChecksum:b315f42d7c886c123c9e87c9713c4911)
*/
/**
* Database access object for the CaseContact entity.
*/
class CRM_Case_DAO_CaseContact extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Case/CaseType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c65e3b1aa03fb9ad3122915d612fefb8)
+ * (GenCodeChecksum:cde81a56b0e8201eac521b92ded6fb45)
*/
/**
* Database access object for the CaseType entity.
*/
class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.5';
/**
* Static instance to hold the table name.
['class' => 'crm-select2 crm-action-menu fa-list-ol']
);
}
+ // This button is hidden but gets clicked by javascript at
+ // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L194
+ // by the onChange handler for the above timeline_id select.
$this->addElement('xbutton', $this->getButtonName('next'), ' ', [
'class' => 'hiddenElement',
'type' => 'submit',
FALSE,
['class' => 'crm-select2 huge']
);
+ // This button is hidden but gets clicked by javascript at
+ // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L55
+ // when the mergeCasesDialog is saved.
$this->addElement('xbutton',
$this->getButtonName('next', 'merge_case'),
ts('Merge'),
],
];
+ $phoneFields = CRM_Core_DAO_Phone::export();
+ // This adds phone_type to the exportable fields and make it available for export.
+ // with testing the same can be done to the other entities.
+ CRM_Core_DAO::appendPseudoConstantsToFields($phoneFields);
$locationFields = array_merge($locationType,
CRM_Core_DAO_Address::export(),
- CRM_Core_DAO_Phone::export(),
+ $phoneFields,
CRM_Core_DAO_Email::export(),
$IMProvider,
CRM_Core_DAO_IM::export(TRUE),
* @param string $contactType
*
* @return bool
+ *
+ * @throws \API_Exception
*/
public static function isActive($contactType) {
- $contact = self::contactTypeInfo(FALSE);
+ $contact = self::contactTypeInfo();
return array_key_exists($contactType, $contact);
}
/**
* Retrieve all subtypes Information.
*
- * @todo - call getAllContactTypes & return filtered results.
- *
* @param array $contactType
- * ..
* @param bool $all
- * @param bool $ignoreCache
*
* @return array
- * Array of sub type information
+ * Array of sub type information, subset of getAllContactTypes.
+ *
+ * @throws \API_Exception
*/
- public static function subTypeInfo($contactType = NULL, $all = FALSE, $ignoreCache = FALSE) {
- $argString = $all ? 'CRM_CT_STI_1_' : 'CRM_CT_STI_0_';
- if (!empty($contactType)) {
- $contactType = (array) $contactType;
- $argString .= implode('_', $contactType);
- }
- if (!Civi::cache('contactTypes')->has($argString) || $ignoreCache) {
- $ctWHERE = '';
- if (!empty($contactType)) {
- $ctWHERE = " AND parent.name IN ('" . implode("','", $contactType) . "')";
- }
-
- $sql = "
-SELECT subtype.*, parent.name as parent, parent.label as parent_label
-FROM civicrm_contact_type subtype
-INNER JOIN civicrm_contact_type parent ON subtype.parent_id = parent.id
-WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE}
-";
- if ($all === FALSE) {
- $sql .= " AND subtype.is_active = 1 AND parent.is_active = 1 ORDER BY parent.id";
- }
- $dao = CRM_Core_DAO::executeQuery($sql, [],
- FALSE, 'CRM_Contact_DAO_ContactType'
- );
- $values = [];
- while ($dao->fetch()) {
- $value = [];
- CRM_Core_DAO::storeValues($dao, $value);
- $value['parent'] = $dao->parent;
- $value['parent_label'] = $dao->parent_label;
- $values[$dao->name] = $value;
+ public static function subTypeInfo($contactType = NULL, $all = FALSE) {
+ $contactTypes = self::getAllContactTypes();
+ foreach ($contactTypes as $index => $type) {
+ if (empty($type['parent']) ||
+ (!$all && !$type['is_active'])
+ || ($contactType && $type['parent'] !== $contactType)
+ ) {
+ unset($contactTypes[$index]);
}
- Civi::cache('contactTypes')->set($argString, $values);
}
- return Civi::cache('contactTypes')->get($argString);
+ return $contactTypes;
}
/**
* @return array
* all subtypes OR list of subtypes associated to
* a given basic contact type
+ * @throws \API_Exception
*/
public static function subTypes($contactType = NULL, $all = FALSE, $columnName = 'name', $ignoreCache = FALSE) {
if ($columnName === 'name') {
}
$field = $this->_fields[$elementName] ?? NULL;
+ if (isset($this->_pseudoConstantsSelect[$field['name']])) {
+ $this->_pseudoConstantsSelect[$name . '-' . $field['name']] = $this->_pseudoConstantsSelect[$field['name']];
+ }
// hack for profile, add location id
if (!$field) {
*
* Generated from xml/schema/CRM/Contact/ACLContactCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b99253b18e66856d4b6d914f2669fa30)
+ * (GenCodeChecksum:97d9be5e13ece64b6c9ad1722d9bca68)
*/
/**
* Database access object for the ACLContactCache entity.
*/
class CRM_Contact_DAO_ACLContactCache extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/Contact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:da59563e28c0229228f7c2baa20caabf)
+ * (GenCodeChecksum:254705f91b182cf2ded06a3caf578f6e)
*/
/**
* Database access object for the Contact entity.
*/
class CRM_Contact_DAO_Contact extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/ContactType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:34f2ee23181ddce3050484b6e30b0e72)
+ * (GenCodeChecksum:0f7546e10f09f7637d50f7a34c632cb5)
*/
/**
* Database access object for the ContactType entity.
*/
class CRM_Contact_DAO_ContactType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/DashboardContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c6084fad33e2fed9634eee46cfcfd4ee)
+ * (GenCodeChecksum:67153c09e74eda2febf15986f9c04439)
*/
/**
* Database access object for the DashboardContact entity.
*/
class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/Group.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a8a3812a392b7544441cdbe1f9500f21)
+ * (GenCodeChecksum:6a2a222c5fa5b461727bb95379723b08)
*/
/**
* Database access object for the Group entity.
*/
class CRM_Contact_DAO_Group extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/GroupContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:11947c2ac6a20781c2daa15b0f894983)
+ * (GenCodeChecksum:143ba4d95cae73fc81c8e932970cbc1f)
*/
/**
* Database access object for the GroupContact entity.
*/
class CRM_Contact_DAO_GroupContact extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/GroupContactCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:78446b0939b21d995dd17476d11030e7)
+ * (GenCodeChecksum:a169b776ec9bfc8864a05750d4ae6b95)
*/
/**
* Database access object for the GroupContactCache entity.
*/
class CRM_Contact_DAO_GroupContactCache extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/GroupNesting.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7e5dfd763c2f4b39ff7f3ea962269bae)
+ * (GenCodeChecksum:0ca7da77b0229b439c9c3a4c4c2e4326)
*/
/**
* Database access object for the GroupNesting entity.
*/
class CRM_Contact_DAO_GroupNesting extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/GroupOrganization.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:59e2d9b6cb5577d3f8a72422fb33f643)
+ * (GenCodeChecksum:dfe8edf8f786790af95f09f456d1cbe7)
*/
/**
* Database access object for the GroupOrganization entity.
*/
class CRM_Contact_DAO_GroupOrganization extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/Relationship.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b1e83f9c102db77881c4b9c730f38337)
+ * (GenCodeChecksum:25faea8225f483ae95cf29af08a8542d)
*/
/**
* Database access object for the Relationship entity.
*/
class CRM_Contact_DAO_Relationship extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/RelationshipCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d511533f30d5d2d8deac82664a6288d1)
+ * (GenCodeChecksum:b40781c15c3351a766a6083522f0e5e4)
*/
/**
* Database access object for the RelationshipCache entity.
*/
class CRM_Contact_DAO_RelationshipCache extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '5.29';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/RelationshipType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:205fa87e1f397fbf810ffbbd74c1853a)
+ * (GenCodeChecksum:6e9767fcd0fc6eba8fcd408588fe0755)
*/
/**
* Database access object for the RelationshipType entity.
*/
class CRM_Contact_DAO_RelationshipType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/SavedSearch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4093fd1cfa684e54d609528d8df160ca)
+ * (GenCodeChecksum:4b2f292a8196a5dc4a73afc078cd11cb)
*/
/**
* Database access object for the SavedSearch entity.
*/
class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contact/SubscriptionHistory.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4aa1411720f09f9ad8e2feb2a8d2a833)
+ * (GenCodeChecksum:7c033b0631f14da30172883b14686574)
*/
/**
* Database access object for the SubscriptionHistory entity.
*/
class CRM_Contact_DAO_SubscriptionHistory extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/Contribution.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5e4c6a77803e361625cafbd2f6e58bbe)
+ * (GenCodeChecksum:534963bc67ddc36a182ff4767f223531)
*/
/**
* Database access object for the Contribution entity.
*/
class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.3';
/**
* Static instance to hold the table name.
'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
'html' => [
'type' => 'Select',
+ 'label' => ts("Contribution Page"),
],
'pseudoconstant' => [
'table' => 'civicrm_contribution_page',
*
* Generated from xml/schema/CRM/Contribute/ContributionPage.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:63bc96be1f5552249e75545940c13bed)
+ * (GenCodeChecksum:f12a7fabc2ed417166aeeefbdd596fb2)
*/
/**
* Database access object for the ContributionPage entity.
*/
class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.3';
/**
* Static instance to hold the table name.
'entity' => 'ContributionPage',
'bao' => 'CRM_Contribute_BAO_ContributionPage',
'localizable' => 0,
+ 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
'html' => [
'type' => 'Select',
],
*
* Generated from xml/schema/CRM/Contribute/ContributionProduct.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:dd95e7a994c6dfe314f149b5ba7d48db)
+ * (GenCodeChecksum:4e76d9dc75f5bc1b1141645c8ee5e2e4)
*/
/**
* Database access object for the ContributionProduct entity.
*/
class CRM_Contribute_DAO_ContributionProduct extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:62019becf87dee13b7e9e174eb3c286e)
+ * (GenCodeChecksum:decf43c002d0e4ded0fe5f2a2e2f7bd0)
*/
/**
* Database access object for the ContributionRecur entity.
*/
class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/ContributionSoft.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a1c2918874b74f3f9bbbe0464aea1563)
+ * (GenCodeChecksum:caa58722ef865c7342fdff08f24d86ee)
*/
/**
* Database access object for the ContributionSoft entity.
*/
class CRM_Contribute_DAO_ContributionSoft extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/Premium.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:df0bfae4e0916c02a621471db14f3151)
+ * (GenCodeChecksum:cd1826e777cea80450636ef175aaab7f)
*/
/**
* Database access object for the Premium entity.
*/
class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a250114a018b2fd5e9d259f00d18a5c3)
+ * (GenCodeChecksum:4831cb4c7e0611db0f4312f6522d2c20)
*/
/**
* Database access object for the PremiumsProduct entity.
*/
class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/Product.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6e0a8b319985de1fe01120f4d91003a8)
+ * (GenCodeChecksum:dea1c7db61776456a70f752fe9f93f06)
*/
/**
* Database access object for the Product entity.
*/
class CRM_Contribute_DAO_Product extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Contribute/Widget.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b0e7180701d83e1d83d53bf2e43c0c51)
+ * (GenCodeChecksum:e24eaf675b793969d408fbc0f847a9ed)
*/
/**
* Database access object for the Widget entity.
*/
class CRM_Contribute_DAO_Widget extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
}
}
else {
- if ($fields['amount_block_is_active'] && empty($fields['payment_processor'])) {
+ if (!empty($fields['amount_block_is_active']) && empty($fields['payment_processor'])) {
$errors['payment_processor'] = ts('You have listed fixed contribution options or selected a price set, but no payment option has been selected. Please select at least one payment processor and/or enable the pay later option.');
}
}
if (array_key_exists('payment_processor', $params) &&
!CRM_Utils_System::isNull($params['payment_processor'])
) {
- $params['payment_processor'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, array_keys($params['payment_processor']));
+ $params['payment_processor'] = array_keys($params['payment_processor']);
}
else {
$params['payment_processor'] = 'null';
*/
private $tsFunctionName;
+ private $useHelper = '';
+
+ private $ext = "'civicrm'";
+
/**
* CRM_Core_CodeGen_DAO constructor.
*
parent::__construct($config);
$this->name = $name;
$this->tsFunctionName = $tsFunctionName;
+ // If this DAO belongs to an extension, add `use` statement and define EXT constant.
+ if (strpos($tsFunctionName, '::ts')) {
+ $this->tsFunctionName = 'E::ts';
+ $this->useHelper = 'use \\' . explode('::', $tsFunctionName)[0] . ' as E;';
+ $this->ext = 'E::LONG_NAME';
+ }
}
/**
return;
}
- $template = new CRM_Core_CodeGen_Util_Template('php');
- $template->assign('table', $this->tables[$this->name]);
- if (empty($this->tables[$this->name]['index'])) {
- $template->assign('indicesPhp', var_export([], 1));
- }
- else {
- $template->assign('indicesPhp', var_export($this->tables[$this->name]['index'], 1));
- }
+ $template = $this->getTemplate();
$template->assign('genCodeChecksum', $this->getTableChecksum());
- $template->assign('tsFunctionName', $this->tsFunctionName);
$template->run('dao.tpl', $this->getAbsFileName());
}
*/
public function getRaw() {
if (!$this->raw) {
- $template = new CRM_Core_CodeGen_Util_Template('php');
- $template->assign('table', $this->tables[$this->name]);
- if (empty($this->tables[$this->name]['index'])) {
- $template->assign('indicesPhp', var_export([], 1));
- }
- else {
- $template->assign('indicesPhp', var_export($this->tables[$this->name]['index'], 1));
- }
+ $template = $this->getTemplate();
$template->assign('genCodeChecksum', 'NEW');
- $template->assign('tsFunctionName', $this->tsFunctionName);
$this->raw = $template->fetch('dao.tpl');
}
return $this->raw;
}
+ /**
+ * @return CRM_Core_CodeGen_Util_Template
+ */
+ private function getTemplate() {
+ $template = new CRM_Core_CodeGen_Util_Template('php');
+ $template->assign('table', $this->tables[$this->name]);
+ if (empty($this->tables[$this->name]['index'])) {
+ $template->assign('indicesPhp', var_export([], 1));
+ }
+ else {
+ $template->assign('indicesPhp', var_export($this->tables[$this->name]['index'], 1));
+ }
+ $template->assign('tsFunctionName', $this->tsFunctionName);
+ $template->assign('ext', $this->ext);
+ $template->assign('useHelper', $this->useHelper);
+ return $template;
+ }
+
/**
* Get relative file name.
*
'objectName' => $klass,
'title' => $tableXML->title ?? self::nameToTitle($klass),
'icon' => $tableXML->icon ?? NULL,
+ 'add' => $tableXML->add ?? NULL,
'labelName' => substr($name, 8),
'className' => $this->classNames[$name],
'bao' => ($useBao ? str_replace('DAO', 'BAO', $this->classNames[$name]) : $this->classNames[$name]),
'=> true,' => '=> TRUE,',
'=> false,' => '=> FALSE,',
'static ::' => 'static::',
+ 'use\\' => 'use \\',
];
$contents = str_replace(array_keys($replacements), array_values($replacements), $contents);
$contents = preg_replace('#(\s*)\\/\\*\\*#', "\n\$1/**", $contents);
$options = &PEAR::getStaticProperty('DB_DataObject', 'options');
$options['database'] = $dsn;
$options['quote_identifiers'] = TRUE;
- if (self::isSSLDSN($dsn)) {
+ if (CRM_Utils_SQL::isSSLDSN($dsn)) {
// There are two different options arrays.
$other_options = &PEAR::getStaticProperty('DB', 'options');
$other_options['ssl'] = TRUE;
// Exclude fields yet not added by pending upgrades
$dbVer = \CRM_Core_BAO_Domain::version();
- if ($fields && version_compare($dbVer, \CRM_Utils_System::version()) < 0) {
+ $daoExt = defined(static::class . '::EXT') ? constant(static::class . '::EXT') : NULL;
+ if ($fields && $daoExt === 'civicrm' && version_compare($dbVer, \CRM_Utils_System::version()) < 0) {
$fields = array_filter($fields, function($field) use ($dbVer) {
$add = $field['add'] ?? '1.0.0';
if (substr_count($add, '.') < 2) {
return $result;
}
+ /**
+ * Checks if this DAO's table ought to exist.
+ *
+ * If there are pending DB updates, this function compares the CiviCRM version of the table to the current schema version.
+ *
+ * @return bool
+ * @throws CRM_Core_Exception
+ */
+ public static function tableHasBeenAdded() {
+ if (CRM_Utils_System::version() === CRM_Core_BAO_Domain::version()) {
+ return TRUE;
+ }
+ $daoExt = defined(static::class . '::EXT') ? constant(static::class . '::EXT') : NULL;
+ $daoVersion = defined(static::class . '::TABLE_ADDED') ? constant(static::class . '::TABLE_ADDED') : '1.0';
+ return !($daoExt === 'civicrm' && version_compare(CRM_Core_BAO_Domain::version(), $daoVersion, '<'));
+ }
+
/**
* Check if there is a given table in the database.
*
/**
* @param $version
- *
+ * @deprecated
* @return bool
*/
public function checkVersion($version) {
- $query = "
-SELECT version
-FROM civicrm_domain
-";
- $dbVersion = CRM_Core_DAO::singleValueQuery($query);
+ CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_BAO_Domain::version');
+ $dbVersion = CRM_Core_BAO_Domain::version();
return trim($version) == trim($dbVersion);
}
}
if ($trapException) {
+ CRM_Core_Error::deprecatedFunctionWarning('calling functions should handle exceptions');
$errorScope = CRM_Core_TemporaryErrorScope::ignoreException();
}
}
if (is_a($result, 'DB_Error')) {
+ CRM_Core_Error::deprecatedFunctionWarning('calling functions should handle exceptions');
return $result;
}
}
}
- /**
- * Does the DSN indicate the connection should use ssl.
- *
- * @param string $dsn
- *
- * @return bool
- */
- public static function isSSLDSN(string $dsn):bool {
- // Note that ssl= below is not an official PEAR::DB option. It doesn't know
- // what to do with it. We made it up because it's not required
- // to have client-side certificates to use ssl, so here you can specify
- // you want that by putting ssl=1 in the DSN string.
- //
- // Cast to bool in case of error which we interpret as no ssl.
- return (bool) preg_match('/[\?&](key|cert|ca|capath|cipher|ssl)=/', $dsn);
- }
-
}
*
* Generated from xml/schema/CRM/Core/ActionLog.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1cc48318ce597a6cac7ff0e2a4518ff5)
+ * (GenCodeChecksum:2ccef6f7cc6a43d833301e93a2a0d61f)
*/
/**
* Database access object for the ActionLog entity.
*/
class CRM_Core_DAO_ActionLog extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/ActionMapping.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:be879c0936430ca0cebf0c8bf1c3dc7a)
+ * (GenCodeChecksum:037a3f26719a4774957814f28c499e60)
*/
/**
* Database access object for the ActionMapping entity.
*/
class CRM_Core_DAO_ActionMapping extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/ActionSchedule.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4493f5d18b2b452d4a6b9ee4e15a15bf)
+ * (GenCodeChecksum:caf8b2cabbe06570dcf6cb93144004d2)
*/
/**
* Database access object for the ActionSchedule entity.
*/
class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Address.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8dc9868de21595676938b96deb836379)
+ * (GenCodeChecksum:a6b8f21dd3839de1ce1273e0910f0c8c)
*/
/**
* Database access object for the Address entity.
*/
class CRM_Core_DAO_Address extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/AddressFormat.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:bd005804e8f957b74c4eafacea35792d)
+ * (GenCodeChecksum:1ce11647576d05acfc364969eddfcce4)
*/
/**
* Database access object for the AddressFormat entity.
*/
class CRM_Core_DAO_AddressFormat extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Cache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:695d7ebea0e7103ff58dfbbff111dde6)
+ * (GenCodeChecksum:af1401f844c699c6ad35366a32a8db03)
*/
/**
* Database access object for the Cache entity.
*/
class CRM_Core_DAO_Cache extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Component.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1f7be99fb2d2adfebdf3faa2013666f4)
+ * (GenCodeChecksum:6c3fd2c8e875746c0ceffa499624f77c)
*/
/**
* Database access object for the Component entity.
*/
class CRM_Core_DAO_Component extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Country.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d40139ce11551ce445103a7fe9d3d46e)
+ * (GenCodeChecksum:cdd80b394924586274cf4b91183d3637)
*/
/**
* Database access object for the Country entity.
*/
class CRM_Core_DAO_Country extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/County.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:095ad13ad08bd1d3c12be5094239df32)
+ * (GenCodeChecksum:96f94dbbafff9a4e1f0ff276799fcbbd)
*/
/**
* Database access object for the County entity.
*/
class CRM_Core_DAO_County extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/CustomField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7bdf73d78bf9965895218895184e40a9)
+ * (GenCodeChecksum:200b28277fc9e025b42d3f3e45fde020)
*/
/**
* Database access object for the CustomField entity.
*/
class CRM_Core_DAO_CustomField extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/CustomGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4f58c488f8213dab928db357bc88f478)
+ * (GenCodeChecksum:494d883be861157d8067e6a6c50c23f6)
*/
/**
* Database access object for the CustomGroup entity.
*/
class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Dashboard.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8cc83b4a4fa0fe28868e33887824c4e5)
+ * (GenCodeChecksum:2d134bfa6938d2e8a8d8e25e99769823)
*/
/**
* Database access object for the Dashboard entity.
*/
class CRM_Core_DAO_Dashboard extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Discount.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b240911ddcf71cc294fe02614887711c)
+ * (GenCodeChecksum:a23716379d3cccf678a9d8e423690e7c)
*/
/**
* Database access object for the Discount entity.
*/
class CRM_Core_DAO_Discount extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Domain.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:33e01928bc64aa36fb39bbbeea1579dc)
+ * (GenCodeChecksum:57a526de0b2bc02fed832a22dc50ad80)
*/
/**
* Database access object for the Domain entity.
*/
class CRM_Core_DAO_Domain extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Email.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6e34e9759f2a50eb22dea1fceb15090c)
+ * (GenCodeChecksum:866b627595adac9091080a4e4ab146bc)
*/
/**
* Database access object for the Email entity.
*/
class CRM_Core_DAO_Email extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/EntityFile.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b9ac4293489f424584b9983d1304987f)
+ * (GenCodeChecksum:f2d4dfec2466ad664b4949983b1c7e58)
*/
/**
* Database access object for the EntityFile entity.
*/
class CRM_Core_DAO_EntityFile extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/EntityTag.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3f4e098850d5540fb6ddd3e04d0084fe)
+ * (GenCodeChecksum:58f15f695b38fa4cacfdf82d2734e0f0)
*/
/**
* Database access object for the EntityTag entity.
*/
class CRM_Core_DAO_EntityTag extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Extension.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:84798b0aba44e90cbdde1d65736c616d)
+ * (GenCodeChecksum:08d2151b75e68f334bd88475b58fab7b)
*/
/**
* Database access object for the Extension entity.
*/
class CRM_Core_DAO_Extension extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/File.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5c8f93d416373dd32add73f0bbaa59cc)
+ * (GenCodeChecksum:aa0883a815a43dd250612348f3ec470e)
*/
/**
* Database access object for the File entity.
*/
class CRM_Core_DAO_File extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/IM.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a01a1aec350383201dbc1c3f59e9b709)
+ * (GenCodeChecksum:da6b080a31b208a71635d272fabab7ec)
*/
/**
* Database access object for the IM entity.
*/
class CRM_Core_DAO_IM extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Job.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8f64b00207fd2c2f98c378c01e29b911)
+ * (GenCodeChecksum:6e3a5de515fda550b1b5aeb493c50f0b)
*/
/**
* Database access object for the Job entity.
*/
class CRM_Core_DAO_Job extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/JobLog.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d5266d899de027b3411970632fd2d6ef)
+ * (GenCodeChecksum:eca8e7af1026dbfaf7beecb95ce02361)
*/
/**
* Database access object for the JobLog entity.
*/
class CRM_Core_DAO_JobLog extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/LocBlock.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fd6b47fdf91519058cc607ab736a8934)
+ * (GenCodeChecksum:8459c5a6d25e5c70e44de49b109a82fa)
*/
/**
* Database access object for the LocBlock entity.
*/
class CRM_Core_DAO_LocBlock extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/LocationType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:06904ebbc78a929b34c17ba1bb580350)
+ * (GenCodeChecksum:325ccb933339bc909efc7d6b60c7186b)
*/
/**
* Database access object for the LocationType entity.
*/
class CRM_Core_DAO_LocationType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Log.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a102ecbdf345a1df748ea11fdd997b9e)
+ * (GenCodeChecksum:5dfdb2863ba1bc7b84288a522cdaef51)
*/
/**
* Database access object for the Log entity.
*/
class CRM_Core_DAO_Log extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/MailSettings.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:455750fee6f1acbe50aeb19387f12158)
+ * (GenCodeChecksum:b43716d8c8e362738d8d3420e8fbe03d)
*/
/**
* Database access object for the MailSettings entity.
*/
class CRM_Core_DAO_MailSettings extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Managed.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:939c0ed6422323450f5b9b00f8da85ad)
+ * (GenCodeChecksum:e6146e35f8c8321e600a4198cbd6949e)
*/
/**
* Database access object for the Managed entity.
*/
class CRM_Core_DAO_Managed extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Mapping.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ca067ae4e0d6b7c01e9c24da7cff585a)
+ * (GenCodeChecksum:c97b13ea2aaccdf8ba13b6552ccb59f2)
*/
/**
* Database access object for the Mapping entity.
*/
class CRM_Core_DAO_Mapping extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/MappingField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c29cb464b46084c28cedf37c3757ffd1)
+ * (GenCodeChecksum:3702a3c3cb9cd696eb829d15f4676439)
*/
/**
* Database access object for the MappingField entity.
*/
class CRM_Core_DAO_MappingField extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Menu.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8eaee41a6e8192bd26fab7f4ef443c0c)
+ * (GenCodeChecksum:8be7941b4dccb08266109e3e1599159f)
*/
/**
* Database access object for the Menu entity.
*/
class CRM_Core_DAO_Menu extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/MessageTemplate.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:542e52d6f757c9e8adfa2a5ed07b6475)
+ * (GenCodeChecksum:68dd4ac3c9f098e3577dbed8d5a2a105)
*/
/**
* Database access object for the MessageTemplate entity.
*/
class CRM_Core_DAO_MessageTemplate extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Navigation.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:39aa4b4d2c380d3a08c4931c3e497006)
+ * (GenCodeChecksum:34c3d3b834400b49f1b8c6c99a08c99e)
*/
/**
* Database access object for the Navigation entity.
*/
class CRM_Core_DAO_Navigation extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Note.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0e43e07bfbf7de4e7fa48f4d24a923fd)
+ * (GenCodeChecksum:86e72396a497a58c1568d0d081435e75)
*/
/**
* Database access object for the Note entity.
*/
class CRM_Core_DAO_Note extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/OpenID.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ed6e574083475c9caf6e8f5028510263)
+ * (GenCodeChecksum:4d60933113e2b5330dd8194e7ebe6ae4)
*/
/**
* Database access object for the OpenID entity.
*/
class CRM_Core_DAO_OpenID extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/OptionGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8a0474f902f423a6055399c438cd406c)
+ * (GenCodeChecksum:d0011ad2bb6c090eeb86d25916c5624b)
*/
/**
* Database access object for the OptionGroup entity.
*/
class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/OptionValue.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:370198cee250edd2f29743a5b5667e9a)
+ * (GenCodeChecksum:e51b16ecfe5f8302c8610b7f5dfd55e5)
*/
/**
* Database access object for the OptionValue entity.
*/
class CRM_Core_DAO_OptionValue extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Phone.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3c1f1743128af72b009c6cf4effc1da2)
+ * (GenCodeChecksum:49f2d961afab0fe5b18a91bd1371cf35)
*/
/**
* Database access object for the Phone entity.
*/
class CRM_Core_DAO_Phone extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
'phone_type_id' => [
'name' => 'phone_type_id',
'type' => CRM_Utils_Type::T_INT,
- 'title' => ts('Phone Type'),
+ 'title' => ts('Phone Type ID'),
'description' => ts('Which type of phone does this number belongs.'),
'where' => 'civicrm_phone.phone_type_id',
'export' => TRUE,
*
* Generated from xml/schema/CRM/Core/PreferencesDate.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e950a7985ee12a8b5ec6e926e8a49b20)
+ * (GenCodeChecksum:21383b05b8c8e98ed1721aab06031907)
*/
/**
* Database access object for the PreferencesDate entity.
*/
class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/PrevNextCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3e1ec2353f61b542cca9c3c9efc73e80)
+ * (GenCodeChecksum:8086ffe55554b0fba698136fd6dee894)
*/
/**
* Database access object for the PrevNextCache entity.
*/
class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/PrintLabel.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b98543c0a9d27b4f6aef0ab432bb37e2)
+ * (GenCodeChecksum:484a16ebc1b881e7718bfcf139024ee7)
*/
/**
* Database access object for the PrintLabel entity.
*/
class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/RecurringEntity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4d0ee948935c36ddf9c0a04ed30ec44f)
+ * (GenCodeChecksum:b78474c715335f7689a9a5fcdcb5718e)
*/
/**
* Database access object for the RecurringEntity entity.
*/
class CRM_Core_DAO_RecurringEntity extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Setting.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:196dea902e132f8ba6ffb8b108ee1996)
+ * (GenCodeChecksum:c1fda2807e8265021ffaa490325a7e4f)
*/
/**
* Database access object for the Setting entity.
*/
class CRM_Core_DAO_Setting extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/StateProvince.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:22bfd6264c17c80a3638b9860cb97767)
+ * (GenCodeChecksum:2dced9a7a3e6be3d05ea7b7babe4b113)
*/
/**
* Database access object for the StateProvince entity.
*/
class CRM_Core_DAO_StateProvince extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/StatusPreference.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:48ca8492c6febf737281831d72147a38)
+ * (GenCodeChecksum:1fa80acc24bcb14df3947cba2daa930f)
*/
/**
* Database access object for the StatusPreference entity.
*/
class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.7';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/SystemLog.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c90dd839d7756d95a85e38cadbcb40c9)
+ * (GenCodeChecksum:46d7f317ffb5d01d9cb22898ce38abb3)
*/
/**
* Database access object for the SystemLog entity.
*/
class CRM_Core_DAO_SystemLog extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Tag.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:71590516eaae029ef71f6f4b3d7a800d)
+ * (GenCodeChecksum:7a2eb010fd96445604104b6ada9c0b99)
*/
/**
* Database access object for the Tag entity.
*/
class CRM_Core_DAO_Tag extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Timezone.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fc76675346aa5a97d5ce798b9968ee58)
+ * (GenCodeChecksum:fb1089cb65c1587b1242b9d250c664f7)
*/
/**
* Database access object for the Timezone entity.
*/
class CRM_Core_DAO_Timezone extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/UFField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a77a2bfe4b288e20b6929fd3a7532850)
+ * (GenCodeChecksum:e717ec384cfe13629b4fc440af2a99d5)
*/
/**
* Database access object for the UFField entity.
*/
class CRM_Core_DAO_UFField extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/UFGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:acf9d6ef6307d473c8a32775aa8e8e66)
+ * (GenCodeChecksum:1cac6e6b80a630f69ce25f709a20e4a3)
*/
/**
* Database access object for the UFGroup entity.
*/
class CRM_Core_DAO_UFGroup extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/UFJoin.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:70a227711539c0b5fdea5349d18e6b7f)
+ * (GenCodeChecksum:191143bced279d48cf34cdf6cf85a5fb)
*/
/**
* Database access object for the UFJoin entity.
*/
class CRM_Core_DAO_UFJoin extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/UFMatch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4d249265c27fb6dbe50e0589ddfed7d2)
+ * (GenCodeChecksum:4fca2151c2ecbd762ac9e2f067f0030f)
*/
/**
* Database access object for the UFMatch entity.
*/
class CRM_Core_DAO_UFMatch extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Website.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2b048fb746a5762a6e132fe7b1e8dd07)
+ * (GenCodeChecksum:9e449b1f3a997b63c79066bd5cd782ae)
*/
/**
* Database access object for the Website entity.
*/
class CRM_Core_DAO_Website extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/WordReplacement.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d7e1414f899a3bcabd20806508741f55)
+ * (GenCodeChecksum:f4afc331da543068dba6d243d98b8e39)
*/
/**
* Database access object for the WordReplacement entity.
*/
class CRM_Core_DAO_WordReplacement extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.4';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Core/Worldregion.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8045c0ab7f128626a594fbb634e2f169)
+ * (GenCodeChecksum:0312ba4169a285839ec54d655ff5ceb3)
*/
/**
* Database access object for the Worldregion entity.
*/
class CRM_Core_DAO_Worldregion extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
if ($config->userSystem->is_drupal and function_exists('watchdog')) {
watchdog('civicrm', '%message', ['%message' => $message], $priority ?? WATCHDOG_DEBUG);
}
+ elseif ($config->userSystem->is_drupal and CIVICRM_UF == 'Drupal8') {
+ \Drupal::logger('civicrm')->log($priority ?? \Drupal\Core\Logger\RfcLogLevel::DEBUG, '%message', ['%message' => $message]);
+ }
}
return $str;
$insertSQL = "
INSERT INTO civicrm_prevnext_cache (cachekey, entity_id1, data)
";
- $result = CRM_Core_DAO::executeQuery($insertSQL . $sql, $sqlParams, FALSE, NULL, FALSE, TRUE, TRUE);
+ $result = CRM_Core_DAO::executeQuery($insertSQL . $sql, $sqlParams, FALSE);
if (is_a($result, 'DB_Error')) {
+ CRM_Core_Error::deprecatedFunctionWarning('errors are not expected to be returned');
throw new CRM_Core_Exception($result->message);
}
return TRUE;
* @param string $name
*/
public function __construct($name) {
- // Templates injected into regions should normally be file names, but sometimes inline notation is handy.
- require_once 'CRM/Core/Smarty/resources/String.php';
- civicrm_smarty_register_string_resource();
-
$this->_name = $name;
$this->_snippets = [];
break;
default:
- require_once 'CRM/Core/Exception.php';
throw new CRM_Core_Exception(ts('Snippet type %1 is unrecognized',
[1 => $snippet['type']]));
}
return 0;
}
- /**
- * Add block of static HTML to a region.
- *
- * @param string $markup
- * HTML.
- *
- * public function addMarkup($markup) {
- * return $this->add(array(
- * 'type' => 'markup',
- * 'markup' => $markup,
- * ));
- * }
- *
- * /**
- * Add a Smarty template file to a region.
- *
- * Note: File is not evaluated until the page is rendered
- *
- * @param string $template
- * Path to the Smarty template file.
- *
- * public function addTemplate($template) {
- * return $this->add(array(
- * 'type' => 'template',
- * 'template' => $template,
- * ));
- * }
- *
- * /**
- * Use a callback function to extend a region.
- *
- * @param mixed $callback
- * @param array $arguments
- * Optional, array of parameters for callback; if omitted, the default arguments are ($snippetSpec, $html).
- *
- * public function addCallback($callback, $arguments = FALSE) {
- * return $this->add(array(
- * 'type' => 'callback',
- * 'callback' => $callback,
- * 'arguments' => $arguments,
- * ));
- * }
- */
-
}
*
* Generated from xml/schema/CRM/Cxn/Cxn.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:bafb13cb7901c4f15b5348e2bf9a27b5)
+ * (GenCodeChecksum:059dd4994211085d728a9fc8b7d80803)
*/
/**
* Database access object for the Cxn entity.
*/
class CRM_Cxn_DAO_Cxn extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Dedupe/Exception.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ea7ca2395c6d2d927c35a7241d621cdd)
+ * (GenCodeChecksum:f4bc21b42b1b5c9cfb0ffa7d3eb46e65)
*/
/**
* Database access object for the Exception entity.
*/
class CRM_Dedupe_DAO_Exception extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Dedupe/Rule.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e218ab6aaed8b58ef6dc189845a36755)
+ * (GenCodeChecksum:56abeb7ada5e3dfde910bc5033ca047d)
*/
/**
* Database access object for the Rule entity.
*/
class CRM_Dedupe_DAO_Rule extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Dedupe/RuleGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3c21b8b33d8d561b1104318fba0db930)
+ * (GenCodeChecksum:87a385df0b5bca8150117411f2c31a4a)
*/
/**
* Database access object for the RuleGroup entity.
*/
class CRM_Dedupe_DAO_RuleGroup extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Event/Cart/Cart.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c0fdef43850965dce80a73e66caa3ceb)
+ * (GenCodeChecksum:b4aacbeb6deddb31e520ce700e774db5)
*/
/**
* Database access object for the Cart entity.
*/
class CRM_Event_Cart_DAO_Cart extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Event/Cart/EventInCart.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a995a300028b34f7b866a41b2e2b96bf)
+ * (GenCodeChecksum:b1cb9524ae26740c93dda80d0cb4ff91)
*/
/**
* Database access object for the EventInCart entity.
*/
class CRM_Event_Cart_DAO_EventInCart extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Event/Event.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:331a210ceb36b5e9460705dbfbe71abf)
+ * (GenCodeChecksum:ad8debb948e4646b04fb46991c0867db)
*/
/**
* Database access object for the Event entity.
*/
class CRM_Event_DAO_Event extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.7';
/**
* Static instance to hold the table name.
'entity' => 'Event',
'bao' => 'CRM_Event_BAO_Event',
'localizable' => 0,
+ 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
'html' => [
'type' => 'Select',
],
*
* Generated from xml/schema/CRM/Event/Participant.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5ae3aa69ac3d004f649038adbf993b8b)
+ * (GenCodeChecksum:bf8ed42264e81ccaef0ae236242990d0)
*/
/**
* Database access object for the Participant entity.
*/
class CRM_Event_DAO_Participant extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.7';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Event/ParticipantPayment.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ad58ecbb570f97b4a2d459d750e8f9b3)
+ * (GenCodeChecksum:0c828890e84b791e0432445eb2d01086)
*/
/**
* Database access object for the ParticipantPayment entity.
*/
class CRM_Event_DAO_ParticipantPayment extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.7';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ede2497e706ee17bb6dce92b72a2c535)
+ * (GenCodeChecksum:4a3012f88c67826cb4264a3340e908ec)
*/
/**
* Database access object for the ParticipantStatusType entity.
*/
class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.0';
/**
* Static instance to hold the table name.
}
if (!empty($params['payment_processor'])) {
- $params['payment_processor'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, array_keys($params['payment_processor']));
+ $params['payment_processor'] = array_keys($params['payment_processor']);
}
else {
$params['payment_processor'] = 'null';
* This class generates form components for processing Event.
*/
class CRM_Event_Form_Registration extends CRM_Core_Form {
+
use CRM_Financial_Form_FrontEndPaymentFormTrait;
/**
public $_isEventFull;
public $_lineItem;
+
public $_lineItemParticipantsCount;
+
public $_availableRegistrations;
/**
$this->_values = $this->_fields = [];
//retrieve event information
- $params = array('id' => $this->_eventId);
+ $params = ['id' => $this->_eventId];
CRM_Event_BAO_Event::retrieve($params, $this->_values['event']);
// check for is_monetary status
$isMonetary = $this->_values['event']['is_monetary'] ?? NULL;
self::initEventFee($this, $this->_eventId);
// get the profile ids
- $ufJoinParams = array(
+ $ufJoinParams = [
'entity_table' => 'civicrm_event',
// CRM-4377:Â CiviEvent for the main participant, CiviEvent_Additional for additional participants
'module' => 'CiviEvent',
'entity_id' => $this->_eventId,
- );
+ ];
list($this->_values['custom_pre_id'],
$this->_values['custom_post_id']
) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
if ($this->_values['event']['is_monetary']) {
CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor);
}
- $params = array('entity_id' => $this->_eventId, 'entity_table' => 'civicrm_event');
+ $params = ['entity_id' => $this->_eventId, 'entity_table' => 'civicrm_event'];
$this->_values['location'] = CRM_Core_BAO_Location::getValues($params, TRUE);
$this->set('values', $this->_values);
$this->_availableRegistrations
= CRM_Event_BAO_Participant::eventFull(
- $this->_values['event']['id'], TRUE,
- CRM_Utils_Array::value('has_waitlist', $this->_values['event'])
- );
+ $this->_values['event']['id'], TRUE,
+ CRM_Utils_Array::value('has_waitlist', $this->_values['event'])
+ );
$this->set('availableRegistrations', $this->_availableRegistrations);
}
$this->assign_by_ref('paymentProcessor', $this->_paymentProcessor);
$this->assign('billingName', $name);
$this->set('name', $name);
- $vars = array(
+ $vars = [
'amount',
'currencyID',
'credit_card_type',
'trxn_id',
'amount_level',
'receive_date',
- );
+ ];
foreach ($vars as $v) {
if (!empty($params[$v])) {
// we don't allow conflicting fields to be
// configured via profile
- $fieldsToIgnore = array(
+ $fieldsToIgnore = [
'participant_fee_amount' => 1,
'participant_fee_level' => 1,
- );
+ ];
if ($contactID) {
//FIX CRM-9653
if (is_array($id)) {
}
if ($isPaidEvent && empty($form->_values['fee'])) {
if (CRM_Utils_System::getClassName($form) != 'CRM_Event_Form_Participant') {
- CRM_Core_Error::statusBounce(ts('No Fee Level(s) or Price Set is configured for this event.<br />Click <a href=\'%1\'>CiviEvent >> Manage Event >> Configure >> Event Fees</a> to configure the Fee Level(s) or Price Set for this event.', array(1 => CRM_Utils_System::url('civicrm/event/manage/fee', 'reset=1&action=update&id=' . $form->_eventId))));
+ CRM_Core_Error::statusBounce(ts('No Fee Level(s) or Price Set is configured for this event.<br />Click <a href=\'%1\'>CiviEvent >> Manage Event >> Configure >> Event Fees</a> to configure the Fee Level(s) or Price Set for this event.', [1 => CRM_Utils_System::url('civicrm/event/manage/fee', 'reset=1&action=update&id=' . $form->_eventId)]));
}
}
}
}
$participantFields = CRM_Event_DAO_Participant::fields();
- $participantParams = array(
+ $participantParams = [
'id' => $params['participant_id'] ?? NULL,
'contact_id' => $contactID,
'event_id' => $form->_eventId ? $form->_eventId : $params['event_id'],
'discount_id' => $params['discount_id'] ?? NULL,
'fee_currency' => $params['currencyID'] ?? NULL,
'campaign_id' => $params['campaign_id'] ?? NULL,
- );
+ ];
if ($form->_action & CRM_Core_Action::PREVIEW || CRM_Utils_Array::value('mode', $params) == 'test') {
$participantParams['is_test'] = 1;
//first format the params.
if ($singleFormParams) {
$params = self::formatPriceSetParams($form, $params);
- $params = array($params);
+ $params = [$params];
}
foreach ($params as $key => $values) {
$field = $priceSetDetails['fields'][$fieldId];
if ($field['html_type'] == 'Text') {
$fieldOption = current($field['options']);
- $value = array($fieldOption['id'] => $value);
+ $value = [$fieldOption['id'] => $value];
}
else {
- $value = array($value => TRUE);
+ $value = [$value => TRUE];
}
}
}
foreach ($element->_options as $option) {
if ($option['attr']['value'] === "crm_disabled_opt-{$value[0]}") {
$placeholder = html_entity_decode($option['text'], ENT_QUOTES, "UTF-8");
- $element->updateAttributes(array('placeholder' => $placeholder));
+ $element->updateAttributes(['placeholder' => $placeholder]);
break;
}
}
) {
return;
}
- foreach (array(
- 'constantValues',
- 'submitValues',
- 'defaultValues',
- ) as $val) {
+ foreach (['constantValues', 'submitValues', 'defaultValues'] as $val) {
$values = $form->{"_$val"};
if (!is_array($values) || empty($values)) {
continue;
//validate for price field selection.
if (empty($fieldSelected[$pNum])) {
- $errors[$pNum]['_qf_default'] = ts('Select at least one option from Event Fee(s).');
+ $errors[$pNum]['_qf_default'] = ts('SELECT at least one OPTION FROM EVENT Fee(s).');
}
}
}
elseif (($optMax - $opDbCount) == 1) {
$errors[$soldOutPnum[$optId]]["price_{$fieldId}"]
- = ts('Sorry, currently only a single space is available for this option.', array(1 => ($optMax - $opDbCount)));
+ = ts('Sorry, currently only a single space is available for this option.', [1 => ($optMax - $opDbCount)]);
}
else {
$errors[$soldOutPnum[$optId]]["price_{$fieldId}"]
- = ts('Sorry, currently only %1 spaces are available for this option.', array(1 => ($optMax - $opDbCount)));
+ = ts('Sorry, currently only %1 spaces are available for this option.', [1 => ($optMax - $opDbCount)]);
}
}
}
$this->set('participantId', $this->_participantId);
$ids = $participantValues = [];
- $participantParams = array('id' => $this->_participantId);
+ $participantParams = ['id' => $this->_participantId];
CRM_Event_BAO_Participant::getValues($participantParams, $participantValues, $ids);
$this->_values['participant'] = $participantValues[$this->_participantId];
$this->set('values', $this->_values);
/**
* Check if event is valid.
*
+ * @param string $redirect
+ *
* @todo - combine this with CRM_Event_BAO_Event::validRegistrationRequest
* (probably extract relevant values here & call that with them & handle bounces & redirects here -as
* those belong in the form layer)
*
- * @param string $redirect
*/
public function checkValidEvent($redirect = NULL) {
// is the event active (enabled)?
$startDate &&
$startDate >= $now
) {
- CRM_Core_Error::statusBounce(ts('Registration for this event begins on %1', array(1 => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('registration_start_date', $this->_values['event'])))), $redirect, ts('Sorry'));
+ CRM_Core_Error::statusBounce(ts('Registration for this event begins on %1', [1 => CRM_Utils_Date::customFormat(CRM_Utils_Array::value('registration_start_date', $this->_values['event']))]), $redirect, ts('Sorry'));
}
$regEndDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('registration_end_date',
if (empty($regEndDate)) {
$endDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('event_end_date', $this->_values['event']));
}
- CRM_Core_Error::statusBounce(ts('Registration for this event ended on %1', array(1 => $endDate)), $redirect, ts('Sorry'));
+ CRM_Core_Error::statusBounce(ts('Registration for this event ended on %1', [1 => $endDate]), $redirect, ts('Sorry'));
}
}
if ($this->isHouseholdToSkip($iterationDAO->contact_id)) {
return FALSE;
}
- $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
$row = [];
if (property_exists($iterationDAO, $field)) {
$fieldValue = $iterationDAO->$field;
// to get phone type from phone type id
- if ($field == 'phone_type_id' && isset($phoneTypes[$fieldValue])) {
- $fieldValue = $phoneTypes[$fieldValue];
- }
- elseif ($field == 'provider_id' || $field == 'im_provider') {
+ if ($field == 'provider_id' || $field == 'im_provider') {
$fieldValue = $imProviders[$fieldValue] ?? NULL;
}
elseif (strstr($field, 'master_id')) {
if (!empty($fieldSpec['context'])) {
return $i18n->crm_translate($fieldValue, $fieldSpec);
}
- if (!empty($fieldSpec['pseudoconstant']) && !empty($fieldSpec['hasLocationType'])) {
+ if (!empty($fieldSpec['pseudoconstant']) && !empty($fieldSpec['hasLocationType']) && $fieldSpec['name'] !== 'phone_type_id') {
if (!empty($fieldSpec['bao'])) {
$transformedValue = CRM_Core_PseudoConstant::getLabel($fieldSpec['bao'], $fieldSpec['name'], $fieldValue);
if ($transformedValue) {
foreach ($value as $relationField => $relationValue) {
if (is_object($relDAO) && property_exists($relDAO, $relationField)) {
$fieldValue = $relDAO->$relationField;
- if ($relationField == 'phone_type_id') {
- $fieldValue = $phoneTypes[$relationValue];
- }
- elseif ($relationField == 'provider_id') {
+ if ($relationField == 'provider_id') {
$fieldValue = $imProviders[$relationValue] ?? NULL;
}
// CRM-13995
*
* Generated from xml/schema/CRM/Financial/Currency.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:9141d433586789f5ea9003fdbe9fdf9b)
+ * (GenCodeChecksum:5501c59b453dedfb8bba1f2fab44d9ea)
*/
/**
* Database access object for the Currency entity.
*/
class CRM_Financial_DAO_Currency extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.7';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/EntityFinancialAccount.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5ed0eeb7d3f5f2caf668448cd441b004)
+ * (GenCodeChecksum:c1d51696dd326b61f65fd064a355e7fb)
*/
/**
* Database access object for the EntityFinancialAccount entity.
*/
class CRM_Financial_DAO_EntityFinancialAccount extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/EntityFinancialTrxn.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a4b054ba0fc5a16cd650bda8941690b1)
+ * (GenCodeChecksum:12eb23afdf6c1208bdc01aa7db52770a)
*/
/**
* Database access object for the EntityFinancialTrxn entity.
*/
class CRM_Financial_DAO_EntityFinancialTrxn extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/FinancialAccount.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e9c9d66596703d9dfbf411034ce909c4)
+ * (GenCodeChecksum:b9f200ff95d9186180eff484dcd12a57)
*/
/**
* Database access object for the FinancialAccount entity.
*/
class CRM_Financial_DAO_FinancialAccount extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/FinancialItem.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4f2e977c0c7c668be342598772b0eb61)
+ * (GenCodeChecksum:8bb63ebee681c2eb4acbf8650b224dc2)
*/
/**
* Database access object for the FinancialItem entity.
*/
class CRM_Financial_DAO_FinancialItem extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/FinancialTrxn.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7e2cf7d374cc6e0af61672c0318248b6)
+ * (GenCodeChecksum:5a4324ffe222bf724ab9d4cde26eb4c2)
*/
/**
* Database access object for the FinancialTrxn entity.
*/
class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/FinancialType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:81cc1b7a95feede610081f2066eeb147)
+ * (GenCodeChecksum:024b000d94adcc65200c00d7cef5e624)
*/
/**
* Database access object for the FinancialType entity.
*/
class CRM_Financial_DAO_FinancialType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:625ab4ba983447ea3e236b48491eeed6)
+ * (GenCodeChecksum:7e296728147d44cb68a9231c4995e461)
*/
/**
* Database access object for the PaymentProcessor entity.
*/
class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/PaymentProcessorType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b57486d319cf2c2022b7447a6c53c199)
+ * (GenCodeChecksum:624a9a001f451b6eb17930a9abcceb3e)
*/
/**
* Database access object for the PaymentProcessorType entity.
*/
class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Financial/PaymentToken.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c135e4bffc93086e83c082bbebc84372)
+ * (GenCodeChecksum:ce51f1e6eaf6b29f3adeb67828e85507)
*/
/**
* Database access object for the PaymentToken entity.
*/
class CRM_Financial_DAO_PaymentToken extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.6';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Friend/Friend.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ed3cb6458bdc4ee011d6b30baa9e24ff)
+ * (GenCodeChecksum:3f1c976d43e312175e85da0427f5210d)
*/
/**
* Database access object for the Friend entity.
*/
class CRM_Friend_DAO_Friend extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.0';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Grant/Grant.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b09a04b8edb982e838510dfb9d7dbc35)
+ * (GenCodeChecksum:a2e43b7f0fb8547daf5ed874bf6174c5)
*/
/**
* Database access object for the Grant entity.
*/
class CRM_Grant_DAO_Grant extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/BouncePattern.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e36e2c40e59bfe04998b2e4e216724b6)
+ * (GenCodeChecksum:90abbaf8e68b5749a084a74d77dcc3b7)
*/
/**
* Database access object for the BouncePattern entity.
*/
class CRM_Mailing_DAO_BouncePattern extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/BounceType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b2b6ab45aa6fed676d81a68651f0bf93)
+ * (GenCodeChecksum:4e77659bd433033396e84b6de32c99af)
*/
/**
* Database access object for the BounceType entity.
*/
class CRM_Mailing_DAO_BounceType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Mailing.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:bfcc85d4eb2bab05f214dd946e5fdef6)
+ * (GenCodeChecksum:6a9dc5aaff7aa7f5dcfe3f892255e357)
*/
/**
* Database access object for the Mailing entity.
*/
class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/MailingAB.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fd7f00955d0a5eb4ec56089ccd71f68d)
+ * (GenCodeChecksum:af0f7d34ddde7f3971aaac5abccfcd8c)
*/
/**
* Database access object for the MailingAB entity.
*/
class CRM_Mailing_DAO_MailingAB extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/MailingComponent.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1d0efc3e5ba8dcd6d6bbc422877b86b4)
+ * (GenCodeChecksum:ca95f8566048836c03e1dc58eb51ac11)
*/
/**
* Database access object for the MailingComponent entity.
*/
class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/MailingGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1869c2f625f9a35820d1342217bd7feb)
+ * (GenCodeChecksum:a253e806fcb595ede70c812a10c0dbba)
*/
/**
* Database access object for the MailingGroup entity.
*/
class CRM_Mailing_DAO_MailingGroup extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/MailingJob.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b84e3c6e86ddabfe04066d742f5c0ca5)
+ * (GenCodeChecksum:0c6e76df20fe3579056c287aeed27cdb)
*/
/**
* Database access object for the MailingJob entity.
*/
class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Recipients.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:589a6adc830c8f9197b5123e08b63ba3)
+ * (GenCodeChecksum:ebd2ec177861f8f82a4bc6bc8b33fd9b)
*/
/**
* Database access object for the Recipients entity.
*/
class CRM_Mailing_DAO_Recipients extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Spool.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8e8346020e4f3174bc4c4c2e87d8e136)
+ * (GenCodeChecksum:7bd4a9b64175915a43f602f4f9cfb721)
*/
/**
* Database access object for the Spool entity.
*/
class CRM_Mailing_DAO_Spool extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/TrackableURL.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6436cc3cfd3b7a43b468c5372ec081be)
+ * (GenCodeChecksum:74f858b4e9e666e05416be884002408b)
*/
/**
* Database access object for the TrackableURL entity.
*/
class CRM_Mailing_DAO_TrackableURL extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ca3431a45bad00b42a6bf347338041ed)
+ * (GenCodeChecksum:8e0590dde97f57494203397255fd4604)
*/
/**
* Database access object for the Bounce entity.
*/
class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Confirm.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:01729079bec5be7346678447b6cf2844)
+ * (GenCodeChecksum:827b011dc50d032e8b74d6d164314d83)
*/
/**
* Database access object for the Confirm entity.
*/
class CRM_Mailing_Event_DAO_Confirm extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Delivered.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ced38ed0f599efdc44cca8dad6049d8c)
+ * (GenCodeChecksum:c983e11b4de5a1c4e6d9765eb7d12755)
*/
/**
* Database access object for the Delivered entity.
*/
class CRM_Mailing_Event_DAO_Delivered extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Forward.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ea0e4a784e682347d7320337cb5bc1ac)
+ * (GenCodeChecksum:359e0b700860c29a1e809fd4acbf7598)
*/
/**
* Database access object for the Forward entity.
*/
class CRM_Mailing_Event_DAO_Forward extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Opened.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8c6c5978fae73802fbd9984ef51a2576)
+ * (GenCodeChecksum:dddc76ba8461f8b0c1f3c1cdccddd111)
*/
/**
* Database access object for the Opened entity.
*/
class CRM_Mailing_Event_DAO_Opened extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Queue.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:316f29677ad04a5347bfd30cd60f474e)
+ * (GenCodeChecksum:091cb300f1b0a67dfaf40f988806e6cf)
*/
/**
* Database access object for the Queue entity.
*/
class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Reply.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a8246c6739f95a8e25d17ddebe882db7)
+ * (GenCodeChecksum:b1d572f3d42f6480dc98a2e6f9710fa3)
*/
/**
* Database access object for the Reply entity.
*/
class CRM_Mailing_Event_DAO_Reply extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Subscribe.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:acb361992fd2db48c82ee7b13f8b7cf4)
+ * (GenCodeChecksum:9e1dec99f17dcccde7feeca30b880a85)
*/
/**
* Database access object for the Subscribe entity.
*/
class CRM_Mailing_Event_DAO_Subscribe extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/TrackableURLOpen.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7d55cf77c7be3a81666b51aaa55c6358)
+ * (GenCodeChecksum:b543a83312f2069a45872939517aa480)
*/
/**
* Database access object for the TrackableURLOpen entity.
*/
class CRM_Mailing_Event_DAO_TrackableURLOpen extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Mailing/Event/Unsubscribe.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d16e98421cdacbf5ad1b5542810fca6c)
+ * (GenCodeChecksum:2d080a63032c9dce0331a6ed4f6c3cd2)
*/
/**
* Database access object for the Unsubscribe entity.
*/
class CRM_Mailing_Event_DAO_Unsubscribe extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Member/Membership.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:9a307c1a63b4df70ae38f36ce4171cb6)
+ * (GenCodeChecksum:835c63ea0a55b78d6d115a7a6db5dde2)
*/
/**
* Database access object for the Membership entity.
*/
class CRM_Member_DAO_Membership extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Member/MembershipBlock.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:317a1eb3c0a67ffe4662f939a0b1fb69)
+ * (GenCodeChecksum:8eb2f3a6c818d449da875421b54de619)
*/
/**
* Database access object for the MembershipBlock entity.
*/
class CRM_Member_DAO_MembershipBlock extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Member/MembershipLog.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ff966b7edcdd126ddef1ee3b3f3bff2f)
+ * (GenCodeChecksum:4d5744b433ca7bb5385b11945cc0fe10)
*/
/**
* Database access object for the MembershipLog entity.
*/
class CRM_Member_DAO_MembershipLog extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Member/MembershipPayment.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b2fa8ca60001d75a9049ca179c4e68ce)
+ * (GenCodeChecksum:39168603c262c909ebeee2ce821f0f0d)
*/
/**
* Database access object for the MembershipPayment entity.
*/
class CRM_Member_DAO_MembershipPayment extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Member/MembershipStatus.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e6fe414d2b0dc3ff72ee5adcad75fab8)
+ * (GenCodeChecksum:f0c470d5aca6e3696a0ad8345531f8b8)
*/
/**
* Database access object for the MembershipStatus entity.
*/
class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Member/MembershipType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:20b0eec540f3bb69e386f86b29419391)
+ * (GenCodeChecksum:713057d2c1a6dcb6cbd6449b8934d28c)
*/
/**
* Database access object for the MembershipType entity.
*/
class CRM_Member_DAO_MembershipType extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.5';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/PCP/PCP.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:30c5a26e001449a2ace9e530714e833c)
+ * (GenCodeChecksum:286225e46c4e2f3c12b17cd5f83b210d)
*/
/**
* Database access object for the PCP entity.
*/
class CRM_PCP_DAO_PCP extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/PCP/PCPBlock.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:039e37edb86cfd25e6c882ce4950e3c9)
+ * (GenCodeChecksum:ea1b4158570c5a79356b1dc0ad80db6a)
*/
/**
* Database access object for the PCPBlock entity.
*/
class CRM_PCP_DAO_PCPBlock extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Pledge/Pledge.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8373762a2a35ef14b0d763eb27db0f34)
+ * (GenCodeChecksum:27003a5c2de79b60b4114bc92b65cc07)
*/
/**
* Database access object for the Pledge entity.
*/
class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Pledge/PledgeBlock.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fd4a1319ac7b6cdc29baa3e9e4df68de)
+ * (GenCodeChecksum:bf3640355f445e127c25402500d79668)
*/
/**
* Database access object for the PledgeBlock entity.
*/
class CRM_Pledge_DAO_PledgeBlock extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Pledge/PledgePayment.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:64c6aef9e06ba7320d917ec5515c5ffc)
+ * (GenCodeChecksum:c47a2cbc83c672a8209bc5e725b2f81a)
*/
/**
* Database access object for the PledgePayment entity.
*/
class CRM_Pledge_DAO_PledgePayment extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.1';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Price/LineItem.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:84c128f076238b53a8c0c6dd23a22587)
+ * (GenCodeChecksum:7403b3615b0225350d893750a547061a)
*/
/**
* Database access object for the LineItem entity.
*/
class CRM_Price_DAO_LineItem extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.7';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Price/PriceField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7e0a818f8b8641ca3bae0abe1582c8ce)
+ * (GenCodeChecksum:1492c6421f1c3cb49dcab88bc411075c)
*/
/**
* Database access object for the PriceField entity.
*/
class CRM_Price_DAO_PriceField extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Price/PriceFieldValue.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:11a02f3576be10e8c2a0ea47a19e2dac)
+ * (GenCodeChecksum:4ce556d152a07393048aa1bc0a0e3ed0)
*/
/**
* Database access object for the PriceFieldValue entity.
*/
class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '3.3';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Price/PriceSet.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:53c1906856d1a16d2edba1caa6a4fafc)
+ * (GenCodeChecksum:52d1fb1b25eaa8f1c157012bfec0eaae)
*/
/**
* Database access object for the PriceSet entity.
*/
class CRM_Price_DAO_PriceSet extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Price/PriceSetEntity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a37bda1a3508a9195c561c2b2e4f03a7)
+ * (GenCodeChecksum:f2d6aeda95e4bde969d5ccebe9f26791)
*/
/**
* Database access object for the PriceSetEntity entity.
*/
class CRM_Price_DAO_PriceSetEntity extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '1.8';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Queue/QueueItem.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f71816c891a0730a45d4363883a5756c)
+ * (GenCodeChecksum:7e484400a7f8cf682b9c85e8b10c7bc7)
*/
/**
* Database access object for the QueueItem entity.
*/
class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.2';
/**
* Static instance to hold the table name.
*
* Generated from xml/schema/CRM/Report/ReportInstance.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5e7790bacc5ffff1ecfcaada1abeafec)
+ * (GenCodeChecksum:d0c9e5593f161f18e7979012c4c13724)
*/
/**
* Database access object for the ReportInstance entity.
*/
class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '2.2';
/**
* Static instance to hold the table name.
'subject' => [
'title' => ts('Subject'),
],
+ 'from_name' => [
+ 'title' => ts('Sender Name'),
+ ],
+ 'from_email' => [
+ 'title' => ts('Sender Email'),
+ ],
],
'filters' => [
'is_completed' => [
*
* Generated from xml/schema/CRM/SMS/Provider.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b512d0ed25ec37b9c890952e48c667e6)
+ * (GenCodeChecksum:6ecda65bd52b36e04764cec8ee81e1b8)
*/
/**
* Database access object for the Provider entity.
*/
class CRM_SMS_DAO_Provider extends CRM_Core_DAO {
+ const EXT = 'civicrm';
+ const TABLE_ADDED = '4.2';
/**
* Static instance to hold the table name.
return FALSE;
}
- /**
- * @param $version
- *
- * @return bool
- */
- public function checkVersion($version) {
- $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain',
- $version, 'id',
- 'version'
- );
- return (bool) $domainID;
- }
-
/**
* @return array
* @throws Exception
--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved. |
+ | |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * Upgrade logic for FiveThirty */
+class CRM_Upgrade_Incremental_php_FiveThirty extends CRM_Upgrade_Incremental_Base {
+
+ /**
+ * Compute any messages which should be displayed beforeupgrade.
+ *
+ * Note: This function is called iteratively for each upcoming
+ * revision to the database.
+ *
+ * @param string $preUpgradeMessage
+ * @param string $rev
+ * a version number, e.g. '4.4.alpha1', '4.4.beta3', '4.4.0'.
+ * @param null $currentVer
+ */
+ public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
+ // Example: Generate a pre-upgrade message.
+ // if ($rev == '5.12.34') {
+ // $preUpgradeMessage .= '<p>' . ts('A new permission, "%1", has been added. This permission is now used to control access to the Manage Tags screen.', array(1 => ts('manage tags'))) . '</p>';
+ // }
+ }
+
+ /**
+ * Compute any messages which should be displayed after upgrade.
+ *
+ * @param string $postUpgradeMessage
+ * alterable.
+ * @param string $rev
+ * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.
+ */
+ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
+ // Example: Generate a post-upgrade message.
+ // if ($rev == '5.12.34') {
+ // $postUpgradeMessage .= '<br /><br />' . ts("By default, CiviCRM now disables the ability to import directly from SQL. To use this feature, you must explicitly grant permission 'import SQL datasource'.");
+ // }
+ }
+
+ /*
+ * Important! All upgrade functions MUST add a 'runSql' task.
+ * Uncomment and use the following template for a new upgrade version
+ * (change the x in the function name):
+ */
+
+ // /**
+ // * Upgrade function.
+ // *
+ // * @param string $rev
+ // */
+ // public function upgrade_5_0_x($rev) {
+ // $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
+ // $this->addTask('Do the foo change', 'taskFoo', ...);
+ // // Additional tasks here...
+ // // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
+ // // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
+ // }
+
+ // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
+ // return TRUE;
+ // }
+
+}
--- /dev/null
+{* file to handle db changes in 5.30.alpha1 during upgrade *}
*/
public function getChecksConfig() {
if (!isset(Civi::$statics[__FUNCTION__])) {
- // TODO: Remove this check when MINIMUM_UPGRADABLE_VERSION goes to 4.7.
- if (CRM_Utils_System::version() !== CRM_Core_BAO_Domain::version() && !CRM_Core_DAO::checkTableExists('civicrm_status_pref')) {
- Civi::$statics[__FUNCTION__] = [];
- }
- else {
- Civi::$statics[__FUNCTION__] = (array) StatusPreference::get(FALSE)
- ->addWhere('domain_id', '=', 'current_domain')
- ->execute()->indexBy('name');
- }
+ Civi::$statics[__FUNCTION__] = (array) StatusPreference::get(FALSE)
+ ->addWhere('domain_id', '=', 'current_domain')
+ ->execute()->indexBy('name');
}
return Civi::$statics[__FUNCTION__];
}
* @throws \CiviCRM_API3_Exception
*/
private function checkStatusPreference() {
- // TODO: Remove this check when MINIMUM_UPGRADABLE_VERSION goes to 4.7.
- if (CRM_Utils_System::version() !== CRM_Core_BAO_Domain::version() && !CRM_Core_DAO::checkTableExists('civicrm_status_pref')) {
- return FALSE;
- }
-
$this->hiddenUntil = FALSE;
// Debug & info can't be hidden
if ($this->level < 2) {
return FALSE;
}
- $statusPreferenceParams = [
- 'name' => $this->getName(),
- 'domain_id' => CRM_Core_Config::domainID(),
- 'sequential' => 1,
+ $where = [
+ ['name', '=', $this->getName()],
+ ['domain_id', '=', CRM_Core_Config::domainID()],
];
// Check if there's a StatusPreference matching this name/domain.
- $statusPreference = civicrm_api3('StatusPreference', 'get', $statusPreferenceParams);
- $prefs = CRM_Utils_Array::value('values', $statusPreference, []);
- if ($prefs) {
+ $pref = civicrm_api4('StatusPreference', 'get', ['checkPermissions' => FALSE, 'where' => $where])->first();
+ if ($pref) {
// If so, compare severity to StatusPreference->severity.
- if ($this->level <= $prefs[0]['ignore_severity']) {
- if (isset($prefs[0]['hush_until'])) {
+ if ($this->level <= $pref['ignore_severity']) {
+ if (isset($pref['hush_until'])) {
// Time-based hush.
- $this->hiddenUntil = $prefs[0]['hush_until'];
+ $this->hiddenUntil = $pref['hush_until'];
$today = new DateTime();
- $snoozeDate = new DateTime($prefs[0]['hush_until']);
+ $snoozeDate = new DateTime($pref['hush_until']);
return !($today > $snoozeDate);
}
else {
return CRM_Core_DAO::singleValueQuery('SELECT VERSION()');
}
+ /**
+ * Does the DSN indicate the connection should use ssl.
+ *
+ * @param string $dsn
+ *
+ * @return bool
+ */
+ public static function isSSLDSN(string $dsn):bool {
+ // Note that ssl= below is not an official PEAR::DB option. It doesn't know
+ // what to do with it. We made it up because it's not required
+ // to have client-side certificates to use ssl, so here you can specify
+ // you want that by putting ssl=1 in the DSN string.
+ //
+ // Cast to bool in case of error which we interpret as no ssl.
+ return (bool) preg_match('/[\?&](key|cert|ca|capath|cipher|ssl)=/', $dsn);
+ }
+
}
* process typically done in CLI and cron scripts. See: CRM-12648
*
* Q: Can we move this to the userSystem class so that it can be tuned
- * per-CMS? For example, when dealing with UnitTests UF, there's no
- * userFrameworkDSN.
+ * per-CMS? For example, when dealing with UnitTests UF, does it need to
+ * do this session write since the original issue was for Drupal.
*/
$session = CRM_Core_Session::singleton();
$session->set('civicrmInitSession', TRUE);
- if ($config->userFrameworkDSN) {
- $dbDrupal = DB::connect($config->userFrameworkDSN);
- }
return $config->userSystem->authenticate($name, $password, $loadCMSBootstrap, $realPath);
}
protected $having = [];
public function _run(Result $result) {
+ // Early return if table doesn't exist yet due to pending upgrade
+ $baoName = $this->getBaoName();
+ if (!$baoName::tableHasBeenAdded()) {
+ \Civi::log()->warning("Could not read from {$this->getEntityName()} before table has been added. Upgrade required.", ['civi.tag' => 'upgrade_needed']);
+ return;
+ }
+
$this->setDefaultWhereClause();
$this->expandSelectClauseWildcards();
$this->getObjects($result);
return $this->customGroup;
}
+ /**
+ * @return \CRM_Core_DAO|string
+ */
+ protected function getBaoName() {
+ return \CRM_Core_BAO_CustomValue::class;
+ }
+
}
{name: 'ang2', label: ts('Batch Calls'), code: ''}
],
cli: [
- {name: 'cv', label: ts('CV'), code: ''}
+ {name: 'short', label: ts('CV (short)'), code: ''},
+ {name: 'long', label: ts('CV (long)'), code: ''},
+ {name: 'pipe', label: ts('CV (pipe)'), code: ''}
]
};
}
// Then lookup implicit links
_.each(path, function(node) {
- entity = _.find(links[entity], {alias: node}).entity;
+ var link = _.find(links[entity], {alias: node});
+ if (!link) {
+ return false;
+ }
+ entity = link.entity;
});
return entity;
}
break;
case 'cli':
- // Write cli code
- code.cv = 'cv api4 ' + entity + '.' + action + " '" + stringify(params) + "'";
+ // Cli code using json input
+ code.long = 'cv api4 ' + entity + '.' + action + ' ' + cliFormat(JSON.stringify(params));
+ code.pipe = 'echo ' + cliFormat(JSON.stringify(params)) + ' | cv api4 ' + entity + '.' + action + ' --in=json';
+
+ // Cli code using short syntax
+ code.short = 'cv api4 ' + entity + '.' + action;
+ var limitSet = false;
+ _.each(params, function(param, key) {
+ switch (true) {
+ case (key === 'select' && !_.includes(param.join(), ' ')):
+ code.short += ' +s ' + cliFormat(param.join(','));
+ break;
+ case (key === 'where' && !_.intersection(_.map(param, 0), ['AND', 'OR', 'NOT']).length):
+ _.each(param, function(clause) {
+ code.short += ' +w ' + cliFormat(clause[0] + ' ' + clause[1] + (clause.length > 2 ? (' ' + JSON.stringify(clause[2])) : ''));
+ });
+ break;
+ case (key === 'orderBy'):
+ _.each(param, function(dir, field) {
+ code.short += ' +o ' + cliFormat(field + ' ' + dir);
+ });
+ break;
+ case (key === 'values'):
+ _.each(param, function(val, field) {
+ code.short += ' +v ' + cliFormat(field + '=' + val);
+ });
+ break;
+ case (key === 'limit' || key === 'offset'):
+ // These 2 get combined
+ if (!limitSet) {
+ limitSet = true;
+ code.short += ' +l ' + (params.limit || '0') + (params.offset ? ('@' + params.offset) : '');
+ }
+ break;
+ default:
+ code.short += ' ' + key + '=' + (typeof param === 'string' ? cliFormat(param) : cliFormat(JSON.stringify(param)));
+ }
+ });
}
}
_.each($scope.code, function(vals) {
return JSON.stringify(val).replace(/\$/g, '\\$');
}
+ // Format string to be cli-input-safe
+ function cliFormat(str) {
+ if (!_.includes(str, ' ') && !_.includes(str, '"') && !_.includes(str, "'")) {
+ return str;
+ }
+ if (!_.includes(str, "'")) {
+ return "'" + str + "'";
+ }
+ if (!_.includes(str, '"')) {
+ return '"' + str + '"';
+ }
+ return "'" + str.replace(/'/g, "\\'") + "'";
+ }
+
function fetchMeta() {
crmApi4(getMetaParams)
.then(function(data) {
/**
* Function to do a 'standard' api get - when the api is only doing a $bao->find then use this.
*
- * @param string $bao_name
+ * @param string|CRM_Core_DAO $bao_name
* Name of BAO.
* @param array $params
* Params from api.
$entity = $entity ?: CRM_Core_DAO_AllCoreTables::getBriefName($bao_name);
$options = _civicrm_api3_get_options_from_params($params);
- $query = new \Civi\API\Api3SelectQuery($entity, CRM_Utils_Array::value('check_permissions', $params, FALSE));
- $query->where = $params;
- if ($options['is_count']) {
- $query->select = ['count_rows'];
+ // Skip query if table doesn't exist yet due to pending upgrade
+ if (!$bao_name::tableHasBeenAdded()) {
+ \Civi::log()->warning("Could not read from {$entity} before table has been added. Upgrade required.", ['civi.tag' => 'upgrade_needed']);
+ $result = [];
}
else {
- $query->select = array_keys(array_filter($options['return']));
- $query->orderBy = $options['sort'];
- $query->isFillUniqueFields = $uniqueFields;
- }
- $query->limit = $options['limit'];
- $query->offset = $options['offset'];
- $query->merge($sql);
- $result = $query->run();
+ $query = new \Civi\API\Api3SelectQuery($entity, $params['check_permissions'] ?? FALSE);
+ $query->where = $params;
+ if ($options['is_count']) {
+ $query->select = ['count_rows'];
+ }
+ else {
+ $query->select = array_keys(array_filter($options['return']));
+ $query->orderBy = $options['sort'];
+ $query->isFillUniqueFields = $uniqueFields;
+ }
+ $query->limit = $options['limit'];
+ $query->offset = $options['offset'];
+ $query->merge($sql);
+ $result = $query->run();
+ }
if ($returnAsSuccess) {
return civicrm_api3_create_success($result, $params, $entity, 'get');
"typo3/phar-stream-wrapper": "^2 || ^3.0",
"brick/money": "~0.4",
"ext-intl": "*",
- "pear/mail_mime": "~1.10"
+ "pear/mail_mime": "~1.10",
+ "pear/db": "1.10"
},
"scripts": {
"post-install-cmd": [
"electrolinux/phpquery": {
"PHP7.4 Fix for array access using {} instead of []": "https://raw.githubusercontent.com/civicrm/civicrm-core/fe45bdfc4f3e3d3deb27e3d853cdbc7f616620a9/tools/scripts/composer/patches/php74_array_access_fix_phpquery.patch"
},
+ "pear/db": {
+ "Apply CiviCRM Customisations for the pear:db package": "https://raw.githubusercontent.com/civicrm/civicrm-core/a48a43c2b5f6d694fff1cfb99d522c5d9e2459a0/tools/scripts/composer/pear_db_civicrm_changes.patch"
+ },
"pear/mail": {
"Apply CiviCRM Customisations for CRM-1367 and CRM-5946": "https://raw.githubusercontent.com/civicrm/civicrm-core/36319938a5bf26c1e7e2110a26a65db6a5979268/tools/scripts/composer/patches/pear-mail.patch"
},
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1ff9c045fb03756148c0c66562aa61fd",
+ "content-hash": "46e891da51f0683373d9a6e62fb6f868",
"packages": [
{
"name": "adrienrn/php-mimetyper",
"description": "More info available on: http://pear.php.net/package/Console_Getopt",
"time": "2015-07-20T20:28:12+00:00"
},
+ {
+ "name": "pear/db",
+ "version": "v1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pear/DB.git",
+ "reference": "e158c3a48246b67cd8c95856ffbb93de4ef380fe"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pear/DB/zipball/e158c3a48246b67cd8c95856ffbb93de4ef380fe",
+ "reference": "e158c3a48246b67cd8c95856ffbb93de4ef380fe",
+ "shasum": ""
+ },
+ "require": {
+ "pear/pear-core-minimal": "*"
+ },
+ "type": "library",
+ "extra": {
+ "patches_applied": {
+ "Apply CiviCRM Customisations for the pear:db package": "https://raw.githubusercontent.com/civicrm/civicrm-core/a48a43c2b5f6d694fff1cfb99d522c5d9e2459a0/tools/scripts/composer/pear_db_civicrm_changes.patch"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "DB": "./"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "./"
+ ],
+ "license": [
+ "PHP License v3.01"
+ ],
+ "authors": [
+ {
+ "name": "Daniel Convissor",
+ "email": "danielc@php.net",
+ "role": "Lead"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net",
+ "role": "Lead"
+ },
+ {
+ "name": "Stig Bakken",
+ "email": "stig@php.net",
+ "role": "Developer"
+ },
+ {
+ "name": "Tomas V.V.Cox",
+ "email": "cox@idecnet.com",
+ "role": "Developer"
+ }
+ ],
+ "description": "More info available on: http://pear.php.net/package/DB",
+ "time": "2020-04-19T19:45:59+00:00"
+ },
{
"name": "pear/log",
"version": "1.13.2",
}
$pages = [];
- $is_monetary = FALSE;
- $is_conference = FALSE;
- foreach ($cart->events_in_carts as $event_in_cart) {
- if ($event_in_cart->event->is_monetary) {
- $is_monetary = TRUE;
- }
- }
- $pages["CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices"] = NULL;
+ $pages['CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices'] = NULL;
foreach ($cart->events_in_carts as $event_in_cart) {
if ($event_in_cart->is_parent_event()) {
foreach ($event_in_cart->participants as $participant) {
LOCK TABLES `civicrm_domain` WRITE;
/*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */;
-INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,'5.29.beta1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,'5.30.alpha1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
/*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
UNLOCK TABLES;
VALUES
( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Mailing Detail Report', 'Mailing Detail Report', 'administer CiviMail', 'OR', @reportlastID, '1', NULL, @instanceID+2 );
UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID;
-UPDATE civicrm_domain SET version = '5.29.beta1';
+UPDATE civicrm_domain SET version = '5.30.alpha1';
<p>
{$form.add_activity_type_id.html}
{if $hasAccessToAllCases}
- {$form.timeline_id.html}{$form._qf_CaseView_next.html}
+ {$form.timeline_id.html}{*This CaseView_next button is hidden, but gets clicked by the onChange handler for timeline_id in CaseView.js*}{$form._qf_CaseView_next.html}
{$form.report_id.html}
{/if}
</p>
{if $mergeCases}
<a href="#mergeCasesDialog" class="action-item no-popup crm-hover-button case-miniform"><i class="crm-i fa-compress" aria-hidden="true"></i> {ts}Merge Case{/ts}</a>
- {$form._qf_CaseView_next_merge_case.html}
+ {*This CaseView_next_merge_case button is hidden, but gets clicked by javascript in CaseView.js when the mergeCasesDialog popup is saved.*}{$form._qf_CaseView_next_merge_case.html}
<span id="mergeCasesDialog" class="hiddenElement">
{$form.merge_case_id.html}
</span>
{$form.financial_type_id.html|crmAddClass:twenty}
</td>
<td>
- <label>{ts}Contribution Page{/ts}</label> <br />
+ <label>{$form.contribution_page_id.label}</label> <br />
{$form.contribution_page_id.html|crmAddClass:twenty}
</td>
</tr>
* If any of these contain a single quote or backslash, escape those characters with a backslash: \' and \\, respectively.
*
* Datasource (DSN) format:
- * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true');
+ * define( 'CIVICRM_UF_DSN', 'mysqli://cms_db_username:cms_db_password@db_server/cms_database?new_link=true');
*/
if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') {
- define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true');
+ define( 'CIVICRM_UF_DSN' , 'mysqli://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true');
}
// %%extraSettings%%
*
* Database URL (CIVICRM_DSN) for CiviCRM Data:
* Database URL format:
- * define( 'CIVICRM_DSN', 'mysql://crm_db_username:crm_db_password@db_server/crm_database?new_link=true');
+ * define( 'CIVICRM_DSN', 'mysqli://crm_db_username:crm_db_password@db_server/crm_database?new_link=true');
*
* Drupal and CiviCRM can share the same database, or can be installed into separate databases.
* Backdrop CMS and CiviCRM can also share the same database, or can be installed into separate databases.
*
* EXAMPLE: Drupal/Backdrop and CiviCRM running in the same database...
* DB Name = cms, DB User = cms
- * define( 'CIVICRM_DSN' , 'mysql://cms:YOUR_PASSWORD@localhost/cms?new_link=true');
+ * define( 'CIVICRM_DSN' , 'mysqli://cms:YOUR_PASSWORD@localhost/cms?new_link=true');
*
* EXAMPLE: Drupal/Backdrop and CiviCRM running in separate databases...
* CMS DB Name = cms, DB User = cms
* CiviCRM DB Name = civicrm, CiviCRM DB User = civicrm
- * define( 'CIVICRM_DSN' , 'mysql://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true');
+ * define( 'CIVICRM_DSN' , 'mysqli://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true');
*
* If your username, password, server or DB name contain a single quote or backslash, escape those characters
* with a backslash: \' and \\, respectively.
define('CIVICRM_DSN', $GLOBALS['_CV']['TEST_DB_DSN']);
}
else {
- define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true');
+ define('CIVICRM_DSN', 'mysqli://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true');
}
}
* configuration option, but wish to, for example, use fr_CA instead of the
* default fr_FR (for French), set one or more of the constants below to an
* appropriate regional value.
+ *
+ * Note that since 5.26.0 specifically https://github.com/civicrm/civicrm-core/pull/16700
+ * This generally doesn't get used by WordPress especially if using the Polylang plugin.
+ * The reason is that the WordPress implementation has been changed to get the full locale
+ * from the WordPress plugin rather than just the 2 string language code.
*/
// define('CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA');
// define('CIVICRM_LANGUAGE_MAPPING_EN', 'en_CA');
// check for type:Individual
$result = CRM_Contact_BAO_ContactType::subTypes('Individual');
$this->assertEquals(array_keys($this->getExpectedContactSubTypes('Individual')), $result);
+ $this->assertEquals($this->getExpectedContactSubTypes('Individual'), CRM_Contact_BAO_ContactType::subTypeInfo('Individual'));
// check for type:Organization
$result = CRM_Contact_BAO_ContactType::subTypes('Organization');
$this->assertEquals(array_keys($this->getExpectedContactSubTypes('Organization')), $result);
+ $this->assertEquals($this->getExpectedContactSubTypes('Organization'), CRM_Contact_BAO_ContactType::subTypeInfo('Organization'));
// check for type:Household
$result = CRM_Contact_BAO_ContactType::subTypes('Household');
$this->assertEquals(array_keys($this->getExpectedContactSubTypes('Household')), $result);
+ $this->assertEquals($this->getExpectedContactSubTypes('Household'), CRM_Contact_BAO_ContactType::subTypeInfo('Household'));
// check for all contact types
$result = CRM_Contact_BAO_ContactType::subTypes();
$subtypes = array_keys($this->getExpectedAllSubtypes());
$this->assertEquals(sort($subtypes), sort($result));
+ $this->assertEquals($this->getExpectedAllSubtypes(), CRM_Contact_BAO_ContactType::subTypeInfo());
+
}
/**
$this->assertArrayNotHasKey('api_key', $permissionedContactFields);
}
+ public function testTableHasBeenAdded() {
+ // Hack a different db version
+ CRM_Core_BAO_Domain::getDomain()->version = '5.28.0';
+
+ // Table was added in 5.29
+ $this->assertFalse(CRM_Contact_DAO_RelationshipCache::tableHasBeenAdded());
+
+ // Remove domain version override:
+ CRM_Core_BAO_Domain::version(TRUE);
+
+ $this->assertTrue(CRM_Contact_DAO_RelationshipCache::tableHasBeenAdded());
+ }
+
}
*/
class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase {
- use \Civi\Test\GuzzleTestTrait;
-
- /**
- * @var \CRM_Core_Payment_AuthorizeNet
- */
- protected $processor;
+ use CRM_Core_Payment_AuthorizeNetTrait;
public function setUp() {
parent::setUp();
* Test doing a one-off payment.
*
* @throws \Civi\Payment\Exception\PaymentProcessorException
+ * @throws \CiviCRM_API3_Exception
*/
public function testSinglePayment() {
- $this->createMockHandler([$this->getExpectedSinglePaymentResponse()]);
- $this->setUpClientWithHistoryContainer();
- $this->processor->setGuzzleClient($this->getGuzzleClient());
+ $this->setupMockHandler();
$params = $this->getBillingParams();
$params['amount'] = 5.24;
$this->processor->doPayment($params);
$this->assertEquals($this->getExpectedSinglePaymentRequest(), $this->getRequestBodies()[0]);
}
- /**
- * Get the expected response from Authorize.net.
- *
- * @return string
- */
- public function getExpectedSinglePaymentResponse() {
- return '"1","1","1","(TESTMODE) This transaction has been approved.","000000","P","0","","","5.24","CC","auth_capture","","John","O'Connor","","","","","","","","","","","","","","","","","","","","","","","",""';
- }
-
- /**
- * Get the expected request from Authorize.net.
- *
- * @return string
- */
- public function getExpectedSinglePaymentRequest() {
- return 'x_login=4y5BfuW7jm&x_tran_key=4cAmW927n8uLf5J8&x_email_customer=&x_first_name=John&x_last_name=O%27Connor&x_address=&x_city=&x_state=&x_zip=&x_country=&x_customer_ip=&x_email=&x_invoice_num=&x_amount=5.24&x_currency_code=&x_description=&x_cust_id=&x_relay_response=FALSE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%22&x_card_num=4444333322221111&x_card_code=123&x_exp_date=10%2F2022&x_test_request=TRUE';
- }
-
/**
* Create a single post dated payment as a recurring transaction.
*
* Test works but not both due to some form of caching going on in the SmartySingleton
*/
public function testCreateSingleNowDated() {
- $this->createMockHandler([$this->getExpectedResponse()]);
- $this->setUpClientWithHistoryContainer();
- $this->processor->setGuzzleClient($this->getGuzzleClient());
+ $this->isRecur = TRUE;
+ $this->setupMockHandler();
$firstName = 'John';
$lastName = "O\'Connor";
$nameParams = ['first_name' => 'John', 'last_name' => $lastName];
* Create a single post dated payment as a recurring transaction.
*/
public function testCreateSinglePostDated() {
- $this->createMockHandler([$this->getExpectedResponse()]);
- $this->setUpClientWithHistoryContainer();
- $this->processor->setGuzzleClient($this->getGuzzleClient());
+ $this->isRecur = TRUE;
+ $this->setupMockHandler();
$start_date = date('Ymd', strtotime('+ 1 week'));
$firstName = 'John';
);
$response = $this->getResponseBodies();
- $this->assertEquals($this->getExpectedResponse(), $response[0], 3);
+ $this->assertEquals($this->getExpectedRecurResponse(), $response[0], 3);
$requests = $this->getRequestBodies();
$this->assertEquals($this->getExpectedRequest($contactId, date('Y-m-d', strtotime($start_date)), 70.23, 3, 4007000000027, '2022-10'), $requests[0]);
}
';
}
- /**
- * Get a successful response to setting up a recurring.
- *
- * @return string
- */
- public function getExpectedResponse() {
- return '<?xml version="1.0" encoding="utf-8"?><ARBCreateSubscriptionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><refId>8d468ca1b1dd5c2b56c7</refId><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><subscriptionId>6632052</subscriptionId><profile><customerProfileId>1512023280</customerProfileId><customerPaymentProfileId>1512027350</customerPaymentProfileId></profile></ARBCreateSubscriptionResponse>';
- }
-
/**
* Get some basic billing parameters.
*
--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved. |
+ | |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * Class CRM_Core_Payment_AuthorizeNetTest
+ * @group headless
+ */
+trait CRM_Core_Payment_AuthorizeNetTrait {
+ use \Civi\Test\GuzzleTestTrait;
+
+ /**
+ * @var \CRM_Core_Payment_AuthorizeNet
+ */
+ protected $processor;
+
+ /**
+ * Is this a recurring transaction.
+ *
+ * @var bool
+ */
+ protected $isRecur = FALSE;
+
+ /**
+ * Get the expected response from Authorize.net.
+ *
+ * @return string
+ */
+ public function getExpectedSinglePaymentResponse() {
+ return '"1","1","1","(TESTMODE) This transaction has been approved.","000000","P","0","","","5.24","CC","auth_capture","","John","O'Connor","","","","","","","","","","","","","","","","","","","","","","","",""';
+ }
+
+ /**
+ * Get the expected request from Authorize.net.
+ *
+ * @return string
+ */
+ public function getExpectedSinglePaymentRequest() {
+ return 'x_login=4y5BfuW7jm&x_tran_key=4cAmW927n8uLf5J8&x_email_customer=&x_first_name=John&x_last_name=O%27Connor&x_address=&x_city=&x_state=&x_zip=&x_country=&x_customer_ip=&x_email=&x_invoice_num=&x_amount=5.24&x_currency_code=&x_description=&x_cust_id=&x_relay_response=FALSE&x_delim_data=TRUE&x_delim_char=%2C&x_encap_char=%22&x_card_num=4444333322221111&x_card_code=123&x_exp_date=10%2F2022&x_test_request=TRUE';
+ }
+
+ /**
+ * Add a mock handler to the authorize.net processor for testing.
+ *
+ * @param int|null $id
+ *
+ * @throws \CiviCRM_API3_Exception
+ */
+ protected function setupMockHandler($id = NULL) {
+ if ($id) {
+ $this->processor = Civi\Payment\System::singleton()->getById($id);
+ }
+ $response = $this->isRecur ? $this->getExpectedRecurResponse() : $this->getExpectedSinglePaymentResponse();
+ $this->createMockHandler([$response]);
+ $this->setUpClientWithHistoryContainer();
+ $this->processor->setGuzzleClient($this->getGuzzleClient());
+ }
+
+ /**
+ * Get a successful response to setting up a recurring.
+ *
+ * @return string
+ */
+ public function getExpectedRecurResponse() {
+ return '<?xml version="1.0" encoding="utf-8"?><ARBCreateSubscriptionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><refId>8d468ca1b1dd5c2b56c7</refId><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><subscriptionId>6632052</subscriptionId><profile><customerProfileId>1512023280</customerProfileId><customerPaymentProfileId>1512027350</customerPaymentProfileId></profile></ARBCreateSubscriptionResponse>';
+ }
+
+}
<?php
+use Civi\Api4\OptionValue;
+
/**
* Class CRM_Core_DAOTest
*
'civicrm_case_activity',
'civicrm_campaign',
]);
+ OptionValue::update()->addWhere('name', '=', 'Much Much longer than just phone')->setValues(['label' => 'Mobile'])->execute();
if (!empty($this->locationTypes)) {
$this->callAPISuccess('LocationType', 'delete', ['id' => $this->locationTypes['Whare Kai']['id']]);
'Country' => 'Netherlands',
'Phone' => '',
'Phone Extension' => '',
+ 'Phone Type ID' => '',
'Phone Type' => '',
'Email' => 'home@example.com',
'On Hold' => 'No',
*
* Less over the top complete than the im test.
*
+ * @throws \API_Exception
* @throws \CRM_Core_Exception
+ * @throws \Civi\API\Exception\UnauthorizedException
* @throws \League\Csv\Exception
*/
public function testExportPhoneData() {
$this->contactIDs[] = $this->individualCreate();
$this->contactIDs[] = $this->individualCreate();
+
+ OptionValue::update()->addWhere('name', '=', 'Mobile')->setValues(['label' => 'Much Much longer than just phone'])->execute();
$locationTypes = ['Billing' => 'Billing', 'Home' => 'Home'];
$phoneTypes = ['Mobile', 'Phone'];
foreach ($this->contactIDs as $contactID) {
foreach (array_keys(array_merge($locationTypes, [' ' => ['Primary']])) as $locationType) {
$locationTypeID = CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_Phone', 'location_type_id', $locationType);
$fields[] = ['name' => 'phone', 'location_type_id' => $locationTypeID];
+ $fields[] = ['name' => 'phone_type', 'location_type_id' => $locationTypeID];
$fields[] = ['name' => 'phone_type_id', 'location_type_id' => $locationTypeID];
foreach ($relationships as $contactID => $relationship) {
$fields[] = ['name' => 'phone_type_id', 'relationship_type_id' => $relationship['relationship_type_id'], 'relationship_direction' => 'a_b', 'location_type_id' => $locationTypeID];
+ $fields[] = ['name' => 'phone_type', 'relationship_type_id' => $relationship['relationship_type_id'], 'relationship_direction' => 'a_b', 'location_type_id' => $locationTypeID];
}
foreach ($phoneTypes as $phoneType) {
$phoneTypeID = CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_Phone', 'phone_type_id', $phoneType);
$fields[] = ['name' => 'phone', 'phone_type_id' => $phoneTypeID, 'location_type_id' => $locationTypeID];
foreach ($relationships as $contactID => $relationship) {
$fields[] = ['name' => 'phone_type_id', 'phone_type_id' => $phoneTypeID, 'relationship_type_id' => $relationship['relationship_type_id'], 'relationship_direction' => 'a_b', 'location_type_id' => $locationTypeID];
+ $fields[] = ['name' => 'phone_type', 'phone_type_id' => $phoneTypeID, 'relationship_type_id' => $relationship['relationship_type_id'], 'relationship_direction' => 'a_b', 'location_type_id' => $locationTypeID];
}
}
}
$this->doExportTest(['fields' => $fields, 'ids' => [$this->contactIDs[0]]]);
foreach ($this->csv->getRecords() as $row) {
- $this->assertEquals('BillingMobile3', $row['Billing-Phone-Mobile']);
+ $this->assertEquals('BillingMobile3', $row['Billing-Phone-Much Much longer than just phone']);
$this->assertEquals('', $row['Billing-Phone-Phone']);
- $this->assertEquals('Phone', $row['Spouse of-Phone Type']);
- $this->assertEquals('Mobile', $row['Phone Type']);
- $this->assertEquals('Mobile', $row['Billing-Phone Type']);
+ $this->assertEquals('Much Much longer than just phone', $row['Spouse of-Phone Type']);
+ $this->assertEquals('Much Much longer than just phone', $row['Phone Type']);
+ $this->assertEquals('Much Much longer than just phone', $row['Billing-Phone Type']);
}
}
'Country' => 'Netherlands',
'Phone' => '',
'Phone Extension' => '',
+ 'Phone Type ID' => '',
'Phone Type' => '',
'Email' => 'home@example.com',
'On Hold' => 'No',
'tags' => 1,
'notes' => 1,
'phone_type_id' => 1,
+ 'phone_type' => 1,
];
if (!$isContactMode) {
unset($returnProperties['groups']);
68 => 'Country',
69 => 'Phone',
70 => 'Phone Extension',
- 71 => 'Phone Type',
- 72 => 'Email',
- 73 => 'On Hold',
- 74 => 'Use for Bulk Mail',
- 75 => 'Signature Text',
- 76 => 'Signature Html',
- 77 => 'IM Provider',
- 78 => 'IM Screen Name',
- 79 => 'OpenID',
- 80 => 'World Region',
- 81 => 'Website',
- 82 => 'Group(s)',
- 83 => 'Tag(s)',
- 84 => 'Note(s)',
+ 71 => 'Phone Type ID',
+ 72 => 'Phone Type',
+ 73 => 'Email',
+ 74 => 'On Hold',
+ 75 => 'Use for Bulk Mail',
+ 76 => 'Signature Text',
+ 77 => 'Signature Html',
+ 78 => 'IM Provider',
+ 79 => 'IM Screen Name',
+ 80 => 'OpenID',
+ 81 => 'World Region',
+ 82 => 'Website',
+ 83 => 'Group(s)',
+ 84 => 'Tag(s)',
+ 85 => 'Note(s)',
];
if (!$isContactExport) {
- unset($headers[82]);
unset($headers[83]);
unset($headers[84]);
+ unset($headers[85]);
}
return $headers;
}
'groups' => '`groups` text',
'tags' => '`tags` text',
'notes' => '`notes` text',
+ 'phone_type' => '`phone_type` varchar(255)',
];
if (!$isContactExport) {
unset($columns['groups']);
--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved. |
+ | |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * Test various payment forms.
+ *
+ * This class is intended to be a place to build out testing of various forms - with the
+ * hope being to ensure all payment forms are consistently tested and to refine
+ * helper functions into a trait that could be available to
+ * extensions for testing - notably the eventcart which ideally should interact with core
+ * through approved interfaces - ideally even in tests.
+ *
+ * An approved interface would sit in the Civi directory and would at minimum support some functions
+ * to support using our processors in tests so we are testing a broader swath than just Dummy.
+ * Currently Authorize.net is also testable (uses Guzzle). At some point PaypalPro & Std should also be testable
+ * - allowing us to easily check payment forms work with the core processors which cover a reasonable amount of the
+ * expectations held by non-core processors .
+ *
+ * Note that this tests eventcart but is not in eventcart because I want to be sure about whether the
+ * traits supporting it make sense before making them available to extensions.
+ */
+class CRM_Financial_Form_PaymentFormsTest extends CiviUnitTestCase {
+
+ use CRM_Core_Payment_AuthorizeNetTrait;
+
+ /**
+ * Generic test on event payment forms to make sure they submit without error with payment processing.
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
+ */
+ public function testEventPaymentForms() {
+ $processors = [$this->paymentProcessorAuthorizeNetCreate(['is_test' => FALSE])];
+ $this->setupMockHandler($processors[0]);
+ $eventID = $this->eventCreatePaid([
+ 'end_date' => '+ 1 month',
+ 'registration_end_date' => '+ 1 month',
+ 'payment_processor' => $processors,
+ ])['id'];
+ $this->createLoggedInUser();
+
+ $forms = [
+ 'CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices' => [
+ 'forms' => ['CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices', 'CRM_Event_Cart_Form_Checkout_Payment'],
+ 'controller' => [],
+ 'submitValues' => [
+ 'event' => [$eventID => ['participant' => [1 => ['email' => 'bob@example.com']]]],
+ 'event_' . $eventID . '_price_' . $this->_ids['price_field'][0] => $this->_ids['price_field_value'][0],
+ ],
+ 'REQUEST' => [],
+ ],
+ ];
+ $genericParams = [
+ 'credit_card_number' => 4111111111111111,
+ 'processor_id' => $processors[0],
+ 'cvv2' => '123',
+ 'credit_card_exp_date' => [
+ 'M' => '1',
+ 'Y' => date('Y') + 1,
+ ],
+ 'credit_card_type' => 'Visa',
+ 'billing_contact_email' => 'bobby@example.com',
+ 'billing_first_name' => 'John',
+ 'billing_middle_name' => '',
+ 'billing_last_name' => "O'Connor",
+ 'billing_street_address-5' => '8 Hobbitton Road',
+ 'billing_city-5' => 'The Shire',
+ 'billing_state_province_id-5' => 1012,
+ 'billing_postal_code-5' => 5010,
+ 'billing_country_id-5' => 1228,
+ ];
+
+ $cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
+ $cart->add_event($eventID);
+
+ foreach ($forms as $values) {
+ $_REQUEST = $values['REQUEST'];
+ $qfKey = NULL;
+ foreach ($values['forms'] as $formName) {
+ $formValues = array_merge($genericParams, $values['submitValues'], ['qfKey' => $qfKey]);
+ $form = $this->getFormObject($formName, $formValues);
+ $form->preProcess();
+ $form->buildQuickForm();
+ $form->postProcess();
+ $qfKey = $form->controller->_key;
+ }
+ $this->callAPISuccessGetSingle('Participant', ['participant_status_id' => 'Registered']);
+ $request = explode('&', $this->getRequestBodies()[0]);
+ // This is stand in for now just to check a request happened. We can improve later.
+ $this->assertContains('x_card_num=4111111111111111', $request);
+ }
+ }
+
+}
public function testCreateHiddenGroupFromSearchBuilder() {
$this->createLoggedInUser();
$formValues = [
- 'qfKey' => 'dde96a85ddebb90fb66de44859404aeb_2077',
'entryURL' => 'http://dmaster.local/civicrm/contact/search/builder?reset=1',
'mapper' => [1 => [['Individual']]],
'operator' => [1 => ['=']],
}
}
+ /**
+ * Test isSSLDSN
+ * @dataProvider dsnProvider
+ * @param string $input
+ * @param bool $expected
+ */
+ public function testIsSSLDSN(string $input, bool $expected) {
+ $this->assertSame($expected, CRM_Utils_SQL::isSSLDSN($input));
+ }
+
+ /**
+ * Data provider for testIsSSLDSN
+ * @return array
+ */
+ public function dsnProvider():array {
+ return [
+ ['', FALSE],
+ ['mysqli://user:pass@localhost/drupal', FALSE],
+ ['mysqli://user:pass@localhost:3306/drupal', FALSE],
+ ['mysql://user:pass@localhost:3306/drupal', FALSE],
+ ['mysql://user:pass@localhost:3306/drupal', FALSE],
+ ['mysql://user:pass@localhost:3306/drupal?new_link=true', FALSE],
+ ['mysqli://user:pass@localhost:3306/drupal?ssl', FALSE],
+ ['mysqli://user:pass@localhost:3306/drupal?ssl=1', TRUE],
+ ['mysqli://user:pass@localhost:3306/drupal?new_link=true&ssl=1', TRUE],
+ ['mysql://user:pass@localhost:3306/drupal?ssl=1', TRUE],
+ ['mysqli://user:pass@localhost:3306/drupal?ca=%2Ftmp%2Fcacert.crt', TRUE],
+ ['mysqli://user:pass@localhost/drupal?ca=%2Ftmp%2Fcacert.crt&cert=%2Ftmp%2Fcert.crt&key=%2Ftmp%2F', TRUE],
+ ['mysqli://user:pass@localhost/drupal?ca=%2Fpath%20with%20spaces%2Fcacert.crt', TRUE],
+ ['mysqli://user:pass@localhost:3306/drupal?cipher=aes', TRUE],
+ ['mysqli://user:pass@localhost:3306/drupal?capath=%2Ftmp', TRUE],
+ ['mysqli://user:pass@localhost:3306/drupal?cipher=aes&capath=%2Ftmp&food=banana', TRUE],
+ ['mysqli://user:pass@localhost:3306/drupal?food=banana&cipher=aes', TRUE],
+ ];
+ }
+
}
* @throws \CRM_Core_Exception
*/
public function getFormObject($class, $formValues = [], $pageName = '') {
+ $_POST = $formValues;
$form = new $class();
$_SERVER['REQUEST_METHOD'] = 'GET';
- $form->controller = new CRM_Core_Controller();
+ switch ($class) {
+ case 'CRM_Event_Cart_Form_Checkout_Payment':
+ case 'CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices':
+ $form->controller = new CRM_Event_Cart_Controller_Checkout();
+ break;
+
+ default:
+ $form->controller = new CRM_Core_Controller();
+ }
+ if (!$pageName) {
+ $formParts = explode('_', $class);
+ $pageName = array_pop($formParts);
+ }
$form->controller->setStateMachine(new CRM_Core_StateMachine($form->controller));
$_SESSION['_' . $form->controller->_name . '_container']['values'][$pageName] = $formValues;
return $form;
<class>EntityBatch</class>
<name>civicrm_entity_batch</name>
<comment>Batch entities (Contributions, Participants, Contacts) to a batch.</comment>
+ <add>3.3</add>
<field>
<name>id</name>
<title>EntityBatch ID</title>
</pseudoconstant>
<html>
<type>Select</type>
+ <label>Contribution Page</label>
</html>
<add>1.5</add>
</field>
<name>payment_processor</name>
<type>varchar</type>
<length>128</length>
+ <serialize>SEPARATOR_TRIMMED</serialize>
<comment>Payment Processors configured for this contribution Page</comment>
<pseudoconstant>
<table>civicrm_payment_processor</table>
<class>Discount</class>
<name>civicrm_discount</name>
<comment>Stores discounts for events on the basis of date</comment>
+ <add>2.1</add>
<log>true</log>
<field>
<name>id</name>
<class>EntityFile</class>
<name>civicrm_entity_file</name>
<comment>Attaches (joins) uploaded files (images, documents, etc.) to entities (Contacts, Groups, Actions).</comment>
+ <add>1.5</add>
<log>true</log>
<field>
<name>id</name>
<class>EntityTag</class>
<name>civicrm_entity_tag</name>
<comment>Tag entities (Contacts, Groups, Actions) to categories.</comment>
+ <add>1.1</add>
<log>true</log>
<field>
<name>id</name>
</field>
<field>
<name>phone_type_id</name>
- <title>Phone Type</title>
+ <title>Phone Type ID</title>
<type>int unsigned</type>
<export>true</export>
<comment>Which type of phone does this number belongs.</comment>
<name>payment_processor</name>
<type>varchar</type>
<length>128</length>
+ <serialize>SEPARATOR_TRIMMED</serialize>
<comment>Payment Processors configured for this Event (if is_monetary is true)</comment>
<pseudoconstant>
<table>civicrm_payment_processor</table>
* {$generated}
* (GenCodeChecksum:{$genCodeChecksum})
*/
-
+{$useHelper}
/**
* Database access object for the {$table.entity} entity.
*/
class {$table.className} extends CRM_Core_DAO {ldelim}
+ const EXT = {$ext};
+ const TABLE_ADDED = '{$table.add}';
+
/**
* Static instance to hold the table name.
*
* Returns localized title of this entity.
*/
public static function getEntityTitle() {ldelim}
- return ts('{$table.title}');
+ return {$tsFunctionName}('{$table.title}');
{rdelim}
<?xml version="1.0" encoding="iso-8859-1" ?>
<version>
- <version_no>5.29.beta1</version_no>
+ <version_no>5.30.alpha1</version_no>
</version>