* (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;
+ }
}
function dm_core_exts() {
echo ext/sequentialcreditnotes
echo ext/flexmailer
+ echo ext/eventcart
}
## Copy all packages
<?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>
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;
-- 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);