]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-booking.php
Spaces added because we don't use spaces in SQL queries but in PHP code
[mailer.git] / inc / extensions / ext-booking.php
index 30183f9999817fcd52b2f4dd150235b3c319aa7a..12dc7236a9c49e050d7467aaf1b9dda7dbe4a963 100644 (file)
@@ -52,12 +52,12 @@ enableExtensionProductive(false);
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // Configuration entries
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_per_page` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10");
-               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 3)."");
+               addConfigAddSql('booking_per_page', "TINYINT(3) UNSIGNED NOT NULL DEFAULT 10");
+               addConfigAddSql('booking_purge', "BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 3)."");
 
                // Drop/create table for user bookings
                addDropTableSql('user_book');
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_book`(
+               addCreateTableSql('user_book', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `subject` VARCHAR(255) NOT NULL DEFAULT 'missing',
@@ -74,10 +74,10 @@ PRIMARY KEY (`id`)
                addAdminMenuSql('user','list_booking','Kontoauszüge','Kontoauszüge aller Ihrer Mitglieder oder eines einzelnen Mitgliedes anzeigen.',10);
 
                // Member menu
-               addMemberMenuSql('main','booking','{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Kontoauszug','N','Y',5);
+               addMemberMenuSql('main', 'booking', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Kontoauszug', 'N', 'Y', 5);
 
                // Add the filters
-               registerFilter('add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
+               registerFilter('post_add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
                registerFilter('sub_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun());
                break;
 
@@ -87,7 +87,7 @@ PRIMARY KEY (`id`)
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'");
 
                // Remove the filters
-               unregisterFilter(__FUNCTION__, __LINE__, 'add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
                unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
                break;