Merge pull request #19061 from christianwach/lab-core-2217
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 4 Dec 2020 20:40:44 +0000 (09:40 +1300)
committerGitHub <noreply@github.com>
Fri, 4 Dec 2020 20:40:44 +0000 (09:40 +1300)
Prevent "add_action" from being called multiple times

364 files changed:
CRM/ACL/DAO/ACL.php
CRM/ACL/DAO/ACLCache.php
CRM/ACL/DAO/EntityRole.php
CRM/Activity/DAO/Activity.php
CRM/Activity/DAO/ActivityContact.php
CRM/Activity/Tokens.php
CRM/Admin/Form/PaymentProcessor.php
CRM/Admin/Form/Setting/Localization.php
CRM/Admin/Page/Extensions.php
CRM/Admin/Page/MessageTemplates.php
CRM/Batch/BAO/Batch.php
CRM/Batch/DAO/Batch.php
CRM/Batch/DAO/EntityBatch.php
CRM/Campaign/BAO/Campaign.php
CRM/Campaign/DAO/Campaign.php
CRM/Campaign/DAO/CampaignGroup.php
CRM/Campaign/DAO/Survey.php
CRM/Campaign/Page/DashBoard.php
CRM/Case/BAO/Case.php
CRM/Case/DAO/Case.php
CRM/Case/DAO/CaseActivity.php
CRM/Case/DAO/CaseContact.php
CRM/Case/DAO/CaseType.php
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Group.php
CRM/Contact/BAO/Query.php
CRM/Contact/BAO/Relationship.php
CRM/Contact/DAO/ACLContactCache.php
CRM/Contact/DAO/Contact.php
CRM/Contact/DAO/ContactType.php
CRM/Contact/DAO/DashboardContact.php
CRM/Contact/DAO/Group.php
CRM/Contact/DAO/GroupContact.php
CRM/Contact/DAO/GroupContactCache.php
CRM/Contact/DAO/GroupNesting.php
CRM/Contact/DAO/GroupOrganization.php
CRM/Contact/DAO/Relationship.php
CRM/Contact/DAO/RelationshipCache.php
CRM/Contact/DAO/RelationshipType.php
CRM/Contact/DAO/SavedSearch.php
CRM/Contact/DAO/SubscriptionHistory.php
CRM/Contact/Import/Parser/Contact.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/DAO/Contribution.php
CRM/Contribute/DAO/ContributionPage.php
CRM/Contribute/DAO/ContributionProduct.php
CRM/Contribute/DAO/ContributionRecur.php
CRM/Contribute/DAO/ContributionSoft.php
CRM/Contribute/DAO/Premium.php
CRM/Contribute/DAO/PremiumsProduct.php
CRM/Contribute/DAO/Product.php
CRM/Contribute/DAO/Widget.php
CRM/Contribute/Form/Contribution.php
CRM/Contribute/Form/ManagePremiums.php
CRM/Core/BAO/Country.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/SchemaHandler.php
CRM/Core/BAO/UFGroup.php
CRM/Core/CodeGen/Specification.php
CRM/Core/Config/MagicMerge.php
CRM/Core/DAO.php
CRM/Core/DAO/ActionLog.php
CRM/Core/DAO/ActionMapping.php
CRM/Core/DAO/ActionSchedule.php
CRM/Core/DAO/Address.php
CRM/Core/DAO/AddressFormat.php
CRM/Core/DAO/Cache.php
CRM/Core/DAO/Component.php
CRM/Core/DAO/Country.php
CRM/Core/DAO/County.php
CRM/Core/DAO/CustomField.php
CRM/Core/DAO/CustomGroup.php
CRM/Core/DAO/Dashboard.php
CRM/Core/DAO/Discount.php
CRM/Core/DAO/Domain.php
CRM/Core/DAO/Email.php
CRM/Core/DAO/EntityFile.php
CRM/Core/DAO/EntityTag.php
CRM/Core/DAO/Extension.php
CRM/Core/DAO/File.php
CRM/Core/DAO/IM.php
CRM/Core/DAO/Job.php
CRM/Core/DAO/JobLog.php
CRM/Core/DAO/LocBlock.php
CRM/Core/DAO/LocationType.php
CRM/Core/DAO/Log.php
CRM/Core/DAO/MailSettings.php
CRM/Core/DAO/Managed.php
CRM/Core/DAO/Mapping.php
CRM/Core/DAO/MappingField.php
CRM/Core/DAO/Menu.php
CRM/Core/DAO/MessageTemplate.php
CRM/Core/DAO/Navigation.php
CRM/Core/DAO/Note.php
CRM/Core/DAO/OpenID.php
CRM/Core/DAO/OptionGroup.php
CRM/Core/DAO/OptionValue.php
CRM/Core/DAO/Phone.php
CRM/Core/DAO/PreferencesDate.php
CRM/Core/DAO/PrevNextCache.php
CRM/Core/DAO/PrintLabel.php
CRM/Core/DAO/RecurringEntity.php
CRM/Core/DAO/Setting.php
CRM/Core/DAO/StateProvince.php
CRM/Core/DAO/StatusPreference.php
CRM/Core/DAO/SystemLog.php
CRM/Core/DAO/Tag.php
CRM/Core/DAO/Timezone.php
CRM/Core/DAO/UFField.php
CRM/Core/DAO/UFGroup.php
CRM/Core/DAO/UFJoin.php
CRM/Core/DAO/UFMatch.php
CRM/Core/DAO/Website.php
CRM/Core/DAO/WordReplacement.php
CRM/Core/DAO/Worldregion.php
CRM/Core/Form.php
CRM/Core/PseudoConstant.php
CRM/Core/TokenTrait.php
CRM/Cxn/DAO/Cxn.php
CRM/Dedupe/DAO/Exception.php
CRM/Dedupe/DAO/Rule.php
CRM/Dedupe/DAO/RuleGroup.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/Participant.php
CRM/Event/Cart/DAO/Cart.php
CRM/Event/Cart/DAO/EventInCart.php
CRM/Event/DAO/Event.php
CRM/Event/DAO/Participant.php
CRM/Event/DAO/ParticipantPayment.php
CRM/Event/DAO/ParticipantStatusType.php
CRM/Extension/Mapper.php
CRM/Financial/DAO/Currency.php
CRM/Financial/DAO/EntityFinancialAccount.php
CRM/Financial/DAO/EntityFinancialTrxn.php
CRM/Financial/DAO/FinancialAccount.php
CRM/Financial/DAO/FinancialItem.php
CRM/Financial/DAO/FinancialTrxn.php
CRM/Financial/DAO/FinancialType.php
CRM/Financial/DAO/PaymentProcessor.php
CRM/Financial/DAO/PaymentProcessorType.php
CRM/Financial/DAO/PaymentToken.php
CRM/Financial/Form/PaymentEdit.php
CRM/Friend/DAO/Friend.php
CRM/Grant/BAO/Grant.php
CRM/Grant/DAO/Grant.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingAB.php
CRM/Mailing/BAO/MailingJob.php
CRM/Mailing/DAO/BouncePattern.php
CRM/Mailing/DAO/BounceType.php
CRM/Mailing/DAO/Mailing.php
CRM/Mailing/DAO/MailingAB.php
CRM/Mailing/DAO/MailingComponent.php
CRM/Mailing/DAO/MailingGroup.php
CRM/Mailing/DAO/MailingJob.php
CRM/Mailing/DAO/Recipients.php
CRM/Mailing/DAO/Spool.php
CRM/Mailing/DAO/TrackableURL.php
CRM/Mailing/Event/DAO/Bounce.php
CRM/Mailing/Event/DAO/Confirm.php
CRM/Mailing/Event/DAO/Delivered.php
CRM/Mailing/Event/DAO/Forward.php
CRM/Mailing/Event/DAO/Opened.php
CRM/Mailing/Event/DAO/Queue.php
CRM/Mailing/Event/DAO/Reply.php
CRM/Mailing/Event/DAO/Subscribe.php
CRM/Mailing/Event/DAO/TrackableURLOpen.php
CRM/Mailing/Event/DAO/Unsubscribe.php
CRM/Member/DAO/Membership.php
CRM/Member/DAO/MembershipBlock.php
CRM/Member/DAO/MembershipLog.php
CRM/Member/DAO/MembershipPayment.php
CRM/Member/DAO/MembershipStatus.php
CRM/Member/DAO/MembershipType.php
CRM/PCP/BAO/PCP.php
CRM/PCP/DAO/PCP.php
CRM/PCP/DAO/PCPBlock.php
CRM/Pledge/BAO/Pledge.php
CRM/Pledge/BAO/PledgeBlock.php
CRM/Pledge/DAO/Pledge.php
CRM/Pledge/DAO/PledgeBlock.php
CRM/Pledge/DAO/PledgePayment.php
CRM/Price/DAO/LineItem.php
CRM/Price/DAO/PriceField.php
CRM/Price/DAO/PriceFieldValue.php
CRM/Price/DAO/PriceSet.php
CRM/Price/DAO/PriceSetEntity.php
CRM/Queue/DAO/QueueItem.php
CRM/Report/DAO/ReportInstance.php
CRM/SMS/DAO/Provider.php
CRM/UF/Form/Group.php
CRM/Upgrade/Incremental/php/FiveThirtyFour.php [new file with mode: 0644]
CRM/Upgrade/Incremental/sql/5.33.beta1.mysql.tpl [new file with mode: 0644]
CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl [new file with mode: 0644]
CRM/Utils/Check/Component/Env.php
CRM/Utils/Hook.php
CRM/Utils/Monaco.php [new file with mode: 0644]
CRM/Utils/System/Drupal8.php
CRM/Utils/System/WordPress.php
Civi/Angular/Manager.php
Civi/Api4/ACL.php
Civi/Api4/Action/Entity/Get.php
Civi/Api4/ActionSchedule.php
Civi/Api4/ContactType.php
Civi/Api4/ContributionSoft.php [new file with mode: 0644]
Civi/Api4/CustomField.php
Civi/Api4/CustomGroup.php
Civi/Api4/Dashboard.php
Civi/Api4/DashboardContact.php
Civi/Api4/Domain.php
Civi/Api4/Entity.php
Civi/Api4/Generic/AbstractEntity.php
Civi/Api4/Generic/Traits/CustomValueActionTrait.php
Civi/Api4/Generic/Traits/EntityBridge.php
Civi/Api4/Generic/Traits/OptionList.php
Civi/Api4/GroupNesting.php
Civi/Api4/GroupOrganization.php
Civi/Api4/LocBlock.php
Civi/Api4/MailSettings.php
Civi/Api4/Mapping.php
Civi/Api4/MappingField.php
Civi/Api4/MessageTemplate.php
Civi/Api4/Navigation.php
Civi/Api4/OptionGroup.php
Civi/Api4/PaymentProcessor.php
Civi/Api4/Relationship.php
Civi/Api4/Route.php
Civi/Api4/SavedSearch.php
Civi/Api4/Setting.php
Civi/Api4/StatusPreference.php
Civi/Api4/UFField.php
Civi/Api4/UFGroup.php
Civi/Api4/UFJoin.php
Civi/Api4/UFMatch.php
Civi/Api4/Utils/ReflectionUtils.php
Civi/Test/Api3TestTrait.php
ang/crmMailing/EditRecipOptionsDialogCtrl.html
ang/crmMailingAB/BlockMailing.html
ang/crmMailingAB/ListCtrl.html
ang/crmMonaco.ang.php [new file with mode: 0644]
ang/crmMonaco.css [new file with mode: 0644]
ang/crmMonaco.js [moved from ext/afform/html/ang/afMonaco.js with 72% similarity]
composer.json
composer.lock
ext/afform/core/Civi/Api4/Action/Afform/Convert.php [new file with mode: 0644]
ext/afform/core/Civi/Api4/Afform.php
ext/afform/core/Civi/Api4/AfformPalette.php
ext/afform/core/Civi/Api4/AfformTag.php
ext/afform/core/afform.php
ext/afform/gui/ang/afGuiEditor.ang.php
ext/afform/gui/ang/afGuiEditor.css
ext/afform/gui/ang/afGuiEditor.js
ext/afform/gui/ang/afGuiEditor/canvas.html
ext/afform/gui/ang/afGuiEditor/config-form.html
ext/afform/html/afform_html.php
ext/afform/html/ang/afHtmlAdmin.aff.html
ext/afform/html/ang/afHtmlEditor.aff.html
ext/afform/html/ang/afMonaco.ang.php [deleted file]
ext/afform/html/ang/afMonaco.css [deleted file]
ext/afform/mock/tests/phpunit/api/v4/AfformTest.php
ext/contributioncancelactions/contributioncancelactions.php
ext/contributioncancelactions/tests/phpunit/CancelTest.php
ext/search/Civi/Api4/SearchDisplay.php
ext/search/Civi/Search/Admin.php
js/Common.js
release-notes/5.32.0.md
settings/Localization.setting.php
sql/civicrm_generated.mysql
sql/test_data_second_domain.mysql
templates/CRM/Admin/Form/Setting/Localization.hlp
templates/CRM/Admin/Form/Setting/Localization.tpl
templates/CRM/Admin/Page/Extensions/Main.tpl
templates/CRM/Admin/Page/MessageTemplates.tpl
templates/CRM/common/TabHeader.js
templates/CRM/common/TabHeader.tpl
templates/CRM/common/TabSelected.tpl
tests/phpunit/CRM/Contact/BAO/QueryTest.php
tests/phpunit/CRM/Contact/Form/Search/CriteriaTest.php
tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php
tests/phpunit/CRM/Contact/SelectorTest.php
tests/phpunit/CRM/Contribute/Form/ContributionTest.php
tests/phpunit/CRM/Core/BAO/AddressTest.php
tests/phpunit/CRM/Core/BAO/SchemaHandlerTest.php
tests/phpunit/CRM/Member/Form/MembershipTest.php
tests/phpunit/CRMTraits/Financial/OrderTrait.php
tests/phpunit/api/v3/ContactTest.php
tests/phpunit/api/v3/MembershipTest.php
tests/phpunit/api/v4/Action/ContactGetTest.php
tests/phpunit/api/v4/Action/CustomFieldAlterTest.php
tests/phpunit/api/v4/DataSets/ConformanceTest.json
tests/phpunit/api/v4/Entity/ConformanceTest.php
tests/phpunit/api/v4/Entity/EntityTest.php
xml/schema/Campaign/Campaign.xml
xml/schema/Campaign/CampaignGroup.xml
xml/schema/Campaign/Survey.xml
xml/schema/Case/Case.xml
xml/schema/Case/CaseActivity.xml
xml/schema/Case/CaseContact.xml
xml/schema/Case/CaseType.xml
xml/schema/Contribute/Contribution.xml
xml/schema/Contribute/ContributionPage.xml
xml/schema/Contribute/ContributionProduct.xml
xml/schema/Contribute/ContributionRecur.xml
xml/schema/Contribute/ContributionSoft.xml
xml/schema/Contribute/Premium.xml
xml/schema/Contribute/PremiumsProduct.xml
xml/schema/Contribute/Product.xml
xml/schema/Contribute/Widget.xml
xml/schema/Event/Cart/Cart.xml
xml/schema/Event/Cart/EventInCart.xml
xml/schema/Event/Event.xml
xml/schema/Event/Participant.xml
xml/schema/Event/ParticipantPayment.xml
xml/schema/Event/ParticipantStatusType.xml
xml/schema/Financial/Currency.xml
xml/schema/Financial/EntityFinancialAccount.xml
xml/schema/Financial/EntityFinancialTrxn.xml
xml/schema/Financial/FinancialAccount.xml
xml/schema/Financial/FinancialItem.xml
xml/schema/Financial/FinancialTrxn.xml
xml/schema/Financial/FinancialType.xml
xml/schema/Financial/PaymentProcessor.xml
xml/schema/Financial/PaymentProcessorType.xml
xml/schema/Financial/PaymentToken.xml
xml/schema/Grant/Grant.xml
xml/schema/Mailing/BouncePattern.xml
xml/schema/Mailing/BounceType.xml
xml/schema/Mailing/Component.xml
xml/schema/Mailing/Event/Bounce.xml
xml/schema/Mailing/Event/Confirm.xml
xml/schema/Mailing/Event/Delivered.xml
xml/schema/Mailing/Event/Forward.xml
xml/schema/Mailing/Event/Opened.xml
xml/schema/Mailing/Event/Queue.xml
xml/schema/Mailing/Event/Reply.xml
xml/schema/Mailing/Event/Subscribe.xml
xml/schema/Mailing/Event/TrackableURLOpen.xml
xml/schema/Mailing/Event/Unsubscribe.xml
xml/schema/Mailing/Mailing.xml
xml/schema/Mailing/MailingAB.xml
xml/schema/Mailing/MailingGroup.xml
xml/schema/Mailing/MailingJob.xml
xml/schema/Mailing/Recipients.xml
xml/schema/Mailing/Spool.xml
xml/schema/Mailing/TrackableURL.xml
xml/schema/Member/Membership.xml
xml/schema/Member/MembershipBlock.xml
xml/schema/Member/MembershipLog.xml
xml/schema/Member/MembershipPayment.xml
xml/schema/Member/MembershipStatus.xml
xml/schema/Member/MembershipType.xml
xml/schema/PCP/PCP.xml
xml/schema/PCP/PCPBlock.xml
xml/schema/Pledge/Pledge.xml
xml/schema/Pledge/PledgeBlock.xml
xml/schema/Pledge/PledgePayment.xml
xml/schema/Price/LineItem.xml
xml/schema/Price/PriceField.xml
xml/schema/Price/PriceFieldValue.xml
xml/schema/Price/PriceSet.xml
xml/schema/Price/PriceSetEntity.xml
xml/schema/Report/ReportInstance.xml
xml/templates/dao.tpl
xml/version.xml

index f44367cb27eb58bc67adff96828b42be15061fc9..a63ba76a049e85f751102ee6e4a8edc5473187bd 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/ACL/ACL.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fa7ab50bdcacf98f9b1b043f912fed47)
+ * (GenCodeChecksum:b4b1db29de0700887b7875f82d079c10)
  */
 
 /**
index c37c2aee5a9e922a43db24ada793a71a3f9e695d..ae394a532b17c9dc30d9f75de032c85e974a9b86 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/ACL/ACLCache.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4776199edbbb83ae58a37f1b056bf86a)
+ * (GenCodeChecksum:9676dd799030fb9b56b490595dd3a847)
  */
 
 /**
index 7c83da2983b931b58122da8153b57a3a35de0241..043e1f673f1d180ac37b980fdb4c27a261432a4b 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/ACL/EntityRole.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:53e459e0bbdca49556b59c10aee21862)
+ * (GenCodeChecksum:ec91adfcc1d76814541811d4b97e45b2)
  */
 
 /**
index c83a5c304f3ba70b27fb9f071e683d8112969848..7a11bf5990a28ae2234cb44a9a8f37c7b47f60ee 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Activity/Activity.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4291bcd82f8d55861172be9d2a8243de)
+ * (GenCodeChecksum:cabeb52f5da37045929bb3e0b7748992)
  */
 
 /**
index ae14f3a5473cd1eaee6a0fb3e94b16bd2a89cbf6..7f1bfd317fba6da885a299f006d4664338d852d1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Activity/ActivityContact.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4b08cccd27b433486baf2b9eea79f97e)
+ * (GenCodeChecksum:3f147b2507b1e11a7df971be191161d1)
  */
 
 /**
index 250f88a38dcdaae418f169cd54d15fdabfa33742..93dad6fc11de66be784cf2bd707009b2eb66d037 100644 (file)
@@ -56,7 +56,8 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {
 
   /**
    * Mapping from tokenName to api return field
-   * Use lists since we might need multiple fields
+   * Using arrays allows more complex tokens to be handled that require more than one API field.
+   * For example, an address token might want ['street_address', 'city', 'postal_code']
    *
    * @var array
    */
@@ -132,37 +133,37 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {
     // Get ActivityID either from actionSearchResult (for scheduled reminders) if exists
     $activityId = $row->context['actionSearchResult']->entityID ?? $row->context[$this->getEntityContextSchema()];
 
-    $activity = (object) $prefetch['activity'][$activityId];
+    $activity = $prefetch['activity'][$activityId];
 
     if (in_array($field, ['activity_date_time', 'created_date', 'modified_date'])) {
-      $row->tokens($entity, $field, \CRM_Utils_Date::customFormat($activity->$field));
+      $row->tokens($entity, $field, \CRM_Utils_Date::customFormat($activity[$field]));
     }
-    elseif (isset($mapping[$field]) and (isset($activity->{$mapping[$field]}))) {
-      $row->tokens($entity, $field, $activity->{$mapping[$field]});
+    elseif (isset($mapping[$field]) and (isset($activity[$mapping[$field]]))) {
+      $row->tokens($entity, $field, $activity[$mapping[$field]]);
     }
     elseif (in_array($field, ['activity_type'])) {
-      $row->tokens($entity, $field, $this->activityTypes[$activity->activity_type_id]);
+      $row->tokens($entity, $field, $this->activityTypes[$activity['activity_type_id']]);
     }
     elseif (in_array($field, ['status'])) {
-      $row->tokens($entity, $field, $this->activityStatuses[$activity->status_id]);
+      $row->tokens($entity, $field, $this->activityStatuses[$activity['status_id']]);
     }
     elseif (in_array($field, ['campaign'])) {
-      $row->tokens($entity, $field, $this->campaigns[$activity->campaign_id]);
+      $row->tokens($entity, $field, $this->campaigns[$activity['campaign_id']]);
     }
     elseif (in_array($field, ['case_id'])) {
       // An activity can be linked to multiple cases so case_id is always an array.
       // We just return the first case ID for the token.
-      $row->tokens($entity, $field, is_array($activity->case_id) ? reset($activity->case_id) : $activity->case_id);
+      $row->tokens($entity, $field, is_array($activity['case_id']) ? reset($activity['case_id']) : $activity['case_id']);
     }
     elseif (array_key_exists($field, $this->customFieldTokens)) {
       $row->tokens($entity, $field,
-        isset($activity->$field)
-          ? \CRM_Core_BAO_CustomField::displayValue($activity->$field, $field)
+        isset($activity[$field])
+          ? \CRM_Core_BAO_CustomField::displayValue($activity[$field], $field)
           : ''
       );
     }
-    elseif (isset($activity->$field)) {
-      $row->tokens($entity, $field, $activity->$field);
+    elseif (isset($activity[$field])) {
+      $row->tokens($entity, $field, $activity[$field]);
     }
   }
 
index f72e2a91acedd19091c18ce9a55ed2eea4bce964..ecbc31c6773da1bc1d20fb09e140113d3e861c2b 100644 (file)
@@ -100,34 +100,18 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
     $this->deleteMessage = ts('Deleting this Payment Processor may result in some transaction pages being rendered inactive.') . ' ' . ts('Do you want to continue?');
   }
 
+  /**
+   * Preprocess the form.
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function preProcess() {
     parent::preProcess();
 
-    if ($this->_id) {
-      $this->_paymentProcessorType = CRM_Utils_Request::retrieve('pp', 'String', $this, FALSE, NULL);
-      if (!$this->_paymentProcessorType) {
-        $this->_paymentProcessorType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor',
-          $this->_id,
-          'payment_processor_type_id'
-        );
-      }
-      $this->set('pp', $this->_paymentProcessorType);
-    }
-    else {
-      $this->_paymentProcessorType = CRM_Utils_Request::retrieve('pp', 'String', $this, TRUE, NULL);
-    }
-
+    $this->setPaymentProcessorTypeID();
+    $this->setPaymentProcessor();
     $this->assign('ppType', $this->_paymentProcessorType);
-    $ppTypeName = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType',
-      $this->_paymentProcessorType,
-      'name'
-    );
-    $this->assign('ppTypeName', $ppTypeName);
-
-    $this->_paymentProcessorDAO = new CRM_Financial_DAO_PaymentProcessorType();
-    $this->_paymentProcessorDAO->id = $this->_paymentProcessorType;
-
-    $this->_paymentProcessorDAO->find(TRUE);
+    $this->assign('ppTypeName', $this->_paymentProcessorDAO->name);
 
     if ($this->_id) {
       $refreshURL = CRM_Utils_System::url('civicrm/admin/paymentProcessor',
@@ -317,7 +301,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
    *
    * @return bool
    */
-  public static function checkSection(&$fields, &$errors, $section = NULL) {
+  public static function checkSection(&$fields, &$errors, $section = NULL): bool {
     $names = ['user_name'];
 
     $present = FALSE;
@@ -507,4 +491,43 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
     civicrm_api3('PaymentProcessor', 'create', $params);
   }
 
+  /**
+   * Set the payment processor type id as a form property
+   *
+   * @throws \CRM_Core_Exception
+   */
+  protected function setPaymentProcessorTypeID(): void {
+    if ($this->_id) {
+      $this->_paymentProcessorType = CRM_Utils_Request::retrieve('pp', 'String', $this, FALSE, NULL);
+      if (!$this->_paymentProcessorType) {
+        $this->_paymentProcessorType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor',
+          $this->_id,
+          'payment_processor_type_id'
+        );
+      }
+      $this->set('pp', $this->_paymentProcessorType);
+    }
+    else {
+      $this->_paymentProcessorType = CRM_Utils_Request::retrieve('pp', 'String', $this, TRUE, NULL);
+    }
+  }
+
+  /**
+   * Get the relevant payment processor type id.
+   *
+   * @return int
+   */
+  protected function getPaymentProcessorTypeID(): int {
+    return (int) $this->_paymentProcessorType;
+  }
+
+  /**
+   * Set the payment processor as a form property.
+   */
+  protected function setPaymentProcessor(): void {
+    $this->_paymentProcessorDAO = new CRM_Financial_DAO_PaymentProcessorType();
+    $this->_paymentProcessorDAO->id = $this->getPaymentProcessorTypeID();
+    $this->_paymentProcessorDAO->find(TRUE);
+  }
+
 }
index d33ebb369df1096f9e78358b8119c1438f0b516b..9dc3ae7c5031465e74f0ff58fba187c0e6b63215 100644 (file)
@@ -25,6 +25,7 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
     'countryLimit' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'customTranslateFunction' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'defaultContactCountry' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
+    'pinnedContactCountries' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'defaultContactStateProvince' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'defaultCurrency' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'fieldSeparator' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
index ba0b5a9ec8900fb237aa395bf65aa9601a208e79..46d16e938f092ee22d479631642eee85c3f0b9d8 100644 (file)
@@ -234,6 +234,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
     // build list of available downloads
     $remoteExtensionRows = [];
     $compat = CRM_Extension_System::getCompatibilityInfo();
+    $mapper = CRM_Extension_System::singleton()->getMapper();
 
     foreach ($remoteExtensions as $info) {
       if (!empty($compat[$info->key]['obsolete'])) {
@@ -257,7 +258,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
       if (isset($localExtensionRows[$info->key])) {
         if (array_key_exists('version', $localExtensionRows[$info->key])) {
           if (version_compare($localExtensionRows[$info->key]['version'], $info->version, '<')) {
-            $row['is_upgradeable'] = TRUE;
+            $row['upgradelink'] = $mapper->getUpgradeLink($remoteExtensions[$info->key], $localExtensionRows[$info->key]);
           }
         }
       }
index 3363ac410fbcee74d488d90325dfa06622d78840..36d52d56b43ed1e9b6ab7ee54b2d27f8955f9932 100644 (file)
@@ -274,6 +274,11 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
     $this->assign('canEditSystemTemplates', CRM_Core_Permission::check('edit system workflow message templates'));
     $this->assign('canEditMessageTemplates', CRM_Core_Permission::check('edit message templates'));
     $this->assign('canEditUserDrivenMessageTemplates', CRM_Core_Permission::check('edit user-driven message templates'));
+    Civi::resources()
+      ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
+      ->addSetting([
+        'tabSettings' => ['active' => $_GET['selectedChild'] ?? NULL],
+      ]);
   }
 
 }
index 3bb93f140b70980255282f987bf5c2a0d85476ec..e9fea4c3fba1ae3ab68e73a2e16504ec58304905 100644 (file)
@@ -119,7 +119,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
    */
   public static function deleteBatch($batchId) {
     // delete entry from batch table
-    CRM_Utils_Hook::pre('delete', 'Batch', $batchId, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Batch', $batchId);
     $batch = new CRM_Batch_DAO_Batch();
     $batch->id = $batchId;
     $batch->delete();
index 31bac04ea02a32cbbcd0f0594e4add75bee25eee..4b4925ef6d3223f55f8e3117ba6b322da404d5a0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Batch/Batch.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f37d12b3bc0d6b5efc4768f210a45a3c)
+ * (GenCodeChecksum:717006044703500afc7d4f45f63194df)
  */
 
 /**
index 3e5ea2b5d580f2f774d56b9238f9a8b55a193c6a..e496cad7cd4d9bd5199db35f9e2cd77d72ac207c 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Batch/EntityBatch.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:bbeab14232892d3ec8069ef3a499efdd)
+ * (GenCodeChecksum:61cb70a15ffc587cc8476204cb16353f)
  */
 
 /**
index 7800cf925d466a00d0bcf6811ffda6545d82a2c6..1aa324805ec5e5765a2d380c05f0b14018a72c82 100644 (file)
@@ -84,7 +84,7 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
       return FALSE;
     }
 
-    CRM_Utils_Hook::pre('delete', 'Campaign', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Campaign', $id);
 
     $dao = new CRM_Campaign_DAO_Campaign();
     $dao->id = $id;
index 6dbafa422aa37b69d6327168f298706054b6c0ed..caa08bdaf1bc438f5fd1f50bbcfd496b55af68e7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Campaign/Campaign.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8bafee489dc4969a456393ed48544880)
+ * (GenCodeChecksum:c86618236efd91af786b98c3f359e321)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.3';
+  const COMPONENT = 'CiviCampaign';
 
   /**
    * Static instance to hold the table name.
index f63ad69ecc2b425bdf0279246f20f81ab3ade5d9..a04ca5e611b94f6945b8fc6dbf4fc748220bc91d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:210636d218ebf8e84f862c48bbe9edf9)
+ * (GenCodeChecksum:9e8df6e6e1df93fb351b51bcda21c176)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.3';
+  const COMPONENT = 'CiviCampaign';
 
   /**
    * Static instance to hold the table name.
index 0a301910303048d75e596c1c9ed640f753a8965b..479411f1bec1579d3ee7447e495541af90936dda 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Campaign/Survey.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6f3dd03a11c679278374affba3d2bd76)
+ * (GenCodeChecksum:b324203328e0c8d3dc10a4346a4db6f3)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Campaign_DAO_Survey extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.2';
+  const COMPONENT = 'CiviCampaign';
 
   /**
    * Static instance to hold the table name.
index dfd6f3126cd7bcbd8b30cef56ad646260d5ddb11..c0908cccf59f71ee857aa9bfb5cbb0bc44e89e49 100644 (file)
@@ -29,6 +29,8 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
   private static $_surveyActionLinks;
   private static $_petitionActionLinks;
 
+  public $_tabs;
+
   /**
    * Get the action links for this page.
    *
@@ -439,6 +441,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
     ];
 
     $subPageType = CRM_Utils_Request::retrieve('type', 'String', $this);
+    // Load the data for a specific tab
     if ($subPageType) {
       if (!isset($this->_tabs[$subPageType])) {
         CRM_Utils_System::permissionDenied();
@@ -447,17 +450,10 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
       $this->{'browse' . ucfirst($subPageType)}();
       $this->assign('subPageType', ucfirst($subPageType));
     }
+    // Initialize tabs
     else {
-      //build the tabs.
       $this->buildTabs();
     }
-    CRM_Core_Resources::singleton()
-      ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
-      ->addSetting([
-        'tabSettings' => [
-          'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')),
-        ],
-      ]);
   }
 
   /**
@@ -485,6 +481,13 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
     }
     $allTabs['campaign']['class'] = 'livePage';
     $this->assign('tabHeader', $allTabs);
+    CRM_Core_Resources::singleton()
+      ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
+      ->addSetting([
+        'tabSettings' => [
+          'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')),
+        ],
+      ]);
   }
 
 }
index 96a511e69bc9cdacb2b1021b77e7e5862f34fb12..9d7a008c8982c5584b18031d35f83108729d3cc0 100644 (file)
@@ -187,7 +187,7 @@ WHERE civicrm_case.id = %1";
    *   is successful
    */
   public static function deleteCase($caseId, $moveToTrash = FALSE) {
-    CRM_Utils_Hook::pre('delete', 'Case', $caseId, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Case', $caseId);
 
     //delete activities
     $activities = self::getCaseActivityDates($caseId);
index 4f04b3ab1bef3fce9f664f9e5675a046b2777991..aa52e8d4547a0f8220a942b86e652638aff4a5df 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Case/Case.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:bc33a854daf3f695bd92c4bca41ad5b3)
+ * (GenCodeChecksum:8b354d7c2a0e40d82d27cbfd08776c15)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Case_DAO_Case extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviCase';
 
   /**
    * Static instance to hold the table name.
index 93bc1135f38ab136452d168995d6d7bb91501794..89baec8d6463bd96f787e888abcfcd2702beccc0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Case/CaseActivity.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3f39cbc8d1438b9a0cdee0382638bcae)
+ * (GenCodeChecksum:5fc2509491a88a1bd2d8ce808f99a00e)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Case_DAO_CaseActivity extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviCase';
 
   /**
    * Static instance to hold the table name.
index fa5290d631bb34d396380ffb9f284cc11fcc0a68..24d41dc53e6a1da2aaf2c0bb081e9fb54e9104ec 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Case/CaseContact.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f9da4680a9dc863f5dc6675f5e2fdc0b)
+ * (GenCodeChecksum:8ccb7c478dfa4eb1b3b022eeabc71b79)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Case_DAO_CaseContact extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.1';
+  const COMPONENT = 'CiviCase';
 
   /**
    * Static instance to hold the table name.
index 4050cc6477730833e9ed40c1de91e0c5e3573898..4dc5e69aae40a9f837b67530bc28425f271c77d7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Case/CaseType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b138422db3438224fef3d477a9e1648a)
+ * (GenCodeChecksum:9151b8db1ff873f31d574b5cdec128ac)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '4.5';
+  const COMPONENT = 'CiviCase';
 
   /**
    * Static instance to hold the table name.
index 8d1095747eca8b887c024fdc162699e959c200d4..9eecd8fa74444080e9692d91e03de6ae97d82566 100644 (file)
@@ -3181,6 +3181,11 @@ LEFT JOIN civicrm_email    ON ( civicrm_contact.id = civicrm_email.contact_id )
         }
 
         // finally get menu item for -more- action widget.
+        while (!empty($contextMenu['moreActions'][$values['weight']])) {
+          // Quick & dirty way of handling 2 items with the same weight
+          // without clobbering one.
+          $values['weight']++;
+        }
         $contextMenu['moreActions'][$values['weight']] = [
           'title' => $values['title'],
           'ref' => $values['ref'],
@@ -3198,6 +3203,11 @@ LEFT JOIN civicrm_email    ON ( civicrm_contact.id = civicrm_email.contact_id )
           }
 
           // finally get menu item for -more- action widget.
+          while (!empty($contextMenu['otherActions'][$value['weight']])) {
+            // Quick & dirty way of handling 2 items with the same weight
+            // without clobbering one.
+            $value['weight']++;
+          }
           $contextMenu['otherActions'][$value['weight']] = [
             'title' => $value['title'],
             'ref' => $value['ref'],
@@ -3473,9 +3483,9 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id )
     $obj = new $daoName();
     $obj->id = $id;
     $obj->find();
-    $hookParams = [];
+
     if ($obj->fetch()) {
-      CRM_Utils_Hook::pre('delete', $type, $id, $hookParams);
+      CRM_Utils_Hook::pre('delete', $type, $id);
       $contactId = $obj->contact_id;
       $obj->delete();
     }
index 5861b057571d81d39075582ba5361543015b1c79..138fd9e2d3eddf1b682151b3cca386006d9e9980 100644 (file)
@@ -55,7 +55,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
     if (!$id || !is_numeric($id)) {
       throw new CRM_Core_Exception('Invalid group request attempted');
     }
-    CRM_Utils_Hook::pre('delete', 'Group', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Group', $id);
 
     $transaction = new CRM_Core_Transaction();
 
index ff2b028c0a819ecf4b0df52e0ff0dfa731393da2..f34429084e0a98466f3aeaecf943cd2dbfa64ecf 100644 (file)
@@ -5054,15 +5054,10 @@ civicrm_relationship.start_date > {$today}
 
       if (CRM_Core_Permission::check('access deleted contacts')) {
         if (!$onlyDeleted) {
-          $this->_permissionWhereClause = str_replace('( 1 )', '(contact_a.is_deleted = 0)', $this->_permissionWhereClause);
+          $this->_permissionWhereClause .= ' AND (contact_a.is_deleted = 0)';
         }
         else {
-          if ($this->_permissionWhereClause === '( 1 )') {
-            $this->_permissionWhereClause = str_replace('( 1 )', '(contact_a.is_deleted)', $this->_permissionWhereClause);
-          }
-          else {
-            $this->_permissionWhereClause .= " AND (contact_a.is_deleted) ";
-          }
+          $this->_permissionWhereClause .= " AND (contact_a.is_deleted) ";
         }
       }
 
index 85a8f53822f191de1eb30b97dae3f8eaf995e5b1..8df124f1c4f33604af94167b6d1988e3da782695 100644 (file)
@@ -717,7 +717,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    */
   public static function del($id) {
     // delete from relationship table
-    CRM_Utils_Hook::pre('delete', 'Relationship', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Relationship', $id);
 
     $relationship = self::clearCurrentEmployer($id, CRM_Core_Action::DELETE);
     $relationship->delete();
index f11ef7f27b4acdb4c8e84e3178ec04a0ab68d17e..ce7d7b95767129515bff2c68c5263ef5d3b63cc6 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/ACLContactCache.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0d21895a5f58ee81f21ae524c86a165c)
+ * (GenCodeChecksum:26fea9c61af7afdc2f3401213e0eab2b)
  */
 
 /**
index 5567e958134315e2a06abe4754b32e3b5b36c517..b1661fd458e2848aa4a52816bf99644dd181e5b2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/Contact.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:28e3f64d22175c9d2efea3d1c49196fa)
+ * (GenCodeChecksum:c8000203c94da02a4b215ad1a8f7ed89)
  */
 
 /**
index 0677295aa6fbf801d605ce1efda65027410b4be9..85184131fda0ff85682b2808371ef2068e39e1eb 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/ContactType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ee06613c82c85ea8773dcc16105d2b9b)
+ * (GenCodeChecksum:dfe2f3758a8cf1ad9bd23dfb9e2de671)
  */
 
 /**
index 0a59615b440710c9b8ec45c32fcc71595216b766..6cc3cc53410dd732e3e53dc426c8d11a9f467f2b 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/DashboardContact.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a5629fa4472b5745ec13703142a66f3f)
+ * (GenCodeChecksum:d65c9f2feca6cd296a047c2f4e2a862c)
  */
 
 /**
index e7208d7fc1b9c77bfff8797b7742ca96d74db721..b57821d1deb2d727cc540e534ec0ec874798d52a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/Group.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:abbdc0ad43c008e444512d444c537ebf)
+ * (GenCodeChecksum:3648ad60c504d25253ecc5655c629d72)
  */
 
 /**
index 7838dde527e92e54ab8db6db939a9b90746bed1b..5f6dde1bde790cf216a3c878157f2b4390ba4c96 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/GroupContact.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ea7c012e774a203b869e0fadec080cab)
+ * (GenCodeChecksum:5c26ac19a56e589da1399e755469229b)
  */
 
 /**
index 119f4f3b6a048fdaff9e8a255c5fb9d4cc35a188..f8314a24f4f09cd114c42d8e1217de4d9aa5796b 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/GroupContactCache.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:efae8178ae6bc7c26423501ffb2ba751)
+ * (GenCodeChecksum:db2873674d73776ad753a88082ea072a)
  */
 
 /**
index 2364a2536adff0455de8a4be25c2b114b7bb82e0..d61c74bc684fae59baa11dc6147295eb9c92f5e7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/GroupNesting.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:65fe8a838c3cad53df4a76d3f117d99b)
+ * (GenCodeChecksum:0e7931bbaab17bdf66a41f8b912f92f6)
  */
 
 /**
index 5e5499f6a9bb769ae23e8e4e08c256a21f2ee7c2..2461b6cb60e7f4e12d7f355bf699feb2eff3aac2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/GroupOrganization.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d70fc21adc9befb2edc9c26f9fbe4457)
+ * (GenCodeChecksum:a16da367f856704d5432044055ed5d16)
  */
 
 /**
index ee92fd0ce9b4c124012550143aee1ab049e6b4bb..23c77467b2be2a0975ba5f738cbc64e03be76462 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/Relationship.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6bff7ab95b9b2b5faa9d547ce5219b92)
+ * (GenCodeChecksum:2046fac3c61cd88a17bf21dfe3e6f970)
  */
 
 /**
index d6bee088a1312e3fb3bd550a9789a8847a8f21e4..ba2d97d00223b82c07be6ee3dc6051e8580d5730 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/RelationshipCache.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3b42f72f3268d49d99353a8816d9889b)
+ * (GenCodeChecksum:3bee16c8388728d3e391e9dd7c17abb8)
  */
 
 /**
index 5066ff293f5eb68a74b6afe11bed3a743fd1c789..14df1f92ebb4629eaf109c6b0ff8274fb91f560d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/RelationshipType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:376ec7436375e3ccc2ec6687a3d5b526)
+ * (GenCodeChecksum:a3e3c18c34421b3dbcffb17bd313aa17)
  */
 
 /**
index 612922183294a4178be4992420032431edcbc3ae..1f81f53c8b1b1dda15593a21f2f5fe290797b9d3 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/SavedSearch.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:64396e21031229c36c11423bb4b92fc5)
+ * (GenCodeChecksum:73251f9c4af0127e2e9fc2770f21869d)
  */
 
 /**
index 2feece30bca49bc8b28788d2a56e166629e2f188..a8e7de48a6a60bdac61c34a1f4877e4b37f2055e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/SubscriptionHistory.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2fc83b2d730e10fe0508fa088b241365)
+ * (GenCodeChecksum:3557b2bfd9b5364ea356c17a7237fd5e)
  */
 
 /**
index dc3441baaad2db15fee01500f758879af0c9b718..ce8338ac892b5d3d04a920d4b97c697b0f97e42a 100644 (file)
@@ -739,7 +739,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
 
         //relationship contact insert
         foreach ($params as $key => $field) {
-          list($id, $first, $second) = CRM_Utils_System::explode('_', $key, 3);
+          [$id, $first, $second] = CRM_Utils_System::explode('_', $key, 3);
           if (!($first == 'a' && $second == 'b') && !($first == 'b' && $second == 'a')) {
             continue;
           }
@@ -972,100 +972,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
       $code = NULL;
 
       if (($code = CRM_Utils_Array::value('code', $newContact['error_message'])) && ($code == CRM_Core_Error::DUPLICATE_CONTACT)) {
-        $urls = [];
-        // need to fix at some stage and decide if the error will return an
-        // array or string, crude hack for now
-        if (is_array($newContact['error_message']['params'][0])) {
-          $cids = $newContact['error_message']['params'][0];
-        }
-        else {
-          $cids = explode(',', $newContact['error_message']['params'][0]);
-        }
-
-        foreach ($cids as $cid) {
-          $urls[] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $cid, TRUE);
-        }
-
-        $url_string = implode("\n", $urls);
-
-        // If we duplicate more than one record, skip no matter what
-        if (count($cids) > 1) {
-          $errorMessage = ts('Record duplicates multiple contacts');
-          $importRecordParams = [
-            $statusFieldName => 'ERROR',
-            "${statusFieldName}Msg" => $errorMessage,
-          ];
-
-          //combine error msg to avoid mismatch between error file columns.
-          $errorMessage .= "\n" . $url_string;
-          array_unshift($values, $errorMessage);
-          $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
-          return CRM_Import_Parser::ERROR;
-        }
-
-        // Params only had one id, so shift it out
-        $contactId = array_shift($cids);
-        $cid = NULL;
-
-        $vals = ['contact_id' => $contactId];
-
-        if ($onDuplicate == CRM_Import_Parser::DUPLICATE_REPLACE) {
-          civicrm_api('contact', 'delete', $vals);
-          $cid = CRM_Contact_BAO_Contact::createProfileContact($formatted, $contactFields, $contactId, NULL, NULL, $formatted['contact_type']);
-        }
-        elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) {
-          $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId);
-        }
-        elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) {
-          $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId);
-        }
-        // else skip does nothing and just returns an error code.
-        if ($cid) {
-          $contact = [
-            'contact_id' => $cid,
-          ];
-          $defaults = [];
-          $newContact = CRM_Contact_BAO_Contact::retrieve($contact, $defaults);
-        }
-
-        if (civicrm_error($newContact)) {
-          if (empty($newContact['error_message']['params'])) {
-            // different kind of error other than DUPLICATE
-            $errorMessage = $newContact['error_message'];
-            array_unshift($values, $errorMessage);
-            $importRecordParams = [
-              $statusFieldName => 'ERROR',
-              "${statusFieldName}Msg" => $errorMessage,
-            ];
-            $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
-            return CRM_Import_Parser::ERROR;
-          }
-
-          $contactID = $newContact['error_message']['params'][0];
-          if (is_array($contactID)) {
-            $contactID = array_pop($contactID);
-          }
-          if (!in_array($contactID, $this->_newContacts)) {
-            $this->_newContacts[] = $contactID;
-          }
-        }
-        //CRM-262 No Duplicate Checking
-        if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
-          array_unshift($values, $url_string);
-          $importRecordParams = [
-            $statusFieldName => 'DUPLICATE',
-            "${statusFieldName}Msg" => "Skipping duplicate record",
-          ];
-          $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
-          return CRM_Import_Parser::DUPLICATE;
-        }
-
-        $importRecordParams = [
-          $statusFieldName => 'IMPORTED',
-        ];
-        $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
-        //return warning if street address is not parsed, CRM-5886
-        return $this->processMessage($values, $statusFieldName, CRM_Import_Parser::VALID);
+        return $this->handleDuplicateError($newContact, $statusFieldName, $values, $onDuplicate, $formatted, $contactFields);
       }
       else {
         // Not a dupe, so we had an error
@@ -1680,27 +1587,70 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
     if ((is_null($error)) && (civicrm_error(_civicrm_api3_deprecated_validate_formatted_contact($formatted)))) {
       $error = _civicrm_api3_deprecated_validate_formatted_contact($formatted);
     }
+    if (!is_null($error)) {
+      return $error;
+    }
 
-    $newContact = $error;
+    if ($contactId) {
+      $this->formatParams($formatted, $onDuplicate, (int) $contactId);
+    }
+
+    // Resetting and rebuilding cache could be expensive.
+    CRM_Core_Config::setPermitCacheFlushMode(FALSE);
+
+    // If a user has logged in, or accessed via a checksum
+    // Then deliberately 'blanking' a value in the profile should remove it from their record
+    // @todo this should either be TRUE or FALSE in the context of import - once
+    // we figure out which we can remove all the rest.
+    // Also note the meaning of this parameter is less than it used to
+    // be following block cleanup.
+    $formatted['updateBlankLocInfo'] = TRUE;
+    if ((CRM_Core_Session::singleton()->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0) {
+      $formatted['updateBlankLocInfo'] = FALSE;
+    }
 
-    if (is_null($error)) {
-      if ($contactId) {
-        $this->formatParams($formatted, $onDuplicate, (int) $contactId);
+    list($data, $contactDetails) = CRM_Contact_BAO_Contact::formatProfileContactParams($formatted, $contactFields, $contactId, NULL, $formatted['contact_type']);
+
+    // manage is_opt_out
+    if (array_key_exists('is_opt_out', $contactFields) && array_key_exists('is_opt_out', $formatted)) {
+      $wasOptOut = $contactDetails['is_opt_out'] ?? FALSE;
+      $isOptOut = $formatted['is_opt_out'];
+      $data['is_opt_out'] = $isOptOut;
+      // on change, create new civicrm_subscription_history entry
+      if (($wasOptOut != $isOptOut) && !empty($contactDetails['contact_id'])) {
+        $shParams = [
+          'contact_id' => $contactDetails['contact_id'],
+          'status' => $isOptOut ? 'Removed' : 'Added',
+          'method' => 'Web',
+        ];
+        CRM_Contact_BAO_SubscriptionHistory::create($shParams);
       }
+    }
 
-      // Resetting and rebuilding cache could be expensive.
-      CRM_Core_Config::setPermitCacheFlushMode(FALSE);
-      $cid = CRM_Contact_BAO_Contact::createProfileContact($formatted, $contactFields, $contactId, NULL, NULL, $formatted['contact_type']);
-      CRM_Core_Config::setPermitCacheFlushMode(TRUE);
+    $contact = CRM_Contact_BAO_Contact::create($data);
+    $cid = $contact->id;
 
-      $contact = [
-        'contact_id' => $cid,
-      ];
+    // Process group and tag
+    if (isset($formatted['group'])) {
+      $method = 'Admin';
+      CRM_Contact_BAO_GroupContact::create($formatted['group'], $cid, FALSE, $method);
+    }
 
-      $defaults = [];
-      $newContact = CRM_Contact_BAO_Contact::retrieve($contact, $defaults);
+    if (!empty($fields['tag']) && array_key_exists('tag', $formatted)) {
+      // Convert comma separated form values from select2 v3
+      $tags = is_array($formatted['tag']) ? $formatted['tag'] : array_fill_keys(array_filter(explode(',', $formatted['tag'])), 1);
+      CRM_Core_BAO_EntityTag::create($tags, 'civicrm_contact', $cid);
     }
 
+    CRM_Core_Config::setPermitCacheFlushMode(TRUE);
+
+    $contact = [
+      'contact_id' => $cid,
+    ];
+
+    $defaults = [];
+    $newContact = CRM_Contact_BAO_Contact::retrieve($contact, $defaults);
+
     //get the id of the contact whose street address is not parsable, CRM-5886
     if ($this->_parseStreetAddress && is_object($newContact) && property_exists($newContact, 'address') && $newContact->address) {
       foreach ($newContact->address as $address) {
@@ -2046,4 +1996,115 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
     $this->_relationships = $this->getRelationships();
   }
 
+  /**
+   * @param array $newContact
+   * @param $statusFieldName
+   * @param array $values
+   * @param int $onDuplicate
+   * @param array $formatted
+   * @param array $contactFields
+   *
+   * @return int
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
+   * @throws \Civi\API\Exception\UnauthorizedException
+   */
+  protected function handleDuplicateError(array $newContact, $statusFieldName, array $values, int $onDuplicate, array $formatted, array $contactFields): int {
+    $urls = [];
+    // need to fix at some stage and decide if the error will return an
+    // array or string, crude hack for now
+    if (is_array($newContact['error_message']['params'][0])) {
+      $cids = $newContact['error_message']['params'][0];
+    }
+    else {
+      $cids = explode(',', $newContact['error_message']['params'][0]);
+    }
+
+    foreach ($cids as $cid) {
+      $urls[] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $cid, TRUE);
+    }
+
+    $url_string = implode("\n", $urls);
+
+    // If we duplicate more than one record, skip no matter what
+    if (count($cids) > 1) {
+      $errorMessage = ts('Record duplicates multiple contacts');
+      $importRecordParams = [
+        $statusFieldName => 'ERROR',
+        "${statusFieldName}Msg" => $errorMessage,
+      ];
+
+      //combine error msg to avoid mismatch between error file columns.
+      $errorMessage .= "\n" . $url_string;
+      array_unshift($values, $errorMessage);
+      $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
+      return CRM_Import_Parser::ERROR;
+    }
+
+    // Params only had one id, so shift it out
+    $contactId = array_shift($cids);
+    $cid = NULL;
+
+    $vals = ['contact_id' => $contactId];
+
+    if ($onDuplicate == CRM_Import_Parser::DUPLICATE_REPLACE) {
+      civicrm_api('contact', 'delete', $vals);
+      $cid = CRM_Contact_BAO_Contact::createProfileContact($formatted, $contactFields, $contactId, NULL, NULL, $formatted['contact_type']);
+    }
+    elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) {
+      $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId);
+    }
+    elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) {
+      $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId);
+    }
+    // else skip does nothing and just returns an error code.
+    if ($cid) {
+      $contact = [
+        'contact_id' => $cid,
+      ];
+      $defaults = [];
+      $newContact = CRM_Contact_BAO_Contact::retrieve($contact, $defaults);
+    }
+
+    if (civicrm_error($newContact)) {
+      if (empty($newContact['error_message']['params'])) {
+        // different kind of error other than DUPLICATE
+        $errorMessage = $newContact['error_message'];
+        array_unshift($values, $errorMessage);
+        $importRecordParams = [
+          $statusFieldName => 'ERROR',
+          "${statusFieldName}Msg" => $errorMessage,
+        ];
+        $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
+        return CRM_Import_Parser::ERROR;
+      }
+
+      $contactID = $newContact['error_message']['params'][0];
+      if (is_array($contactID)) {
+        $contactID = array_pop($contactID);
+      }
+      if (!in_array($contactID, $this->_newContacts)) {
+        $this->_newContacts[] = $contactID;
+      }
+    }
+    //CRM-262 No Duplicate Checking
+    if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
+      array_unshift($values, $url_string);
+      $importRecordParams = [
+        $statusFieldName => 'DUPLICATE',
+        "${statusFieldName}Msg" => "Skipping duplicate record",
+      ];
+      $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
+      return CRM_Import_Parser::DUPLICATE;
+    }
+
+    $importRecordParams = [
+      $statusFieldName => 'IMPORTED',
+    ];
+    $this->updateImportRecord($values[count($values) - 1], $importRecordParams);
+    //return warning if street address is not parsed, CRM-5886
+    return $this->processMessage($values, $statusFieldName, CRM_Import_Parser::VALID);
+  }
+
 }
index 5545936098061730f7de88e0d937f272ae43bcac..b7bbf5f323715235ec3f5d1d65d12254eb2e71e6 100644 (file)
@@ -935,45 +935,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
   protected static function cancel($memberships, $contributionId, $membershipStatuses, $participant, $oldStatus, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId) {
     // @fixme https://lab.civicrm.org/dev/core/issues/927 Cancelling membership etc is not desirable for all use-cases and we should be able to disable it
     $participantStatuses = CRM_Event_PseudoConstant::participantStatus();
-    if (is_array($memberships)) {
-      foreach ($memberships as $membership) {
-        $update = TRUE;
-        //Update Membership status if there is no other completed contribution associated with the membership.
-        $relatedContributions = CRM_Member_BAO_Membership::getMembershipContributionId($membership->id, TRUE);
-        foreach ($relatedContributions as $contriId) {
-          if ($contriId == $contributionId) {
-            continue;
-          }
-          $statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $contriId, 'contribution_status_id');
-          if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $statusId) === 'Completed') {
-            $update = FALSE;
-          }
-        }
-        if ($membership && $update) {
-          $newStatus = array_search('Cancelled', $membershipStatuses);
-
-          // Create activity
-          $allStatus = CRM_Member_BAO_Membership::buildOptions('status_id', 'get');
-          $activityParam = [
-            'subject' => "Status changed from {$allStatus[$membership->status_id]} to {$allStatus[$newStatus]}",
-            'source_contact_id' => CRM_Core_Session::singleton()->get('userID'),
-            'target_contact_id' => $membership->contact_id,
-            'source_record_id' => $membership->id,
-            'activity_type_id' => 'Change Membership Status',
-            'status_id' => 'Completed',
-            'priority_id' => 'Normal',
-            'activity_date_time' => 'now',
-          ];
-
-          $membership->status_id = $newStatus;
-          $membership->is_override = TRUE;
-          $membership->status_override_end_date = 'null';
-          $membership->save();
-          civicrm_api3('activity', 'create', $activityParam);
-        }
-      }
-    }
-
     if ($participant) {
       $updatedStatusId = array_search('Cancelled', $participantStatuses);
       CRM_Event_BAO_Participant::updateParticipantStatus($participant->id, $oldStatus, $updatedStatusId, TRUE);
@@ -1491,7 +1452,7 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = c.contact_id )
    *   $results no of deleted Contribution on success, false otherwise
    */
   public static function deleteContribution($id) {
-    CRM_Utils_Hook::pre('delete', 'Contribution', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Contribution', $id);
 
     $transaction = new CRM_Core_Transaction();
 
index b0a2d5ab5993e0be735bdd0d3d299cda813a1b43..b47d34d2e1b05a92d6a2dd8c7c376c295df77ec1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/Contribution.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6681702174b0431d22a1bc98c71bd747)
+ * (GenCodeChecksum:a24c14ae34bb8c68b8f0348b946c18b9)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 795591c821c2b0a0057749caf63c6275ccff9061..75a82ba3f49ead52496982e2d734cca28099299f 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/ContributionPage.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1a64443b99f8c5f11333e600e3cb47a3)
+ * (GenCodeChecksum:1fc0665cc8320aec4576a39e1491d57a)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 78d7a932f409e3cac8cef2822aa080773492be7a..ef635d760fed3e1fd0f8a5687678b7ccaf8b56b8 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/ContributionProduct.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:45dff2998f47d5bd918d767c018eeac4)
+ * (GenCodeChecksum:f1269124a9b0ee2a9482aea7d0ee221c)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_ContributionProduct extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.4';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index f574c6c48589a0d48c2318112531356e042464e1..55e632c1a94cd0bd06fdd956636279d2608a66b4 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f8fcfe64d80dea9fe9f1f8eb86246f73)
+ * (GenCodeChecksum:c080fbdfdb5b780a36f5a48e5a88eaae)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.6';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 97fc0e8eebbea549742857527a48d4ff12b20b50..3ab488c55d5b0d498f6faf6c2553d9b6784883cf 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/ContributionSoft.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f790cd9c491079f788527103d96230f9)
+ * (GenCodeChecksum:3bbe2837f1b310d77d79614a4fd5a9af)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_ContributionSoft extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.2';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 9493fa18039a8858baccedcffac931276e47d058..0564f5c13751247dac1de0f86e011debf437f2ce 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/Premium.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:30736c3404f66636b59373f2e81f5d2e)
+ * (GenCodeChecksum:44100b596ee94445f953e783f37cdfba)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.4';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 82f2f4d7fb4c144033e1e966e7f8f76c5f907498..8b9ef605c0f0c1c20a797c52f4df03ce8cbb6ee3 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:490466ed1df27a5a6157a87f0dd6eb30)
+ * (GenCodeChecksum:09f3e3060480299738b12caf7121662d)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.4';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 48bacacc24ef1e065c1f4efe652e57e1ec1a5443..4373dbe3d7635899f01fb4df3f23d54d0c2c7cf2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/Product.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6f4d4d48a0c392a2a72b268a9815006b)
+ * (GenCodeChecksum:45a3c80396259fbc6da8cbecc0ba652d)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_Product extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.4';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 16d735e64335d7ec17597ab228cd59d7f7fd4597..d852ced939a01f5578f07264ab04d4e2a188bcc0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/Widget.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f1346769d093ec9021994764d62dedfe)
+ * (GenCodeChecksum:b98e1da73e0723e617a9dae64a8e8dad)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Contribute_DAO_Widget extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.0';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index c28a695d92ef3c6d9114f623c9a106029c70a1f1..1fc9dc4063994da1cb40e7bd6b3483e13a3f8039 100644 (file)
@@ -1483,7 +1483,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
 
     $isEmpty = array_keys(array_flip($submittedValues['soft_credit_contact_id']));
     if ($this->_id && count($isEmpty) == 1 && key($isEmpty) == NULL) {
-      civicrm_api3('ContributionSoft', 'get', ['contribution_id' => $this->_id, 'pcp_id' => NULL, 'api.ContributionSoft.delete' => 1]);
+      civicrm_api3('ContributionSoft', 'get', ['contribution_id' => $this->_id, 'pcp_id' => ['IS NULL' => 1], 'api.ContributionSoft.delete' => 1]);
     }
 
     // set the contact, when contact is selected
index 85b8ad03c9fb793476c4cec5d1f39de1b12c463e..a5ad9e40e36357a330801293a5766c09ab2f089e 100644 (file)
 class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
   /**
-   * Pre process the form.
+   * Classes extending CRM_Core_Form should implement this method.
+   *
+   * @return string
    */
-  public function preProcess() {
-    parent::preProcess();
+  public function getDefaultEntity() {
+    return 'Product';
   }
 
   /**
@@ -59,6 +61,8 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
   /**
    * Build the form object.
+   *
+   * @throws \CiviCRM_API3_Exception
    */
   public function buildQuickForm() {
     parent::buildQuickForm();
@@ -114,12 +118,9 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
     $this->add('text', 'fixed_period_start_day', ts('Fixed Period Start Day'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'fixed_period_start_day'));
 
-    $this->add('Select', 'duration_unit', ts('Duration Unit'), CRM_Core_SelectValues::getPremiumUnits(), FALSE, ['placeholder' => ts('- select period -')]);
-
+    $this->addField('duration_unit', ['placeholder' => ts('- select period -')], FALSE);
     $this->add('text', 'duration_interval', ts('Duration'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'duration_interval'));
-
-    $this->add('Select', 'frequency_unit', ts('Frequency Unit'), CRM_Core_SelectValues::getPremiumUnits(), FALSE, ['placeholder' => ts('- select period -')]);
-
+    $this->addField('frequency_unit', ['placeholder' => ts('- select period -')], FALSE);
     $this->add('text', 'frequency_interval', ts('Frequency'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'frequency_interval'));
 
     //Financial Type CRM-11106
index 49413ba891d41640a39a644efa0aad4ef9ba5d08..d81958f09dbe21f1e890088812926787c5a5bc84 100644 (file)
@@ -94,6 +94,61 @@ class CRM_Core_BAO_Country extends CRM_Core_DAO_Country {
     return $cachedContactCountry;
   }
 
+  /**
+   * Provide list of Pinned countries.
+   *
+   * @param $availableCountries
+   * @return array
+   */
+  public static function pinnedContactCountries($availableCountries) {
+    if (!isset(Civi::$statics[__CLASS__]['cachedPinnedContactCountries'])) {
+      $pinnedContactCountries = Civi::settings()->get('pinnedContactCountries');
+      $pinnedCountries = [];
+      if (!empty($pinnedContactCountries)) {
+        foreach ($pinnedContactCountries as $pinnedContactCountry) {
+          // pinned country must exist in available country list.
+          if (array_key_exists($pinnedContactCountry, $availableCountries)) {
+            $pinnedCountries[$pinnedContactCountry] = $availableCountries[$pinnedContactCountry];
+          }
+        }
+      }
+      Civi::$statics[__CLASS__]['cachedPinnedContactCountries'] = $pinnedCountries;
+    }
+
+    return Civi::$statics[__CLASS__]['cachedPinnedContactCountries'];
+  }
+
+  /**
+   * Provide sorted list of countries with default country with first position
+   * then Pinned countries then rest of countries.
+   *
+   * @param $availableCountries
+   * @return array
+   */
+  public static function _defaultContactCountries($availableCountries) {
+    // localise the country names if in an non-en_US locale
+    $tsLocale = CRM_Core_I18n::getLocale();
+    if ($tsLocale != '' and $tsLocale != 'en_US') {
+      $i18n = CRM_Core_I18n::singleton();
+      $i18n->localizeArray($availableCountries, [
+        'context' => 'country',
+      ]);
+      $availableCountries = CRM_Utils_Array::asort($availableCountries);
+    }
+    $pinnedContactCountries = CRM_Core_BAO_Country::pinnedContactCountries($availableCountries);
+    // if default country is set, percolate it to the top, then pinned countries and then remaining available countries.
+    if ($defaultContactCountry = Civi::settings()->get('defaultContactCountry')) {
+      $default = [$defaultContactCountry => $availableCountries[$defaultContactCountry] ?? NULL];
+      $availableCountries = $default + $pinnedContactCountries + $availableCountries;
+    }
+    elseif (!empty($pinnedContactCountries)) {
+      // if default country is missing then use only pinned countries at the top then rest of the countries.
+      $availableCountries = $pinnedContactCountries + $availableCountries;
+    }
+
+    return $availableCountries;
+  }
+
   /**
    * Provide cached default country name.
    *
index 4a0ae0fba333a56b001bbafabf77631b65f20092..f951f3fce3297d3817cd931668caecfc768b5e2e 100644 (file)
@@ -85,9 +85,18 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
    * @return CRM_Core_DAO_CustomField
    */
   public static function create($params) {
+    $changeSerialize = self::getChangeSerialize($params);
     $customField = self::createCustomFieldRecord($params);
+    // When deserializing a field, the update needs to run before the schema change
+    if ($changeSerialize === 0) {
+      CRM_Core_DAO::singleValueQuery(self::getAlterSerializeSQL($customField));
+    }
     $op = empty($params['id']) ? 'add' : 'modify';
     self::createField($customField, $op);
+    // When serializing a field, the update needs to run after the schema change
+    if ($changeSerialize === 1) {
+      CRM_Core_DAO::singleValueQuery(self::getAlterSerializeSQL($customField));
+    }
 
     CRM_Utils_Hook::post(($op === 'add' ? 'create' : 'edit'), 'CustomField', $customField->id, $customField);
 
@@ -114,10 +123,18 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
    * @throws \CiviCRM_API3_Exception
    */
   public static function bulkSave($bulkParams, $defaults = []) {
-    $addedColumns = $sql = $customFields = [];
+    $addedColumns = $sql = $customFields = $pre = $post = [];
     foreach ($bulkParams as $index => $fieldParams) {
       $params = array_merge($defaults, $fieldParams);
+      $changeSerialize = self::getChangeSerialize($params);
       $customField = self::createCustomFieldRecord($params);
+      // Serialize/deserialize sql must run after/before the table is altered
+      if ($changeSerialize === 0) {
+        $pre[] = self::getAlterSerializeSQL($customField);
+      }
+      if ($changeSerialize === 1) {
+        $post[] = self::getAlterSerializeSQL($customField);
+      }
       $fieldSQL = self::getAlterFieldSQL($customField, empty($params['id']) ? 'add' : 'modify');
       if (!isset($params['custom_group_id'])) {
         $params['custom_group_id'] = civicrm_api3('CustomField', 'getvalue', ['id' => $customField->id, 'return' => 'custom_group_id']);
@@ -128,6 +145,10 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
       $customFields[$index] = $customField;
     }
 
+    foreach ($pre as $query) {
+      CRM_Core_DAO::executeQuery($query);
+    }
+
     foreach ($sql as $tableName => $statements) {
       // CRM-7007: do not i18n-rewrite this query
       CRM_Core_DAO::executeQuery("ALTER TABLE $tableName " . implode(', ', $statements), [], TRUE, NULL, FALSE, FALSE);
@@ -139,6 +160,11 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
 
       Civi::service('sql_triggers')->rebuild($tableName, TRUE);
     }
+
+    foreach ($post as $query) {
+      CRM_Core_DAO::executeQuery($query);
+    }
+
     CRM_Utils_System::flushCache();
     foreach ($customFields as $index => $customField) {
       CRM_Utils_Hook::post(empty($bulkParams[$index]['id']) ? 'create' : 'edit', 'CustomField', $customField->id, $customField);
@@ -1686,31 +1712,29 @@ SELECT $columnName
    * @return bool
    */
   public static function getAlterFieldSQL($field, $operation) {
-    $indexExist = $operation === 'add' ? FALSE : CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $field->id, 'is_searchable');
     $params = self::prepareCreateParams($field, $operation);
     // Let's suppress the required flag, since that can cause an sql issue... for unknown reasons since we are calling
     // a function only used by Custom Field creation...
     $params['required'] = FALSE;
-    return CRM_Core_BAO_SchemaHandler::getFieldAlterSQL($params, $indexExist);
+    return CRM_Core_BAO_SchemaHandler::getFieldAlterSQL($params);
   }
 
   /**
-   * Reformat existing values for a field when changing its serialize attribute
+   * Get query to reformat existing values for a field when changing its serialize attribute
    *
    * @param CRM_Core_DAO_CustomField $field
-   * @throws CRM_Core_Exception
+   * @return string
    */
-  private static function alterSerialize($field) {
+  private static function getAlterSerializeSQL($field) {
     $table = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $field->custom_group_id, 'table_name');
     $col = $field->column_name;
     $sp = CRM_Core_DAO::VALUE_SEPARATOR;
     if ($field->serialize) {
-      $sql = "UPDATE `$table` SET `$col` = CONCAT('$sp', `$col`, '$sp') WHERE `$col` IS NOT NULL AND `$col` NOT LIKE '$sp%' AND `$col` != ''";
+      return "UPDATE `$table` SET `$col` = CONCAT('$sp', `$col`, '$sp') WHERE `$col` IS NOT NULL AND `$col` NOT LIKE '$sp%' AND `$col` != ''";
     }
     else {
-      $sql = "UPDATE `$table` SET `$col` = SUBSTRING_INDEX(SUBSTRING(`$col`, 2), '$sp', 1) WHERE `$col` LIKE '$sp%'";
+      return "UPDATE `$table` SET `$col` = SUBSTRING_INDEX(SUBSTRING(`$col`, 2), '$sp', 1) WHERE `$col` LIKE '$sp%'";
     }
-    CRM_Core_DAO::executeQuery($sql);
   }
 
   /**
@@ -2006,9 +2030,6 @@ WHERE  id IN ( %1, %2 )
     $transaction = new CRM_Core_Transaction();
     $params = self::prepareCreate($params);
 
-    $alterSerialize = isset($params['serialize']) && !empty($params['id'])
-      && ($params['serialize'] != CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $params['id'], 'serialize'));
-
     $customField = new CRM_Core_DAO_CustomField();
     $customField->copyValues($params);
     $customField->save();
@@ -2029,13 +2050,22 @@ WHERE  id IN ( %1, %2 )
     // make sure all values are present in the object for further processing
     $customField->find(TRUE);
 
-    if ($alterSerialize) {
-      self::alterSerialize($customField);
-    }
-
     return $customField;
   }
 
+  /**
+   * @param $params
+   * @return int|null
+   */
+  protected static function getChangeSerialize($params) {
+    if (isset($params['serialize']) && !empty($params['id'])) {
+      if ($params['serialize'] != CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $params['id'], 'serialize')) {
+        return (int) $params['serialize'];
+      }
+    }
+    return NULL;
+  }
+
   /**
    * Move custom data from one contact to another.
    *
@@ -2646,13 +2676,9 @@ WHERE cf.id = %1 AND cg.is_multiple = 1";
       'searchable' => $field->is_searchable,
     ];
 
-    if ($operation == 'delete') {
-      $fkName = "{$tableName}_{$field->column_name}";
-      if (strlen($fkName) >= 48) {
-        $fkName = substr($fkName, 0, 32) . '_' . substr(md5($fkName), 0, 16);
-      }
-      $params['fkName'] = $fkName;
-    }
+    // For adding/dropping FK constraints
+    $params['fkName'] = CRM_Core_BAO_SchemaHandler::getIndexName($tableName, $field->column_name);
+
     if ($field->data_type == 'Country' && !self::isSerialized($field)) {
       $params['fk_table_name'] = 'civicrm_country';
       $params['fk_field_name'] = 'id';
index cb56200c4b740e846df19fd8325b9e13347e7d91..52f08c45139e7492abab4dc3a8bf1ecaa8a27401 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Core_BAO_SchemaHandler {
         $sql .= self::buildPrimaryKeySQL($field, $separator, $prefix);
       }
       foreach ($params['fields'] as $field) {
-        $sql .= self::buildSearchIndexSQL($field, $separator, $prefix);
+        $sql .= self::buildSearchIndexSQL($field, $separator);
       }
       if (isset($params['indexes'])) {
         foreach ($params['indexes'] as $index) {
@@ -155,13 +155,13 @@ class CRM_Core_BAO_SchemaHandler {
 
   /**
    * @param array $params
-   * @param $separator
-   * @param $prefix
-   * @param bool $indexExist
+   * @param string $separator
+   * @param string $prefix
+   * @param string|NULL $existingIndex
    *
    * @return NULL|string
    */
-  public static function buildSearchIndexSQL($params, $separator, $prefix, $indexExist = FALSE) {
+  public static function buildSearchIndexSQL($params, $separator, $prefix = '', $existingIndex = NULL) {
     $sql = NULL;
 
     // dont index blob
@@ -169,20 +169,19 @@ class CRM_Core_BAO_SchemaHandler {
       return $sql;
     }
 
-    //create index only for searchable fields during ADD,
-    //create index only if field is become searchable during MODIFY,
-    //drop index only if field is no longer searchable and it does not reference
-    //a forgein key (and indexExist is true)
-    if (!empty($params['searchable']) && !$indexExist) {
+    // Add index if field is searchable if it does not reference a foreign key
+    // (skip indexing FK fields because it would be redundant to have 2 indexes)
+    if (!empty($params['searchable']) && empty($params['fk_table_name']) && substr($existingIndex, 0, 5) !== 'INDEX') {
       $sql .= $separator;
       $sql .= str_repeat(' ', 8);
       $sql .= $prefix;
       $sql .= "INDEX_{$params['name']} ( {$params['name']} )";
     }
-    elseif (empty($params['searchable']) && empty($params['fk_table_name']) && $indexExist) {
+    // Drop search index if field is no longer searchable
+    elseif (empty($params['searchable']) && substr($existingIndex, 0, 5) === 'INDEX') {
       $sql .= $separator;
       $sql .= str_repeat(' ', 8);
-      $sql .= "DROP INDEX INDEX_{$params['name']}";
+      $sql .= "DROP INDEX $existingIndex";
     }
     return $sql;
   }
@@ -260,13 +259,10 @@ ALTER TABLE {$tableName}
       $sql .= $separator;
       $sql .= str_repeat(' ', 8);
       $sql .= $prefix;
-      $fkName = "{$tableName}_{$params['name']}";
-      if (strlen($fkName) >= 48) {
-        $fkName = substr($fkName, 0, 32) . "_" . substr(md5($fkName), 0, 16);
-      }
+      $fkName = $params['fkName'] ?? self::getIndexName($tableName, $params['name']);
 
       $sql .= "CONSTRAINT FK_$fkName FOREIGN KEY ( `{$params['name']}` ) REFERENCES {$params['fk_table_name']} ( {$params['fk_field_name']} ) ";
-      $sql .= CRM_Utils_Array::value('fk_attributes', $params);
+      $sql .= $params['fk_attributes'] ?? '';
     }
     return $sql;
   }
@@ -704,14 +700,13 @@ MODIFY      {$columnName} varchar( $length )
    * Build the sql to alter the field.
    *
    * @param array $params
-   * @param bool $indexExist
    *
    * @return string
    */
-  public static function buildFieldChangeSql($params, $indexExist) {
+  public static function buildFieldChangeSql($params) {
     $sql = str_repeat(' ', 8);
     $sql .= "ALTER TABLE {$params['table_name']}";
-    return $sql . self::getFieldAlterSQL($params, $indexExist);
+    return $sql . self::getFieldAlterSQL($params);
   }
 
   /**
@@ -721,11 +716,10 @@ MODIFY      {$columnName} varchar( $length )
    * by individual field we can do one or many.
    *
    * @param array $params
-   * @param bool $indexExist
    *
    * @return string
    */
-  public static function getFieldAlterSQL($params, $indexExist) {
+  public static function getFieldAlterSQL($params) {
     $sql = '';
     switch ($params['operation']) {
       case 'add':
@@ -739,9 +733,22 @@ MODIFY      {$columnName} varchar( $length )
 
       case 'modify':
         $separator = "\n";
+        $existingIndex = NULL;
+        $dao = CRM_Core_DAO::executeQuery("SHOW INDEX FROM `{$params['table_name']}` WHERE Column_name = '{$params['name']}'");
+        if ($dao->fetch()) {
+          $existingIndex = $dao->Key_name;
+        }
+        $fkSql = self::buildForeignKeySQL($params, ",\n", "ADD ", $params['table_name']);
+        if (substr($existingIndex, 0, 2) === 'FK' && !$fkSql) {
+          $sql .= "$separator DROP FOREIGN KEY {$existingIndex},\nDROP INDEX {$existingIndex}";
+          $separator = ",\n";
+        }
         $sql .= self::buildFieldSQL($params, $separator, "MODIFY ");
         $separator = ",\n";
-        $sql .= self::buildSearchIndexSQL($params, $separator, "ADD INDEX ", $indexExist);
+        $sql .= self::buildSearchIndexSQL($params, $separator, "ADD INDEX ", $existingIndex);
+        if (!$existingIndex && $fkSql) {
+          $sql .= $fkSql;
+        }
         break;
 
       case 'delete':
@@ -757,6 +764,21 @@ MODIFY      {$columnName} varchar( $length )
     return $sql;
   }
 
+  /**
+   * Turns tableName + columnName into a safe & predictable index name
+   *
+   * @param $tableName
+   * @param $columnName
+   * @return string
+   */
+  public static function getIndexName($tableName, $columnName) {
+    $indexName = "{$tableName}_{$columnName}";
+    if (strlen($indexName) >= 48) {
+      $indexName = substr($indexName, 0, 32) . "_" . substr(md5($indexName), 0, 16);
+    }
+    return $indexName;
+  }
+
   /**
    * Performs the utf8mb4 migration.
    *
@@ -877,7 +899,7 @@ MODIFY      {$columnName} varchar( $length )
    *
    * @return string
    */
-  public static function getInUseCollation() {
+  public static function getInUseCollation(): string {
     if (!isset(\Civi::$statics[__CLASS__][__FUNCTION__])) {
       $dao = CRM_Core_DAO::executeQuery('SHOW TABLE STATUS LIKE \'civicrm_contact\'');
       $dao->fetch();
@@ -886,6 +908,23 @@ MODIFY      {$columnName} varchar( $length )
     return \Civi::$statics[__CLASS__][__FUNCTION__];
   }
 
+  /**
+   * Does the database support utf8mb4.
+   *
+   * Utf8mb4 is required to support emojis but older databases may not have it enabled.
+   *
+   * This is aggressively cached despite just being a string function
+   * as it is expected it might be called many times.
+   *
+   * @return bool
+   */
+  public static function databaseSupportsUTF8MB4(): bool {
+    if (!isset(\Civi::$statics[__CLASS__][__FUNCTION__])) {
+      \Civi::$statics[__CLASS__][__FUNCTION__] = stripos(self::getInUseCollation(), 'utf8mb4') === TRUE;
+    }
+    return \Civi::$statics[__CLASS__][__FUNCTION__];
+  }
+
   /**
    * Get the database collation.
    *
index 988be26421492d7f13083d3b133839e9c2fce78c..fcf582ef6f66d480ece9c6daf75adea9c8e2d580 100644 (file)
@@ -1399,6 +1399,8 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
    *
    */
   public static function del($id) {
+    CRM_Utils_Hook::pre('delete', 'UFGroup', $id);
+
     //check whether this group contains  any profile fields
     $profileField = new CRM_Core_DAO_UFField();
     $profileField->uf_group_id = $id;
@@ -1416,6 +1418,8 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
     $group = new CRM_Core_DAO_UFGroup();
     $group->id = $id;
     $group->delete();
+
+    CRM_Utils_Hook::post('delete', 'UFGroup', $id, $group);
     return 1;
   }
 
@@ -1425,12 +1429,16 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
    * @param array $params
    *   Reference array contains the values submitted by the form.
    * @param array $ids
-   *   Reference array contains the id.
+   *   Deprecated array.
    *
    *
    * @return object
    */
   public static function add(&$params, $ids = []) {
+    if (empty($params['id']) && !empty($ids['ufgroup'])) {
+      $params['id'] = $ids['ufgroup'];
+      Civi::log()->warning('ids parameter is deprecated', ['civi.tag' => 'deprecated']);
+    }
     $fields = [
       'is_active',
       'add_captcha',
index c4508b185962feb7257652659714940d3f2ea7da..269cb57813aef9b2b0ae09fd4648c997ed26c75f 100644 (file)
@@ -216,6 +216,7 @@ class CRM_Core_CodeGen_Specification {
       'titlePlural' => $tableXML->titlePlural ?? CRM_Utils_String::pluralize($tableXML->title ?? $titleFromClass),
       'icon' => $tableXML->icon ?? NULL,
       'add' => $tableXML->add ?? NULL,
+      'component' => $tableXML->component ?? NULL,
       'paths' => (array) ($tableXML->paths ?? []),
       'labelName' => substr($name, 8),
       'className' => $this->classNames[$name],
index 6050c22a2dacd034cb06d50abce96178b29a55fd..ab9ef828673b2bc184a5671c0489dfeca6087df6 100644 (file)
@@ -120,6 +120,7 @@ class CRM_Core_Config_MagicMerge {
       // renamed.
       'debug' => ['setting', 'debug_enabled'],
       'defaultContactCountry' => ['setting'],
+      'pinnedContactCountries' => ['setting'],
       'defaultContactStateProvince' => ['setting'],
       'defaultCurrency' => ['setting'],
       'defaultSearchProfileID' => ['setting'],
index 13c0c8c65a4654998c4b79ca4bca3e006d3d8709..2d40afd073630aa17cb9f57357a46c63aeb96934 100644 (file)
@@ -2782,6 +2782,22 @@ SELECT contact_id
    */
   public static function createSQLFilter($fieldName, $filter, $type = NULL, $alias = NULL, $returnSanitisedArray = FALSE) {
     foreach ($filter as $operator => $criteria) {
+      if (!CRM_Core_BAO_SchemaHandler::databaseSupportsUTF8MB4()) {
+        foreach ((array) $criteria as $criterion) {
+          if (!empty($criterion) && !is_numeric($criterion)
+            // The first 2 criteria are redundant but are added as they
+            // seem like they would
+            // be quicker than this 3rd check.
+            && max(array_map('ord', str_split($criterion))) >= 240) {
+            // String contains unsupported emojis.
+            // We return a clause that resolves to false as an emoji string by definition cannot be saved.
+            // note that if we return just 0 for false if gets lost in empty checks.
+            // https://stackoverflow.com/questions/16496554/can-php-detect-4-byte-encoded-utf8-chars
+            return '0 = 1';
+          }
+        }
+      }
+
       if (in_array($operator, self::acceptedSQLOperators(), TRUE)) {
         switch ($operator) {
           // unary operators
index 75d98dc023f090af79533a1ffcc3278f6d097362..96d4bfa19a76dce0218a36591dfbb874ec017a01 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/ActionLog.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d1a6159f18c0818e42fb3763f097772d)
+ * (GenCodeChecksum:5e54867f6cec000d7f219c82a1c081d3)
  */
 
 /**
index 20093f808ef18083e7b45b5067c6ebd4b9aa572b..2bdd4fa93d5c72152271f27c1749c258418273ef 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/ActionMapping.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c095a458e031091596adf3b9bb46baf5)
+ * (GenCodeChecksum:786c067af45c5d1979519a8326665453)
  */
 
 /**
index 376f8feeedda6fa620ada3de86e1cdef3f8976c9..cf818ad09bfc73b393888ec162ca3c45c0cfd475 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/ActionSchedule.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d2d45ba583a410b375e261a1cf1ce485)
+ * (GenCodeChecksum:674f2b73fdc72758a31b2f023a33526a)
  */
 
 /**
index 9636ae96643745adc7b6e2caf90b7000dce0f41b..8b00d71af76226e899a8cffb51d5ac64b6c7b9e0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Address.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b612c958c68fcd4f5e4b0b244ca6c3b1)
+ * (GenCodeChecksum:44eb25ddfd0e9d87e213e2f80f80233d)
  */
 
 /**
index e8f85252317f6d8ebce6bf2ee58645ddfd55c0b4..374ca1449bc4a7e553e1b98039a6d36e07407c18 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/AddressFormat.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:090b4784d528f3c465b4daa2cc7bdf1e)
+ * (GenCodeChecksum:47ce2c9d196b195fda0a60eaac02f5d1)
  */
 
 /**
index 10a1489a8c3fad08caee0ef3ba5fcd5ec9acdc3d..beafabc7c0650d1aa317e80442b48cdc5761f7b3 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Cache.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:637ce0498ba1c4f1f32fbfd16bb7d66d)
+ * (GenCodeChecksum:6b4eec63c83fffde053a8259221d0bfe)
  */
 
 /**
index dd7d0c43ba4eb8e8b7908baf944a9455ecbb94c4..0c9216f26d73267723b1998fd7d701450d88a729 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Component.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e8ae3905d2f7dc380ec1e334dad6e198)
+ * (GenCodeChecksum:3b686ef7dde6f66dfe5eb708e667dcc7)
  */
 
 /**
index f6febfcdeb6076269b7b500fa6fabca226e077f9..2ac1296eb886310d63c516eb0b52f4677bdccf30 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Country.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:707ca40a97f702747efb02f28ed710e6)
+ * (GenCodeChecksum:baa7ed7cb183bc7f1ee86a41a001e580)
  */
 
 /**
index 7aba507039408b7061d1bf4e1624779d56c25478..6ec5bf444f745348a72817ec2530425c4f268e64 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/County.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4317f5a9d6526937ac406407ce9a97a1)
+ * (GenCodeChecksum:9e49f92ab040fc02002d5ec5507cf49a)
  */
 
 /**
index 838b3fc7de9dff3e0352f772cfe67bdbbc0f04cf..e02729998acf28d12463d2e71d7f68091a1d7e7f 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/CustomField.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:754b560576d029a21029661e48f3075b)
+ * (GenCodeChecksum:58c67e6b3ec035823fb7553abb962ab9)
  */
 
 /**
index df8fb2c33e3a3655475cccef81c76833df2bc096..58742e8fd47e39c20b8337f670d32b68adce97dd 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/CustomGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a40273d2f899d4fa280d0c02297b5263)
+ * (GenCodeChecksum:807040c22af3159cb198becb183444bc)
  */
 
 /**
index 5644b1e62daea63425aeb91e46887110385ae478..2e31d42d4d01468d90111eea796b0d173ca3a996 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Dashboard.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1f32e4ff906a25d432cc28598e388f60)
+ * (GenCodeChecksum:96e683f4bec8fff387930109c2f5ea41)
  */
 
 /**
index 7298c492fd33300015c04bdc26f3e58c9d9d3a3d..05377bc2bff0a0caea292410eae804ef1038e3b5 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Discount.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7f9f8e28c00e7b9c3dbf1631b4ad4391)
+ * (GenCodeChecksum:ccb85ff70ce8a536ac4a941628455d8d)
  */
 
 /**
index 2a632dc1cbb70f4e9adc8c1c48bd080fb4649b2f..f178a01687faef7809da15f9db98232bc64d282e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Domain.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4af215dcb8fae4156854344b4dfb3960)
+ * (GenCodeChecksum:6a8de20676ad3eeaca16ea3059958a4e)
  */
 
 /**
index 0a95daea34c130c04d651816b22e0a4b0292783d..75ef40b6bab96f68172bf943c397b4840c1e8976 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Email.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fef14f6148a58eacf0e1695dfd794134)
+ * (GenCodeChecksum:032cf9c0a45f5d15baaf7a9087741569)
  */
 
 /**
index 0ba6edd26e29850c11af4af2042c9399f045c0e4..22279799284d89d2329f633789b9f3b054233445 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/EntityFile.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7fa9cd793366f00f34e879ba97791bf5)
+ * (GenCodeChecksum:8d4673d56dc80b50b0acdd5186a19068)
  */
 
 /**
index 798191aad4856237d7e4c46e6bca971da15c0c06..5a4e3588565b7e0023da9e74f39a7d8ffc1713b7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/EntityTag.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:975426ca9328abeb310b81dd060af25a)
+ * (GenCodeChecksum:f02ad487f101cb549da790954fbaa7a4)
  */
 
 /**
index 1a46364fd35d3fe93a51417cb3255ebffb26ff1e..9b2ca48c88f71477893ae9d4f731dee9d0f2a897 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Extension.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:dd8b0d8ddff649f7180b28991e578a3f)
+ * (GenCodeChecksum:c85a50145f3c9647e6fb46328034090e)
  */
 
 /**
index 1e4e9aae1f96389b364726e9ac33e5bdc0f68d44..8598cfc242fde782f7d15546e0b8b4efb2c59fb0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/File.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:aa00f0710c5c740b37ff1c7f91df3638)
+ * (GenCodeChecksum:d47b8b85ee8790c3da0216b40c2dc657)
  */
 
 /**
index 4f595ba6959520ab421bfb40817b5379b60abb53..b1d6e63df19c1f5ea7acd074f2b980600bef392f 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/IM.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f56fbd26bb48c845527d822e77392881)
+ * (GenCodeChecksum:d44807afb48eb3aa89bdae6db574f89e)
  */
 
 /**
index ed582a88520518b4d7293e4c5d4265e4ab57168e..c24f6dcad1e75d3a32ecb6235e32636337e6090d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Job.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:9b8f984453f85c6a451aff41f267fdc5)
+ * (GenCodeChecksum:434388c3fa5b5f67932dd71f5d64a031)
  */
 
 /**
index 4920de1673670071cacf85640d1ba6fb1f9976dc..314634b30082f69cdb6e9d86345d1003f705f3b0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/JobLog.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:15b8a4864ded5f1a68773ec432bf620b)
+ * (GenCodeChecksum:03cf51e361b98d8ed31dcbd86eda2722)
  */
 
 /**
index 07bf949d6250eb07c12a90c2bbbd2f746b19ec99..9e43a2a2417916a6cc70790ac416253c0c7097d1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/LocBlock.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8a50c9ef2129e7b7b0ed8b99a86d13a5)
+ * (GenCodeChecksum:86653150176ca5b8f4bb80b8dc581010)
  */
 
 /**
index 5df47dc899d6af55ac101c7fac6c75c2c5020ce8..561ea83175c4ea5446a072b4e560dc6dbfac2dd4 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/LocationType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a0fb6f020e3685ffe293609a32bcc741)
+ * (GenCodeChecksum:0aac55ebb9932e5ab19fcf2e6eca7dd0)
  */
 
 /**
index c4dae9152a7ad0db9b87a40e4d4a953c125813e1..c648403e39ae4bc9a8f579a46152a983065f79d9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Log.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d5fdccfff5a70b31fb787ca55f0d589f)
+ * (GenCodeChecksum:816b07245cf23f330f371b32bc278d17)
  */
 
 /**
index 32969569bc67b26cfadf12556d254046f00b42e0..fd35409ecdc73fbe6c16a606d70793cf23cc7410 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/MailSettings.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:685ef3fc528a263bfb0546a1e523c6e5)
+ * (GenCodeChecksum:a362c7cd24732b55a96cd4e526d29102)
  */
 
 /**
index ee1ab17a4387c72200b648b97f1c4a260b93fdbd..55aae70513fae1266c01143ef4fc6b22d1756e16 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Managed.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5e27c0a48637f591ddd474093510e532)
+ * (GenCodeChecksum:a6c528f54d10bee8fbc3b12c1bafd44c)
  */
 
 /**
index 180a957223ebc69d0b03b9e01f6caaa61cf46964..caf70fe97d4087f79072e7a68b900b5efdc286ce 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Mapping.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fed9ff4fb50e9c53d4b17f3015e7dabe)
+ * (GenCodeChecksum:50a6b7f051df6e61bf9e0b9b930dc861)
  */
 
 /**
index 11e7eee50280f5a192936a313757a1be691ca9b9..d32d628cad213ae502a8ebf00ff6a7bb48cf6624 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/MappingField.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b65ac30d21a5de881f6c7ac422d532b3)
+ * (GenCodeChecksum:b61d71dabcb618c14e3e8d7985b324de)
  */
 
 /**
index b49215189cd293914f62536de6c6ba2be19274f9..abc4794b7d5ce89727188ec0a5f875153b17d6f9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Menu.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f9b7fc0b2a944f399d46f739459f6174)
+ * (GenCodeChecksum:57fa30940edf98c8e957dd1f33df3f51)
  */
 
 /**
index a048026a443d45683ef14b2122a6279e3e2dc733..b374ba633ee57fb8c91b3fb76714fd3ffdb085f1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/MessageTemplate.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a85d986e421657c55de1e56dcb475a60)
+ * (GenCodeChecksum:8bdd2857d4229fc76ced7a2153574864)
  */
 
 /**
index 05f5119ef3fb2e43ef17d31e13a51a4ea1e6902b..a01fe2ad647cdb335ba8398700304b7361921b48 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Navigation.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c8bbc337e1ec2dfac5a6a470131e80d9)
+ * (GenCodeChecksum:ca49dd9232dd72c6e1236488837a30cb)
  */
 
 /**
index 22dfc9b7fa00a958b419fd2249812cfd2420b176..0cac3ede16911d192aa84be6ceb5055532b236ef 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Note.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ac7f4de63097d51ee52cc876ccad55e9)
+ * (GenCodeChecksum:b623a27bc1f57db04764a14ce6a3f113)
  */
 
 /**
index e993122b228a3ec20140c1b89bc6790a18eb510f..d699f9cab4e9bada47de841b33d5a5f8afb80708 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/OpenID.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0dfd6eb0f06f6d29d661fdc2b51d707a)
+ * (GenCodeChecksum:47984d6d7242a00042bf664e5fff0600)
  */
 
 /**
index 16ef4582f628c9e78d9a15823f7e022b0627caa1..6ed7e5b6b714e10fbe04afc40b337cc1935bb557 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/OptionGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ce2435eb871ead2e9fe08535da0efdf4)
+ * (GenCodeChecksum:0892af5a47aecaeaa04a82c6f9875348)
  */
 
 /**
index cb8ba2cd42daae40e3f214103ee8d7d867f54d3b..6d517cba38cd99e1aee3c59bf5abc4e0c53b2fa1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/OptionValue.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:44af5e1daf9325ef98fbd4ec20927635)
+ * (GenCodeChecksum:613a9cc4fed472d40f1d49cf456a9711)
  */
 
 /**
index e0283a285d9c2aaf246a71cc8cecd2fe7976e164..7c6afe22e321eb0d6a4cb856862b15e0b728480a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Phone.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ab1d2489e34ff90df7146ee39364fb2a)
+ * (GenCodeChecksum:600322e85619a002b34c9faf0f02e5c8)
  */
 
 /**
index 7b3a3780d7a1b1aed3dea50cec7eec4b7a00ef06..cafec81099b62d9046a0ad62836095187734c8a4 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/PreferencesDate.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0c9efd56cae3a34bea22b763c67162df)
+ * (GenCodeChecksum:a0d91310a76fe98662806ef3104d8f30)
  */
 
 /**
index ec7e3514019139b6561d2c7b53badaf4d9ef91b7..a1ff559fd5a44eff067ec0b48ce419a5a3bfc25a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/PrevNextCache.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:10cb66e317ece2bfe45642c4004d9b36)
+ * (GenCodeChecksum:eb88786d7c15dbc509450465b4fdd6a2)
  */
 
 /**
index 2ef91fe1d4ca8725bfca3b88af4284bad59f0b03..516171a9696a5d202a46c16602c4f39e336c0dd0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/PrintLabel.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2505ce7214d5180635182054f5a784b1)
+ * (GenCodeChecksum:39e91965d2ee2599f3eae8ab3b4cc7f8)
  */
 
 /**
index 6ee540259a9520de91b9ae40c3f01392dac520ee..994edba70e35b13dabf2505dedf42bb6030244be 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/RecurringEntity.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:50582177a0117aba7d8f7b65f98a9d59)
+ * (GenCodeChecksum:9cb2098de9f52e400a1083f996431878)
  */
 
 /**
index 67348cfbcdc96c2d0f22f51f339af41fce688650..6945563cfdd020fb0942d147eaaac157388efe78 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Setting.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d50b37651a6a36273110251643e9e633)
+ * (GenCodeChecksum:2eb3a69876a76a1aca598e6bfb7031a4)
  */
 
 /**
index 67a04a1373c165af70385a5c928cecbe0a94c8b7..c39952b65210d742a4349191aea06d66a3c2b068 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/StateProvince.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6af37b242446cb229568ae2c0a05d95e)
+ * (GenCodeChecksum:abd329da6e7801c901c3c97c1b09ef59)
  */
 
 /**
index cec45ce4827059df85100f244c655fa91283b321..da0a13644eceb2fed8807a631541ca1ffa83dc77 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/StatusPreference.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:51374620eeab683f30d11aee9b51a448)
+ * (GenCodeChecksum:bb2fbd63b6758475161446097d35804c)
  */
 
 /**
index 4cfe5f126262002f8db1d07b5ca0c8aa1f385427..c92cbcea6bdc9d7d534429b400849f745aac37d1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/SystemLog.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ca34da7770ea481ca165e648c5b456f0)
+ * (GenCodeChecksum:e302c6097bd6aff575d7067c771eaef0)
  */
 
 /**
index e6edf14624fbdaff51e73acfc601a1cffdecffe1..c76428bc8e5bf2d62add2c4b815a242209db8733 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Tag.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2ee103855c84fdb6d8487b3a028aca7e)
+ * (GenCodeChecksum:1de963194e3e392448445fac3eac82c8)
  */
 
 /**
index f0006ca68b1ba5897762e8229905a4ca4c359a12..bc16f905b94c5fa9f0396ddd1b8c20a4005cfc82 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Timezone.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4d758a9da910a13c54c4fce360cfbb03)
+ * (GenCodeChecksum:1a876a8f56414a6d8094669bb3ce16f8)
  */
 
 /**
index 180ddae18747eec00133194a105558637a888fae..d95e7cbd62b969b4e0488a6ca92f26d85df59a9a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/UFField.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2c1662232dc0ee7de0f5ffb329a956a0)
+ * (GenCodeChecksum:1c306561fedcaf68fb7d1c78756edf2e)
  */
 
 /**
index 1e5739156e5df15dbb6c9ccc36ccaaa637807b7c..06ef6672c1185802cc94d01b1292b530283a1d7e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/UFGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ca1887e29e1d2daf1318be1cfd5ae8b9)
+ * (GenCodeChecksum:94b47a495b66ddc579bd2c3559e8af7d)
  */
 
 /**
index 52a6403368f1188be213fa73023ed5eeea326882..6fdd9f5096860fcc96749c0dbeedfeb7f9259b3c 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/UFJoin.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:50c3c6aa59540ad200f1fac488337a75)
+ * (GenCodeChecksum:e5418263459cb127f21a1eafeba89e4c)
  */
 
 /**
index 2ecaee86fe3c702822b20915955ce5916cf53630..3a72a545ef99229ebc3cb1f813d10a8cb32c66d5 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/UFMatch.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:37ebdcccf0be04453b78d536b688e2a9)
+ * (GenCodeChecksum:b10c23e083b100bb39e93f9fd8b1cf86)
  */
 
 /**
index c1c8942ea7eccb326ad3628b14b686fb34b6fce6..50ffba632eb40da5ac4a15108bf4f1d3e93df434 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Website.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:521615f9d64b0fcdc159ca28efaaec31)
+ * (GenCodeChecksum:f5b6bc86206d0baccab8691ee1ae634e)
  */
 
 /**
index 91e530a2ec97991199f1236781393743c392370f..9e5d54137b8ae4b96973bef5d0a999c08d88f0a9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/WordReplacement.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:59c9ea0b5ac2faa96c0c40bd1ff519ca)
+ * (GenCodeChecksum:765a5a578d09ff1a4662c313438f7995)
  */
 
 /**
index cec48a02d774ac6813e370071247e0b5e191ccd5..9d4615c1b8fe27f6bba92db5582558a7f2a81942 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/Worldregion.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5da53f7fa56df3c4873bdc36d431b87f)
+ * (GenCodeChecksum:bc0230cdd003ef494022c8d78486656e)
  */
 
 /**
index 8c49fee8a533511407818235bb95e764a185ea48..6d67ce875fe056495d8ad9523976baf73a865e5b 100644 (file)
@@ -2693,6 +2693,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     if (!empty($selectedChild)) {
       $this->set('selectedChild', $selectedChild);
       $this->assign('selectedChild', $selectedChild);
+      Civi::resources()->addSetting(['tabSettings' => ['active' => $selectedChild]]);
     }
   }
 
index c1f5af9e77f31390486d0ba084780327eae84e41..92b12571d9fd15fb4e82e20083ab51c2546519e6 100644 (file)
@@ -732,25 +732,7 @@ WHERE  id = %1";
 
       self::populate(self::$country, 'CRM_Core_DAO_Country', TRUE, 'name', 'is_active', $whereClause);
 
-      // if default country is set, percolate it to the top
-      if (CRM_Core_BAO_Country::defaultContactCountry()) {
-        $countryIsoCodes = self::countryIsoCode();
-        $defaultID = array_search(CRM_Core_BAO_Country::defaultContactCountry(), $countryIsoCodes);
-        if ($defaultID !== FALSE) {
-          $default[$defaultID] = self::$country[$defaultID] ?? NULL;
-          self::$country = $default + self::$country;
-        }
-      }
-
-      // localise the country names if in an non-en_US locale
-      $tsLocale = CRM_Core_I18n::getLocale();
-      if ($tsLocale != '' and $tsLocale != 'en_US') {
-        $i18n = CRM_Core_I18n::singleton();
-        $i18n->localizeArray(self::$country, [
-          'context' => 'country',
-        ]);
-        self::$country = CRM_Utils_Array::asort(self::$country);
-      }
+      self::$country = CRM_Core_BAO_Country::_defaultContactCountries(self::$country);
     }
     if ($id) {
       if (array_key_exists($id, self::$country)) {
@@ -1579,12 +1561,19 @@ WHERE  id = %1
     }
     // Localize results
     if (!empty($params['localize']) || $pseudoconstant['table'] === 'civicrm_country' || $pseudoconstant['table'] === 'civicrm_state_province') {
-      $I18nParams = [];
-      if ($localizeContext) {
-        $I18nParams['context'] = $localizeContext;
+      if ($pseudoconstant['table'] === 'civicrm_country') {
+        $output = CRM_Core_BAO_Country::_defaultContactCountries($output);
+        // avoid further sorting
+        $order = '';
+      }
+      else {
+        $I18nParams = [];
+        if ($localizeContext) {
+          $I18nParams['context'] = $localizeContext;
+        }
+        $i18n = CRM_Core_I18n::singleton();
+        $i18n->localizeArray($output, $I18nParams);
       }
-      $i18n = CRM_Core_I18n::singleton();
-      $i18n->localizeArray($output, $I18nParams);
       // Maintain sort by label
       if ($order === 'ORDER BY %2') {
         $output = CRM_Utils_Array::asort($output);
index 26110155eff60f3b96140e65f0cd8087da1df0b5..a2940b23e6f5134318c72f97aea277d873e0c9ed 100644 (file)
@@ -51,16 +51,18 @@ trait CRM_Core_TokenTrait {
 
   /**
    * Find the fields that we need to get to construct the tokens requested.
-   * @param  array $tokens list of tokens
+   * @param  array $activeTokens list of active tokens
    * @return array         list of fields needed to generate those tokens
    */
-  public function getReturnFields($tokens) {
+  public function getReturnFields($activeTokens) {
     // Make sure we always return something
     $fields = ['id'];
 
-    foreach (array_intersect($tokens,
+    $tokensInUse = array_intersect(
+      $activeTokens,
       array_merge(array_keys(self::getBasicTokens()), array_keys(self::getCustomFieldTokens()))
-             ) as $token) {
+    );
+    foreach ($tokensInUse as $token) {
       if (isset(self::$fieldMapping[$token])) {
         $fields = array_merge($fields, self::$fieldMapping[$token]);
       }
index 22632dc1f53524dc85f41129b1aa8a51af2ff2b4..08b20f3375753378922464d9d49aa106d8d72867 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Cxn/Cxn.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:aae971d0607825ba1b21bc2f11ea3f8a)
+ * (GenCodeChecksum:4c6be1bafb940a9e87e5952364b00fb1)
  */
 
 /**
index 8de5b5cbef24204042cd07589f4821904a453146..b5d6939707c44fb31c9dc7ce494e3f463f61cea2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Dedupe/Exception.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0af60fac5e3a7987feaa168009fcc29f)
+ * (GenCodeChecksum:10f530a37c036ee1bd91295ed84e0c6d)
  */
 
 /**
index 1470eb59bcac3446413a18eb2d9619741c9de35c..459714a31af085c225c97e14a64daec0c759b816 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Dedupe/Rule.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:32900bb777ad3b4433835fb588ca9e8b)
+ * (GenCodeChecksum:7771f7be0df7716eb9372415720e1622)
  */
 
 /**
index f2c54cfaa862ad7eba127cf6d467b0e2e2576019..f8636db8798079ee3b681773983506753544c86e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Dedupe/RuleGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8cfa2fabe0dc4bd5d8f5668619b1c3bd)
+ * (GenCodeChecksum:521bf67a7ab4ab491ff90780009e759f)
  */
 
 /**
index 26bb7f276595b880ba16fdb4fea060f71be3b8a8..6adb77093dafebf41f94983e0f2683e5da58b579 100644 (file)
@@ -171,7 +171,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
       return NULL;
     }
 
-    CRM_Utils_Hook::pre('delete', 'Event', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Event', $id);
 
     $extends = ['event'];
     $groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, NULL, $extends);
index 9818d888988b4b639230091e81eebb37e8ef2d96..9c726376c9f5de5d8220185cfa172c2253299efa 100644 (file)
@@ -843,7 +843,7 @@ WHERE  civicrm_participant.id = {$participantId}
     if (!$participant->find()) {
       return FALSE;
     }
-    CRM_Utils_Hook::pre('delete', 'Participant', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Participant', $id);
 
     $transaction = new CRM_Core_Transaction();
 
index 819457017cae253d02193ac10ef8f3be7424112e..6125df0f7f57fc8759bc62db9b8803af00a691cc 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Cart/Cart.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:9ba9d7103a061bdc244d16a6c7252fde)
+ * (GenCodeChecksum:b3bc270f4bdd9b9a8744b2391bcba154)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Event_Cart_DAO_Cart extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviEvent';
 
   /**
    * Static instance to hold the table name.
index 8f2bb529e7604ff09c8b94ad201cef42f06856d0..aad296ee96252b22af3ec398be7558245f19553d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Cart/EventInCart.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ac722f73c2721247894ec9fff3c7ee3e)
+ * (GenCodeChecksum:f08a1e139f2486ec664ccad97f121e7e)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Event_Cart_DAO_EventInCart extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviEvent';
 
   /**
    * Static instance to hold the table name.
index f9ae994c58859eaaa57b3cea3a88ec02923e648c..7cd25de01e75920b9ac0bdcc85726ba649fd3aba 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Event.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d6fecb12a76e0474aa4bfab8a7b012fb)
+ * (GenCodeChecksum:b24aa9a8e4e0f838a71effac403eeeb7)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Event_DAO_Event extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.7';
+  const COMPONENT = 'CiviEvent';
 
   /**
    * Static instance to hold the table name.
index 0f87a1a039d5edd931c7a9e9fe78e3dc3ad254a7..c883a9f54f02a99cd92a2a37d76043f4a076a3ff 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Participant.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:89a8003239597da5e935fbce49827aee)
+ * (GenCodeChecksum:25a479f6858f45acff4110a2de47bbae)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Event_DAO_Participant extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.7';
+  const COMPONENT = 'CiviEvent';
 
   /**
    * Static instance to hold the table name.
index 49faf4362f31245ea9d0ea346eb1dcec9c987fdf..99f836c3dfebca47f0e65cf781651e2ee0487190 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/ParticipantPayment.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4acfc883c7ffc0ac03801022d6620a6c)
+ * (GenCodeChecksum:46b1d29e4240673e67e23252fd2a1e1b)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Event_DAO_ParticipantPayment extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.7';
+  const COMPONENT = 'CiviEvent';
 
   /**
    * Static instance to hold the table name.
index c68386fe3ac722c0d7b6369732470155e321cde4..028a28f1681e4b461494b122b25e70757b8d12a6 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ae55eda6ef9990e6f3c5868545b96c34)
+ * (GenCodeChecksum:05084131b15d6dd7f29ad8d62df1bb82)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.0';
+  const COMPONENT = 'CiviEvent';
 
   /**
    * Static instance to hold the table name.
index ce50f74495d3a000f28f9cadcaf7fc39c13acb4a..59caf165e00925f38ee63606941722198ef46f64 100644 (file)
@@ -535,4 +535,24 @@ class CRM_Extension_Mapper {
     CRM_Extension_System::singleton()->getClassLoader()->refresh();
   }
 
+  /**
+   * This returns a formatted string containing an extension upgrade link for the UI.
+   * @todo We should improve this to return more appropriate text. eg. when an extension is not installed
+   *   it should not say "version xx is installed".
+   *
+   * @param array $remoteExtensionInfo
+   * @param array $localExtensionInfo
+   *
+   * @return string
+   */
+  public function getUpgradeLink($remoteExtensionInfo, $localExtensionInfo) {
+    if (!empty($remoteExtensionInfo) && version_compare($localExtensionInfo['version'], $remoteExtensionInfo->version, '<')) {
+      return ts('Version %1 is installed. <a %2>Upgrade to version %3</a>.', [
+        1 => $localExtensionInfo['version'],
+        2 => 'href="' . CRM_Utils_System::url('civicrm/admin/extensions', "action=update&id={$localExtensionInfo['key']}&key={$localExtensionInfo['key']}") . '"',
+        3 => $remoteExtensionInfo->version,
+      ]);
+    }
+  }
+
 }
index 07e10ae151d9f908247b04674a8a20fe727ec23d..c7fbee1473cde9d071409b4c6e4c1dd486a9bbd9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/Currency.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:59d9bdfece27d7a08113a81a83cd36ef)
+ * (GenCodeChecksum:dfa755f71113ba5258a488c28b9a1273)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_Currency extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.7';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index b85d64b0c83937d6b2718525d5c86cff56732339..9dafc39a7188b7cd0aa75d41023f9e87b1911c2d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/EntityFinancialAccount.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:3e6010351d131140c8cf791e1ec2ee87)
+ * (GenCodeChecksum:4fc4867bfb36e44a31368515e6b9aad3)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_EntityFinancialAccount extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '4.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 186521f898d81e777df36098fe212eac0a1a7db5..8d5fd5c75eaf00cb50f5df4405d95b3e4ce79a0e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/EntityFinancialTrxn.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e834c532b7de805d7caf615f7cb1dc89)
+ * (GenCodeChecksum:4f05ac73d1ac6b79d0c9fade6ec4adbd)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_EntityFinancialTrxn extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.2';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index f424a53d07b1db8a42d0154a83a87c69174611bb..9158cf3d672346a9e2540d02c8595357edd5a9d8 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/FinancialAccount.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0ec6a6cdeba369d17f5fd2502183af58)
+ * (GenCodeChecksum:ecd889135e73d124a753ac96a7dd05bc)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_FinancialAccount extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.2';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index c1e8a499a69528139e0912c9c4041f4e6bb60307..0db8ea56c56d7c18f7596eda6f86530ff3d2a0fa 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/FinancialItem.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:07179eb8641f88a9849b268070ba3916)
+ * (GenCodeChecksum:b3bc1270d0d0769da2bd49b49585ac61)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_FinancialItem extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '4.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index c123d23defad34acad204e12acb7e9e41fc09456..5bd0cb5b1b935b5a8bf3f9e401a85da4bb115bf2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/FinancialTrxn.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:06958233f84eb778009eb5b02002f342)
+ * (GenCodeChecksum:fc046a70dcf53925768a8b28647dd6dc)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 89eacce2ec0420363a18896f5c667be625899148..b08320a0bec0426efbc14f671a07a57089c052ab 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/FinancialType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:14e5e79b764d26b8861496c73cacca14)
+ * (GenCodeChecksum:fd432275b49386f3ed17cc5697280dc4)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_FinancialType extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index b073331bd2b3efa7d46ff9c589a8e55a1c9a5e22..60158912954b1003d375b4f7e977ba31116aec6d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0333db5b51d70297d51351e8e97baec6)
+ * (GenCodeChecksum:ce0ba2d5ffb2cc00c72c3c300db8eadf)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index bcffa4ea0a327847fdddf96d64d9469aaabf7f5e..bdb4c8e09432ae834f8589b49859ce1403e5a635 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/PaymentProcessorType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:baffa34a0c2ee650a71299ea2df91b57)
+ * (GenCodeChecksum:15dff8fa9ba4df684c09d6fb8c9f0430)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index f5e020b99a263340c1b3b10f78144043803cff8b..c983f9afd618f18e15c2b955f47587e621bca400 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/PaymentToken.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ec9e29386ab9e67c4e3256bd47222eda)
+ * (GenCodeChecksum:8ceea9ee5d164fb8b69a178117a7ebb8)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Financial_DAO_PaymentToken extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '4.6';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index b40f1325a344db138a3caf4fe3818a8d901f422a..ff85efa7351cebaa2e2bd98d26127218ffb5fee7 100644 (file)
@@ -67,11 +67,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form {
    */
   public function setDefaultValues() {
     $defaults = $this->_values;
-    // Format money fields - localize for display
-    $moneyFields = ['total_amount', 'fee_amount', 'net_amount'];
-    foreach ($moneyFields as $field) {
-      $defaults[$field] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($this->_values[$field]);
-    }
+    $defaults['total_amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($this->_values['total_amount']);
     return $defaults;
   }
 
@@ -195,7 +191,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form {
       $previousFinanciaTrxn['contribution_id'] = $newFinancialTrxn['contribution_id'] = $this->_contributionID;
 
       $newFinancialTrxn['to_financial_account_id'] = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount($submittedValues['payment_instrument_id']);
-      foreach (['total_amount', 'fee_amount', 'net_amount', 'currency', 'is_payment', 'status_id'] as $fieldName) {
+      foreach (['total_amount', 'currency', 'is_payment', 'status_id'] as $fieldName) {
         $newFinancialTrxn[$fieldName] = $this->_values[$fieldName];
       }
 
index 920353eb7ca337db290173e4bcf8528abdb1592e..61d6d984838a32c9dac7ebc32cedca1c66284bad 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Friend/Friend.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:988585422bc3fa558dd2cd8b84867f30)
+ * (GenCodeChecksum:3d5fa2c27a1430537988ce50ac455566)
  */
 
 /**
index e203d546f5585b0b371fe3a7441603de8d5eb630..bc33e04c8070ee600643c5a20239b2c9b24c3b27 100644 (file)
@@ -252,7 +252,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    * @return bool|mixed
    */
   public static function del($id) {
-    CRM_Utils_Hook::pre('delete', 'Grant', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Grant', $id);
 
     $grant = new CRM_Grant_DAO_Grant();
     $grant->id = $id;
index 438641761e9d72f3f69949dc6e756eaa1ce170f6..b61479b16b27ee334a454ba92ec75e6de838f188 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Grant/Grant.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1e2a7c1d16518e1bffa40c673976aa28)
+ * (GenCodeChecksum:4ab9a294ffb22e1a8ff42103bc6f9bed)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Grant_DAO_Grant extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviGrant';
 
   /**
    * Static instance to hold the table name.
index 8a1e9529096e79d8cee9ad72191469f7686b6299..f28c1f17f5ef71360f1af6e7b109dac2d4d0d387 100644 (file)
@@ -2463,7 +2463,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
       throw new CRM_Core_Exception(ts('No id passed to mailing del function'));
     }
 
-    CRM_Utils_Hook::pre('delete', 'Mailing', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Mailing', $id);
 
     // delete all file attachments
     CRM_Core_BAO_File::deleteEntityFile('civicrm_mailing',
index 7d26a2c1000a2f9f43e615dfdd0a7d5be3befe45..e035ec6962297fba866a793a1256f2cf133293bb 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB {
       throw new CRM_Core_Exception(ts('No id passed to MailingAB del function'));
     }
     CRM_Core_Transaction::create()->run(function () use ($id) {
-      CRM_Utils_Hook::pre('delete', 'MailingAB', $id, CRM_Core_DAO::$_nullArray);
+      CRM_Utils_Hook::pre('delete', 'MailingAB', $id);
 
       $dao = new CRM_Mailing_DAO_MailingAB();
       $dao->id = $id;
index 228406bb99653bc7061edc53635c126afaa566f7..020c65b7e16fc70dabeac638b174b1446c962487 100644 (file)
@@ -1122,7 +1122,7 @@ AND    record_type_id = $targetRecordID
    * @return mixed
    */
   public static function del($id) {
-    CRM_Utils_Hook::pre('delete', 'MailingJob', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'MailingJob', $id);
 
     $jobDAO = new CRM_Mailing_BAO_MailingJob();
     $jobDAO->id = $id;
index 24d754b6b94d348f466e7311c44a228e5a5020ef..ad0248d4eef8d36fecd42a5e529c7af189a3ca2e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/BouncePattern.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:560357c028d9622650b14d00ff4a988b)
+ * (GenCodeChecksum:b6a045ddc0126618d3ee8c08a1c495b0)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_BouncePattern extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 6d2c61ffec022650285e5b4422a0e0cf53436a53..d4fcce67622df910fc96d0d6be1b3af359d4a2ad 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/BounceType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5bc7e4fa62c93ca85f2be5049c835364)
+ * (GenCodeChecksum:fda474bf7647672115d82925ba255f6d)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_BounceType extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index d4dd5e90933269adb2a34729cefa9862b35fc2a5..3fd0735bffa8a859dd81c415155eeaa6e8a2e428 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Mailing.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:99b193c66e023171c288bf12e2548c9d)
+ * (GenCodeChecksum:e64cedbbdd4a36410257c174d92faae4)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 06c9c7cfdf3d18932d693218dc2139675ed106bc..c81af427b2d3a45f250ce341c08cffea8af02489 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/MailingAB.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f272ec7c03cec8fc418235f43faee2f0)
+ * (GenCodeChecksum:175573c32fef00a9a00350db020b1696)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_MailingAB extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 739c4b73efda30476b9b803d6232fc3e993edc0f..1633191ed199a5d15cfcfec29843f6ddf82b118d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/MailingComponent.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:976aaaac1e4b5b4292eed10c4790c815)
+ * (GenCodeChecksum:c7300c29b273a7e479cd5b77bc951be8)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 2f4890745cec0b246ccd349805abe9e92e8943c9..031e68b946418c130cd48a2e5fd23f6c2504f712 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/MailingGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:01f3eba5240adc62845ac97f6e0a73db)
+ * (GenCodeChecksum:fca3e29764697a459aa7d5000fec50b5)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_MailingGroup extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index ca807ec7482d209f7b60035561cf83c9792cb842..0fd88a85e2f975d081e9c6a53e1d9f14637535cc 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/MailingJob.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:65a91689ae410dcce9b9b181269e6b4d)
+ * (GenCodeChecksum:1b9f973abaa13e77251c3082a4fa7363)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index ee3e810413f350389c8db5bcd1f61793035c562f..0a0ff212dac385bd785838370d9b8674fd854981 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Recipients.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:cbb42af0d0519d97437cb92707a169d8)
+ * (GenCodeChecksum:78ccf653fdbb92c65accfe079140cc43)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_Recipients extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 33e5f83280af577d89c3f4230f61feb860604dd7..35bf153891dfc0e318e3b3cbdc49f75462d50d8d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Spool.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4da95477da6dcac11d1f7d8aade85953)
+ * (GenCodeChecksum:20306dd6c4ce1990d47a78f8cd42606a)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_Spool extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index dd5207e8ae5da446b98ebf1b1a23968b34dcfeb9..dc6f6cc5923e3d88a5b2cda1009e563d0180cabe 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/TrackableURL.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0cf245411bb62afa6c9b8f63a903f1ad)
+ * (GenCodeChecksum:a3235a7f9b19cd9594dab7408265f615)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_DAO_TrackableURL extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 0e4f373f520743df52a1009d4f28e2c66263a249..1d20e73ee32dac4562525cd41aa352f11ea9531f 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:50ce35d916fa3bda6ce5bc04b623918e)
+ * (GenCodeChecksum:c04dd12381de74d127ab1d4263fd5065)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 4782e61fc17eb0de1e989ea7f4b1c377f2f35f0c..6f9562be61e0e543ae17dea5c6a8f4a789735fb1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Confirm.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f2ed5f47531f144f3850e179fee6c18f)
+ * (GenCodeChecksum:af8836892ba117428350b4de8dc63c2c)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Confirm extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 1b92fe506db71c5685692d0112dfdc1257cde895..413939c50ebce8f41a9be4e634743038039a8e7e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Delivered.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5c10ce5edff5d1ca52c405080756bb69)
+ * (GenCodeChecksum:c04f2a7f3f1389526bc0e4cee49fcd36)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Delivered extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index cbf07e35de4e8838022c5ac7349e0d0705bc9fa4..7b7ef56fdf77487cf5d7f324edfeaba11eb11524 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Forward.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0e75326c3a49e51e29781f8a0d532553)
+ * (GenCodeChecksum:fbbbf6b96b04c95b027d76cd7c061eae)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Forward extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 96c2c601eb4215fc64d81cfd44c986363571730a..aab7ac9dbe6e85d83d1911325c550b4d97bc652d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Opened.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b875f7351dbd80e0b09eb8aa7118a3ab)
+ * (GenCodeChecksum:cef918cb23efd8adcf04dbd0d7a0e029)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Opened extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index be83f4bf5d889e17a9f46184c8e198c9bc92719b..f488bc7b61f84810784d28f972e34d6b0283c559 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Queue.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:a1a2a9f4685e49e3888669527b7ccfc9)
+ * (GenCodeChecksum:3125dd5147f0e11ca76fae6a9377dc2e)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 28ec734dc6804def7c79886fa61a12119ca313c5..c6b462e22740cb15f4c32e9ef83ed25b0f88968c 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Reply.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:09d539a90e11ec1cb333d10900eaba88)
+ * (GenCodeChecksum:2efc7b66635682132414c6724344bf55)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Reply extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index e389110706997b443b564e5f42929d3be403499d..ae51468cefe720a80abd203956d35c3a692a03b7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Subscribe.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:29a50c0404f021195a3102f41a67f3fa)
+ * (GenCodeChecksum:c1a80e519891849628fc022202ebab69)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Subscribe extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 8d066db1b458d0bc3daada0ed29f5ff2bb2d4f37..e4e40d6f9530c386df404aaa2dda264dfbc786a0 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/TrackableURLOpen.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7e3b22693523f8453eaa28a44a286de9)
+ * (GenCodeChecksum:b72c3391aec97b4f66c2004364f597b3)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_TrackableURLOpen extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 102f53854facade257f5336c485025596df4504b..c351b71e570b4a1669e2fd56f76a6d7d72e58c98 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Event/Unsubscribe.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:cbe929e71408b28356b7f66c16fd630b)
+ * (GenCodeChecksum:20666a88b096371a3db2f12eb77a1404)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Mailing_Event_DAO_Unsubscribe extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '';
+  const COMPONENT = 'CiviMail';
 
   /**
    * Static instance to hold the table name.
index 382fb5ba70d10e83492056f138857840f47fb3f0..ab9743aca9bd47ddc4ad2de4cae1452354289d8e 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/Membership.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d7667a8f99b6f74f97eb5d167a10588a)
+ * (GenCodeChecksum:c69464029008f62263d9befb37b79391)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Member_DAO_Membership extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.5';
+  const COMPONENT = 'CiviMember';
 
   /**
    * Static instance to hold the table name.
index 9a1b171e38be750500808f803aef9438f117ba87..eabb31bbfc48a2b4a4b827c1ff5a31a42501dc5d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/MembershipBlock.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:213063eacc89b54159a5b8a9be83e154)
+ * (GenCodeChecksum:5e9363fa5064faee6dc27f96afcb4cf3)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Member_DAO_MembershipBlock extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.5';
+  const COMPONENT = 'CiviMember';
 
   /**
    * Static instance to hold the table name.
index d290e78d3dc273cf63b2a0cf856ca69459882586..ebb957e58d1f62ed870005db80ed436caf3a1b2d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/MembershipLog.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:c566d3d521cd6d8c69985dfee3966f32)
+ * (GenCodeChecksum:7374d7db00c9fe6e86a696434b8bba6f)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Member_DAO_MembershipLog extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.5';
+  const COMPONENT = 'CiviMember';
 
   /**
    * Static instance to hold the table name.
index 86a3fa30639943382b4e25317d32abadc08c2537..473e59f279625f148c0b03722edf6aabd98b5817 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/MembershipPayment.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f9f29f55166a77a306e48917878c13eb)
+ * (GenCodeChecksum:19e551db721c6a286c81456c16568bea)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Member_DAO_MembershipPayment extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.5';
+  const COMPONENT = 'CiviMember';
 
   /**
    * Static instance to hold the table name.
index 9dac1319e1960a94af4383c20ab83d72f057964c..94ec0409d5e3bb0b7f0668383a8504a6848e8155 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/MembershipStatus.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8a9ae3df6a24e73e88c365b49b794939)
+ * (GenCodeChecksum:32d46c01e3eb4143e83820310037df39)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.5';
+  const COMPONENT = 'CiviMember';
 
   /**
    * Static instance to hold the table name.
index 2a26d7176ea823233a1a7419edc27fa21a76a889..3407bf99779cbd1e61a4720fe5b5df31dae6988b 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/MembershipType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:23a28ee6fccd8f82844eb2bd78968ce1)
+ * (GenCodeChecksum:867428c502b94f8a8ed29082ac7c3845)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Member_DAO_MembershipType extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.5';
+  const COMPONENT = 'CiviMember';
 
   /**
    * Static instance to hold the table name.
index 6fdd36d0275380d8eb62600bce4d631c9174aed5..9b6afa3dc58064c5198c99e11fd90f8fee2900f5 100644 (file)
@@ -340,7 +340,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id = %2 AND cc.is_test = 0";
    *   Campaign page id.
    */
   public static function deleteById($id) {
-    CRM_Utils_Hook::pre('delete', 'Campaign', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Campaign', $id);
 
     $transaction = new CRM_Core_Transaction();
 
index deba667bfe0cac4caac8aa401d4a7418f05be8dc..44e31fff1e96fccb520eddf019737b1726a426e6 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/PCP/PCP.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:90c78e7a79e25aedd5c724e39954fce1)
+ * (GenCodeChecksum:6799d7afab4c8caeb518d19653090978)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_PCP_DAO_PCP extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.2';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 3ddc6b2ecb9a08f9ffbc126c8e709c2fb9a37bab..e11b5782ed8844e194aeee33d8d8b36eb9246c90 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/PCP/PCPBlock.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:520b1c5953cbbc59f2d8f017a47447ce)
+ * (GenCodeChecksum:4e188de537dbafef837dcc55947ee1b4)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_PCP_DAO_PCPBlock extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.2';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 9bc13cda3129ec13397964d09e3972e705a993f5..299e3ffa56b0303c593f7f51311d001363163350 100644 (file)
@@ -285,7 +285,7 @@ class CRM_Pledge_BAO_Pledge extends CRM_Pledge_DAO_Pledge {
    * @return mixed
    */
   public static function deletePledge($id) {
-    CRM_Utils_Hook::pre('delete', 'Pledge', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'Pledge', $id);
 
     $transaction = new CRM_Core_Transaction();
 
index a3b80ff7d86102dd78c6140bef42a796ec75e31d..68304860c22e5be0727b5488167affea94320b77 100644 (file)
@@ -93,7 +93,7 @@ class CRM_Pledge_BAO_PledgeBlock extends CRM_Pledge_DAO_PledgeBlock {
    * @return mixed|null
    */
   public static function deletePledgeBlock($id) {
-    CRM_Utils_Hook::pre('delete', 'PledgeBlock', $id, CRM_Core_DAO::$_nullArray);
+    CRM_Utils_Hook::pre('delete', 'PledgeBlock', $id);
 
     $transaction = new CRM_Core_Transaction();
 
index 9ad4fd299a3876706c43642cea3b7de8011dc0e9..f1c70bf347f3ec4be4e9b6f57e6d5ae2bdc28dca 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Pledge/Pledge.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:90520b21b729953e89642a110732c3a7)
+ * (GenCodeChecksum:186d3064229a2bd8a2de2483b4bb90c6)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.1';
+  const COMPONENT = 'CiviPledge';
 
   /**
    * Static instance to hold the table name.
index 181d04dce81dddd48c0fcaf35b38d0c1fade419e..048230641b853383ccf2fbbf6a503dffa8095aa9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Pledge/PledgeBlock.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0013d80a4d2323ab5165901d323c642d)
+ * (GenCodeChecksum:044b9e8fedad0a0e71621172f92bddfb)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Pledge_DAO_PledgeBlock extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.1';
+  const COMPONENT = 'CiviPledge';
 
   /**
    * Static instance to hold the table name.
index b05d0fb9929af7ffdb63adbd1eed35ceaab978ee..ffbca53c75981ba116cf7bbdb49e569c346d6242 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Pledge/PledgePayment.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:29c227f26fe3caa851814aaaf7145a07)
+ * (GenCodeChecksum:4daa04efc77569c5e172fb2c92c956b2)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Pledge_DAO_PledgePayment extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.1';
+  const COMPONENT = 'CiviPledge';
 
   /**
    * Static instance to hold the table name.
index 1bf602f677fb92190fd215fe64df8784ca00f68c..262413aa4d24e861cec83c4840ee5726252457df 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Price/LineItem.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6a7eb4dd390df7342c9a7d81f308d5e8)
+ * (GenCodeChecksum:eeaf69c8d27acbb7ad4dd4eba0c587d7)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Price_DAO_LineItem extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.7';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 4c22eaffc5899281c59c1239d51977dafd3d3032..ec4c8e9d665f7bf0b79c0636d8e6db6ecbcca146 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Price/PriceField.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d7e79b4e9e95854e162c629324a05004)
+ * (GenCodeChecksum:82c753fc735a0a09af3c426fff7603cf)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Price_DAO_PriceField extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 1c9a8ba91d9dfcb060d006faf40e999f3b677edd..25791f373cc240bf7deeb088170a6b39b286b187 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Price/PriceFieldValue.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fca6ff018517b3def65b2a381f400c69)
+ * (GenCodeChecksum:d01e238a4afcdf6b79cc2dc59987361d)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '3.3';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index cd9c6244dadf7f3e74411497f224242f25c39021..223ff10f4ad2cf8d81211e1dace8abf004df53b1 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Price/PriceSet.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:af23f33ee60d1b06662c4e11187dbcb6)
+ * (GenCodeChecksum:9252b0d8247c5419198250cbf0a2a9d4)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Price_DAO_PriceSet extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 16e92b3a84f01d3e9c7ec6c0c6814c25c3811846..9f28417ca179d363b57f62846f90fe79a3f7edee 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Price/PriceSetEntity.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:bbdb5b9c0e6f8df52ab74238ec47883d)
+ * (GenCodeChecksum:b85629f3ae24a3f503327a5d60f4f17f)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Price_DAO_PriceSetEntity extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '1.8';
+  const COMPONENT = 'CiviContribute';
 
   /**
    * Static instance to hold the table name.
index 88737075a2fc226fcaaa9865267ccb06dab3d8a8..8eb9f6476ed0cddbeaafe17059d5c36b13dae046 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Queue/QueueItem.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:21270fc0075d353032051ac4343095bc)
+ * (GenCodeChecksum:2ec3738d4db4ad5473162176d25f552c)
  */
 
 /**
index a0e9823737dcea67e3db8568f8166c2128c38a5a..84c549150394c3c1e87e6cdd199049d5da2e0465 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Report/ReportInstance.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4a333db47b94692a5cbc5395fdfcb899)
+ * (GenCodeChecksum:7c11a51cc566e33761a9f06522c43bbd)
  */
 
 /**
@@ -15,6 +15,7 @@
 class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
   const EXT = 'civicrm';
   const TABLE_ADDED = '2.2';
+  const COMPONENT = 'CiviReport';
 
   /**
    * Static instance to hold the table name.
index 1af2b2b570e5982a81453f3aebfaca297c3650da..e3358134396b047eddbc42e88060abc4cee99edc 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/SMS/Provider.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:abd82ad9d4a5b45b82523ec84dcf848a)
+ * (GenCodeChecksum:6501ba50ba1ce7df2d0408cc78bb012c)
  */
 
 /**
index 5a4d3dd570a5e70c57dcd27212e2bd10ad002db7..c464d1a2f4f546c804d5235860ff061b72fc036d 100644 (file)
@@ -363,7 +363,6 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     }
     else {
       // get the submitted form values.
-      $ids = [];
       $params = $this->controller->exportValues($this->_name);
 
       if (!array_key_exists('is_active', $params)) {
@@ -371,7 +370,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
       }
 
       if ($this->_action & (CRM_Core_Action::UPDATE)) {
-        $ids['ufgroup'] = $this->_id;
+        $params['id'] = $this->_id;
         // CRM-5284
         // lets skip trying to mess around with profile weights and allow the user to do as needed.
       }
@@ -382,7 +381,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
       }
 
       // create uf group
-      $ufGroup = CRM_Core_BAO_UFGroup::add($params, $ids);
+      $ufGroup = CRM_Core_BAO_UFGroup::add($params);
 
       if (!empty($params['is_active'])) {
         //make entry in uf join table
diff --git a/CRM/Upgrade/Incremental/php/FiveThirtyFour.php b/CRM/Upgrade/Incremental/php/FiveThirtyFour.php
new file mode 100644 (file)
index 0000000..03c0ba7
--- /dev/null
@@ -0,0 +1,72 @@
+<?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 FiveThirtyFour */
+class CRM_Upgrade_Incremental_php_FiveThirtyFour 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;
+  // }
+
+}
diff --git a/CRM/Upgrade/Incremental/sql/5.33.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.33.beta1.mysql.tpl
new file mode 100644 (file)
index 0000000..55a35a7
--- /dev/null
@@ -0,0 +1 @@
+{* file to handle db changes in 5.33.beta1 during upgrade *}
diff --git a/CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl
new file mode 100644 (file)
index 0000000..5d1c91f
--- /dev/null
@@ -0,0 +1 @@
+{* file to handle db changes in 5.34.alpha1 during upgrade *}
index 29e0a2fd6a8561b628f812abcb54fab30ad14cc0..6b5f4f1778c4d0b53e646b8f76b6e79c2fb9bbaa 100644 (file)
@@ -620,23 +620,16 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
 
         case CRM_Extension_Manager::STATUS_INSTALLED:
           if (!empty($remotes[$key]) && version_compare($row['version'], $remotes[$key]->version, '<')) {
-            $updates[] = ts('%1 (%2) version %3 is installed. <a %4>Upgrade to version %5</a>.', [
-              1 => $row['label'] ?? NULL,
-              2 => $key,
-              3 => $row['version'],
-              4 => 'href="' . CRM_Utils_System::url('civicrm/admin/extensions', "action=update&id=$key&key=$key") . '"',
-              5 => $remotes[$key]->version,
-            ]);
+            $updates[] = $row['label'] . ': ' . $mapper->getUpgradeLink($remotes[$key], $row);
           }
           else {
             if (empty($row['label'])) {
               $okextensions[] = $key;
             }
             else {
-              $okextensions[] = ts('%1 (%2) version %3', [
+              $okextensions[] = ts('%1: Version %2', [
                 1 => $row['label'],
-                2 => $key,
-                3 => $row['version'],
+                2 => $row['version'],
               ]);
             }
           }
index 47233dd4bd7c8bb1d09f5f44803b3311ec0fd56a..f173abac3bf2955e94aa4e49f799b737de7ddd14 100644 (file)
@@ -339,7 +339,7 @@ abstract class CRM_Utils_Hook {
    * @return null
    *   the return value is ignored
    */
-  public static function pre($op, $objectName, $id, &$params) {
+  public static function pre($op, $objectName, $id, &$params = []) {
     $event = new \Civi\Core\Event\PreEvent($op, $objectName, $id, $params);
     \Civi::dispatcher()->dispatch('hook_civicrm_pre', $event);
     return $event->getReturnValues();
diff --git a/CRM/Utils/Monaco.php b/CRM/Utils/Monaco.php
new file mode 100644 (file)
index 0000000..e147904
--- /dev/null
@@ -0,0 +1,33 @@
+<?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       |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ *
+ * @package CiviCRM
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
+ */
+class CRM_Utils_Monaco {
+
+  /**
+   * Get a list of JS variables (`CRM.crmMonaco`) to provide to the browser.
+   *
+   * @return array
+   * @see CRM_Utils_Hook::alterAngular()
+   */
+  public static function getSettings() {
+    return [
+      'paths' => [
+        'vs' => Civi::paths()->getUrl('[civicrm.bower]/monaco-editor/min/vs'),
+      ],
+    ];
+  }
+
+}
index fa6d8ac92651c9a2dc851fc676e8c4dbc94ad891..deb80cb60e458d5ea3b65f001123de3ed9ba570a 100644 (file)
@@ -835,4 +835,16 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
     return ['ufAccessURL' => \Drupal\Core\Url::fromRoute('user.admin_permissions')->toString()];
   }
 
+  /**
+   * Start a new session.
+   */
+  public function sessionStart() {
+    if (\Drupal::hasContainer()) {
+      $session = \Drupal::service('session');
+      if (!$session->isStarted()) {
+        $session->start();
+      }
+    }
+  }
+
 }
index 98cb5a88fd8a9fadab1e872a04a57a30b26af718..1b2d22ebf2b8311135ed3b00f562bc69c45eb97e 100644 (file)
@@ -24,7 +24,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
    * Get a normalized version of the wpBasePage.
    */
   public static function getBasePage() {
-    return rtrim(Civi::settings()->get('wpBasePage'), '/');
+    return strtolower(rtrim(Civi::settings()->get('wpBasePage'), '/'));
   }
 
   /**
index 7fbc9ca4f3d428b1b39283c446b91c186884f47f..2ecf2f1514d41a22f32e278face614dd819adbb6 100644 (file)
@@ -105,6 +105,7 @@ class Manager {
       $angularModules['crmAttachment'] = include "$civicrm_root/ang/crmAttachment.ang.php";
       $angularModules['crmAutosave'] = include "$civicrm_root/ang/crmAutosave.ang.php";
       $angularModules['crmCxn'] = include "$civicrm_root/ang/crmCxn.ang.php";
+      $angularModules['crmMonaco'] = include "$civicrm_root/ang/crmMonaco.ang.php";
       $angularModules['crmResource'] = include "$civicrm_root/ang/crmResource.ang.php";
       $angularModules['crmRouteBinder'] = include "$civicrm_root/ang/crmRouteBinder.ang.php";
       $angularModules['crmUi'] = include "$civicrm_root/ang/crmUi.ang.php";
index db5f774fdee389bef2dee5fc37a8d4d660e1b607..01de7979ea3589071794c254e69194d6a6e45f22 100644 (file)
@@ -30,6 +30,7 @@ namespace Civi\Api4;
  *
  * Creating a new ACL requires at minimum an entity table, entity ID and object_table.
  *
+ * @searchable false
  * @see https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control
  * @package Civi\Api4
  */
index 3b8484e16f1a7b0978577ddd4ce718a9092d27f9..4c2cbf2e8b3d3e723e4c23b7dace477f255127ed 100644 (file)
@@ -25,7 +25,7 @@ use Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable;
 /**
  * Get the names & docblocks of all APIv4 entities.
  *
- * Scans for api entities in core + enabled extensions.
+ * Scans for api entities in core, enabled components & enabled extensions.
  *
  * Also includes pseudo-entities from multi-record custom groups by default.
  *
@@ -50,6 +50,7 @@ class Get extends \Civi\Api4\Generic\BasicGetAction {
     $locations = array_merge([\Civi::paths()->getPath('[civicrm.root]/Civi.php')],
       array_column(\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(), 'filePath')
     );
+    $enabledComponents = array_keys(\CRM_Core_Component::getEnabledComponents());
     foreach ($locations as $location) {
       $dir = \CRM_Utils_File::addTrailingSlash(dirname($location)) . 'Civi/Api4';
       if (is_dir($dir)) {
@@ -62,7 +63,10 @@ class Get extends \Civi\Api4\Generic\BasicGetAction {
             && is_a($entity, '\Civi\Api4\Generic\AbstractEntity', TRUE)
           ) {
             $info = $entity::getInfo();
-            $entities[$info['name']] = $info;
+            // Only include DAO entities from enabled components
+            if (empty($info['dao']) || !defined($info['dao'] . '::COMPONENT') || in_array(constant($info['dao'] . '::COMPONENT'), $enabledComponents)) {
+              $entities[$info['name']] = $info;
+            }
           }
         }
       }
index 86cf74fc9db7bf5bf73386f9e704a4fc7ca5a675..2451af42925560e9f176e6bb7f29c8bb5a1bf780 100644 (file)
@@ -28,6 +28,7 @@ namespace Civi\Api4;
  *
  * Creating a new ActionSchedule requires at minimum a title, mapping_id and entity_value.
  *
+ * @searchable false
  * @see https://docs.civicrm.org/user/en/latest/email/scheduled-reminders/
  * @package Civi\Api4
  */
index d2ebd1b25b173c325db39de693a6efb858410c79..ac6731e569f4f5e00d8bc0fd06b4ed9137ecfdf8 100644 (file)
@@ -33,5 +33,6 @@ namespace Civi\Api4;
  * @package Civi\Api4
  */
 class ContactType extends Generic\DAOEntity {
+  use Generic\Traits\OptionList;
 
 }
diff --git a/Civi/Api4/ContributionSoft.php b/Civi/Api4/ContributionSoft.php
new file mode 100644 (file)
index 0000000..17dc9fd
--- /dev/null
@@ -0,0 +1,22 @@
+<?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       |
+ +--------------------------------------------------------------------+
+ */
+
+namespace Civi\Api4;
+
+/**
+ * ContributionSoft entity.
+ *
+ * @package Civi\Api4
+ */
+class ContributionSoft extends Generic\DAOEntity {
+
+}
index 7ac3b10657129ea75b948e97d3fc152a877c83b3..1d4b7e104bdc5d4870dc104d5bda3c42e5c7c68d 100644 (file)
@@ -23,7 +23,7 @@ namespace Civi\Api4;
  * CustomField entity.
  *
  * @see https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class CustomField extends Generic\DAOEntity {
index 14a878354b29f8ab03d49f6e219e5de80c6b4178..7a87a2bde0f0ab6710062638ca323f1ef9156742 100644 (file)
@@ -23,7 +23,7 @@ namespace Civi\Api4;
  * CustomGroup entity.
  *
  * @see https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class CustomGroup extends Generic\DAOEntity {
index d5c9c12c7734b95099b69e1fc7a74e6b4bac3368..24b42557a6e0b4a0a722ac3912a15856c1ac04d5 100644 (file)
@@ -28,6 +28,7 @@ namespace Civi\Api4;
  * Displaying an item to a user is done with the `DashboardContact` entity.
  *
  * @see \Civi\Api4\DashboardContact
+ * @searchable false
  * @package Civi\Api4
  */
 class Dashboard extends Generic\DAOEntity {
index 4ca8b6ecf61b7945971dcdda6fa95b78da40c769..f2538b326c4a4d12bd703f0bcf042fe79729d5fe 100644 (file)
@@ -24,6 +24,7 @@ namespace Civi\Api4;
  * This places a dashboard item on a user's home screen.
  *
  * @see \Civi\Api4\Dashboard
+ * @searchable false
  * @package Civi\Api4
  */
 class DashboardContact extends Generic\DAOEntity {
index a8a40cac74d4ef75bae23801bdc7cd3e7811aca1..8d356fac3200043b609714d6dd9c68ff9ef4c35c 100644 (file)
@@ -23,7 +23,7 @@ namespace Civi\Api4;
  * Domains - multisite instances of CiviCRM.
  *
  * @see https://docs.civicrm.org/sysadmin/en/latest/setup/multisite/
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class Domain extends Generic\DAOEntity {
index e326df383075d56de198430ad112e63bd65009f5..8dec4cebaf213a462c297b2a2f256144c914f881 100644 (file)
@@ -84,6 +84,10 @@ class Entity extends Generic\AbstractEntity {
           'name' => 'dao',
           'description' => 'Class name for dao-based entities',
         ],
+        [
+          'name' => 'searchable',
+          'description' => 'Should this entity be selectable in search kit UI',
+        ],
         [
           'name' => 'paths',
           'data_type' => 'Array',
index a07dc847d17893762b6a28149a1cf58d9b01ad1f..d4e775ecefe1bae7729d89c2ae6fc98bbb1aa548 100644 (file)
@@ -139,8 +139,9 @@ abstract class AbstractEntity {
     foreach (ReflectionUtils::getTraits(static::class) as $trait) {
       $info['type'][] = self::stripNamespace($trait);
     }
+    $info['searchable'] = !in_array('OptionList', $info['type']);
     $reflection = new \ReflectionClass(static::class);
-    $info += ReflectionUtils::getCodeDocs($reflection, NULL, ['entity' => $info['name']]);
+    $info = array_merge($info, ReflectionUtils::getCodeDocs($reflection, NULL, ['entity' => $info['name']]));
     unset($info['package'], $info['method']);
     return $info;
   }
index 2fed2b7f467c08845ddc67fbb9135ce089c522b6..5a7a0e33127607b914774beb577f54b6af635ce9 100644 (file)
@@ -83,7 +83,7 @@ trait CustomValueActionTrait {
     $customTable = CoreUtil::getTableName($this->getEntityName());
     $ids = [];
     foreach ($items as $item) {
-      \CRM_Utils_Hook::pre('delete', $this->getEntityName(), $item['id'], \CRM_Core_DAO::$_nullArray);
+      \CRM_Utils_Hook::pre('delete', $this->getEntityName(), $item['id']);
       \CRM_Utils_SQL_Delete::from($customTable)
         ->where('id = #value')
         ->param('#value', $item['id'])
index 1123021dba96d755011cadbcc313445a4976d5ba..49b17680cd4e35725245305c4d0464d632023d2a 100644 (file)
@@ -15,6 +15,8 @@ namespace Civi\Api4\Generic\Traits;
  * A bridge is a small table that provides an intermediary link between two other tables.
  *
  * The API can automatically incorporate a Bridge into a join expression.
+ *
+ * Note: at time of writing this trait does nothing except affect the "type" shown in Entity::get() metadata.
  */
 trait EntityBridge {
 
index fb400cc55eef077f20e432fd3c6580664617f510..70936e0119af9d24111cc5f86f304978e16e0405 100644 (file)
@@ -15,6 +15,9 @@ namespace Civi\Api4\Generic\Traits;
  * An optionList is a small entity whose primary purpose is to supply a semi-static list of options to fields in other entities.
  *
  * The options appear in the field metadata for other entities that reference this one via pseudoconstant.
+ *
+ * Note: At time of writing, this trait does nothing except toggle the searchable flag, (and adds "OptionList" to the "type" in Entity::get() metadata).
+ * @searchable false (FYI annotation isn't functional because this is a trait - workaround in AbstractEntity::getInfo)
  */
 trait OptionList {
 
index 10e6b8d17430340a91703c06056d0793ea67b20d..a8376088b9666032038f6158cf7a0901ca0c1129 100644 (file)
@@ -22,7 +22,7 @@ namespace Civi\Api4;
  * GroupNesting entity.
  *
  * @see \Civi\Api4\Group
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class GroupNesting extends Generic\DAOEntity {
index d7229a22ff439ec1f78b1286e9d87dd5d12f1a5b..87b683810b84fa3cae70460b2dbc4b6b77c368d7 100644 (file)
@@ -27,5 +27,6 @@ namespace Civi\Api4;
  * @package Civi\Api4
  */
 class GroupOrganization extends Generic\DAOEntity {
+  use Generic\Traits\EntityBridge;
 
 }
index 6b0ac77de9a15fa0ad186f3d13ed5ac23a662202..03c2c9752ca9d1ba6795cc10c99c9ff7e14a1170 100644 (file)
 namespace Civi\Api4;
 
 /**
- * ContributionPage entity.
+ * LocBlock entity.
  *
+ * Links addresses, emails & phones to Events.
+ *
+ * @searchable false
  * @package Civi\Api4
  */
 class LocBlock extends Generic\DAOEntity {
index 012a7869f222856f04555db2cb08a3ad70b5bbad..d5c70622c643fd1d5b788d5a75b9272a092fbd1c 100644 (file)
@@ -22,6 +22,7 @@ namespace Civi\Api4;
 /**
  * MailSettings entity.
  *
+ * @searchable false
  * @package Civi\Api4
  */
 class MailSettings extends Generic\DAOEntity {
index bd45b0b8d7a2c1e9365abd3ea296bdbe9ea2ab30..9c74f7d497db11df461356fadae5a009b31e6f36 100644 (file)
@@ -23,6 +23,7 @@ namespace Civi\Api4;
  *
  * This is a collection of MappingFields, for reuse in import, export, etc.
  *
+ * @searchable false
  * @package Civi\Api4
  */
 class Mapping extends Generic\DAOEntity {
index 23cb5e0ca96404778be7e4a74f29d433e9e2930f..bde710c401942b48d9e99be8b76d91dd1b216775 100644 (file)
@@ -24,7 +24,7 @@ namespace Civi\Api4;
  * This represents one field in a Mapping collection.
  *
  * @see \Civi\Api4\Mapping
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class MappingField extends Generic\DAOEntity {
index 10101db1538f01f6c9aecd08913c919cf694a975..5f05a517d554ba038b64a3f23f2b9ace61b60b28 100644 (file)
@@ -22,7 +22,7 @@ namespace Civi\Api4;
  * MsgTemplate entity.
  *
  * This is a collection of MsgTemplate, for reuse in import, export, etc.
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class MessageTemplate extends Generic\DAOEntity {
index 3ae9e5cb09f69d779835f2f078d0bd7c8c7effe1..57963db4e40ea4dfe628a793fa5fc8677ba2b15e 100644 (file)
@@ -21,6 +21,7 @@ namespace Civi\Api4;
 /**
  * Navigation entity.
  *
+ * @searchable false
  * @package Civi\Api4
  */
 class Navigation extends Generic\DAOEntity {
index 51a7c60a1deaba865d8af1ed08a501038678552d..a25bed16949147dec30ee09aa5c066b85843da77 100644 (file)
@@ -26,5 +26,6 @@ namespace Civi\Api4;
  * @package Civi\Api4
  */
 class OptionGroup extends Generic\DAOEntity {
+  use Generic\Traits\OptionList;
 
 }
index c15a4487337f158258aa8eacfedf07708132d721..c864069478c1b4f47a708d39820b675ba7f5fa1e 100644 (file)
@@ -25,5 +25,6 @@ namespace Civi\Api4;
  * @package Civi\Api4
  */
 class PaymentProcessor extends Generic\DAOEntity {
+  use Generic\Traits\OptionList;
 
 }
index dd76ecc23e211f0593c3db5f7b74f14c661b19a1..276da78074d04a2c12284e9b037ec5db618a91ed 100644 (file)
@@ -23,7 +23,7 @@ namespace Civi\Api4;
  * Relationship entity.
  *
  * @see https://docs.civicrm.org/user/en/latest/organising-your-data/relationships/
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class Relationship extends Generic\DAOEntity {
index a407a5093e4f4fee61d1ce0890ae83890a659ce7..6681b645ecfb6294485ddfc40fb948f20a71cb2c 100644 (file)
@@ -26,7 +26,7 @@ namespace Civi\Api4;
  * Note: this is a read-only api as routes are set via xml files and hooks.
  *
  * @see https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterMenu/
- *
+ * @searchable false
  * @package Civi\Api4
  */
 class Route extends \Civi\Api4\Generic\AbstractEntity {
index 1262b6747ed00fd49ffc0c7c6baff5bba00abc04..79c5e0c2e9cf1ac8179bee8e4fc0d4617c6ad472 100644 (file)
@@ -25,6 +25,7 @@ namespace Civi\Api4;
  * Stores search parameters for populating smart groups with live results.
  *
  * @see https://docs.civicrm.org/user/en/latest/organising-your-data/smart-groups/
+ * @searchable false
  * @package Civi\Api4
  */
 class SavedSearch extends Generic\DAOEntity {
index a5d3654c98f7e1ad1ee8592eb480edfeee1f5e20..f97627b6aa0444e0361ddf2798ba3533f3f98cda 100644 (file)
@@ -25,6 +25,7 @@ namespace Civi\Api4;
  * Used to read/write persistent setting data from CiviCRM.
  *
  * @see \Civi\Core\SettingsBag
+ * @searchable false
  * @package Civi\Api4
  */
 class Setting extends Generic\AbstractEntity {
index d56476e13ebf75cfca291734a16f1f110589f482..4a2ece25ddb356a92189dd59d3673eebcbda8ad3 100644 (file)
@@ -24,6 +24,7 @@ namespace Civi\Api4;
  *
  * For setting "hush" preferences for system check alerts.
  *
+ * @searchable false
  * @package Civi\Api4
  */
 class StatusPreference extends Generic\DAOEntity {
index 2f8db8784c1047dccc2cedcd1f8ca1f0fd96c477..6d044da20728b3282aaceb766ec24dc55ba7c556 100644 (file)
@@ -23,6 +23,7 @@ namespace Civi\Api4;
  * UFField entity - aka profile fields.
  *
  * @see \Civi\Api4\UFGroup
+ * @searchable false
  * @package Civi\Api4
  */
 class UFField extends Generic\DAOEntity {
index 2d66a7257108560558ada06b4c16aae2616cadf8..2f80638a07bc5609dc2d26010b97f94765a326fc 100644 (file)
@@ -23,6 +23,7 @@ namespace Civi\Api4;
  * UFGroup entity - AKA profiles.
  *
  * @see https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/
+ * @searchable false
  * @package Civi\Api4
  */
 class UFGroup extends Generic\DAOEntity {
index a5c8ce90088ba0f4f9efcad269c5969c0fc79da5..b1c874a93fe3aeaa1b9a0669ba85bcfe6e333ba6 100644 (file)
@@ -23,6 +23,7 @@ namespace Civi\Api4;
  * UFJoin entity - links profiles to the components/extensions they are used for.
  *
  * @see \Civi\Api4\UFGroup
+ * @searchable false
  * @package Civi\Api4
  */
 class UFJoin extends Generic\DAOEntity {
index c7956c9d88c131971763f134b5d2f3ebdc91ed5f..05cd8fa5a568729ec8a350e346c500af175db4cc 100644 (file)
@@ -22,6 +22,7 @@ namespace Civi\Api4;
 /**
  * UFMatch entity - links civicrm contacts with users created externally
  *
+ * @searchable false
  * @package Civi\Api4
  */
 class UFMatch extends Generic\DAOEntity {
index 0733b20f891fe5b26f63ed02dab49fb6ea81d4b2..cb7ddb01dc5b61e4b61acf1fbb25de507367b7c7 100644 (file)
@@ -95,6 +95,9 @@ class ReflectionUtils {
         elseif ($key == 'throws' || $key == 'see') {
           $info[$key][] = implode(' ', $words);
         }
+        elseif ($key == 'searchable') {
+          $info[$key] = strtolower($words[0]) !== 'false';
+        }
         elseif ($key == 'param' && $words) {
           $type = $words[0][0] !== '$' ? explode('|', array_shift($words)) : NULL;
           $param = rtrim(array_shift($words), '-:()/');
index 176564a686632b143e64d2566f2f243615f92b9b..f84c4c2f98019c1f2eec7e751394a0595a39cc7e 100644 (file)
@@ -173,7 +173,7 @@ trait Api3TestTrait {
 
   /**
    * This function exists to wrap api getValue function & check the result
-   * so we can ensure they succeed & throw exceptions without litterering the test with checks
+   * so we can ensure they succeed & throw exceptions without littering the test with checks
    * There is a type check in this
    *
    * @param string $entity
index 56faec438aa814e61bf00876a5069c1170702cd7..1f6a7d3fe7285c530fd51ae2ea8cd93edb8f871c 100644 (file)
@@ -20,7 +20,7 @@
           >
           <option value="">{{:: ts('Automatic') }}</option>
           <option ng-repeat="locType in model.fields.location_type_id.options"
-                  ng-value="locType.key">{{locType.value}}</option>
+                  value="{{ locType.key }}">{{locType.value}}</option>
         </select>
       </div>
 
@@ -32,7 +32,7 @@
           ng-model="model.mailing.email_selection_method"
           >
           <option ng-repeat="selMet in model.fields.email_selection_method.options"
-                  ng-value="selMet.key">{{selMet.value}}</option>
+                  value="{{ selMet.key }}">{{selMet.value}}</option>
         </select>
       </div>
 
index 0b0063fc1f73ddc4b91ffc9c530d21e42be514f4..522edfd7c43aff3b25ffc0e4935b656109c5b852 100644 (file)
@@ -26,7 +26,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
             ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
             >
             <option value=""></option>
-            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" value="{{ frm.id }}">{{frm.msg_title}}</option>
           </select>
           <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{:: ts('Save As') }}"></a>
         </div>
@@ -42,7 +42,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
             ng-change="loadTemplate(abtest.mailings.a, abtest.mailings.a.msg_template_id)"
             >
             <option value=""></option>
-            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" value="{{ frm.id }}">{{frm.msg_title}}</option>
           </select>
           <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.a)" class="crm-hover-button" title="{{:: ts('Save As') }}"></a>
         </div>
@@ -58,7 +58,7 @@ processed by Angular; if false, the field will be hidden and completely ignored
             ng-change="loadTemplate(abtest.mailings.b, abtest.mailings.b.msg_template_id)"
             >
             <option value=""></option>
-            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id">{{frm.msg_title}}</option>
+            <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" value="{{ frm.id }}">{{frm.msg_title}}</option>
           </select>
           <a crm-icon="fa-floppy-o" ng-click="saveTemplate(abtest.mailings.b)" class="crm-hover-button" title="{{:: ts('Save As') }}"></a>
         </div>
index 0d5c1499e8b0c5a87a2f14795a0f7bbbd6cb3956..9e102810c2de85b38b8f870c5f6f811cada5488b 100644 (file)
@@ -13,13 +13,13 @@ Required vars: mailingABList
     <span>
       <select crm-ui-select style="width: 10em;" ng-model="filter.status">
         <option value="">{{:: ts('- Status -') }}</option>
-        <option ng-repeat="o in fields.status.options" ng-value="o.key">{{o.value}}</option>
+        <option ng-repeat="o in fields.status.options" value="{{o.key}}">{{o.value}}</option>
       </select>
     </span>
     <span>
       <select crm-ui-select style="width: 20em;" ng-model="filter.testing_criteria">
         <option value="">{{:: ts('- Test Type -') }}</option>
-        <option ng-repeat="o in fields.testing_criteria.options" ng-value="o.key">{{o.value}}</option>
+        <option ng-repeat="o in fields.testing_criteria.options" value="{{o.key}}">{{o.value}}</option>
       </select>
     </span>
   </form>
diff --git a/ang/crmMonaco.ang.php b/ang/crmMonaco.ang.php
new file mode 100644 (file)
index 0000000..9583ac4
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+return array(
+  'ext' => 'civicrm',
+  'js' => [
+    'bower_components/monaco-editor/min/vs/loader.js',
+    'ang/crmMonaco.js',
+    //    'ang/crmMonaco/*.js',
+    //    'ang/crmMonaco/*/*.js',
+  ],
+  'css' => ['ang/crmMonaco.css'],
+  // 'partials' => ['ang/crmMonaco'],
+  'requires' => ['crmUi', 'crmUtil'],
+  'settingsFactory' => ['CRM_Utils_Monaco', 'getSettings'],
+  'basePages' => [],
+  'exports' => [
+    'crm-monaco' => 'A',
+  ],
+);
diff --git a/ang/crmMonaco.css b/ang/crmMonaco.css
new file mode 100644 (file)
index 0000000..1907232
--- /dev/null
@@ -0,0 +1,4 @@
+/* Add any CSS rules for Angular module "crmMonaco" */
+.crm-monaco-container {
+    border:1px solid grey;
+}
\ No newline at end of file
similarity index 72%
rename from ext/afform/html/ang/afMonaco.js
rename to ang/crmMonaco.js
index 3e0009b7af6841daf94f58b603f333ee61d6b4a0..15ff3747d4473ce9bdb605d9912dab50bbac1525 100644 (file)
@@ -1,25 +1,30 @@
 (function(angular, $, _) {
-  angular.module('afMonaco', CRM.angRequires('afMonaco'));
+  angular.module('crmMonaco', CRM.angRequires('crmMonaco'));
 
-  // "afMonaco" is a basic skeletal directive.
-  // Example usage: <div af-monaco ng-model="my.content"></div>
-  angular.module('afMonaco').directive('afMonaco', function($timeout) {
+  // "crmMonaco" is a basic skeletal directive.
+  // Example usage: <div crm-monaco ng-model="my.content"></div>
+  // Example usage: <div crm-monaco="{readOnly: true}" ng-model="my.content"></div>
+  angular.module('crmMonaco').directive('crmMonaco', function($timeout, $parse) {
     return {
       restrict: 'AE',
       require: 'ngModel',
-      template: '<div class="af-monaco-container"></div>',
+      template: '<div class="crm-monaco-container"></div>',
       link: function($scope, $el, $attr, ngModel) {
         var heightPct = 0.70;
         var editor;
-        require.config({paths: CRM.afMonaco.paths});
+        require.config({paths: CRM.crmMonaco.paths});
         require(['vs/editor/editor.main'], function() {
-          var editorEl = $el.find('.af-monaco-container');
-          editorEl.css({height: Math.round(heightPct * $(window).height())});
-          editor = monaco.editor.create(editorEl[0], {
-            value: ngModel.$modelValue,
+          var options =  {
+            readOnly: false,
             language: 'html',
             // theme: 'vs-dark',
-            theme: 'vs',
+            theme: 'vs'
+          };
+          if ($attr.crmMonaco) {
+            angular.extend(options, $parse($attr.crmMonaco)($scope));
+          }
+          angular.extend(options, {
+            value: ngModel.$modelValue,
             minimap: {
               enabled: false
             },
             }
           });
 
+          var editorEl = $el.find('.crm-monaco-container');
+          editorEl.css({height: Math.round(heightPct * $(window).height())});
+          editor = monaco.editor.create(editorEl[0], options);
+
           editor.onDidChangeModelContent(_.debounce(function () {
             $scope.$apply(function () {
               ngModel.$setViewValue(editor.getValue());
index d0fba558f87f19913d3540148e9797763d91f693..30130a8f0cb154d8953f008a0e09185331419788 100644 (file)
@@ -43,7 +43,7 @@
   },
   "require": {
     "php": "~7.1",
-    "cache/integration-tests": "~0.16.0",
+    "cache/integration-tests": "~0.17.0",
     "dompdf/dompdf" : "~0.8",
     "electrolinux/phpquery": "^0.9.6",
     "symfony/config": "~3.0 || ~4.4",
       },
       "monaco-editor": {
         "url": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.16.2.tgz",
-        "path": "ext/afform/html/bower_components/monaco-editor"
+        "path": "bower_components/monaco-editor"
       },
       "google-code-prettify": {
         "url": "https://github.com/tcollard/google-code-prettify/archive/v1.0.5.zip",
       "adrienrn/php-mimetyper": {
         "Update gitignore to ensure that sites that manage via git don't miss out on the important db.json file": "https://patch-diff.githubusercontent.com/raw/adrienrn/php-mimetyper/pull/15.patch"
       },
-      "cache/integration-tests": {
-        "Allow adding tests": "https://github.com/php-cache/integration-tests/commit/05f97174c09364dc10c084a38ba0cfd5124f4cec.patch",
-        "Support PHPUnit 6+": "https://github.com/php-cache/integration-tests/commit/1ec7362962185df91d3d749bc3fa7e7b99cb9fc7.patch",
-        "Add tests for binary data round trip": "https://github.com/php-cache/integration-tests/commit/89cd7068e83aa776774bfc44f6bcba858c085616.patch"
-      },
       "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"
       },
index 0d077a8513f6131e3fcf0e686d4f9eb6868c8815..5f9e7064a070cfc754e5add0fd6ac2a983ae9cb7 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "0a477e3a819cc7555e2993da4e8e1754",
+    "content-hash": "f32350338fcd33fb89de9bcea7a49125",
     "packages": [
         {
             "name": "adrienrn/php-mimetyper",
         },
         {
             "name": "cache/integration-tests",
-            "version": "0.16.0",
+            "version": "0.17.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/php-cache/integration-tests.git",
-                "reference": "a8d9538a44ed5a70d551f9b87f534c98dfe6b0ee"
+                "reference": "eda2e6b8bc5abcd623c8047e2345cda38dd6479e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/php-cache/integration-tests/zipball/a8d9538a44ed5a70d551f9b87f534c98dfe6b0ee",
-                "reference": "a8d9538a44ed5a70d551f9b87f534c98dfe6b0ee",
+                "url": "https://api.github.com/repos/php-cache/integration-tests/zipball/eda2e6b8bc5abcd623c8047e2345cda38dd6479e",
+                "reference": "eda2e6b8bc5abcd623c8047e2345cda38dd6479e",
                 "shasum": ""
             },
             "require": {
                 "cache/tag-interop": "^1.0",
-                "php": "^5.4|^7",
+                "php": ">=5.5.9",
                 "psr/cache": "~1.0"
             },
+            "conflict": {
+                "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
+            },
             "require-dev": {
-                "cache/cache": "dev-master",
-                "illuminate/cache": "^5.0",
-                "madewithlove/illuminate-psr-cache-bridge": "^1.0",
-                "phpunit/phpunit": "^4.0|^5.0",
-                "symfony/cache": "^3.1",
-                "tedivm/stash": "dev-master"
+                "cache/cache": "^1.0",
+                "illuminate/cache": "^5.4|^5.5|^5.6",
+                "mockery/mockery": "^1.0",
+                "symfony/cache": "^3.4.31|^4.3.4|^5.0",
+                "symfony/phpunit-bridge": "^5.1",
+                "tedivm/stash": "^0.14"
             },
             "type": "library",
-            "extra": {
-                "patches_applied": {
-                    "Allow adding tests": "https://github.com/php-cache/integration-tests/commit/05f97174c09364dc10c084a38ba0cfd5124f4cec.patch",
-                    "Support PHPUnit 6+": "https://github.com/php-cache/integration-tests/commit/1ec7362962185df91d3d749bc3fa7e7b99cb9fc7.patch",
-                    "Add tests for binary data round trip": "https://github.com/php-cache/integration-tests/commit/89cd7068e83aa776774bfc44f6bcba858c085616.patch"
-                }
-            },
             "autoload": {
                 "psr-4": {
                     "Cache\\IntegrationTests\\": "src/"
                 {
                     "name": "Tobias Nyholm",
                     "email": "tobias.nyholm@gmail.com",
-                    "homepage": "https://github.com/Nyholm"
+                    "homepage": "https://github.com/nyholm"
                 }
             ],
             "description": "Integration tests for PSR-6 and PSR-16 cache implementations",
                 "psr6",
                 "test"
             ],
-            "time": "2017-02-02T14:29:50+00:00"
+            "time": "2020-11-03T12:52:23+00:00"
         },
         {
             "name": "cache/tag-interop",
diff --git a/ext/afform/core/Civi/Api4/Action/Afform/Convert.php b/ext/afform/core/Civi/Api4/Action/Afform/Convert.php
new file mode 100644 (file)
index 0000000..638ccfb
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+
+namespace Civi\Api4\Action\Afform;
+
+use Civi\Api4\Generic\AbstractAction;
+use Civi\Api4\Generic\Result;
+
+/**
+ * Convert afform layouts between different representations, e.g. from
+ * a deep array to HTML.
+ *
+ * @method setLayout(mixed $layout)
+ * @method getLayout(): mixed
+ * @method setFrom(string $layoutFormat)
+ * @method getFrom(): string
+ * @method setTo(string $layoutFormat)
+ * @method getTo(): string
+ * @method setFormatWhitespace(string $layoutFormat)
+ * @method getFormatWhitespace(): string
+ *
+ * @package Civi\Api4\Action\Afform
+ */
+class Convert extends AbstractAction {
+
+  /**
+   * @var string|array
+   */
+  protected $layout;
+
+  /**
+   * How is the input `$layout` formatted?
+   *
+   * @var string
+   * @options html,shallow,deep
+   */
+  protected $from = NULL;
+
+  /**
+   * How should the `$layout` be returned?
+   *
+   * @var string
+   * @options html,shallow,deep
+   */
+  protected $to = NULL;
+
+  /**
+   * Normalize whitespace?
+   *
+   * @var bool
+   */
+  protected $formatWhitespace = FALSE;
+
+  public function _run(Result $result) {
+    // Normalize to HTML
+    if ($this->from === 'html') {
+      $interimHtml = $this->layout;
+    }
+    else {
+      $converter = new \CRM_Afform_ArrayHtml($this->from !== 'shallow', $this->formatWhitespace);
+      $interimHtml = $converter->convertTreeToHtml($this->layout);
+    }
+
+    // And go to preferred format
+    if ($this->to === 'html') {
+      $final = $interimHtml;
+    }
+    else {
+      $converter = new \CRM_Afform_ArrayHtml($this->to !== 'shallow', $this->formatWhitespace);
+      $final = $converter->convertHtmlToArray($interimHtml);
+    }
+
+    $result[] = [
+      'layout' => $final,
+    ];
+  }
+
+}
index 94abb0467be5b5afbbcfd4cce6bae02bb24501ee..a69ee5c29207f9497607a4efa59c3e506e889376 100644 (file)
@@ -16,6 +16,7 @@ use Civi\Api4\Generic\BasicBatchAction;
  *      The `prefill` and `submit` actions are used for preparing forms and processing submissions.
  *
  * @see https://lab.civicrm.org/extensions/afform
+ * @searchable false
  * @package Civi\Api4
  */
 class Afform extends Generic\AbstractEntity {
@@ -56,6 +57,15 @@ class Afform extends Generic\AbstractEntity {
       ->setCheckPermissions($checkPermissions);
   }
 
+  /**
+   * @param bool $checkPermissions
+   * @return Action\Afform\Convert
+   */
+  public static function convert($checkPermissions = TRUE) {
+    return (new Action\Afform\Convert('Afform', __FUNCTION__))
+      ->setCheckPermissions($checkPermissions);
+  }
+
   /**
    * @param bool $checkPermissions
    * @return Action\Afform\Prefill
index 981d5ad9a92106b6defb3f09e9a1037b0bd335b7..e803aa01766b675f480aa70f4ee38a228a494144 100644 (file)
@@ -4,6 +4,7 @@ namespace Civi\Api4;
 
 /**
  * Class AfformPalette
+ * @searchable false
  * @package Civi\Api4
  */
 class AfformPalette extends Generic\AbstractEntity {
index e2b5b77e93fc253fba1c573dd8fc5e5b0eb9b9a3..e2ca67f92bc21c14ece55103753763f1fba942c0 100644 (file)
@@ -3,6 +3,7 @@ namespace Civi\Api4;
 
 /**
  * Class AfformTag
+ * @searchable false
  * @package Civi\Api4
  */
 class AfformTag extends Generic\AbstractEntity {
index b73043d1fb7bdb082a30121a27ba0850f5e76a70..a5c4584849044b3bf09ba13f492327441cc210ec 100644 (file)
@@ -392,8 +392,9 @@ function _af_fill_field_metadata($entityType, DOMElement $afField) {
     $params['values'] = ['contact_type' => $entityType];
     $entityType = 'Contact';
   }
-  $getFields = civicrm_api4($entityType, 'getFields', $params);
-  // Merge field definition data with whatever's already in the markup
+  // Merge field definition data with whatever's already in the markup.
+  // If the admin has chosen to include this field on the form, then it's OK for us to get metadata about the field - regardless of user's other permissions.
+  $getFields = civicrm_api4($entityType, 'getFields', $params + ['checkPermissions' => FALSE]);
   $deep = ['input_attrs'];
   foreach ($getFields as $fieldInfo) {
     $existingFieldDefn = trim(pq($afField)->attr('defn') ?: '');
index cea47a8d19f268a8165632029330429278453482..09e0a2c95bcab9ba4003ea25087871deb21d98fe 100644 (file)
@@ -7,7 +7,7 @@ return [
   ],
   'css' => ['ang/afGuiEditor.css'],
   'partials' => ['ang/afGuiEditor'],
-  'requires' => ['crmUi', 'crmUtil', 'dialogService', 'api4'],
+  'requires' => ['crmUi', 'crmUtil', 'dialogService', 'api4', 'crmMonaco'],
   'settings' => [],
   'basePages' => [],
   'exports' => [
index fa0d8fddc997cdbe9770d586981815e42abdbc8d..e99b30e90381ff36fb8adfaf3bfb8d300571dde1 100644 (file)
   width: 300px;
 }
 
-#afGuiEditor-canvas .panel-heading .btn-group {
-  position: relative;
-  top: -8px;
-}
-
 #afGuiEditor .af-gui-button {
   padding-left: 15px;
 }
index a0cf7992a592d84914e6f0ae585f625b2d79208a..cf67d84e85820740e275e776dc69dc7a9c1795cc 100644 (file)
@@ -62,6 +62,8 @@
               alert('Error: unknown form "' + $scope.afGuiEditor.name + '"');
             }
           }
+          $scope.canvasTab = 'layout';
+          $scope.layoutHtml = '';
           $scope.layout = findRecursive($scope.afform.layout, {'#tag': 'af-form'})[0];
           $scope.entities = findRecursive($scope.layout['#children'], {'#tag': 'af-entity'}, 'name');
 
           }, true);
         }
 
+        $scope.updateLayoutHtml = function() {
+          $scope.layoutHtml = '...Loading...';
+          crmApi4('Afform', 'convert', {layout: [$scope.layout], from: 'deep', to: 'html', formatWhitespace: true})
+            .then(function(r){
+              $scope.layoutHtml = r[0].layout || '(Error)';
+            })
+            .catch(function(r){
+              $scope.layoutHtml = '(Error)';
+            });
+        };
+
         this.addEntity = function(type) {
           var meta = editor.meta.entities[type],
             num = 1;
index fc2553fb95858f579b94ecd1e3c49c81f1cb2be4..484a543cc8c3ea82e75261135adadb825408c3a9 100644 (file)
@@ -1,18 +1,36 @@
 <div class="panel panel-default">
   <div class="panel-heading">
-    <form class="form-inline">
-      <div class="btn-group btn-group-md pull-right">
-        <button type="submit" class="btn" ng-class="{'btn-primary': !changesSaved && !saving, 'btn-warning': saving, 'btn-success': changesSaved}" ng-disabled="changesSaved || saving || !afform.title" ng-click="save()">
-          <i class="crm-i" ng-class="{'fa-check': !saving, 'fa-spin fa-spinner': saving}"></i>
-          <span ng-if="changesSaved && !saving">{{ ts('Saved') }}</span>
-          <span ng-if="!changesSaved && !saving">{{ ts('Save') }}</span>
-          <span ng-if="saving">{{ ts('Saving...') }}</span>
-        </button>
-      </div>
-      <div>{{ ts('Form Layout') }}</div>
-    </form>
+
+    <div class="btn-group btn-group-md  pull-right">
+      <button type="submit" class="btn" ng-class="{'btn-primary': !changesSaved && !saving, 'btn-warning': saving, 'btn-success': changesSaved}" ng-disabled="changesSaved || saving || !afform.title" ng-click="save()">
+        <i class="crm-i" ng-class="{'fa-check': !saving, 'fa-spin fa-spinner': saving}"></i>
+        <span ng-if="changesSaved && !saving">{{ ts('Saved') }}</span>
+        <span ng-if="!changesSaved && !saving">{{ ts('Save') }}</span>
+        <span ng-if="saving">{{ ts('Saving...') }}</span>
+      </button>
+    </div>
+
+    <ul class="nav nav-tabs">
+      <li role="presentation" ng-class="{active: canvasTab === 'layout'}">
+        <a ng-click="canvasTab = 'layout'">
+          <span>{{ ts('Form Layout') }}</span>
+        </a>
+      </li>
+      <li role="presentation" ng-class="{active: canvasTab === 'markup'}">
+        <a ng-click="canvasTab = 'markup'; updateLayoutHtml()">
+          <span>{{ ts('Markup') }}</span>
+        </a>
+      </li>
+    </ul>
+
   </div>
-  <div id="afGuiEditor-canvas-body" class="panel-body">
+  <div id="afGuiEditor-canvas-body" class="panel-body" ng-if="canvasTab === 'layout'">
     <div ng-if="layout" af-gui-container="layout" entity-name="" />
   </div>
+  <div class="panel-body" ng-if="canvasTab === 'markup'">
+    <p class="help-block">{{ts('This is a read-only preview of the auto-generated markup.')}}</p>
+    <!-- Wiring up edit mode wouldn't be super-hard in itself, but it's not worthwhile until we have validation to ensure that GUI+raw content are exchangeable  -->
+    <div crm-monaco="{readOnly: true}" ng-model="layoutHtml"></div>
+  </div>
+
 </div>
index 60a3c830e5c2cc2bc49c5fce33358f4730a521a1..4aa58ebfb62a93c5fb50ab088696d9000e7796bb 100644 (file)
     {{ ts('Description:') }}
   </label>
   <textarea ng-model="afform.description" class="form-control" id="af_config_form_description"></textarea>
+  <p class="help-block">{{ts('Semi-private description about the form\'s purpose.')}}</p>
+  <!-- "Semi-private": not generally public, but not audited for secrecy -->
 </div>
 
 <div class="form-group">
   <label for="af_config_form_server_route">
-    {{ ts('URL:') }}
+    {{ ts('Path:') }}
   </label>
   <input ng-model="afform.server_route" class="form-control" id="af_config_form_server_route" />
+  <p class="help-block">{{ts('Expose the form as a standalone page on the web site. (Example: "civicrm/my-form")')}}</p>
 </div>
 
-<div class="form-group">
-  <label for="af_config_form_permission">
-    {{ ts('Permission:') }}
+<div class="form-group" ng-if="!!afform.server_route">
+  <label for="af_config_form_is_public">
+    <input type="checkbox" id="af_config_form_is_public" ng-model="afform.is_public">
+    {{ ts('Enable frontend styling') }}
   </label>
-  <input ng-model="afform.permission" class="form-control" id="af_config_form_permission" crm-ui-select="{data: editor.meta.permissions, placeholder: ts('Open access')}" />
+  <p class="help-block">{{ts('The general look/feel should match the frontend')}}</p>
 </div>
 
 <div class="form-group">
     <input type="checkbox" id="af_config_form_is_dashlet" ng-model="afform.is_dashlet">
     {{ ts('Enable dashlet') }}
   </label>
+  <p class="help-block">{{ts('Allow backend users to embed the form on the dashboard.')}}</p>
+</div>
+
+<div class="form-group">
+  <label for="af_config_form_permission">
+    {{ ts('Permission:') }}
+  </label>
+  <input ng-model="afform.permission" class="form-control" id="af_config_form_permission" crm-ui-select="{data: editor.meta.permissions, placeholder: ts('Open access')}" />
+  <p class="help-block">{{ts('What permission is required to use this form?')}}</p>
 </div>
 
 </ng-form>
index c7dd357d7ab2a8add95b4737bb0de94d558763d9..0b75ec68d24331ed5503deedac9045c9be24efc4 100644 (file)
@@ -144,19 +144,3 @@ function afform_html_civicrm_entityTypes(&$entityTypes) {
 function afform_html_civicrm_themes(&$themes) {
   _afform_html_civix_civicrm_themes($themes);
 }
-
-/**
- * Implements hook_civicrm_check().
- */
-function afform_html_civicrm_check(&$messages) {
-  $dir = E::path(AFFORM_HTML_MONACO);
-  if (!file_exists($dir)) {
-    $messages[] = new CRM_Utils_Check_Message(
-      'afform_html_monaco',
-      ts('Afform HTML is missing its "bower_components" folder. Please consult the README.md for current installation instructions.'),
-      ts('Afform HTML: Packages are missing'),
-      \Psr\Log\LogLevel::CRITICAL,
-      'fa-chain-broken'
-    );
-  }
-}
index 2f463b86a771503018d45ae8d103998903f1f415..f953a8e749c7567d32b7630b674937ad33f1bd57 100644 (file)
@@ -1,7 +1,9 @@
-<div ng-if="!routeParams.name">
-  <div af-html-list=""></div>
-</div>
+<div class="bootstrap-theme">
+  <div ng-if="!routeParams.name">
+    <div af-html-list=""></div>
+  </div>
 
-<div ng-if="routeParams.name">
-  <div af-html-editor="{name: routeParams.name}"></div>
+  <div ng-if="routeParams.name">
+    <div af-html-editor="{name: routeParams.name}"></div>
+  </div>
 </div>
index 0cbca87fd24174c052d8d3d7decc6cabc3f7cbf5..782ea3a256c11b57f0f40b43ba5cd506cf4f111e 100644 (file)
@@ -4,32 +4,88 @@
     {{ts('Failed to find requested form.')}}
   </div>
 
-  <div ng-repeat="resultForm in apiData.result" ng-if="apiData.result.length > 0">
-    <div crm-ui-debug="resultForm"></div>
-
-    <div>
-      <a ng-href="#!/">{{ts('Back')}}</a>
-      |
-      <a af-api4-action="['Afform', 'update', {layoutFormat: 'html', where: [['name', '=', resultForm.name]], values:resultForm}]">{{ts('Save')}}</a>
-      <span ng-if="resultForm.server_route">
-        | <a target="_blank" ng-href="{{crmUrl(resultForm.server_route)}}">Open</a>
-      </span>
-    </div>
+  <div ng-repeat="resultForm in apiData.result" ng-if="apiData.result.length > 0" class="container-fluid">
+
+    <div class="row">
+
+      <div class="col-sm-12 col-md-4">
+        <div class="panel panel-default">
+          <div class="panel-heading">{{ts('Properties')}}</div>
+          <div class="panel-body">
+
+            <div crm-ui-debug="resultForm"></div>
+
+            <div class="form-group">
+              <label class="control-label">{{ts('Name')}}</label>
+              <p class="form-control-static">{{resultForm.name}}</p>
+            </div>
+            <div class="form-group">
+              <label class="control-label">{{ts('Title')}}</label>
+              <input ng-model="resultForm.title" type="text" class="form-control" />
+            </div>
+            <div class="form-group">
+              <label class="control-label">{{ts('Description')}}</label>
+              <textarea class="form-control" ng-model="resultForm.description"></textarea>
+              <p class="help-block">{{ts('Semi-private description about the form\'s purpose.')}}</p>
+              <!-- "Semi-private": not generally public, but not audited for secrecy -->
+            </div>
+            <div class="form-group">
+              <label class="control-label">{{ts('Path')}}</label>
+              <input ng-model="resultForm.server_route" type="text" class="form-control" />
+              <p class="help-block">{{ts('Expose the form as a standalone page on the web site. (Example: "civicrm/my-form")')}}</p>
+            </div>
+            <div class="form-group" ng-if="!!resultForm.server_route">
+              <label for="af_config_form_is_public">
+                <input type="checkbox" id="af_config_form_is_public" ng-model="resultForm.is_public">
+                {{ ts('Enable frontend styling') }}
+              </label>
+              <p class="help-block">{{ts('The general look/feel should match the frontend')}}</p>
+            </div>
+            <div class="form-group">
+              <label for="af_config_form_is_dashlet">
+                <input type="checkbox" id="af_config_form_is_dashlet" ng-model="resultForm.is_dashlet">
+                {{ ts('Enable dashlet') }}
+              </label>
+              <p class="help-block">{{ts('Allow backend users to embed the form on the dashboard.')}}</p>
+            </div>
+            <div class="form-group">
+              <label class="control-label">{{ts('Permission')}}</label>
+              <input ng-model="resultForm.permission" type="text" class="form-control" />
+              <p class="help-block">{{ts('What permission is required to use this form?')}}</p>
+            </div>
+          </div>
+        </div>
 
-    <fieldset>
-      <legend>{{ts('Properties')}}</legend>
-      <div><label>{{ts('Name')}}:</label> {{resultForm.name}}</div>
-      <div><label>{{ts('Title')}}:</label> <input ng-model="resultForm.title" type="text" /></div>
-      <div><label>{{ts('Server Route')}}:</label> <input ng-model="resultForm.server_route" type="text" /></div>
-      <div><label>{{ts('Permission')}}:</label> <input ng-model="resultForm.permission" type="text" /></div>
-      <div><label>{{ts('Description')}}:</label> <textarea ng-model="resultForm.description"></textarea></div>
-    </fieldset>
+        <div class="clearfix"></div>
+      </div>
 
-    <fieldset>
-      <legend>{{ts('Layout')}}</legend>
-      <div af-monaco ng-model="resultForm.layout"></div>
-    </fieldset>
+      <div class="col-sm-12 col-md-8">
+        <div class="panel panel-default">
+          <div class="panel-heading">
+            <div class="btn-group btn-group-xs pull-right" role="group" aria-label="{{ts('Actions')}}">
 
+              <a class="btn btn-default" target="_blank" ng-href="{{crmUrl(resultForm.server_route)}}"  ng-if="resultForm.server_route">
+                <i class="crm-i fa-location-arrow"></i>
+                {{ts('Open')}}
+              </a>
+
+              <a class="btn btn-default"
+                 af-api4-action="['Afform', 'update', {layoutFormat: 'html', where: [['name', '=', resultForm.name]], values:resultForm}]">
+                <i class="crm-i fa-floppy-o"></i>
+                {{ts('Save')}}
+              </a>
+
+            </div>
+
+            {{ts('Markup')}}
+          </div>
+          <div class="panel-body">
+            <div crm-monaco ng-model="resultForm.layout"></div>
+          </div>
+        </div>
+      </div>
+
+    </div>
   </div>
 
 </div>
diff --git a/ext/afform/html/ang/afMonaco.ang.php b/ext/afform/html/ang/afMonaco.ang.php
deleted file mode 100644 (file)
index ec04390..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-// This file declares an Angular module which can be autoloaded
-return array(
-  'js' => [
-    AFFORM_HTML_MONACO . '/loader.js',
-    'ang/afMonaco.js',
-    //    'ang/afMonaco/*.js',
-    //    'ang/afMonaco/*/*.js',
-  ],
-  'css' => ['ang/afMonaco.css'],
-  // 'partials' => ['ang/afMonaco'],
-  'requires' => ['crmUi', 'crmUtil'],
-  'settings' => [
-    'paths' => [
-      'vs' => CRM_AfformHtml_ExtensionUtil::url(AFFORM_HTML_MONACO),
-    ],
-  ],
-  'basePages' => [],
-  'exports' => [
-    'af-monaco' => 'A',
-  ],
-);
diff --git a/ext/afform/html/ang/afMonaco.css b/ext/afform/html/ang/afMonaco.css
deleted file mode 100644 (file)
index 01029b1..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Add any CSS rules for Angular module "afMonaco" */
-.af-monaco-container {
-    border:1px solid grey;
-}
\ No newline at end of file
index d80e994395e141ca82e9c8c11c248dc94f314b7a..66c80aa4b13bcc425db666939035dca556bd78b1 100644 (file)
@@ -115,6 +115,48 @@ class api_v4_AfformTest extends api_v4_AfformTestCase {
     return $ex;
   }
 
+  /**
+   * In this test, we receive a layout
+   *
+   * @param string $formName
+   *   The symbolic name of the form.
+   * @param string $updateFormat
+   *   The format with which to write the data.
+   *   'html' or 'array'
+   * @param mixed $updateLayout
+   *   The new value to set
+   * @param string $readFormat
+   *   The format with which to read the data.
+   *   'html' or 'array'
+   * @param mixed $readLayout
+   *   The value that we expect to read.
+   * @param string $exampleName
+   *   (For debug messages) A symbolic name of the example data-set being tested.
+   * @dataProvider getFormatExamples
+   */
+  public function testBasicConvert($formName, $updateFormat, $updateLayout, $readFormat, $readLayout, $exampleName) {
+    $actual = Civi\Api4\Afform::convert()->setLayout($updateLayout)
+      ->setFrom($updateFormat)
+      ->setTo($readFormat)
+      ->execute();
+
+    $cb = function($m) {
+      return '<' . rtrim($m[1]) . '/>';
+    };
+    $norm = function($layout) use ($cb, &$norm) {
+      if (is_string($layout)) {
+        return preg_replace_callback(';<((br|img)[^>]*)/>;', $cb, $layout);
+      }
+      elseif (is_array($layout)) {
+        foreach ($layout as &$item) {
+          $item = $norm($item);
+        }
+      }
+    };
+
+    $this->assertEquals($norm($readLayout), $norm($actual->single()['layout']), "Based on \"$exampleName\", writing content as \"$updateFormat\" and reading back as \"$readFormat\".");
+  }
+
   /**
    * In this test, we update the layout and in one format and then read it back
    * in another format.
index 8665b19d2412e662c2dace501a2718c0f489b7b5..d72a390ef75cbd9c0294c793e5c00bd0a57cfc7f 100644 (file)
@@ -104,6 +104,6 @@ function contributioncancelactions_cancel_related_pending_memberships($contribut
     return;
   }
   foreach ($connectedMemberships as $membershipID) {
-    civicrm_api3('Membership', 'create', ['status_id' => 'Cancelled', 'id' => $membershipID, 'is_override' => 1]);
+    civicrm_api3('Membership', 'create', ['status_id' => 'Cancelled', 'id' => $membershipID, 'is_override' => 1, 'status_override_end_date' => 'null']);
   }
 }
index 946b3484d4511b90477c8d5d0da3b01aada95ae7..567da3f45c96abd47dfc8526951e50422fa99388 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Civi\Api4\Activity;
+use Civi\Api4\Contribution;
 use Civi\Test\Api3TestTrait;
 use Civi\Test\CiviEnvBuilder;
 use Civi\Test\HeadlessInterface;
@@ -13,6 +15,7 @@ use Civi\Api4\Event;
 use Civi\Api4\PriceField;
 use Civi\Api4\Participant;
 use PHPUnit\Framework\TestCase;
+use Civi\Test\ContactTestTrait;
 
 /**
  * FIXME - Add test description.
@@ -31,6 +34,7 @@ use PHPUnit\Framework\TestCase;
 class CancelTest extends TestCase implements HeadlessInterface, HookInterface, TransactionalInterface {
 
   use Api3TestTrait;
+  use ContactTestTrait;
 
   /**
    * Created ids.
@@ -276,6 +280,45 @@ class CancelTest extends TestCase implements HeadlessInterface, HookInterface, T
     $this->assertEquals('', $afterPledge['pledge_total_paid']);
   }
 
+  /**
+   * Test cancelling a contribution with a membership on the contribution edit
+   * form.
+   *
+   * @throws \API_Exception
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
+   */
+  public function testCancelFromContributionForm(): void {
+    $this->createContact();
+    $this->createMembershipType();
+    $this->createMembershipOrder();
+    $this->createLoggedInUser();
+    $formValues = [
+      'id' => $this->ids['Contribution'][0],
+      'contact_id' => $this->ids['contact'][0],
+      'contribution_status_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Cancelled'),
+    ];
+    $form = new CRM_Contribute_Form_Contribution();
+    $_SERVER['REQUEST_METHOD'] = 'GET';
+    $form->controller = new CRM_Core_Controller();
+    $form->controller->setStateMachine(new CRM_Core_StateMachine($form->controller));
+    $form->testSubmit($formValues, CRM_Core_Action::UPDATE);
+
+    $contribution = Contribution::get()
+      ->addWhere('id', '=', $this->ids['Contribution'][0])
+      ->addSelect('contribution_status_id:name')
+      ->execute()->first();
+    $this->assertEquals('Cancelled', $contribution['contribution_status_id:name']);
+    $membership = $this->callAPISuccessGetSingle('Membership', []);
+    $this->assertEquals('Cancelled', CRM_Core_PseudoConstant::getName('CRM_Member_BAO_Membership', 'status_id', $membership['status_id']));
+    $activity = Activity::get()
+      ->addSelect('subject', 'source_record_id', 'status_id')
+      ->addWhere('activity_type_id:name', '=', 'Change Membership Status')
+      ->execute();
+    $this->assertCount(1, $activity);
+    $this->assertEquals('Status changed from Pending to Cancelled', $activity->first()['subject']);
+  }
+
   /**
    * Create an event and an order for a participant in that event.
    *
index 33f44977b2102f4375d892dae569d95b1fb42aad..93503b83d4ff001c2bb0e95fbb2df571fbc50625 100644 (file)
@@ -6,6 +6,7 @@ namespace Civi\Api4;
  *
  * Provided by the Search Kit extension.
  *
+ * @searchable false
  * @package Civi\Api4
  */
 class SearchDisplay extends Generic\DAOEntity {
index ab90e7f02ecb862fe1e9c0dd89fa07f586924211..00448fee40f444ef6f9f2602d00aca5f4f872e69 100644 (file)
@@ -59,7 +59,7 @@ class Admin {
     $schema = [];
     $entities = \Civi\Api4\Entity::get()
       ->addSelect('name', 'title', 'type', 'title_plural', 'description', 'icon', 'paths')
-      ->addWhere('name', '!=', 'Entity')
+      ->addWhere('searchable', '=', TRUE)
       ->addOrderBy('title_plural')
       ->setChain([
         'get' => ['$name', 'getActions', ['where' => [['name', '=', 'get']]], ['params']],
index 22757a2bb41bff54eb845d9f60caf50019d76555..93beb168eb569a957e784842554783ca3b07ab55 100644 (file)
@@ -1048,6 +1048,8 @@ if (!CRM.vars) CRM.vars = {};
   };
 
   $.fn.crmtooltip = function () {
+    var TOOLTIP_HIDE_DELAY = 300;
+
     $(document)
       .on('mouseover', 'a.crm-summary-link:not(.crm-processed)', function (e) {
         $(this).addClass('crm-processed crm-tooltip-active');
@@ -1062,8 +1064,13 @@ if (!CRM.vars) CRM.vars = {};
             .load(this.href);
         }
       })
-      .on('mouseout', 'a.crm-summary-link', function () {
-        $(this).removeClass('crm-processed crm-tooltip-active crm-tooltip-down');
+      .on('mouseleave', 'a.crm-summary-link', function () {
+        var tooltipLink = $(this);
+        setTimeout(function () {
+          if (tooltipLink.filter(':hover').length === 0) {
+            tooltipLink.removeClass('crm-processed crm-tooltip-active crm-tooltip-down');
+          }
+        }, TOOLTIP_HIDE_DELAY);
       })
       .on('click', 'a.crm-summary-link', false);
   };
index c78fa24d18f9d6167c73ddbb5df05900e4198e4d..30b5aea16078515303b1d9cba0208c45566e5385 100644 (file)
@@ -66,18 +66,27 @@ Released December 2, 2020
   Preliminary cleanup of code to move towards making search actions available
   from search builder.
 
-- **Lotsa new features for the Search Kit extension
+- **Search Kit: Lotsa new features
   ([18876](https://github.com/civicrm/civicrm-core/pull/18876))**
 
   Integrates Search Kit/Afform. Adds a standalone page for viewing search kit
   displays. Adds first search kit display type "table". Adds search kit display
   entity and UI. Adds CRUD form for managing saved search kit searches.
 
-- **Search ext: Add links to search admin and improve links in displays
+- **Search Kit: Add links to search admin and improve links in displays
   ([18909](https://github.com/civicrm/civicrm-core/pull/18909))**
 
   Improves links in search kit results.
 
+- **Search Kit: Bind parameters to URL
+  ([#18976](https://github.com/civicrm/civicrm-core/pull/18976))**
+
+- **Search Kit: Add "List" display. Fix other bugs.
+  ([#18999](https://github.com/civicrm/civicrm-core/pull/18999))**
+
+- **Search Kit: Improve options in "List" search display
+  ([19031](https://github.com/civicrm/civicrm-core/pull/19031/files))**
+
 - **SavedSearch - Add name and label columns
   ([18809](https://github.com/civicrm/civicrm-core/pull/18809))**
 
@@ -144,12 +153,15 @@ Released December 2, 2020
 
 ### CiviMail
 
-- **OAuth2 administration (email focus) (Work Towards
-  [dev/core#2141](https://lab.civicrm.org/dev/core/-/issues/2141):
+- **OAuth2 Client ([dev/core#2141](https://lab.civicrm.org/dev/core/-/issues/2141):
   [18902](https://github.com/civicrm/civicrm-core/pull/18902),
   [18914](https://github.com/civicrm/civicrm-core/pull/18914),
-  [18885](https://github.com/civicrm/civicrm-core/pull/18885) and
-  [18908](https://github.com/civicrm/civicrm-core/pull/18908))**
+  [18885](https://github.com/civicrm/civicrm-core/pull/18885),
+  [18908](https://github.com/civicrm/civicrm-core/pull/18908),
+  [18943](https://github.com/civicrm/civicrm-core/pull/18943),
+  [18955](https://github.com/civicrm/civicrm-core/pull/18955),
+  [18951](https://github.com/civicrm/civicrm-core/pull/18951), and
+  [19001](https://github.com/civicrm/civicrm-core/pull/19001))**
 
   Adds a new hook `hook_civicrm_alterMailStore` which can be used to add or
   modify a driver. Adds a hidden `oauth-client` extension for connecting to
@@ -290,6 +302,10 @@ Released December 2, 2020
 - **Rationalise date formatting
   ([18805](https://github.com/civicrm/civicrm-core/pull/18805))**
 
+- **Fix filter for users who have permission "view deleted contacts"
+  ([19088](https://github.com/civicrm/civicrm-core/pull/19088))**
+
+
 ### CiviCampaign
 
 - **Fix campaign_id handling for batch entry
@@ -304,6 +320,9 @@ Released December 2, 2020
   ([dev/core#2152](https://lab.civicrm.org/dev/core/-/issues/2152):
   [18884](https://github.com/civicrm/civicrm-core/pull/18884))**
 
+- **Fix deprecation notice
+  ([dev/core#2205](https://lab.civicrm.org/dev/core/-/issues/2205): [#19018](https://github.com/civicrm/civicrm-core/pull/19018))**
+
 ### CiviContribute
 
 - **finish 'this round' of completeOrder cleanup
@@ -358,6 +377,13 @@ Released December 2, 2020
 - **PCP 'Your Message' should use WYSIWYG
   ([18411](https://github.com/civicrm/civicrm-core/pull/18411))**
 
+- **Fix fatal error on "Edit Contribution" form
+  ([19091](https://github.com/civicrm/civicrm-core/pull/19091))**
+
+- **Fix product form such that it is possible to unselec duration unit, frequency unit
+  ([dev/drupal#148](https://lab.civicrm.org/dev/drupal/-/issues/148): [19084](https://github.com/civicrm/civicrm-core/pull/19084))**
+
+
 ### CiviEvent
 
 - **.ical files not populating correctly for sites with ACL's configured for
@@ -376,6 +402,9 @@ Released December 2, 2020
 - **crmMailing - Only load Angular settings if they're needed
   ([18749](https://github.com/civicrm/civicrm-core/pull/18749))**
 
+- **Error when changing "Location Type"
+  ([dev/core#2228](https://lab.civicrm.org/dev/core/-/issues/2228): [19092](https://github.com/civicrm/civicrm-core/pull/19092))**
+
 ### CiviSMS
 
 - **Error in the selected phone to send an SMS when the Mobile type label is
@@ -421,6 +450,8 @@ Released December 2, 2020
 
 ## <a name="misc"></a>Miscellany
 
+- **_Composer Patches_: Update to v1.7.0. Support Composer v2. ([#18940](https://github.com/civicrm/civicrm-core/pull/18940))**
+
 - **Schema handler fixes
   ([18932](https://github.com/civicrm/civicrm-core/pull/18932))**
 
@@ -465,6 +496,15 @@ Released December 2, 2020
 - **Hack away at false negative test fails
   ([18892](https://github.com/civicrm/civicrm-core/pull/18892))**
 
+- **Search Kit - Fix search action button
+  ([19055](https://github.com/civicrm/civicrm-core/pull/19055))**
+
+- **Release Notes: Add 5.32.0
+  ([#18958](https://github.com/civicrm/civicrm-core/pull/18958), [#18945](https://github.com/civicrm/civicrm-core/pull/18945))**
+
+- **Release Notes: Add 5.31.1
+  ([#19029](https://github.com/civicrm/civicrm-core/pull/19029))**
+
 - **Remove always-true IF
   ([18803](https://github.com/civicrm/civicrm-core/pull/18803))**
 
@@ -554,6 +594,9 @@ Released December 2, 2020
 - **unit test for #18306 - order create api test for contribution
   ([18785](https://github.com/civicrm/civicrm-core/pull/18785))**
 
+- **(NFC) Update cache/integration-tests
+  ([19076](https://github.com/civicrm/civicrm-core/pull/19076))**
+
 - **(NFC) Fix typo in Money valueFormat depretation warning
   ([18886](https://github.com/civicrm/civicrm-core/pull/18886))**
 
index dbfbaa38a03aa64553cf999676461b27d637ed79..6854b522594d8f5c702292a5143f639471491dc1 100644 (file)
@@ -528,4 +528,27 @@ return [
     'help_text' => 'If a contact is created with no language this setting will determine the language data (if any) to save.'
     . 'You may or may not wish to make an assumption here about whether it matches the site language',
   ],
+  'pinnedContactCountries' => [
+    'group_name' => 'Localization Preferences',
+    'group' => 'localization',
+    'name' => 'pinnedContactCountries',
+    'type' => 'Array',
+    'quick_form_type' => 'Element',
+    'html_type' => 'advmultiselect',
+    'html_attributes' => [
+      'size' => 5,
+      'style' => 'width:150px',
+      'class' => 'advmultiselect',
+    ],
+    'default' => [],
+    'add' => '5.33',
+    'title' => ts('Pinned Countries'),
+    'is_domain' => 1,
+    'is_contact' => 0,
+    'description' => ts('Appear in Top section of select list'),
+    'help_text' => ts('Selected countries will appear in top section of country list'),
+    'pseudoconstant' => [
+      'callback' => 'CRM_Admin_Form_Setting_Localization::getAvailableCountries',
+    ],
+  ],
 ];
index 8eeadd33c6c60405f6dd08335f3edcd86ec504bf..0b120987ae3fced65588f5c3648b9521efc45d97 100644 (file)
@@ -399,7 +399,7 @@ UNLOCK TABLES;
 
 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.33.alpha1',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.34.alpha1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
 /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
 UNLOCK TABLES;
 
index c8e46441a40b0cf28a15e8aed8aa045807a20ed5..409b739dfffcd17fa04a1f3fdb9d9809d2b67eba 100644 (file)
@@ -963,4 +963,4 @@ INSERT INTO civicrm_navigation
 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.33.alpha1';
+UPDATE civicrm_domain SET version = '5.34.alpha1';
index 42d93a6739252b38f3820444fabcc1b99d1b5eec..20b0a910316397420787877ed816de071c15da77 100644 (file)
@@ -65,3 +65,8 @@
     {ts}State/province listings are populated dynamically based on the selected Country for all standard contact address editing forms, as well as for <strong>Profile forms which include both a Country and a State/Province field</strong>.  This setting controls which countries' states and/or provinces are available in the State/Province selection field <strong>for Custom Fields</strong> or for Profile forms which do NOT include a Country field.{/ts}
   </p>
 {/htxt}
+{htxt id="pinnedContactCountries"}
+  <p>
+      {ts}Selected countries will appear in top section of country list.{/ts}
+  </p>
+{/htxt}
index 498e9f13a0c55d153ce6454cab81592f2acbfbc7..9666278ac60c6b92c21f3eef5741973b6273a65a 100644 (file)
                 <td class="label">{$form.defaultContactCountry.label} {help id='defaultContactCountry' title=$form.defaultContactCountry.label}</td>
                 <td>{$form.defaultContactCountry.html}</td>
             </tr>
+            <tr class="crm-localization-form-block-pinnedContactCountries">
+                <td class="label">{$form.pinnedContactCountries.label} {help id='pinnedContactCountries' title=$form.pinnedContactCountries.label}</td>
+                <td>{$form.pinnedContactCountries.html}</td>
+            </tr>
            <tr class="crm-localization-form-block-defaultContactStateProvince">
                 <td class="label">{$form.defaultContactStateProvince.label} {help id='defaultContactCountry' title=$form.defaultContactStateProvince.label}</td>
                 <td>{$form.defaultContactStateProvince.html}</td>
index 5e87242afb5abc9d46333ad0fce29ccd51753c56..881d1a4d0ce90e53e06d99825a22752c063f7a29 100644 (file)
@@ -22,9 +22,8 @@ Depends: CRM/common/enableDisableApi.tpl and CRM/common/jsortable.tpl
         <tr id="extension-{$row.file}" class="crm-entity crm-extension-{$row.file}{if $row.status eq 'disabled'} disabled{/if}{if $row.status eq 'installed-missing' or $row.status eq 'disabled-missing'} extension-missing{/if}{if $row.upgradable} extension-upgradable{elseif $row.status eq 'installed'} extension-installed{/if}">
           <td class="crm-extensions-label">
               <a class="collapsed" href="#"></a>&nbsp;<strong>{$row.label}</strong><br/>{$row.description}
-              {if $extAddNewEnabled && $remoteExtensionRows[$extKey] && $remoteExtensionRows[$extKey].is_upgradeable}
-                {capture assign='upgradeURL'}{crmURL p='civicrm/admin/extensions' q="action=update&id=$extKey&key=$extKey"}{/capture}
-                <div class="crm-extensions-upgrade">{ts 1=$upgradeURL}Version {$remoteExtensionRows[$extKey].version} is available. <a href="%1">Upgrade</a>{/ts}</div>
+              {if $extAddNewEnabled && $remoteExtensionRows[$extKey] && $remoteExtensionRows[$extKey].upgradelink}
+                <div class="crm-extensions-upgrade">{$remoteExtensionRows[$extKey].upgradelink}</div>
               {/if}
           </td>
           <td class="crm-extensions-label">{$row.statusLabel} {if $row.upgradable}<br/>({ts}Outdated{/ts}){/if}</td>
index b60355dede5c249e9e019fda75ca156a4cd1332b..0adf34c5b1859e7b4e5cacc444bd1f9b22a660c2 100644 (file)
     {/foreach}
   </div>
 </div>
-{include file="CRM/common/TabHeader.tpl"}
 
 {elseif $action ne 1 and $action ne 2 and $action ne 4 and $action ne 8}
   <div class="messages status no-popup">
index ba514b81268fb2719b1485a598b685f1240a61c7..24547f8de7e9632eaa8a0fcc9b9f23cac1c7dbaf 100644 (file)
@@ -1,66 +1,68 @@
 // https://civicrm.org/licensing
-/**
- * By default this simply loads tabs via ajax CRM.loadPage method
- * Tabs with class 'ajaxForm' will use CRM.loadForm instead, suitable for most forms
- * Tabs with class 'livePage' will get popup action links, suitable for crud tables
- */
-CRM.$(function($) {
-  var tabSettings = CRM.tabSettings || {};
-  tabSettings.active = tabSettings.active ? $('#tab_' + tabSettings.active).prevAll().length : 0;
-  $("#mainTabContainer")
-    .on('tabsbeforeactivate', function(e, ui) {
-      // CRM-14353 - Warn of unsaved changes for all forms except those which have opted out
-      if (CRM.utils.initialValueChanged($('form:not([data-warn-changes=false])', ui.oldPanel))) {
-        CRM.alert(ts('Your changes in the <em>%1</em> tab have not been saved.', {1: ui.oldTab.text()}), ts('Unsaved Changes'), 'warning');
-      }
-    })
-    .on('tabsbeforeload', function(e, ui) {
-      // Use civicrm ajax wrappers rather than the default $.load
-      if (!ui.panel.data("civiCrmSnippet")) {
-        var method = ui.tab.hasClass('ajaxForm') ? 'loadForm' : 'loadPage';
-        var params = {target: ui.panel};
-        if (method === 'loadForm') {
-          params.autoClose = params.openInline = params.cancelButton = params.refreshAction = false;
-          ui.panel.on('crmFormLoad', function() {
-            // Hack: "Save and done" and "Cancel" buttons submit without ajax
-            $('.cancel.crm-form-submit, button[name$=upload_done]', this).on('click', function(e) {
-              $(this).closest('form').ajaxFormUnbind();
-            });
-          });
+(function($, _) {
+  /**
+   * By default this simply loads tabs via ajax CRM.loadPage method
+   * Tabs with class 'ajaxForm' will use CRM.loadForm instead, suitable for most forms
+   * Tabs with class 'livePage' will get popup action links, suitable for crud tables
+   */
+  $(function($) {
+    // CRM.tabSettings.active is the name of the tab which should open on page load
+    var tabSettings = CRM.tabSettings ? _.cloneDeep(CRM.tabSettings) : {};
+    tabSettings.active = tabSettings.active ? $('#tab_' + tabSettings.active).prevAll().length : 0;
+    $("#mainTabContainer")
+      .on('tabsbeforeactivate', function(e, ui) {
+        // CRM-14353 - Warn of unsaved changes for all forms except those which have opted out
+        if (CRM.utils.initialValueChanged($('form:not([data-warn-changes=false])', ui.oldPanel))) {
+          CRM.alert(ts('Your changes in the <em>%1</em> tab have not been saved.', {1: ui.oldTab.text()}), ts('Unsaved Changes'), 'warning');
         }
-        if (ui.tab.hasClass('livePage') && CRM.config.ajaxPopupsEnabled) {
+      })
+      .on('tabsbeforeload', function(e, ui) {
+        // Use civicrm ajax wrappers rather than the default $.load
+        if (!ui.panel.data("civiCrmSnippet")) {
+          var method = ui.tab.hasClass('ajaxForm') ? 'loadForm' : 'loadPage';
+          var params = {target: ui.panel};
+          if (method === 'loadForm') {
+            params.autoClose = params.openInline = params.cancelButton = params.refreshAction = false;
+            ui.panel.on('crmFormLoad', function() {
+              // Hack: "Save and done" and "Cancel" buttons submit without ajax
+              $('.cancel.crm-form-submit, button[name$=upload_done]', this).on('click', function(e) {
+                $(this).closest('form').ajaxFormUnbind();
+              });
+            });
+          }
+          if (ui.tab.hasClass('livePage') && CRM.config.ajaxPopupsEnabled) {
+            ui.panel
+              .off('click.crmLivePage')
+              .on('click.crmLivePage', 'a.button, a.action-item', CRM.popup)
+              .on('crmPopupFormSuccess.crmLivePage', 'a.button, a.action-item:not(.crm-enable-disable)', CRM.refreshParent);
+          }
           ui.panel
-            .off('click.crmLivePage')
-            .on('click.crmLivePage', 'a.button, a.action-item', CRM.popup)
-            .on('crmPopupFormSuccess.crmLivePage', 'a.button, a.action-item:not(.crm-enable-disable)', CRM.refreshParent);
-        }
-        ui.panel
-          .off('.tabInfo')
-          .on('crmLoad.tabInfo crmFormSuccess.tabInfo', function(e, data) {
-            if (data) {
-              if (typeof(data.tabCount) !== 'undefined') {
-                CRM.tabHeader.updateCount(ui.tab, data.tabCount);
+            .off('.tabInfo')
+            .on('crmLoad.tabInfo crmFormSuccess.tabInfo', function(e, data) {
+              if (data) {
+                if (typeof(data.tabCount) !== 'undefined') {
+                  CRM.tabHeader.updateCount(ui.tab, data.tabCount);
+                }
+                if (typeof(data.tabValid) !== 'undefined') {
+                  var method = data.tabValid ? 'removeClass' : 'addClass';
+                  ui.tab[method]('disabled');
+                }
               }
-              if (typeof(data.tabValid) !== 'undefined') {
-                var method = data.tabValid ? 'removeClass' : 'addClass';
-                ui.tab[method]('disabled');
-              }
-            }
-          });
-        CRM[method]($('a', ui.tab).attr('href'), params);
+            });
+          CRM[method]($('a', ui.tab).attr('href'), params);
+        }
+        e.preventDefault();
+      })
+      .tabs(tabSettings);
+    // Any load/submit event could potentially call for tabs to refresh.
+    $(document).on('crmLoad.tabInfo crmFormSuccess.tabInfo', function(e, data) {
+      if (data && $.isPlainObject(data.updateTabs)) {
+        $.each(data.updateTabs, CRM.tabHeader.updateCount);
+        $.each(data.updateTabs, CRM.tabHeader.resetTab);
       }
-      e.preventDefault();
-    })
-    .tabs(tabSettings);
-  // Any load/submit event could potentially call for tabs to refresh.
-  $(document).on('crmLoad.tabInfo crmFormSuccess.tabInfo', function(e, data) {
-    if (data && $.isPlainObject(data.updateTabs)) {
-      $.each(data.updateTabs, CRM.tabHeader.updateCount);
-      $.each(data.updateTabs, CRM.tabHeader.resetTab);
-    }
+    });
   });
-});
-(function($) {
+
   // Utility functions
   CRM.tabHeader = CRM.tabHeader || {};
 
@@ -146,4 +148,4 @@ CRM.$(function($) {
       $panel.crmSnippet('destroy');
     }
   };
-})(CRM.$);
+})(CRM.$, CRM._);
index a10aa28ffa0b1c3531b10c169a1c3bc946098a50..1345f31f9a2a3cc1a1058f9a1899414a67d240ce 100644 (file)
@@ -37,4 +37,3 @@
   {/if}
   <div class="clear"></div>
 </div> {* crm-content-block ends here *}
-{include file="CRM/common/TabSelected.tpl" defaultTab="settings"}
index 2b32581b8528f4ff63cf20eb85b63ed3f990182f..573d5ae7c2b177d3f324993f913dfd12984c3f7a 100644 (file)
@@ -1,3 +1,4 @@
+{* DEPRECATED script, should be refactored out and removed *}
 <script type='text/javascript'>
   var selectedTab = '{$defaultTab}';
   var tabContainer = '#mainTabContainer';
index e3d02a668d754a6950fbf8bf70d24b1b82157e9e..19abb8717fb233e309a1c637a63446173500c9ab 100644 (file)
@@ -405,7 +405,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
       'contact_sub_type' => 1,
       'sort_name' => 1,
     ];
-    $expectedSQL = 'SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, civicrm_address.id as address_id, ' . $selectClause . "  FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) WHERE  (  ( " . $whereClause . " )  )  AND (contact_a.is_deleted = 0)    ORDER BY `contact_a`.`sort_name` ASC, `contact_a`.`id` ";
+    $expectedSQL = 'SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, civicrm_address.id as address_id, ' . $selectClause . "  FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) WHERE  (  ( " . $whereClause . " )  )  AND ( 1 ) AND (contact_a.is_deleted = 0)    ORDER BY `contact_a`.`sort_name` ASC, `contact_a`.`id` ";
     $queryObj = new CRM_Contact_BAO_Query($params, $returnProperties);
     try {
       $this->assertLike($expectedSQL, $queryObj->getSearchSQL());
index 1145e2e1bccfb1c69ae4f1f265a30752440c0004..92111527adfbec74ccbf8c9844092bd914733548 100644 (file)
@@ -22,7 +22,7 @@ class CRM_Contact_Form_Search_CriteriaTest extends CiviUnitTestCase {
    * Test that the 'multiple bulk email' setting correctly affects the type of
    * field used for the 'email on hold' criteria in Advanced Search.
    */
-  public function testAdvancedHSearchObservesMultipleBulkEmailSetting() {
+  public function testAdvancedHSearchObservesMultipleBulkEmailSetting(): void {
 
     // If setting is enabled, criteria should be a select element.
     Civi::settings()->set('civimail_multiple_bulk_emails', 1);
index fbfa8f9990b087ba8c9ffc844eddbb21aab2e5fc..1a154a2671a3ded5d762255bda0b57b66ada3172 100644 (file)
@@ -121,10 +121,10 @@ class CRM_Contact_Import_Parser_ContactTest extends CiviUnitTestCase {
    *
    * In this case the contact has no external identifier.
    *
-   * @throws \Exception
+   * @throws \CRM_Core_Exception
    */
-  public function testImportParserWithUpdateWithoutExternalIdentifier() {
-    list($originalValues, $result) = $this->setUpBaseContact();
+  public function testImportParserWithUpdateWithoutExternalIdentifier(): void {
+    [$originalValues, $result] = $this->setUpBaseContact();
     $originalValues['nick_name'] = 'Old Bill';
     $this->runImport($originalValues, CRM_Import_Parser::DUPLICATE_UPDATE, CRM_Import_Parser::VALID);
     $originalValues['id'] = $result['id'];
@@ -802,14 +802,16 @@ class CRM_Contact_Import_Parser_ContactTest extends CiviUnitTestCase {
 
   /**
    * CRM-19888 default country should be used if ambigous.
+   *
+   * @throws \CRM_Core_Exception
    */
-  public function testImportAmbiguousStateCountry() {
+  public function testImportAmbiguousStateCountry(): void {
     $this->callAPISuccess('Setting', 'create', ['defaultContactCountry' => 1228]);
     $countries = CRM_Core_PseudoConstant::country(FALSE, FALSE);
     $this->callAPISuccess('Setting', 'create', ['countryLimit' => [array_search('United States', $countries), array_search('Guyana', $countries), array_search('Netherlands', $countries)]]);
     $this->callAPISuccess('Setting', 'create', ['provinceLimit' => [array_search('United States', $countries), array_search('Guyana', $countries), array_search('Netherlands', $countries)]]);
     $mapper = [0 => NULL, 1 => NULL, 2 => 'Primary', 3 => NULL];
-    list($contactValues) = $this->setUpBaseContact();
+    [$contactValues] = $this->setUpBaseContact();
     $fields = array_keys($contactValues);
     $addressValues = [
       'street_address' => 'PO Box 2716',
index 6129ee5ec08a1635abb4b897a9bba669567324d8..5316ebbd23e6b2397028308ff432b1c3359feb39 100644 (file)
@@ -263,7 +263,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'expected_query' => [
             0 => 'default',
             1 => 'default',
-            2 => "WHERE  ( civicrm_email.email LIKE '%mickey@mouseville.com%' )  AND (contact_a.is_deleted = 0)",
+            2 => "WHERE  ( civicrm_email.email LIKE '%mickey@mouseville.com%' )  AND ( 1 ) AND (contact_a.is_deleted = 0)",
           ],
         ],
       ],
@@ -282,7 +282,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'expected_query' => [
             0 => 'default',
             1 => 'default',
-            2 => "WHERE  ( civicrm_email.email LIKE '%mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE '%Mouse%' ) OR ( civicrm_email.email LIKE '%Mouse%' ) ) ) ) AND (contact_a.is_deleted = 0)",
+            2 => "WHERE  ( civicrm_email.email LIKE '%mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE '%Mouse%' ) OR ( civicrm_email.email LIKE '%Mouse%' ) ) ) ) AND ( 1 ) AND (contact_a.is_deleted = 0)",
           ],
         ],
       ],
@@ -301,7 +301,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'expected_query' => [
             0 => 'default',
             1 => 'default',
-            2 => "WHERE  ( civicrm_email.email LIKE 'mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND (contact_a.is_deleted = 0)",
+            2 => "WHERE  ( civicrm_email.email LIKE 'mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND ( 1 ) AND (contact_a.is_deleted = 0)",
           ],
         ],
       ],
@@ -320,7 +320,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'expected_query' => [
             0 => 'default',
             1 => 'default',
-            2 => "WHERE  ( civicrm_email.email LIKE 'mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND (contact_a.is_deleted)",
+            2 => "WHERE  ( civicrm_email.email LIKE 'mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND ( 1 ) AND (contact_a.is_deleted)",
           ],
         ],
       ],
@@ -344,6 +344,26 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           ],
         ],
       ],
+      [
+        [
+          'description' => 'Ensure that the Join to the acl contact cache is correct and that if we are not searching in the trash trashed contacts are not returned',
+          'class' => 'CRM_Contact_Selector',
+          'settings' => [['name' => 'includeWildCardInName', 'value' => FALSE]],
+          'form_values' => ['email' => 'mickey@mouseville.com', 'sort_name' => 'Mouse'],
+          'params' => [],
+          'return_properties' => NULL,
+          'context' => 'advanced',
+          'action' => CRM_Core_Action::ADVANCED,
+          'includeContactIds' => NULL,
+          'searchDescendentGroups' => FALSE,
+          'limitedPermissions' => TRUE,
+          'expected_query' => [
+            0 => 'default',
+            1 => 'FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_country ON ( civicrm_address.country_id = civicrm_country.id ) LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id INNER JOIN civicrm_acl_contact_cache aclContactCache ON contact_a.id = aclContactCache.contact_id',
+            2 => "WHERE  ( civicrm_email.email LIKE 'mickey@mouseville.com%'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND  aclContactCache.user_id = 0 AND (contact_a.is_deleted = 0)",
+          ],
+        ],
+      ],
       [
         [
           'description' => 'Use of quotes for exact string',
@@ -360,7 +380,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'expected_query' => [
             0 => 'default',
             1 => 'default',
-            2 => "WHERE  ( civicrm_email.email = 'mickey@mouseville.com'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND (contact_a.is_deleted = 0)",
+            2 => "WHERE  ( civicrm_email.email = 'mickey@mouseville.com'  AND ( ( ( contact_a.sort_name LIKE 'Mouse%' ) OR ( civicrm_email.email LIKE 'Mouse%' ) ) ) ) AND ( 1 ) AND (contact_a.is_deleted = 0)",
           ],
         ],
       ],
@@ -383,7 +403,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'expected_query' => [
             0 => 'SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, civicrm_address.id as address_id, civicrm_address.country_id as country_id',
             1 => ' FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 )',
-            2 => 'WHERE ( contact_a.contact_type IN ("Individual") AND civicrm_address.country_id IS NOT NULL ) AND (contact_a.is_deleted = 0)',
+            2 => 'WHERE ( contact_a.contact_type IN ("Individual") AND civicrm_address.country_id IS NOT NULL ) AND ( 1 ) AND  (contact_a.is_deleted = 0)',
           ],
         ],
       ],
@@ -403,7 +423,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
           'searchDescendentGroups' => FALSE,
           'expected_query' => [
             0 => 'SELECT contact_a.id as contact_id, source_contact.id as source_contact_id',
-            2 => 'WHERE ( source_contact.id IS NOT NULL ) AND (contact_a.is_deleted = 0)',
+            2 => 'WHERE ( source_contact.id IS NOT NULL ) AND ( 1 ) AND (contact_a.is_deleted = 0)',
           ],
         ],
       ],
@@ -423,7 +443,7 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase {
             0 => 'SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, contact_a.do_not_email as `do_not_email`, contact_a.do_not_phone as `do_not_phone`, contact_a.do_not_mail as `do_not_mail`, contact_a.do_not_sms as `do_not_sms`, contact_a.do_not_trade as `do_not_trade`, contact_a.is_opt_out as `is_opt_out`, contact_a.legal_identifier as `legal_identifier`, contact_a.external_identifier as `external_identifier`, contact_a.nick_name as `nick_name`, contact_a.legal_name as `legal_name`, contact_a.image_URL as `image_URL`, contact_a.preferred_communication_method as `preferred_communication_method`, contact_a.preferred_language as `preferred_language`, contact_a.preferred_mail_format as `preferred_mail_format`, contact_a.first_name as `first_name`, contact_a.middle_name as `middle_name`, contact_a.last_name as `last_name`, contact_a.prefix_id as `prefix_id`, contact_a.suffix_id as `suffix_id`, contact_a.formal_title as `formal_title`, contact_a.communication_style_id as `communication_style_id`, contact_a.job_title as `job_title`, contact_a.gender_id as `gender_id`, contact_a.birth_date as `birth_date`, contact_a.is_deceased as `is_deceased`, contact_a.deceased_date as `deceased_date`, contact_a.household_name as `household_name`, IF ( contact_a.contact_type = \'Individual\', NULL, contact_a.organization_name ) as organization_name, contact_a.sic_code as `sic_code`, contact_a.is_deleted as `contact_is_deleted`, IF ( contact_a.contact_type = \'Individual\', contact_a.organization_name, NULL ) as current_employer, civicrm_address.id as address_id, civicrm_address.street_address as `street_address`, civicrm_address.supplemental_address_1 as `supplemental_address_1`, civicrm_address.supplemental_address_2 as `supplemental_address_2`, civicrm_address.supplemental_address_3 as `supplemental_address_3`, civicrm_address.city as `city`, civicrm_address.postal_code_suffix as `postal_code_suffix`, civicrm_address.postal_code as `postal_code`, civicrm_address.geo_code_1 as `geo_code_1`, civicrm_address.geo_code_2 as `geo_code_2`, civicrm_address.state_province_id as state_province_id, civicrm_address.country_id as country_id, civicrm_phone.id as phone_id, civicrm_phone.phone_type_id as phone_type_id, civicrm_phone.phone as `phone`, civicrm_email.id as email_id, civicrm_email.email as `email`, civicrm_email.on_hold as `on_hold`, civicrm_im.id as im_id, civicrm_im.provider_id as provider_id, civicrm_im.name as `im`, civicrm_worldregion.id as worldregion_id, civicrm_worldregion.name as `world_region`',
             2 => 'WHERE displayRelType.relationship_type_id = 1
 AND   displayRelType.is_active = 1
-AND (contact_a.is_deleted = 0)',
+AND ( 1 ) AND (contact_a.is_deleted = 0)',
           ],
         ],
       ],
@@ -499,7 +519,7 @@ AND (contact_a.is_deleted = 0)',
     $expectedQuery = [
       0 => "SELECT contact_a.id as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, `Non_ASCII_Location_Type-location_type`.id as `Non_ASCII_Location_Type-location_type_id`, `Non_ASCII_Location_Type-location_type`.name as `Non_ASCII_Location_Type-location_type`, `Non_ASCII_Location_Type-email`.id as `Non_ASCII_Location_Type-email_id`, `Non_ASCII_Location_Type-email`.email as `Non_ASCII_Location_Type-email`",
       // @TODO these FROM clause doesn't matches due to extra spaces or special character
-      2 => "WHERE  (  ( `Non_ASCII_Location_Type-email`.email IS NOT NULL )  )  AND (contact_a.is_deleted = 0)",
+      2 => "WHERE  (  ( `Non_ASCII_Location_Type-email`.email IS NOT NULL )  )  AND ( 1 ) AND (contact_a.is_deleted = 0)",
     ];
     foreach ($expectedQuery as $index => $queryString) {
       $this->assertEquals($this->strWrangle($queryString), $this->strWrangle($sql[$index]));
index 3ab9be1c36013b005542c678be3f31819c56b5ca..42094065cbb474db7d950151b4742251c0de9775 100644 (file)
@@ -1773,7 +1773,7 @@ Price Field - Price Field 1        1   $ 100.00      $ 100.00
 
     // The page contents load later by ajax, so there's just the surrounding
     // html available now, but we can check at least one thing while we're here.
-    $this->assertStringContainsString("selectedTab = 'widget';", $contents);
+    $this->assertContains("mainTabContainer", $contents);
   }
 
 }
index 707df1e1489e080b00fbb892ff7dfde5cb4b4c5c..4236dcff92ceae46dbf2e76cec187c8bbf251def 100644 (file)
@@ -644,4 +644,53 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase {
 
   }
 
+  /**
+   * Pinned countries with Default country
+   */
+  public function testPinnedCountriesWithDefaultCountry() {
+    // Guyana, Netherlands, United States
+    $pinnedCountries = ['1093', '1152', '1228'];
+
+    // set default country to Netherlands
+    $this->callAPISuccess('Setting', 'create', ['defaultContactCountry' => 1152, 'pinnedContactCountries' => $pinnedCountries]);
+    // get the list of country
+    $availableCountries = CRM_Core_PseudoConstant::country(FALSE, FALSE);
+    // get the order of country id using their keys
+    $availableCountries = array_keys($availableCountries);
+
+    // default country is set, so first country should be Netherlands, then rest from pinned countries.
+
+    // Netherlands
+    $this->assertEquals(1152, $availableCountries[0]);
+    // Guyana
+    $this->assertEquals(1093, $availableCountries[1]);
+    // United States
+    $this->assertEquals(1228, $availableCountries[2]);
+  }
+
+  /**
+   * Pinned countries with out Default country
+   */
+  public function testPinnedCountriesWithOutDefaultCountry() {
+    // Guyana, Netherlands, United States
+    $pinnedCountries = ['1093', '1152', '1228'];
+
+    // unset default country
+    $this->callAPISuccess('Setting', 'create', ['defaultContactCountry' => NULL, 'pinnedContactCountries' => $pinnedCountries]);
+
+    // get the list of country
+    $availableCountries = CRM_Core_PseudoConstant::country(FALSE, FALSE);
+    // get the order of country id using their keys
+    $availableCountries = array_keys($availableCountries);
+
+    // no default country, so sequnece should be present as per pinned countries.
+
+    // Guyana
+    $this->assertEquals(1093, $availableCountries[0]);
+    // Netherlands
+    $this->assertEquals(1152, $availableCountries[1]);
+    // United States
+    $this->assertEquals(1228, $availableCountries[2]);
+  }
+
 }
index ae788ba64f722146f792dcb1dc229e4a16e59b6d..756ba9bc5bb25a1dbfd50acadc6267a8e80694ef 100644 (file)
@@ -377,24 +377,25 @@ class CRM_Core_BAO_SchemaHandlerTest extends CiviUnitTestCase {
    */
   public function testBuildFieldChangeSql() {
     $params = [
-      'table_name' => 'big_table',
+      'table_name' => 'civicrm_contact',
       'operation' => 'add',
       'name' => 'big_bob',
       'type' => 'text',
     ];
     $sql = CRM_Core_BAO_SchemaHandler::buildFieldChangeSql($params, FALSE);
-    $this->assertEquals('ALTER TABLE big_table
+    $this->assertEquals('ALTER TABLE civicrm_contact
         ADD COLUMN `big_bob` text', trim($sql));
 
     $params['operation'] = 'modify';
     $params['comment'] = 'super big';
+    $params['fkName'] = CRM_Core_BAO_SchemaHandler::getIndexName('civicrm_contact', 'big_bob');
     $sql = CRM_Core_BAO_SchemaHandler::buildFieldChangeSql($params, FALSE);
-    $this->assertEquals("ALTER TABLE big_table
+    $this->assertEquals("ALTER TABLE civicrm_contact
         MODIFY `big_bob` text COMMENT 'super big'", trim($sql));
 
     $params['operation'] = 'delete';
     $sql = CRM_Core_BAO_SchemaHandler::buildFieldChangeSql($params, FALSE);
-    $this->assertEquals('ALTER TABLE big_table DROP COLUMN `big_bob`', trim($sql));
+    $this->assertEquals('ALTER TABLE civicrm_contact DROP COLUMN `big_bob`', trim($sql));
   }
 
 }
index 61a88b684e5e90a50c8f8453783a7534c3a126e6..3682925eb6c3a1b9246b313b7e0bf21eeb9bc5c5 100644 (file)
@@ -25,6 +25,8 @@
  */
 class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
 
+  use CRMTraits_Financial_OrderTrait;
+
   protected $_individualId;
   protected $_contribution;
   protected $_financialTypeId = 1;
@@ -1320,41 +1322,29 @@ Expires: ',
    * @throws \CRM_Core_Exception
    * @throws \CiviCRM_API3_Exception
    */
-  public function testContributionFormStatusUpdate() {
+  public function testContributionFormStatusUpdate(): void {
 
-    $this->_individualId = $this->createLoggedInUser();
-    $membershipId = $this->contactMembershipCreate([
-      'contact_id' => $this->_individualId,
-      'membership_type_id' => $this->membershipTypeAnnualFixedID,
-      'status_id' => 'New',
-    ]);
+    $this->_contactID = $this->createLoggedInUser();
+    $this->createContributionAndMembershipOrder();
 
     $params = [
       'total_amount' => 50,
       'financial_type_id' => 2,
-      'contact_id' => $this->_individualId,
+      'contact_id' => $this->_contactID,
       'payment_instrument_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', 'Check'),
       'contribution_status_id' => CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Cancelled'),
     ];
 
-    $contriParams = [
-      'membership_id' => $membershipId,
-      'total_amount' => 50,
-      'financial_type_id' => 2,
-      'contact_id' => $this->_individualId,
-    ];
-    $contribution = CRM_Member_BAO_Membership::recordMembershipContribution($contriParams);
-
     //Update Contribution to Cancelled.
     $form = new CRM_Contribute_Form_Contribution();
-    $form->_id = $params['id'] = $contribution->id;
+    $form->_id = $params['id'] = $this->ids['Contribution'][0];
     $form->_mode = NULL;
     $form->_contactID = $this->_individualId;
     $form->testSubmit($params, CRM_Core_Action::UPDATE);
-    $membership = $this->callAPISuccessGetSingle('Membership', ['contact_id' => $this->_individualId]);
+    $membership = $this->callAPISuccessGetSingle('Membership', ['contact_id' => $this->_contactID]);
 
     //Assert membership status overrides when the contribution cancelled.
-    $this->assertEquals($membership['is_override'], TRUE);
+    $this->assertEquals(TRUE, $membership['is_override']);
     $this->assertEquals($membership['status_id'], $this->callAPISuccessGetValue('MembershipStatus', [
       'return' => 'id',
       'name' => 'Cancelled',
index fbbd2347eb9447e30ae1a72948693d4bece0b62c..8652d40ac20e9d41c14d82b7eb421a6b47cef09a 100644 (file)
@@ -74,7 +74,7 @@ trait CRMTraits_Financial_OrderTrait {
    *
    * @throws \CRM_Core_Exception
    */
-  protected function createContributionAndMembershipOrder() {
+  protected function createContributionAndMembershipOrder(): void {
     $this->ids['membership_type'][0] = $this->membershipTypeCreate();
     $orderID = $this->callAPISuccess('Order', 'create', [
       'financial_type_id' => 'Donation',
@@ -110,6 +110,10 @@ trait CRMTraits_Financial_OrderTrait {
             'contact_id' => $this->_contactID,
             'membership_type_id' => 'General',
             'source' => 'Payment',
+            // This is necessary because Membership_BAO otherwise ignores the
+            // pending status. I do have a fix but it's held up behind other pending-review PRs
+            // so this should be temporary until we get the membership PRs flowing.
+            'skipStatusCal' => TRUE,
           ],
           'line_item' => $this->getMembershipLineItem(),
         ],
index df25b45c005223465152e09c61ac1ced5ee0dd55..5178b75a94a51a676e7c6bda7f45f1bee126210b 100644 (file)
@@ -4936,4 +4936,34 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     return $this->callAPISuccessGetSingle('Contact', ['id' => $isReverse ? $this->ids['contact'][1] : $this->ids['contact'][0]]);
   }
 
+  /**
+   * Test a lack of fatal errors when the where contains an emoji.
+   *
+   * By default our DBs are not ðŸ¦‰ compliant. This test will age
+   * out when we are.
+   *
+   * @throws \API_Exception
+   */
+  public function testEmojiInWhereClause(): void {
+    $schemaNeedsAlter = \CRM_Core_BAO_SchemaHandler::databaseSupportsUTF8MB4();
+    if ($schemaNeedsAlter) {
+      \CRM_Core_DAO::executeQuery("
+        ALTER TABLE civicrm_contact MODIFY COLUMN
+        `first_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'First Name.',
+        CHARSET utf8
+      ");
+    }
+    $this->callAPISuccess('Contact', 'get', [
+      'debug' => 1,
+      'first_name' => '🦉Claire',
+    ]);
+    if ($schemaNeedsAlter) {
+      \CRM_Core_DAO::executeQuery("
+        ALTER TABLE civicrm_contact MODIFY COLUMN
+        `first_name` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'First Name.',
+        CHARSET utf8mb4
+      ");
+    }
+  }
+
 }
index bec416700c6f26cfc8d4c2e51b460deefa1b085d..4550d1eff110acde3b783d294b3e3382a55eb61f 100644 (file)
@@ -139,24 +139,17 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
 
   /**
    * Test Activity creation on cancellation of membership contribution.
+   *
+   * @throws \CRM_Core_Exception
+   * @throws \CiviCRM_API3_Exception
    */
-  public function testActivityForCancelledContribution() {
+  public function testActivityForCancelledContribution(): void {
     $contactId = $this->createLoggedInUser();
-    $membershipID = $this->contactMembershipCreate($this->_params);
-
-    $ContributionCreate = $this->callAPISuccess('Contribution', 'create', [
-      'financial_type_id' => 'Member Dues',
-      'total_amount' => 100,
-      'contact_id' => $this->_params['contact_id'],
-    ]);
-    $this->callAPISuccess('MembershipPayment', 'create', [
-      'sequential' => 1,
-      'contribution_id' => $ContributionCreate['id'],
-      'membership_id' => $membershipID,
-    ]);
 
+    $this->createContributionAndMembershipOrder();
+    $membershipID = $this->callAPISuccessGetValue('MembershipPayment', ['return' => 'id']);
     $form = new CRM_Contribute_Form_Contribution();
-    $form->_id = $ContributionCreate['id'];
+    $form->_id = $this->ids['Contribution'][0];
     $form->testSubmit([
       'total_amount' => 100,
       'financial_type_id' => 1,
@@ -169,7 +162,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->callAPISuccessGetSingle('Activity', [
       'activity_type_id' => 'Membership Signup',
       'source_record_id' => $membershipID,
-      'subject' => 'General - Payment - Status: test status',
+      'subject' => 'General - Payment - Status: Pending',
     ]);
     $this->callAPISuccessGetSingle('Activity', [
       'activity_type_id' => 'Change Membership Status',
index 649928815ed18b20d033271928320100a19f391f..965a8b88ee9f73fe31a3c3bfc4f5d3afde03a2da 100644 (file)
@@ -102,4 +102,34 @@ class ContactGetTest extends \api\v4\UnitTestCase {
     $this->assertTrue(!empty($limit1->single()['sort_name']));
   }
 
+  /**
+   * Test a lack of fatal errors when the where contains an emoji.
+   *
+   * By default our DBs are not ðŸ¦‰ compliant. This test will age
+   * out when we are.
+   *
+   * @throws \API_Exception
+   */
+  public function testEmoji(): void {
+    $schemaNeedsAlter = \CRM_Core_BAO_SchemaHandler::databaseSupportsUTF8MB4();
+    if ($schemaNeedsAlter) {
+      \CRM_Core_DAO::executeQuery("
+        ALTER TABLE civicrm_contact MODIFY COLUMN
+        `first_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'First Name.',
+        CHARSET utf8
+      ");
+    }
+    Contact::get()
+      ->setDebug(TRUE)
+      ->addWhere('first_name', '=', '🦉Claire')
+      ->execute();
+    if ($schemaNeedsAlter) {
+      \CRM_Core_DAO::executeQuery("
+        ALTER TABLE civicrm_contact MODIFY COLUMN
+        `first_name` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'First Name.',
+        CHARSET utf8mb4
+      ");
+    }
+  }
+
 }
index 3e44ca82e2d5625eb814cbf05d2ae3c25e342c3f..689ef37ba5565079828621b00e5b3e5e2897f92f 100644 (file)
@@ -50,6 +50,13 @@ class CustomFieldAlterTest extends BaseCustomValueTest {
         ->addValue('label', 'TestText')
         ->addValue('html_type', 'Text'), 0
       )
+      ->addChain('field3', CustomField::create()
+        ->addValue('custom_group_id', '$id')
+        ->addValue('serialize', TRUE)
+        ->addValue('label', 'TestCountry')
+        ->addValue('data_type', 'Country')
+        ->addValue('html_type', 'Select'), 0
+      )
       ->execute()
       ->first();
 
@@ -58,7 +65,7 @@ class CustomFieldAlterTest extends BaseCustomValueTest {
       ->addRecord(['subject' => 'A1', 'MyFieldsToAlter.TestText' => 'A1', 'MyFieldsToAlter.TestOptions' => '1'])
       ->addRecord(['subject' => 'A2', 'MyFieldsToAlter.TestText' => 'A2', 'MyFieldsToAlter.TestOptions' => '2'])
       ->addRecord(['subject' => 'A3', 'MyFieldsToAlter.TestText' => 'A3', 'MyFieldsToAlter.TestOptions' => ''])
-      ->addRecord(['subject' => 'A4', 'MyFieldsToAlter.TestText' => 'A4'])
+      ->addRecord(['subject' => 'A4', 'MyFieldsToAlter.TestText' => 'A4', 'MyFieldsToAlter.TestCountry' => [1228, 1039]])
       ->execute();
 
     $result = Activity::get(FALSE)
@@ -74,7 +81,7 @@ class CustomFieldAlterTest extends BaseCustomValueTest {
     $this->assertTrue(empty($result['A3']['MyFieldsToAlter.TestOptions']));
     $this->assertTrue(empty($result['A4']['MyFieldsToAlter.TestOptions']));
 
-    // Change field to multiselect
+    // Change options field to multiselect
     CustomField::update(FALSE)
       ->addWhere('id', '=', $customGroup['field1']['id'])
       ->addValue('serialize', TRUE)
@@ -109,6 +116,34 @@ class CustomFieldAlterTest extends BaseCustomValueTest {
     $this->assertEquals('Two', $result['A2']['MyFieldsToAlter.TestOptions:label']);
     $this->assertTrue(empty($result['A3']['MyFieldsToAlter.TestOptions']));
     $this->assertTrue(empty($result['A4']['MyFieldsToAlter.TestOptions']));
+
+    // Change country field from multiselect to single
+    CustomField::update(FALSE)
+      ->addWhere('id', '=', $customGroup['field3']['id'])
+      ->addValue('serialize', FALSE)
+      ->execute();
+
+    $result = Activity::get(FALSE)
+      ->addWhere('MyFieldsToAlter.TestCountry', 'IS NOT NULL')
+      ->addSelect('custom.*', 'subject')
+      ->execute()->indexBy('subject');
+    $this->assertCount(1, $result);
+    // The two values originally entered will now be one value
+    $this->assertEquals(1228, $result['A4']['MyFieldsToAlter.TestCountry']);
+
+    // Change country field from single to multiselect
+    CustomField::update(FALSE)
+      ->addWhere('id', '=', $customGroup['field3']['id'])
+      ->addValue('serialize', TRUE)
+      ->execute();
+
+    $result = Activity::get(FALSE)
+      ->addWhere('MyFieldsToAlter.TestCountry', 'IS NOT NULL')
+      ->addSelect('custom.*', 'subject')
+      ->execute()->indexBy('subject');
+    $this->assertCount(1, $result);
+    // The two values originally entered will now be one value
+    $this->assertEquals([1228], $result['A4']['MyFieldsToAlter.TestCountry']);
   }
 
 }
index 15a2a66b1d51fc5d7ad00d6525b9d4ef8ddcbb7c..3833bb3e5a77934babc7d2becccec06463f3f64b 100644 (file)
       "activity_type_id:name": "Phone Call",
       "source_contact_id": "@ref test_contact_1.id"
     }
+  ],
+  "Contribution": [
+    {
+      "total_amount": 999.89,
+      "financial_type_id:name": "Donation",
+      "contact_id": "@ref test_contact_1.id"
+    }
   ]
 }
index 957ed485d7568c601482938abbe6909e3db3ef63..eac1f5f9d5387c10dd3ffa923d11ffc3d00728d5 100644 (file)
@@ -69,6 +69,14 @@ class ConformanceTest extends UnitTestCase {
    * @throws \Civi\API\Exception\UnauthorizedException
    */
   public function getEntitiesHitech() {
+    // Ensure all components are enabled so their entities show up
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviEvent');
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviGrant');
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase');
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviContribute');
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign');
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviPledge');
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviReport');
     return $this->toDataProviderArray(Entity::get(FALSE)->execute()->column('name'));
   }
 
@@ -86,7 +94,7 @@ class ConformanceTest extends UnitTestCase {
     $manual['remove'] = ['CustomValue'];
 
     $scanned = [];
-    $srcDir = dirname(dirname(dirname(dirname(dirname(__DIR__)))));
+    $srcDir = dirname(__DIR__, 5);
     foreach ((array) glob("$srcDir/Civi/Api4/*.php") as $name) {
       $scanned[] = preg_replace('/\.php/', '', basename($name));
     }
@@ -110,9 +118,12 @@ class ConformanceTest extends UnitTestCase {
   /**
    * @param string $entity
    *   Ex: 'Contact'
+   *
    * @dataProvider getEntitiesLotech
+   *
+   * @throws \API_Exception
    */
-  public function testConformance($entity) {
+  public function testConformance($entity): void {
     $entityClass = 'Civi\Api4\\' . $entity;
 
     $this->checkEntityInfo($entityClass);
@@ -137,7 +148,7 @@ class ConformanceTest extends UnitTestCase {
   /**
    * @param \Civi\Api4\Generic\AbstractEntity|string $entityClass
    */
-  protected function checkEntityInfo($entityClass) {
+  protected function checkEntityInfo($entityClass): void {
     $info = $entityClass::getInfo();
     $this->assertNotEmpty($info['name']);
     $this->assertNotEmpty($info['title']);
@@ -149,6 +160,8 @@ class ConformanceTest extends UnitTestCase {
   /**
    * @param \Civi\Api4\Generic\AbstractEntity|string $entityClass
    * @param string $entity
+   *
+   * @throws \API_Exception
    */
   protected function checkFields($entityClass, $entity) {
     $fields = $entityClass::getFields(FALSE)
@@ -166,8 +179,10 @@ class ConformanceTest extends UnitTestCase {
    * @param \Civi\Api4\Generic\AbstractEntity|string $entityClass
    *
    * @return array
+   *
+   * @throws \API_Exception
    */
-  protected function checkActions($entityClass) {
+  protected function checkActions($entityClass): array {
     $actions = $entityClass::getActions(FALSE)
       ->execute()
       ->indexBy('name');
@@ -202,7 +217,7 @@ class ConformanceTest extends UnitTestCase {
    * @param \Civi\Api4\Generic\AbstractEntity|string $entityClass
    * @param int $id
    */
-  protected function checkUpdateFailsFromCreate($entityClass, $id) {
+  protected function checkUpdateFailsFromCreate($entityClass, $id): void {
     $exceptionThrown = '';
     try {
       $entityClass::create(FALSE)
@@ -235,7 +250,7 @@ class ConformanceTest extends UnitTestCase {
    * @param int $id
    * @param string $entity
    */
-  protected function checkGetCount($entityClass, $id, $entity) {
+  protected function checkGetCount($entityClass, $id, $entity): void {
     $getResult = $entityClass::get(FALSE)
       ->addWhere('id', '=', $id)
       ->selectRowCount()
index 5f5e8abfe00981f28d55d618c11b24ba163611c1..b239e257ab72730fbddb5217c0ba802b8e5eb15f 100644 (file)
@@ -28,6 +28,7 @@ use api\v4\UnitTestCase;
 class EntityTest extends UnitTestCase {
 
   public function testEntityGet() {
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviEvent');
     $result = Entity::get(FALSE)
       ->execute()
       ->indexBy('name');
@@ -47,4 +48,20 @@ class EntityTest extends UnitTestCase {
       "Entity entity has more than basic actions");
   }
 
+  public function testEntityComponent() {
+    \CRM_Core_BAO_ConfigSetting::disableComponent('CiviEvent');
+    $result = Entity::get(FALSE)
+      ->execute()
+      ->indexBy('name');
+    $this->assertArrayNotHasKey('Participant', $result,
+      "Entity::get should not have Participant when CiviEvent disabled");
+
+    \CRM_Core_BAO_ConfigSetting::enableComponent('CiviEvent');
+    $result = Entity::get(FALSE)
+      ->execute()
+      ->indexBy('name');
+    $this->assertArrayHasKey('Participant', $result,
+      "Entity::get should have Participant when CiviEvent enabled");
+  }
+
 }
index 3625aca74aa2dde5f42287679ff39153a7a48d4a..19d5df80b91efb5096d39ce34f70ad625166fadb 100644 (file)
@@ -6,6 +6,7 @@
   <comment>Campaign Details.</comment>
   <add>3.3</add>
   <icon>fa-bullhorn</icon>
+  <component>CiviCampaign</component>
   <paths>
     <add>civicrm/campaign/add?reset=1</add>
     <update>civicrm/campaign/add?reset=1&amp;action=update&amp;id=[id]</update>
index dda4c7dc8046dabdcf504d942b8609d36cddac84..ea143c1d1c48ef44086f89298577a836b5f03971 100644 (file)
@@ -5,7 +5,7 @@
   <name>civicrm_campaign_group</name>
   <comment>Campaign Group Details.</comment>
   <add>3.3</add>
-
+  <component>CiviCampaign</component>
   <field>
     <name>id</name>
     <title>Campaign Group ID</title>
index 5d13bbd79b4ab94f30a4e6fbd8d0a1f7c3133b05..dc41dbeefaaa5aadb565be42e42515004bbef749 100644 (file)
@@ -6,6 +6,7 @@
   <comment>Campaign Survey Details.</comment>
   <add>3.2</add>
   <icon>fa-clipboard</icon>
+  <component>CiviCampaign</component>
   <field>
     <name>id</name>
     <title>Survey ID</title>
index 492a1df43d46e148f5d9e333b59dc4fe3ecdb05a..ed1dba9d797dfaecf53ba9c3214f824833b463e2 100644 (file)
@@ -7,6 +7,7 @@
   <add>1.8</add>
   <log>true</log>
   <icon>fa-folder-open</icon>
+  <component>CiviCase</component>
   <field>
     <name>id</name>
     <type>int unsigned</type>
index daa0a895d216bf97f57e86ad959efb279393cfae..678e4eb89f7cad2b8db982ebde08939463e3e9cd 100644 (file)
@@ -6,6 +6,7 @@
   <comment>Joining table for case-activity associations.</comment>
   <add>1.8</add>
   <log>true</log>
+  <component>CiviCase</component>
   <field>
     <name>id</name>
     <title>Case Activity ID</title>
index f4ae08f187057818e9da408d2394218b82135403..0ddfc379a01284d6f690ac8c40556805dd40b922 100644 (file)
@@ -6,6 +6,7 @@
   <comment>Joining table for case-contact associations.</comment>
   <add>2.1</add>
   <log>true</log>
+  <component>CiviCase</component>
   <field>
     <name>id</name>
     <title>Case Contact ID</title>
index 8af587a5b5044501cc56d12fb05d46ee22467ce7..99d40cd9ea699be1b794b5b224392f9710b465ad 100644 (file)
@@ -6,6 +6,7 @@
   <comment>Case type definition</comment>
   <add>4.5</add>
   <log>true</log>
+  <component>CiviCase</component>
   <field>
     <name>id</name>
     <title>Case Type ID</title>
index 8d7635d51cfd45e6d982056dd2f82e4dcb3d8812..6c725b1ddc28e7e5dde385b27d59493e3ba7bf27 100644 (file)
@@ -7,6 +7,7 @@
   <add>1.3</add>
   <log>true</log>
   <icon>fa-credit-card</icon>
+  <component>CiviContribute</component>
   <paths>
     <add>civicrm/contribute/add?reset=1&amp;action=add&amp;context=standalone</add>
     <view>civicrm/contact/view/contribution?reset=1&amp;action=view&amp;id=[id]</view>
index fb93703f74769ddbe5df4c46d7416e5be3f5d2ca..ec39744138ba0ca5438e1ba72e2eb31a610bdcdf 100644 (file)
@@ -7,6 +7,7 @@
   <comment>A Contribution object store meta information about a single customized contribution page</comment>
   <add>1.3</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Contribution Page ID</title>
index 1e3526d27c5a53bbef786a6f849d9898c618a0cd..2f9d253e2a11a93913ddefda16ad0571d3823641 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_contribution_product</name>
   <add>1.4</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Contribution Product ID</title>
index 00411d639be88341aef2ffde43cb18d7e3b22295..fa78706c182e1fd511b5b11cfd840306cd85ef33 100644 (file)
@@ -6,6 +6,7 @@
   <add>1.6</add>
   <log>true</log>
   <title>Recurring Contribution</title>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <uniqueName>contribution_recur_id</uniqueName>
index 85da611d778c01cf867cdc756167923703697959..5f012de36d79682eec1d797f944581037b41593c 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_contribution_soft</name>
   <add>2.2</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <uniqueName>contribution_soft_id</uniqueName>
index 039d1921a90f3e7be6344f80fd4d467724d286dc..aaea0628d04c97fc00d9bbe3ab401314ab6a8bec 100644 (file)
@@ -7,6 +7,7 @@
   <name>civicrm_premiums</name>
   <add>1.4</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Premium ID</title>
index 6ed7ca1ce61761e2f7fb900ce81c8f2fb74eeecd..d2fe7456de367c7b93d3421e707b082a6c77cbe8 100644 (file)
@@ -7,6 +7,7 @@
   <comment>joins premiums (settings) to individual product/premium items - determines which products are available for a given contribution page</comment>
   <add>1.4</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Premium Product ID</title>
index 8c18004c2cd1082e9ec91c9872a1f9e2d8b4ee61..2f4e32485ce8bcbae1c9fdcf799ea8c0d7118806 100644 (file)
@@ -7,6 +7,7 @@
   <name>civicrm_product</name>
   <add>1.4</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Product ID</title>
index f6dd5b31785152d46502dd865fd6c966596eb553..d9ebeb77e199aeb1eb6b89aeb98ccc1a9af6248c 100644 (file)
@@ -7,6 +7,7 @@
   <comment>A Widget object to store meta information about a single customized contribution widget</comment>
   <add>2.0</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Widget ID</title>
index 48c4ae3fd21c7544c3291e2818e248474322896e..0c957af2a7650cce86b6d5159995837b0d750d19 100644 (file)
@@ -5,6 +5,7 @@
   <class>Cart</class>
   <useBao>1</useBao>
   <name>civicrm_event_carts</name>
+  <component>CiviEvent</component>
   <field>
     <name>id</name>
     <title>Cart ID</title>
index f8ac8d506b792f97e13c48a3be18e4967b59c67e..25eb7b0979e7fe073bbf0df89ca9b8fbc291049e 100644 (file)
@@ -5,6 +5,7 @@
   <class>EventInCart</class>
   <useBao>1</useBao>
   <name>civicrm_events_in_carts</name>
+  <component>CiviEvent</component>
   <field>
     <name>id</name>
     <title>Event In Cart</title>
index 7471a61e8a87d49977b7f5b7fe7c21c92c0a67f2..6bef35f2318d8205ed74c81a47bc5d09b537d72a 100644 (file)
@@ -7,6 +7,7 @@
   <add>1.7</add>
   <log>true</log>
   <icon>fa-calendar</icon>
+  <component>CiviEvent</component>
   <paths>
     <add>civicrm/event/add?reset=1</add>
     <view>civicrm/event/info?reset=1&amp;id=[id]</view>
index cefaeef59b3ab7c22545bf93effdccbdb88428ce..6fd2a94f542b4738098364cd6432165cc6474e00 100644 (file)
@@ -7,6 +7,7 @@
   <add>1.7</add>
   <log>true</log>
   <icon>fa-ticket</icon>
+  <component>CiviEvent</component>
   <field>
     <name>id</name>
     <uniqueName>participant_id</uniqueName>
index 00edfcde042a9bbc80bc430a4f54af46ca90a2d0..8872bdd25eefcf75a76578f0cb8233684b5f37e3 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_participant_payment</name>
   <add>1.7</add>
   <log>true</log>
+  <component>CiviEvent</component>
   <field>
     <name>id</name>
     <title>Payment ID</title>
index 17dad28221b311850fcfd2d460e65b5ea97e3a60..083e9a2058e7c4036563bf4dd1e3446dfc4b9ba8 100644 (file)
@@ -6,6 +6,7 @@
   <comment>various types of CiviEvent participant statuses</comment>
   <add>3.0</add>
   <log>true</log>
+  <component>CiviEvent</component>
   <field>
     <name>id</name>
     <title>Participant Status Type ID</title>
index 28060cd1c20f3ceb5a7f5cd363f5c08449f67b10..31ccd6b38b1964f0b8e316861a04a9d7e4030e84 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_currency</name>
   <add>1.7</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Currency ID</title>
index 9d20ca8d2ecb8b05a65adc1dfbee28933c9b422b..86032a2567128c18646c8240037ce927f529deef 100644 (file)
@@ -7,6 +7,7 @@
   <add>4.3</add>
   <comment>Map between an entity and a financial account, where there is a specific relationship between the financial account and the entity, e.g. Income Account for or AR Account for</comment>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Entity Financial Account ID</title>
index f48a3f3c6574af9723d4357d1cf6f95143b0c932..ad7bee1e665acafbd15c65f40037f56436e04be9 100644 (file)
@@ -5,6 +5,7 @@
   <class>EntityFinancialTrxn</class>
   <name>civicrm_entity_financial_trxn</name>
   <add>3.2</add>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Entity Financial Transaction ID</title>
index 3188e5847e3113bb3a0a21bf9c68af76d70f16d9..45e7ba751c5f5d115872d01003f589608677a559 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_financial_account</name>
   <add>3.2</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Financial Account ID</title>
index 4c6b4c0b207234e68867f7c3e3d805572a090d40..294a3707821ab2ed128aa7d5d140b93e18159123 100644 (file)
@@ -7,6 +7,7 @@
   <add>4.3</add>
   <comment>Financial data for civicrm_line_item, etc.</comment>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <type>int unsigned</type>
index f66395144b2a8b02478de371876a561a8cd0db25..b6005f868cdc2a56e992f47dfc477bec267a4220 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_financial_trxn</name>
   <add>1.3</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Financial Transaction ID</title>
index 3d02bf8b0991bab93460c21c15629eafa355f033..adc6b7f4eabeea62754924ff991ade0a36657ae3 100644 (file)
@@ -7,6 +7,7 @@
   <add>1.3</add>
   <comment>Formerly civicrm_contribution_type merged into this table in 4.3</comment>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Financial Type ID</title>
index a363ce8784677d213180de420e5e58b2753d1bec..f66d1cd093371429d14dad438f9dd786bb9d379f 100644 (file)
@@ -5,6 +5,7 @@
   <class>PaymentProcessor</class>
   <name>civicrm_payment_processor</name>
   <add>1.8</add>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Payment Processor ID</title>
index 72ea65d2b245ce5233dbf2566087949a3d2e32b5..f282e334486f548bb5b40e6a7d017b85aa7ffec2 100644 (file)
@@ -5,6 +5,7 @@
   <class>PaymentProcessorType</class>
   <name>civicrm_payment_processor_type</name>
   <add>1.8</add>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Payment Processor Type ID</title>
index fd7c2b60b8d47e67ad70b073881917174717e344..594ea0ec7f633847082106730f58b5bd4bea2ee6 100644 (file)
@@ -1,78 +1,79 @@
-<?xml version="1.0" encoding="iso-8859-1" ?> 
+<?xml version="1.0" encoding="iso-8859-1" ?>
 
-<table> 
-  <base>CRM/Financial</base> 
-  <class>PaymentToken</class> 
-  <name>civicrm_payment_token</name> 
-  <comment>Payment Token</comment> 
-  <add>4.6</add> 
-  <field> 
+<table>
+  <base>CRM/Financial</base>
+  <class>PaymentToken</class>
+  <name>civicrm_payment_token</name>
+  <comment>Payment Token</comment>
+  <add>4.6</add>
+  <component>CiviContribute</component>
+  <field>
     <name>id</name>
     <uniqueName>payment_token_id</uniqueName>
     <title>Payment Token ID</title>
-    <type>int unsigned</type> 
-    <required>true</required> 
-    <comment>Payment Token ID</comment> 
-    <add>4.6</add> 
-  </field> 
-  <primaryKey> 
-    <name>id</name> 
-    <autoincrement>true</autoincrement> 
-  </primaryKey> 
-  <field> 
-    <name>contact_id</name> 
-    <title>Contact ID</title> 
-    <type>int unsigned</type> 
-    <required>true</required> 
-    <comment>FK to Contact ID for the owner of the token</comment> 
-    <add>4.6</add> 
-  </field> 
-  <foreignKey> 
-    <name>contact_id</name> 
-    <table>civicrm_contact</table> 
-    <key>id</key> 
-    <add>4.6</add> 
-    <onDelete>CASCADE</onDelete> 
-  </foreignKey> 
-  <field> 
-    <name>payment_processor_id</name> 
-    <title>Payment Processor ID</title> 
-    <type>int unsigned</type> 
-    <required>true</required> 
-    <comment></comment> 
-    <add>4.6</add> 
-  </field> 
-  <foreignKey> 
-    <name>payment_processor_id</name> 
-    <table>civicrm_payment_processor</table> 
-    <key>id</key> 
-    <add>4.6</add> 
-    <onDelete>RESTRICT</onDelete> 
-  </foreignKey> 
-  <field> 
-    <name>token</name> 
+    <type>int unsigned</type>
+    <required>true</required>
+    <comment>Payment Token ID</comment>
+    <add>4.6</add>
+  </field>
+  <primaryKey>
+    <name>id</name>
+    <autoincrement>true</autoincrement>
+  </primaryKey>
+  <field>
+    <name>contact_id</name>
+    <title>Contact ID</title>
+    <type>int unsigned</type>
+    <required>true</required>
+    <comment>FK to Contact ID for the owner of the token</comment>
+    <add>4.6</add>
+  </field>
+  <foreignKey>
+    <name>contact_id</name>
+    <table>civicrm_contact</table>
+    <key>id</key>
+    <add>4.6</add>
+    <onDelete>CASCADE</onDelete>
+  </foreignKey>
+  <field>
+    <name>payment_processor_id</name>
+    <title>Payment Processor ID</title>
+    <type>int unsigned</type>
+    <required>true</required>
+    <comment></comment>
+    <add>4.6</add>
+  </field>
+  <foreignKey>
+    <name>payment_processor_id</name>
+    <table>civicrm_payment_processor</table>
+    <key>id</key>
+    <add>4.6</add>
+    <onDelete>RESTRICT</onDelete>
+  </foreignKey>
+  <field>
+    <name>token</name>
     <type>varchar</type>
     <title>Token</title>
-    <length>255</length> 
-    <required>true</required> 
-    <comment>Externally provided token string</comment> 
-    <add>4.6</add> 
-  </field> 
-  <field> 
+    <length>255</length>
+    <required>true</required>
+    <comment>Externally provided token string</comment>
+    <add>4.6</add>
+  </field>
+  <field>
     <name>created_date</name>
     <title>Created Date</title>
-    <type>timestamp</type> 
+    <type>timestamp</type>
     <comment>Date created</comment>
     <default>CURRENT_TIMESTAMP</default>
-    <add>4.6</add> 
-  </field> 
-  <field> 
+    <add>4.6</add>
+  </field>
+  <field>
     <name>created_id</name>
     <title>Created ID</title>
-    <type>int unsigned</type>  
-    <comment>Contact ID of token creator</comment> 
-    <add>4.6</add> 
-  </field> 
+    <type>int unsigned</type>
+    <comment>Contact ID of token creator</comment>
+    <add>4.6</add>
+  </field>
   <foreignKey>
     <name>created_id</name>
     <table>civicrm_contact</table>
     <add>4.6</add>
     <onDelete>SET NULL</onDelete>
   </foreignKey>
-  <field> 
+  <field>
     <name>expiry_date</name>
     <title>Expiry Date</title>
-    <type>datetime</type> 
-    <comment>Date this token expires</comment> 
-    <add>4.6</add> 
-  </field> 
-  <field> 
+    <type>datetime</type>
+    <comment>Date this token expires</comment>
+    <add>4.6</add>
+  </field>
+  <field>
     <name>email</name>
     <title>Email</title>
-    <length>255</length> 
-    <type>varchar</type> 
-    <comment>Email at the time of token creation. Useful for fraud forensics</comment> 
-    <add>4.6</add> 
-  </field> 
- <field> 
+    <length>255</length>
+    <type>varchar</type>
+    <comment>Email at the time of token creation. Useful for fraud forensics</comment>
+    <add>4.6</add>
+  </field>
+ <field>
     <name>billing_first_name</name>
     <title>Billing First Name</title>
-    <type>varchar</type> 
-    <length>255</length> 
-    <comment>Billing first name at the time of token creation. Useful for fraud forensics</comment> 
-    <add>4.6</add> 
-  </field> 
- <field> 
-    <name>billing_middle_name</name> 
+    <type>varchar</type>
+    <length>255</length>
+    <comment>Billing first name at the time of token creation. Useful for fraud forensics</comment>
+    <add>4.6</add>
+  </field>
+ <field>
+    <name>billing_middle_name</name>
     <title>Billing Middle Name</title>
-    <type>varchar</type> 
-    <length>255</length> 
-    <comment>Billing middle name at the time of token creation. Useful for fraud forensics</comment> 
-    <add>4.6</add> 
-  </field> 
- <field> 
-    <name>billing_last_name</name> 
+    <type>varchar</type>
+    <length>255</length>
+    <comment>Billing middle name at the time of token creation. Useful for fraud forensics</comment>
+    <add>4.6</add>
+  </field>
+ <field>
+    <name>billing_last_name</name>
     <title>Billing Last Name</title>
-    <type>varchar</type> 
-    <length>255</length> 
-    <comment>Billing last name at the time of token creation. Useful for fraud forensics</comment> 
-    <add>4.6</add> 
-  </field> 
- <field> 
+    <type>varchar</type>
+    <length>255</length>
+    <comment>Billing last name at the time of token creation. Useful for fraud forensics</comment>
+    <add>4.6</add>
+  </field>
+ <field>
     <name>masked_account_number</name>
     <title>Masked Account Number</title>
-    <type>varchar</type> 
-    <length>255</length> 
-    <comment>Holds the part of the card number or account details that may be retained or displayed</comment> 
-    <add>4.6</add> 
-  </field> 
-  <field> 
+    <type>varchar</type>
+    <length>255</length>
+    <comment>Holds the part of the card number or account details that may be retained or displayed</comment>
+    <add>4.6</add>
+  </field>
+  <field>
     <name>ip_address</name>
     <title>IP Address</title>
-    <type>varchar</type> 
-    <length>255</length> 
-    <comment>IP used when creating the token. Useful for fraud forensics</comment> 
-    <add>4.6</add> 
-  </field> 
-</table> 
+    <type>varchar</type>
+    <length>255</length>
+    <comment>IP used when creating the token. Useful for fraud forensics</comment>
+    <add>4.6</add>
+  </field>
+</table>
index da03aea06f62f16ca80b4a22d372dbc83aaeeb44..fb2732218aeba2b2236de772ebbb1fa94e41d134 100644 (file)
@@ -7,6 +7,7 @@
   <add>1.8</add>
   <log>true</log>
   <icon>fa-money</icon>
+  <component>CiviGrant</component>
   <paths>
     <add>civicrm/grant/add?reset=1&amp;action=add&amp;context=standalone</add>
     <view>contact/view/grant?reset=1&amp;action=view&amp;id=[id]&amp;cid=[contact_id]</view>
index 357572c2728e89c04a3f0ba7201198da18f00fd4..8c486d165e2b07a654e4905a0ac3e58eb9b1d804 100644 (file)
@@ -5,6 +5,7 @@
   <class>BouncePattern</class>
   <name>civicrm_mailing_bounce_pattern</name>
   <comment>Pseudo-constant table of patterns for bounce classification</comment>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Bounce Pattern ID</title>
index e24f7fe44c62a6279043fbe1382ef9de5382c25f..a0807bf0e4e200408b0b4cab48d48d7842a784b9 100644 (file)
@@ -5,6 +5,7 @@
   <class>BounceType</class>
   <name>civicrm_mailing_bounce_type</name>
   <comment>Table to index the various bounce types and their properties</comment>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Bounce Type ID</title>
index 53f9c4a5c04ac45a009106b37567e86e6efe946f..0c5f546e9805e7f1fe540edb213e9acc7b50ab23 100644 (file)
@@ -5,6 +5,7 @@
   <class>MailingComponent</class>
   <name>civicrm_mailing_component</name>
   <comment>Stores information about the mailing components (header/footer).</comment>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Component ID</title>
index c2b6aa40e4d0be5d064219c0b2e9499f75d8954e..8eae87a4a1f695e4107be67b0d906d85f5d49485 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_bounce</name>
   <comment>Tracks when and why an email bounced.</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Bounce ID</title>
index 338b06eebb4358cf5b68033adf4a4d1e4df0e147..cd0b389f7739084ceb2383d3caa9dedb52f1b5ea 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_confirm</name>
   <comment>Tracks when a subscription event is confirmed by email</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Confirmation ID</title>
index a38b0c5b773ec47eef0533be130fffcb73970b5f..350ba3e5f0116281bdff225d317d48fc5276b8f9 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_delivered</name>
   <comment>Tracks when a queued email is actually delivered to the MTA</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Delivered ID</title>
index 442d8c8b95a8e6da3aa27734653448f0e4fcb041..a86928841679b01d151003a4db52a04a23472bc1 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_forward</name>
   <comment>Tracks when a contact forwards a mailing to a (new) contact</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Forward ID</title>
index 814fcb365f8f8ea9ac77b069510efdc0e94fb6a9..befb98fe8775f3c414b7aa52c945106f90e4e167 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_opened</name>
   <comment>Tracks when a delivered email is opened by the recipient</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Opened ID</title>
index db4774035add725012250e96a870e2405439df45..6f3a872779a9666275c2586fa5afffa3ed18032c 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_queue</name>
   <comment>A collection of all intended recipients of a job</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <type>int unsigned</type>
index d4084592e96590f659bd55934119cc38373f64e8..db6ead58945338b91986fef9ff7c974a22ec1081 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_reply</name>
   <comment>Tracks when a contact replies to a mailing</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Reply ID</title>
index 67f50439efbe414e94599d4650bd0b4b3b07cc6a..01be3097f5fc1f06e364d49a797c6a452f418a7d 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_subscribe</name>
   <comment>Tracks when a (new) contact subscribes to a group by email</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Subscribe ID</title>
index fd1150f4634444011665c325b2281f49444ede25..7500634bf9736e38267360015bde90cd13575b14 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_trackable_url_open</name>
   <comment>Tracks when a TrackableURL is clicked by a recipient.</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Trackable URL Open ID</title>
index 1dde5f09861201b6742d51487b9e47680acc7a7e..347be796db234d4c21019633a5e972a98302ec32 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_event_unsubscribe</name>
   <comment>Tracks when a recipient unsubscribes from a group/domain</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Unsubscribe ID</title>
index 5fc2a62b2069036bc6af39046a18142ba828e288..45264afb44995e93537f9bc937aabdd9cd32382d 100644 (file)
@@ -7,6 +7,7 @@
   <comment>Stores information about a mailing.</comment>
   <archive>true</archive>
   <icon>fa-envelope-o</icon>
+  <component>CiviMail</component>
   <paths>
     <add>civicrm/a/#/mailing/new</add>
     <update>civicrm/a/#/mailing/[id]</update>
index 61716bef1e6aa0387ee26f15fd8a6b6c3fa5027b..2ac6f0bf01f5ea0d4e83757c980566860fa76a52 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_abtest</name>
   <comment>Stores information about abtesting</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <type>int unsigned</type>
index 0bb3bde4e6ed591285bb5279e1edf483554b1a3d..77cc087acc55eefeda88735e9a1c5f800ae0d1da 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_group</name>
   <comment>Stores information about the groups that participate in this mailing..</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Group ID</title>
index 58b81ef95339f90659d1f595fcd4743fd78bd52f..9f047ed0b77f76d66c144694cffa620387a6c4f5 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_job</name>
   <comment>Stores information about the job that executes this mailing</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Job ID</title>
index 729354c184b0a3ce1bbb7047e43bba2a6eac7f7d..6a86cabf473ac97b440f6e2c69a713770b03c0aa 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_recipients</name>
   <comment>Stores information about the recipients of a mailing.</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Mailing Recipients ID</title>
index de95f7b9e51a6555291b8908677d1c5701e36bc6..36cd5eb7b8ced517733f6408dce6faead1687311 100644 (file)
@@ -5,6 +5,7 @@
   <class>Spool</class>
   <name>civicrm_mailing_spool</name>
   <comment>Stores the outbond mails</comment>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Spool ID</title>
index f1b510a1d4593fee358372385926de2a470e9443..54a0e180882a6cc263f16dfb4ec56d620a9d8b70 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_mailing_trackable_url</name>
   <comment>Stores URLs for which we should track click-throughs from mailings</comment>
   <archive>true</archive>
+  <component>CiviMail</component>
   <field>
     <name>id</name>
     <title>Trackable URL ID</title>
index b2063cb4add4e02db18d9e5a68032aa369b3ecc6..f8be7b3607638e3d0b0a22a3b22f2fe3bf171bf3 100644 (file)
@@ -8,6 +8,7 @@
   <add>1.5</add>
   <log>true</log>
   <icon>fa-id-badge</icon>
+  <component>CiviMember</component>
   <paths>
     <add>civicrm/member/add?reset=1&amp;action=add&amp;context=standalone</add>
     <view>civicrm/contact/view/membership?reset=1&amp;action=view&amp;id=[id]&amp;cid=[contact_id]</view>
index 89503bb66b1f5d4e0098f7b1f2e7b95aa4b00be1..12e81bb9195b09a185f20b9f0fe30b1e9cb171b8 100644 (file)
@@ -7,6 +7,7 @@
   <comment>A Membership Block stores admin configurable status options and rules</comment>
   <add>1.5</add>
   <log>true</log>
+  <component>CiviMember</component>
   <field>
     <name>id</name>
     <title>Membership Block ID</title>
index 51dd870a1f440143ab5a980a2b3d546349f24230..29593bde967cf37b8e01dc65c7cb035d46e71afd 100644 (file)
@@ -7,6 +7,7 @@
   <log>true</log>
   <comment>Logs actions which affect a Membership record (signup, status override, renewal, etc.)</comment>
   <add>1.5</add>
+  <component>CiviMember</component>
   <field>
     <name>id</name>
     <title>Membership Log ID</title>
index 3f8a7399cd73e5f8941bf9e2a5ccebffc8e2908c..1d12a14f4cba20667c6c327ef2e33c57e349bcec 100644 (file)
@@ -7,6 +7,7 @@
   <comment>Membership Payment</comment>
   <add>1.5</add>
   <log>true</log>
+  <component>CiviMember</component>
   <field>
     <name>id</name>
     <title>Membership Payment ID</title>
index 5ef3ce5004cc32d1c25820015fdc32620380dd5d..becbbc63918757e06ebdd3e95cc6c4e73162b768 100644 (file)
@@ -7,6 +7,7 @@
   <comment>Membership Status stores admin configurable rules for assigning status to memberships.</comment>
   <add>1.5</add>
   <log>true</log>
+  <component>CiviMember</component>
   <field>
     <name>id</name>
     <title>Membership Status ID</title>
index fbae25e8d494a3ffbcd7375dac60ce560f09f22a..bf2223bcb92e3db7a3242d536f806e5871027b1f 100644 (file)
@@ -7,6 +7,7 @@
   <comment>Sites can configure multiple types of memberships. They encode the owner organization, fee, and the rules needed to set start and end (expire) dates when a member signs up for that type.</comment>
   <add>1.5</add>
   <log>true</log>
+  <component>CiviMember</component>
   <field>
     <name>id</name>
     <title>Membership Type ID</title>
index 0ef29ee2563cd656777b61a40442f4b8971a3237..762e09c3d5af45d26b6045d8d58299bab612018a 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_pcp</name>
   <add>2.2</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <uniqueName>pcp_id</uniqueName>
index d25b6eb7c221e986b066158e08dd1635306e25a8..b7777e4bc9792577e10a92d79e96294a739ac772 100644 (file)
@@ -7,6 +7,7 @@
   <comment>A Personal Campaign Page Block stores admin configurable status options and rules</comment>
   <add>2.2</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>PCP Block ID</title>
index 32b806f39f52c8a0c057241d3e991e5c8dce8b25..fe58bcfeda87923f67932ad236735a932b627401 100644 (file)
@@ -6,6 +6,7 @@
   <add>2.1</add>
   <log>true</log>
   <icon>fa-paper-plane</icon>
+  <component>CiviPledge</component>
   <field>
     <name>id</name>
     <uniqueName>pledge_id</uniqueName>
index 6dd3b8a659ce46e0618e632e1e635909a044dd8a..f4790fad9ed320a41698240c19fb0aa495f4dda1 100644 (file)
@@ -5,6 +5,7 @@
   <name>civicrm_pledge_block</name>
   <add>2.1</add>
   <log>true</log>
+  <component>CiviPledge</component>
   <field>
     <name>id</name>
     <title>Pledge Block ID</title>
index bc711aef4394fd04152892edc891341556206c58..b588d548393887d36422f4cccbbd3700acc9be9e 100644 (file)
@@ -7,6 +7,7 @@
   <comment>Pledge Payment</comment>
   <add>2.1</add>
   <log>true</log>
+  <component>CiviPledge</component>
   <field>
     <name>id</name>
     <uniqueName>pledge_payment_id</uniqueName>
index ee61447fee6c031b2c48b42c3117b461e707e534..274d9389a0ec39968dc3c4cc8491a1256808e207 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_line_item</name>
   <add>1.7</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Line Item ID</title>
index ce61ecc87c4fc5b1c49eb75b6b4554b0c1fa47d9..d261c7311051bc882506159131763e95add47cc2 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_price_field</name>
   <add>1.8</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Price Field ID</title>
index 2290d96282893aeaad029d8aa2b3cd672204a57e..3c4e39e70cd2d7fe38cd476edb8ed303bd8b75cf 100644 (file)
@@ -5,6 +5,7 @@
   <class>PriceFieldValue</class>
   <name>civicrm_price_field_value</name>
   <add>3.3</add>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Price Field Value ID</title>
index 4e995b9b33e3c3f6bd97f449224631cf03de8ce5..866ac927acf756306a69ee16d9c0848575a50928 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_price_set</name>
   <add>1.8</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Price Set</title>
index 4049d8a820428f95a4b08383b0045b0dc8e7ddac..effc85ad2c7289bb37b80e89d52f44521ae6b005 100644 (file)
@@ -6,6 +6,7 @@
   <name>civicrm_price_set_entity</name>
   <add>1.8</add>
   <log>true</log>
+  <component>CiviContribute</component>
   <field>
     <name>id</name>
     <title>Price Set Entity ID</title>
index d85b605c5d9182403c1745aea5e7d996faf5791f..0edd075cba505e20e24d0a6ecb2db46f19ae2b85 100644 (file)
@@ -8,6 +8,7 @@
   <add>2.2</add>
   <title>Report</title>
   <icon>fa-bar-chart</icon>
+  <component>CiviReport</component>
   <field>
     <name>id</name>
     <title>Report Instance ID</title>
index b8c2e514d8281d3abedb9eb282453b841ef150e8..f3ee241333175a6e6032ef8d274529abf5256903 100644 (file)
@@ -15,6 +15,7 @@ class {$table.className} extends CRM_Core_DAO {ldelim}
 
      const EXT = {$ext};
      const TABLE_ADDED = '{$table.add}';
+     {if !empty($table.component)}const COMPONENT = '{$table.component}';{/if}
 
      /**
       * Static instance to hold the table name.
index c60cbeb03d2dd17a756036708abab1bab3288aef..a506f2ee39f5b3eab867080d6ed33018bf59d2ab 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 <version>
-  <version_no>5.33.alpha1</version_no>
+  <version_no>5.34.alpha1</version_no>
 </version>