Move BAO and template files into event cart
authoreileen <emcnaughton@wikimedia.org>
Fri, 3 Jul 2020 08:00:04 +0000 (20:00 +1200)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 14 Jul 2020 22:57:47 +0000 (08:57 +1000)
Fix templates Path

29 files changed:
CRM/Upgrade/Incremental/php/FiveTwentyNine.php
distmaker/dists/common.sh
ext/eventcart/CRM/Event/Cart/BAO/Cart.php [moved from CRM/Event/Cart/BAO/Cart.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/BAO/Conference.php [moved from CRM/Event/Cart/BAO/Conference.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/BAO/EventInCart.php [moved from CRM/Event/Cart/BAO/EventInCart.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/BAO/MerParticipant.php [moved from CRM/Event/Cart/BAO/MerParticipant.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Controller/Checkout.php [moved from CRM/Event/Cart/Controller/Checkout.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Form/Cart.php [moved from CRM/Event/Cart/Form/Cart.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Form/Checkout/ConferenceEvents.php [moved from CRM/Event/Cart/Form/Checkout/ConferenceEvents.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php [moved from CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Form/Checkout/Payment.php [moved from CRM/Event/Cart/Form/Checkout/Payment.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Form/Checkout/ThankYou.php [moved from CRM/Event/Cart/Form/Checkout/ThankYou.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Form/MerParticipant.php [moved from CRM/Event/Cart/Form/MerParticipant.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Page/AddToCart.php [moved from CRM/Event/Cart/Page/AddToCart.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Page/CheckoutAJAX.php [moved from CRM/Event/Cart/Page/CheckoutAJAX.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Page/RemoveFromCart.php [moved from CRM/Event/Cart/Page/RemoveFromCart.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/Page/ViewCart.php [moved from CRM/Event/Cart/Page/ViewCart.php with 100% similarity]
ext/eventcart/CRM/Event/Cart/StateMachine/Checkout.php [moved from CRM/Event/Cart/StateMachine/Checkout.php with 100% similarity]
ext/eventcart/info.xml
ext/eventcart/templates/CRM/Event/Cart/Form/Checkout/ConferenceEvents.tpl [moved from templates/CRM/Event/Cart/Form/Checkout/ConferenceEvents.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Form/Checkout/Participant.tpl [moved from templates/CRM/Event/Cart/Form/Checkout/Participant.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.tpl [moved from templates/CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Form/Checkout/Payment.tpl [moved from templates/CRM/Event/Cart/Form/Checkout/Payment.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Form/Checkout/ThankYou.tpl [moved from templates/CRM/Event/Cart/Form/Checkout/ThankYou.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Form/viewCartLink.tpl [moved from templates/CRM/Event/Cart/Form/viewCartLink.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Page/AddToCart.tpl [moved from templates/CRM/Event/Cart/Page/AddToCart.tpl with 100% similarity]
ext/eventcart/templates/CRM/Event/Cart/Page/ViewCart.tpl [moved from templates/CRM/Event/Cart/Page/ViewCart.tpl with 100% similarity]
sql/civicrm_generated.mysql
xml/templates/civicrm_data.tpl

index c36320f5a8d1cabf6181a01443f9a44b7a3fdaf0..37a4600e201a036371f728178352844826d8b9fc 100644 (file)
@@ -52,21 +52,45 @@ class CRM_Upgrade_Incremental_php_FiveTwentyNine extends CRM_Upgrade_Incremental
    * (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.
-  //  }
+  /**
+   * Upgrade function.
+   *
+   * @param string $rev
+   */
+  public function upgrade_5_29_alpha1($rev) {
+    $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
+    $this->addTask('Install eventcart extension', 'installEventCart');
+  }
 
-  // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
-  //   return TRUE;
-  // }
+  /**
+   * Install sequentialCreditNotes extension.
+   *
+   * This feature is restructured as a core extension - which is primarily a code cleanup step.
+   *
+   * @param \CRM_Queue_TaskContext $ctx
+   *
+   * @return bool
+   *
+   * @throws \CiviCRM_API3_Exception
+   * @throws \CRM_Core_Exception
+   */
+  public static function installEventCart(CRM_Queue_TaskContext $ctx) {
+    // Install via direct SQL manipulation. Note that:
+    // (1) This extension has no activation logic.
+    // (2) On new installs, the extension is activated purely via default SQL INSERT.
+    // (3) Caches are flushed at the end of the upgrade.
+    // ($) Over long term, upgrade steps are more reliable in SQL. API/BAO sometimes don't work mid-upgrade.
+    $insert = CRM_Utils_SQL_Insert::into('civicrm_extension')->row([
+      'type' => 'module',
+      'full_name' => 'eventcart',
+      'name' => 'eventcart',
+      'label' => 'Event Cart',
+      'file' => 'eventcart',
+      'schema_version' => NULL,
+      'is_active' => 1,
+    ]);
+    CRM_Core_DAO::executeQuery($insert->usingReplace()->toSQL());
+    return TRUE;
+  }
 
 }
index 2194aaaf7d4d3e0d5396ac9e14596e57c91541e9..c31042066f16bf57f4406dc6d50e7e6fa216c6aa 100644 (file)
@@ -108,6 +108,7 @@ function dm_install_coreext() {
 function dm_core_exts() {
   echo ext/sequentialcreditnotes
   echo ext/flexmailer
+  echo ext/eventcart
 }
 
 ## Copy all packages
index 12d480259a61856cc6c53b2c3d7e592271a6f957..6c1bf45ba57216e15d5302b8ce78a50d9ce9b296 100644 (file)
@@ -1,30 +1,30 @@
 <?xml version="1.0"?>
 <extension key="eventcart" type="module">
   <file>eventcart</file>
-  <name>FIXME</name>
-  <description>FIXME</description>
+  <name>Event Cart</name>
+  <description>This feature allows users to register for more than one event at a time. When enabled, users will add event(s) to a "cart" and then pay for them all at once. Enabling this setting will affect online registration for all active events.</description>
   <license>AGPL-3.0</license>
   <maintainer>
     <author>CiviCRM</author>
     <email>info@civicrm.org</email>
   </maintainer>
   <urls>
-    <url desc="Main Extension Page">http://FIXME</url>
-    <url desc="Documentation">http://FIXME</url>
-    <url desc="Support">http://FIXME</url>
+    <url desc="Main Extension Page">https://github.com/civicrm/civicrm-core/tree/master/ext/eventcart</url>
     <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
   </urls>
-  <releaseDate>2020-07-03</releaseDate>
+  <releaseDate>2020-08-03</releaseDate>
   <version>1.0</version>
-  <develStage>alpha</develStage>
+  <tags>
+    <tag>mgmt:hidden</tag>
+  </tags>
+  <develStage>stable</develStage>
   <compatibility>
-    <ver>5.0</ver>
+    <ver>5.29</ver>
   </compatibility>
-  <comments>This is a new, undeveloped module</comments>
   <classloader>
     <psr4 prefix="Civi\" path="Civi"/>
   </classloader>
   <civix>
-    <namespace>CRM/Eventcart</namespace>
+    <namespace>CRM/Event/Cart</namespace>
   </civix>
 </extension>
index fab07d65596d92bf44630028bcc01269b0aee727..ee0280aaa4bb99729067150e0986b5cc7dc29dc6 100644 (file)
@@ -496,6 +496,7 @@ UNLOCK TABLES;
 LOCK TABLES `civicrm_extension` WRITE;
 /*!40000 ALTER TABLE `civicrm_extension` DISABLE KEYS */;
 INSERT INTO `civicrm_extension` (`id`, `type`, `full_name`, `name`, `label`, `file`, `schema_version`, `is_active`) VALUES (1,'module','sequentialcreditnotes','Sequential credit notes','Sequential credit notes','sequentialcreditnotes',NULL,1);
+INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'eventcart', 'Event cart', 'Event cart', 'eventcart', 1);
 /*!40000 ALTER TABLE `civicrm_extension` ENABLE KEYS */;
 UNLOCK TABLES;
 
index c32355c12eb06b7bbd86c17301b6d16005bb3b65..54d4b01f6c525e08b905e6069ae903ee25b35690 100644 (file)
@@ -1780,3 +1780,4 @@ VALUES
 -- in the setup routine based on their tags & using the standard extension install api.
 -- do not try this at home folks.
 INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'sequentialcreditnotes', 'Sequential credit notes', 'Sequential credit notes', 'sequentialcreditnotes', 1);
+INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'eventcart', 'Event cart', 'Event cart', 'eventcart', 1);