X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-booking.php;h=66e93c3fc341bc302bb8142f2e689079dc801653;hb=0bf456cd708fd2a7d8d37d2df78889072c741c3f;hp=bb4469b12a79831691954d89cc069d2bb7912d9c;hpb=2df8c1757b41f35e7c5b6a92c52ca96ab1b0bcb8;p=mailer.git diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index bb4469b12a..66e93c3fc3 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -41,14 +41,12 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0.0'); +setThisExtensionVersion('0.0.1'); // Version history array (add more with , '0.0.1' and so on) -setExtensionVersionHistory(array('0.0.0')); - -// This extension is in development (non-productive) -enableExtensionProductive(false); +setExtensionVersionHistory(array('0.0.0', '0.0.1')); +// Check extension load-mode switch (getExtensionMode()) { case 'register': // Do stuff when installation is running // Configuration entries @@ -58,14 +56,15 @@ switch (getExtensionMode()) { // Drop/create table for user bookings addDropTableSql('user_booking'); addCreateTableSql('user_booking', " -`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`booking_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `subject` VARCHAR(255) NOT NULL DEFAULT 'missing', `points_mode` ENUM('ADD','SUB') NOT NULL DEFAULT 'ADD', +`points_account_type` VARCHAR(255) NOT NULL DEFAULT 'INVALID', `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.0000, `comments` TINYTEXT NULL DEFAULT NULL, `recorded` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -PRIMARY KEY (`id`), +PRIMARY KEY (`booking_id`), INDEX (`userid`)", 'Member points booking table'); @@ -77,8 +76,9 @@ INDEX (`userid`)", addMemberMenuSql('main', 'booking', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Kontoauszug', 5); // Add the filters - registerFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun()); - registerFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun()); + registerFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', FALSE, TRUE, isExtensionDryRun()); + registerFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', FALSE, TRUE, isExtensionDryRun()); + registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_BOOKING_MEMBER_ACTION', FALSE, TRUE, isExtensionDryRun()); break; case 'remove': // Do stuff when removing extension @@ -87,8 +87,9 @@ INDEX (`userid`)", addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'"); // Remove the filters - unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun()); - unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'post_sub_points', 'ADD_BOOKING_RECORD', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_BOOKING_MEMBER_ACTION', TRUE, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension @@ -104,10 +105,10 @@ INDEX (`userid`)", case 'update': // Update an extension switch (getCurrentExtensionVersion()) { case '0.0.1': // SQL queries for v0.0.1 - addExtensionSql(''); + addExtensionChangeTableColumnSql('user_booking', 'id', 'booking_id', 'BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT'); // Update notes (these will be set as task text!) - setExtensionUpdateNotes(''); + setExtensionUpdateNotes("Spalte idbooking_id, da id zu allgemein ist (sollte am besten überall folgen)."); break; } // END - switch @@ -121,7 +122,7 @@ INDEX (`userid`)", break; default: // Unknown extension mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); + reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; } // END - switch