2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 01/22/2013 *
4 * =================== Last change: 01/22/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-update.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Swapped out order system for PRO version *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Ausgelagertes Buchungssytem fuer PRO-Version *
12 * -------------------------------------------------------------------- *
13 * Copyright (c) 2003 - 2009 by Roland Haeder *
14 * Copyright (c) 2009 - 2015 by Mailer Developer Team *
15 * For more information visit: http://mxchange.org *
17 * This program is free software; you can redistribute it and/or modify *
18 * it under the terms of the GNU General Public License as published by *
19 * the Free Software Foundation; either version 2 of the License, or *
20 * (at your option) any later version. *
22 * This program is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
25 * GNU General Public License for more details. *
27 * You should have received a copy of the GNU General Public License *
28 * along with this program; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
31 ************************************************************************/
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
38 // @TODO Remove double-tab from all lines
39 switch (getCurrentExtensionVersion()) {
40 case '0.1.0': // SQL queries for v0.1
41 addConfigAddSql('order_max_full', "ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'");
42 addAdminMenuSql('setup','config_order','Mailbuchungsseite','Einstellungen am Mailbuchungsformular.',7);
44 // Update notes (these will be set as task text!)
45 setExtensionUpdateNotes("Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig.");
48 case '0.1.1': // SQL queries for v0.1.1
49 addExtensionAddTableColumnSql('user_data', 'mail_orders', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
51 // Update notes (these will be set as task text!)
52 setExtensionUpdateNotes("Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber).");
55 case '0.1.3': // SQL queries for v0.1.3
56 // Update notes (these will be set as task text!)
57 setExtensionUpdateNotes("Maximale Mailbuchungen repariert (werden nun hochgezählt und bei täglichem Reset auf 0 gesetzt).");
60 case '0.1.4': // SQL queries for v0.1.4
61 // Update notes (these will be set as task text!)
62 setExtensionUpdateNotes("Dummy-Datenfeld wird wieder gelöscht, um Probleme zu vermeiden. Fehlende Spalte <span class=\"bad\">mail_order</span> korregiert auf <span class=\"bad\">mail_orders</span>.");
65 case '0.1.5': // SQL queries for v0.1.5
66 // Update notes (these will be set as task text!)
67 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
70 case '0.1.6': // SQL queries for v0.1.6
71 // Update notes (these will be set as task text!)
72 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
75 case '0.1.7': // SQL queries for v0.1.7
76 // Update notes (these will be set as task text!)
77 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
80 case '0.1.8': // SQL queries for v0.1.8
81 // Update notes (these will be set as task text!)
82 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
85 case '0.1.9': // SQL queries for v0.1.9
86 // Update notes (these will be set as task text!)
87 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
90 case '0.2.0': // SQL queries for v0.2.0
91 // Update notes (these will be set as task text!)
92 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
95 case '0.2.1': // SQL queries for v0.2.1
96 // Update notes (these will be set as task text!)
97 setExtensionUpdateNotes("Templates <u>member_frameset-back.tpl</u> und <u>member_frameset-send.tpl</u> nach <u>member_order_back.tpl</u> und <u>member_order_send.tpl</u> umbenannt.");
100 case '0.2.2': // SQL queries for v0.2.2
101 // Update notes (these will be set as task text!)
102 setExtensionUpdateNotes("Es wird nun überprüft ob auch genügend Empfänger eingegeben worden sind und ob auch genügend empfangsbereit sind.");
105 case '0.2.3': // SQL queries for v0.2.3
106 addConfigAddSql('order_min', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 10');
108 // Update notes (these will be set as task text!)
109 setExtensionUpdateNotes("Minimum an Empfänger pro Mailbuchung einstellbar. Standard: 10 Empfänger");
112 case '0.2.4': // SQL queries for v0.2.4
113 // Update notes (these will be set as task text!)
114 setExtensionUpdateNotes("Anzahl mindestens einszustellende Empfänger wird nun auch angezeigt.");
117 case '0.2.5': // SQL queries for v0.2.5
118 // Update notes (these will be set as task text!)
119 setExtensionUpdateNotes("Speicherung der Einstellungen klappt.");
122 case '0.2.6': // SQL queries for v0.2.6
123 // Update notes (these will be set as task text!)
124 setExtensionUpdateNotes("Fehler in Mailbuchung behoben: Es wurde beim Ermitteln der nötigen {?POINTS?} die maximale Anzahl von Usern in der Kategorie gewählt und
125 nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der User hätte nicht genügend {?POINTS?} auf dem Konto. Ein Rechenbeispiel:
127 <li>Das Mitglied wählt eine Kategorie XYZ mit maximal 15 Empfängern aus.</li>
128 <li>Es stellt die Mailart <u>"3 {?POINTS?} Kosten / Mail"</u> ein.</li>
129 <li>Es hat aber nur {?POINTS?} für 10 Empfänger und gibt 10 ein.</li>
130 <li>Das Script hatte bis zu dieser Version 3 {?POINTS?} * <u>15</u> = 45 {?POINTS?} gerechnet, hat das Mitglied mehr oder gleich 45 {?POINTS?}, fiehl dieser Fehler nicht
132 <li>Hatte es aber, wie hier im Beispiel 31 {?POINTS?}, konnte es nicht mehr buchen.</li>
133 <li>Jetzt ist der Fehler endlich weg! Machen Sie dies bitte Ihren Mitgliedern bekannt.</li>
137 case '0.2.7': // SQL queries for v0.2.7
138 // Update notes (these will be set as task text!)
139 setExtensionUpdateNotes("Fehler mit <u>__MIN_VALUE</u> behoben.");
142 case '0.2.8': // SQL queries for v0.2.8
143 // Update notes (these will be set as task text!)
144 setExtensionUpdateNotes("Konstantenproblem beseitigt.");
147 case '0.2.9': // SQL queries for v0.2.9
148 // Update notes (these will be set as task text!)
149 setExtensionUpdateNotes("Problem mit nicht funktionierenden Mailbuchungen beseitigt.");
152 case '0.3.0': // SQL queries for v0.3.0
153 // Update notes (these will be set as task text!)
154 setExtensionUpdateNotes("Basis-Modul <strong>order.php</strong> abgesichert, wenn Erweiterung nicht aktiviert ist.");
157 case '0.3.1': // SQL queries for v0.3.1
158 addConfigAddSql('order_select', "VARCHAR(255) NOT NULL DEFAULT 'userid'");
159 addConfigAddSql('order_mode', "ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'");
161 // Update notes (these will be set as task text!)
162 setExtensionUpdateNotes("Beworbene URL wird nun getestet.");
165 case '0.3.2': // SQL queries for v0.3.2
166 // Update notes (these will be set as task text!)
167 setExtensionUpdateNotes("Datumsformat festgelegt auf ausführlich.");
170 case '0.3.3': // SQL queries for v0.3.3
171 // Update notes (these will be set as task text!)
172 setExtensionUpdateNotes("Unter <strong>Einstellungen - Mailbuchungsseite</strong> war immer die Tabellenspalte <strong>Mitgliedsnummer</strong> ausgewählt.");
175 case '0.3.4': // SQL queries for v0.3.4
176 // Update notes (these will be set as task text!)
177 setExtensionUpdateNotes("Dateiamenskonflikt zwischen den Erweiterungen <strong>support</strong> und <strong>order</strong> behoben.");
180 case '0.3.5': // SQL queries for v0.3.5
181 // Update notes (these will be set as task text!)
182 setExtensionUpdateNotes("Das Mitglied konnte geziehlt die Anzahl Mailbuchungen durch Abspeichern seines Profiles beeinflussen. Der Fehler war eine falsche Tabellenspalte. Dies war <strong>max_mails</strong>, die durch das Mitglieder veränderbar ist und zur Festellung der Maximalen Mailbuchungen herangezogen wurde.");
185 case '0.3.6': // SQL queries for v0.3.6
186 // Update notes (these will be set as task text!)
187 setExtensionUpdateNotes("Im Modul order (<strong>inc/modules/order.php</strong>) wurde fehlerhafterweise die Erweiterung <strong>beg</strong> getestet.");
190 case '0.3.7': // SQL queries for v0.3.7
191 // Update notes (these will be set as task text!)
192 setExtensionUpdateNotes("SQL-Anweisungen mit sqlQueryEscaped() abgesichert.");
195 case '0.3.8': // SQL queries for v0.3.8
196 // Update notes (these will be set as task text!)
197 setExtensionUpdateNotes("Mailbuchungsseite korregiert.");
200 case '0.3.9': // SQL queries for v0.3.9
201 // Update notes (these will be set as task text!)
202 setExtensionUpdateNotes("Erneuten Fehler in Mailbuchungsseite behoben.");
205 case '0.4.0': // SQL queries for v0.4.0
206 // Update notes (these will be set as task text!)
207 setExtensionUpdateNotes("{?POINTS?}-Abzug klappt wieder. Danke an Andreman!");
210 case '0.4.1': // SQL queries for v0.4.1
211 // Update notes (these will be set as task text!)
212 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
215 case '0.4.2': // SQL queries for v0.4.2
216 // Update notes (these will be set as task text!)
217 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
220 case '0.4.3': // SQL queries for v0.4.3
221 // Update notes (these will be set as task text!)
222 setExtensionUpdateNotes("Neue Urlaubsschaltung mit integriert.");
225 case '0.4.4': // SQL queries for v0.4.4
226 // Update notes (these will be set as task text!)
227 setExtensionUpdateNotes("Ein <strong>WHERE `ext_active`='Y'</strong> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.");
230 case '0.4.5': // SQL queries for v0.4.5
231 // Update notes (these will be set as task text!)
232 setExtensionUpdateNotes("De-/Aktivieren des mit dieser Erweiterung verknüpften Modules eingebunden.");
235 case '0.4.6': // SQL queries for v0.4.6
236 addMemberMenuSql('order', NULL, 'Mailbuchungen', 3);
237 addMemberMenuSql('order', 'order2', 'Framekiller-Mails', 2);
238 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='order',`title`='Klick-Mails',`sort`=1 WHERE `what`='order' LIMIT 1");
240 // Update notes (these will be set as task text!)
241 setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
244 case '0.4.7': // SQL queries for v0.4.7
245 // Update notes (these will be set as task text!)
246 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
249 case '0.4.8': // SQL queries for v0.4.8
250 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Mailbuchung' WHERE `what`='config_order' LIMIT 1");
252 // Update notes (these will be set as task text!)
253 setExtensionUpdateNotes("Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben.");
256 case '0.4.9': // SQL queries for v0.4.9
257 addConfigAddSql('repay_deleted_mails', "ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'");
259 // Update notes (these will be set as task text!)
260 setExtensionUpdateNotes("Bei Löschung von Mailbuchungen kann nun scripteweit entschieden werden (Einstellungen also), ob die verbliebenen {?POINTS?} wieder gutgeschrieben werden sollen oder in den Jackpot landen.");
263 case '0.5.0': // SQL queries for v0.5.0
264 // Update notes (these will be set as task text!)
265 setExtensionUpdateNotes("Nicht mehr gültiges Update.");
268 case '0.5.1': // SQL queries for v0.5.1
269 // Update notes (these will be set as task text!)
270 setExtensionUpdateNotes("Nicht mehr gültiges Update.");
273 case '0.5.2': // SQL queries for v0.5.2
274 addConfigDropSql('test_text');
275 addConfigDropSql('test_subj');
276 addConfigAddSql('allow_url_in_text', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
277 addConfigAddSql('allow_url_in_subject', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
279 // Update notes (these will be set as task text!)
280 setExtensionUpdateNotes("Inkonsistenz in Konfigurationsnamen korregiert.");
283 case '0.5.3': // SQL queries for v0.5.3
284 addExtensionAddTableColumnSql('user_points', 'order_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
285 addExtensionAddTableColumnSql('user_points', 'locked_order_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
287 // This update depends on ext-user
288 addExtensionDependency('user');
290 // Register filters for gathering points
291 registerFilter(__FILE__, __LINE__, 'get_total_points', 'ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
292 registerFilter(__FILE__, __LINE__, 'get_own_points', 'ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
294 // Update notes (these will be set as task text!)
295 setExtensionUpdateNotes("Weiteres Verwendungszwecke "Werbeguthaben" hinzugefügt (verschoben von ext-user) und neue Filter zum Zurückliefern des Werbeguthabens hinzugefügt.");
298 case '0.5.4': // SQL queries for v0.5.4
299 // Register filter for handling locked points
300 registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
302 // Register filter for all column names
303 registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', FALSE, TRUE, isExtensionDryRun());
305 // Update notes (these will be set as task text!)
306 setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");
309 case '0.5.5': // SQL queries for v0.5.5
311 registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', FALSE, TRUE, isExtensionDryRun());
313 // Update notes (these will be set as task text!)
314 setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");
317 case '0.5.6': // SQL queries for v0.5.6
319 registerFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', FALSE, TRUE, isExtensionDryRun());
321 // Update notes (these will be set as task text!)
322 setExtensionUpdateNotes("Filter für Spaltenname des gesperrten Werbeguthabens hinzugefügt.");
325 case '0.5.7': // SQL queries for v0.5.7
326 addDropTableSql('url_blacklist');
328 // Update notes (these will be set as task text!)
329 setExtensionUpdateNotes("Tabelle für URL-Sperrliste gelöscht (nach <strong>ext-blacklist</strong> verschoben).");
332 case '0.5.8': // SQL queries for v0.5.8
333 addConfigAddSql('order_multi_page', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
335 // Update notes (these will be set as task text!)
336 setExtensionUpdateNotes("Konfiguration wird nun in dieser Erweiterung hinzugefügt (vorher: allgemeine <strong>tables.sql</strong>).");
339 case '0.5.9': // SQL queries for v0.5.9
340 addConfigAddSql('max_unconfirmed', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 100');
341 addConfigChangeSql('unconfirmed', 'max_unconfirmed', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 100');
342 addConfigAddSql('autosend_member_mails', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
343 addConfigChangeSql('autosend_active', 'autosend_member_mails', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
344 addConfigAddSql('max_text_length', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000');
345 addConfigChangeSql('max_tlength', 'max_text_length', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000');
347 // Update notes (these will be set as task text!)
348 setExtensionUpdateNotes("Konfiguration wird nun in dieser Erweiterung hinzugefügt (vorher: allgemeine <strong>tables.sql</strong>).");
351 case '0.6.0': // SQL queries for v0.6.0
353 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_SUBJECT' , FALSE, TRUE, isExtensionDryRun());
354 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_TEXT' , FALSE, TRUE, isExtensionDryRun());
355 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_TYPE' , FALSE, TRUE, isExtensionDryRun());
356 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_URL' , FALSE, TRUE, isExtensionDryRun());
357 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_RECEIVER', FALSE, TRUE, isExtensionDryRun());
359 // Update notes (these will be set as task text!)
360 setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");