Skip to content

Commit

Permalink
Merge pull request #17743 from eileenmcnaughton/eventcart
Browse files Browse the repository at this point in the history
Move BAO and template files into event cart
  • Loading branch information
seamuslee001 authored Jul 14, 2020
2 parents 75f8b7d + 685bf3d commit b8b24ec
Show file tree
Hide file tree
Showing 29 changed files with 52 additions and 25 deletions.
54 changes: 39 additions & 15 deletions CRM/Upgrade/Incremental/php/FiveTwentyNine.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,45 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
* (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;
}

}
1 change: 1 addition & 0 deletions distmaker/dists/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function dm_install_coreext() {
function dm_core_exts() {
echo ext/sequentialcreditnotes
echo ext/flexmailer
echo ext/eventcart
}

## Copy all packages
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions ext/eventcart/info.xml
Original file line number Diff line number Diff line change
@@ -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>
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions sql/civicrm_generated.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions xml/templates/civicrm_data.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit b8b24ec

Please sign in to comment.