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 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // @TODO Remove double-tab from all lines
44 switch (getCurrentExtensionVersion()) {
45 case '0.1.0': // SQL queries for v0.1
46 addConfigAddSql('order_max_full', "ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'");
47 addAdminMenuSql('setup','config_order','Mailbuchungsseite','Einstellungen am Mailbuchungsformular.',7);
49 // Update notes (these will be set as task text!)
50 setExtensionUpdateNotes("Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig.");
53 case '0.1.1': // SQL queries for v0.1.1
54 addExtensionAddTableColumnSql('user_data', 'mail_orders', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
56 // Update notes (these will be set as task text!)
57 setExtensionUpdateNotes("Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber).");
60 case '0.1.3': // SQL queries for v0.1.3
61 // Update notes (these will be set as task text!)
62 setExtensionUpdateNotes("Maximale Mailbuchungen repariert (werden nun hochgezählt und bei täglichem Reset auf 0 gesetzt).");
65 case '0.1.4': // SQL queries for v0.1.4
66 // Update notes (these will be set as task text!)
67 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>.");
70 case '0.1.5': // SQL queries for v0.1.5
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.6': // SQL queries for v0.1.6
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.7': // SQL queries for v0.1.7
81 // Update notes (these will be set as task text!)
82 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
85 case '0.1.8': // SQL queries for v0.1.8
86 // Update notes (these will be set as task text!)
87 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
90 case '0.1.9': // SQL queries for v0.1.9
91 // Update notes (these will be set as task text!)
92 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
95 case '0.2.0': // SQL queries for v0.2.0
96 // Update notes (these will be set as task text!)
97 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
100 case '0.2.1': // SQL queries for v0.2.1
101 // Update notes (these will be set as task text!)
102 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.");
105 case '0.2.2': // SQL queries for v0.2.2
106 // Update notes (these will be set as task text!)
107 setExtensionUpdateNotes("Es wird nun überprüft ob auch genügend Empfänger eingegeben worden sind und ob auch genügend empfangsbereit sind.");
110 case '0.2.3': // SQL queries for v0.2.3
111 addConfigAddSql('order_min', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 10');
113 // Update notes (these will be set as task text!)
114 setExtensionUpdateNotes("Minimum an Empfänger pro Mailbuchung einstellbar. Standard: 10 Empfänger");
117 case '0.2.4': // SQL queries for v0.2.4
118 // Update notes (these will be set as task text!)
119 setExtensionUpdateNotes("Anzahl mindestens einszustellende Empfänger wird nun auch angezeigt.");
122 case '0.2.5': // SQL queries for v0.2.5
123 // Update notes (these will be set as task text!)
124 setExtensionUpdateNotes("Speicherung der Einstellungen klappt.");
127 case '0.2.6': // SQL queries for v0.2.6
128 // Update notes (these will be set as task text!)
129 setExtensionUpdateNotes("Fehler in Mailbuchung behoben: Es wurde beim Ermitteln der nötigen {?POINTS?} die maximale Anzahl von Usern in der Kategorie gewählt und
130 nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der User hätte nicht genügend {?POINTS?} auf dem Konto. Ein Rechenbeispiel:
132 <li>Das Mitglied wählt eine Kategorie XYZ mit maximal 15 Empfängern aus.</li>
133 <li>Es stellt die Mailart <u>"3 {?POINTS?} Kosten / Mail"</u> ein.</li>
134 <li>Es hat aber nur {?POINTS?} für 10 Empfänger und gibt 10 ein.</li>
135 <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
137 <li>Hatte es aber, wie hier im Beispiel 31 {?POINTS?}, konnte es nicht mehr buchen.</li>
138 <li>Jetzt ist der Fehler endlich weg! Machen Sie dies bitte Ihren Mitgliedern bekannt.</li>
142 case '0.2.7': // SQL queries for v0.2.7
143 // Update notes (these will be set as task text!)
144 setExtensionUpdateNotes("Fehler mit <u>__MIN_VALUE</u> behoben.");
147 case '0.2.8': // SQL queries for v0.2.8
148 // Update notes (these will be set as task text!)
149 setExtensionUpdateNotes("Konstantenproblem beseitigt.");
152 case '0.2.9': // SQL queries for v0.2.9
153 // Update notes (these will be set as task text!)
154 setExtensionUpdateNotes("Problem mit nicht funktionierenden Mailbuchungen beseitigt.");
157 case '0.3.0': // SQL queries for v0.3.0
158 // Update notes (these will be set as task text!)
159 setExtensionUpdateNotes("Basis-Modul <strong>order.php</strong> abgesichert, wenn Erweiterung nicht aktiviert ist.");
162 case '0.3.1': // SQL queries for v0.3.1
163 addConfigAddSql('order_select', "VARCHAR(255) NOT NULL DEFAULT 'userid'");
164 addConfigAddSql('order_mode', "ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'");
166 // Update notes (these will be set as task text!)
167 setExtensionUpdateNotes("Beworbene URL wird nun getestet.");
170 case '0.3.2': // SQL queries for v0.3.2
171 // Update notes (these will be set as task text!)
172 setExtensionUpdateNotes("Datumsformat festgelegt auf ausführlich.");
175 case '0.3.3': // SQL queries for v0.3.3
176 // Update notes (these will be set as task text!)
177 setExtensionUpdateNotes("Unter <strong>Einstellungen - Mailbuchungsseite</strong> war immer die Tabellenspalte <strong>Mitgliedsnummer</strong> ausgewählt.");
180 case '0.3.4': // SQL queries for v0.3.4
181 // Update notes (these will be set as task text!)
182 setExtensionUpdateNotes("Dateiamenskonflikt zwischen den Erweiterungen <strong>support</strong> und <strong>order</strong> behoben.");
185 case '0.3.5': // SQL queries for v0.3.5
186 // Update notes (these will be set as task text!)
187 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.");
190 case '0.3.6': // SQL queries for v0.3.6
191 // Update notes (these will be set as task text!)
192 setExtensionUpdateNotes("Im Modul order (<strong>inc/modules/order.php</strong>) wurde fehlerhafterweise die Erweiterung <strong>beg</strong> getestet.");
195 case '0.3.7': // SQL queries for v0.3.7
196 // Update notes (these will be set as task text!)
197 setExtensionUpdateNotes("SQL-Anweisungen mit sqlQueryEscaped() abgesichert.");
200 case '0.3.8': // SQL queries for v0.3.8
201 // Update notes (these will be set as task text!)
202 setExtensionUpdateNotes("Mailbuchungsseite korregiert.");
205 case '0.3.9': // SQL queries for v0.3.9
206 // Update notes (these will be set as task text!)
207 setExtensionUpdateNotes("Erneuten Fehler in Mailbuchungsseite behoben.");
210 case '0.4.0': // SQL queries for v0.4.0
211 // Update notes (these will be set as task text!)
212 setExtensionUpdateNotes("{?POINTS?}-Abzug klappt wieder. Danke an Andreman!");
215 case '0.4.1': // SQL queries for v0.4.1
216 // Update notes (these will be set as task text!)
217 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
220 case '0.4.2': // SQL queries for v0.4.2
221 // Update notes (these will be set as task text!)
222 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
225 case '0.4.3': // SQL queries for v0.4.3
226 // Update notes (these will be set as task text!)
227 setExtensionUpdateNotes("Neue Urlaubsschaltung mit integriert.");
230 case '0.4.4': // SQL queries for v0.4.4
231 // Update notes (these will be set as task text!)
232 setExtensionUpdateNotes("Ein <strong>WHERE `ext_active`='Y'</strong> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.");
235 case '0.4.5': // SQL queries for v0.4.5
236 // Update notes (these will be set as task text!)
237 setExtensionUpdateNotes("De-/Aktivieren des mit dieser Erweiterung verknüpften Modules eingebunden.");
240 case '0.4.6': // SQL queries for v0.4.6
241 addMemberMenuSql('order', NULL, 'Mailbuchungen', 3);
242 addMemberMenuSql('order', 'order2', 'Framekiller-Mails', 2);
243 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='order',`title`='Klick-Mails',`sort`=1 WHERE `what`='order' LIMIT 1");
245 // Update notes (these will be set as task text!)
246 setExtensionUpdateNotes("Mitgliedsmenü komplett umgebaut.");
249 case '0.4.7': // SQL queries for v0.4.7
250 // Update notes (these will be set as task text!)
251 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
254 case '0.4.8': // SQL queries for v0.4.8
255 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Mailbuchung' WHERE `what`='config_order' LIMIT 1");
257 // Update notes (these will be set as task text!)
258 setExtensionUpdateNotes("Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben.");
261 case '0.4.9': // SQL queries for v0.4.9
262 addConfigAddSql('repay_deleted_mails', "ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'");
264 // Update notes (these will be set as task text!)
265 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.");
268 case '0.5.0': // SQL queries for v0.5.0
269 // Update notes (these will be set as task text!)
270 setExtensionUpdateNotes("Nicht mehr gültiges Update.");
273 case '0.5.1': // SQL queries for v0.5.1
274 // Update notes (these will be set as task text!)
275 setExtensionUpdateNotes("Nicht mehr gültiges Update.");
278 case '0.5.2': // SQL queries for v0.5.2
279 addConfigDropSql('test_text');
280 addConfigDropSql('test_subj');
281 addConfigAddSql('allow_url_in_text', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
282 addConfigAddSql('allow_url_in_subject', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
284 // Update notes (these will be set as task text!)
285 setExtensionUpdateNotes("Inkonsistenz in Konfigurationsnamen korregiert.");
288 case '0.5.3': // SQL queries for v0.5.3
289 addExtensionAddTableColumnSql('user_points', 'order_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
290 addExtensionAddTableColumnSql('user_points', 'locked_order_points', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
292 // This update depends on ext-user
293 addExtensionDependency('user');
295 // Register filters for gathering points
296 registerFilter(__FILE__, __LINE__, 'get_total_points', 'ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
297 registerFilter(__FILE__, __LINE__, 'get_own_points', 'ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
299 // Update notes (these will be set as task text!)
300 setExtensionUpdateNotes("Weiteres Verwendungszwecke "Werbeguthaben" hinzugefügt (verschoben von ext-user) und neue Filter zum Zurückliefern des Werbeguthabens hinzugefügt.");
303 case '0.5.4': // SQL queries for v0.5.4
304 // Register filter for handling locked points
305 registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_ORDER_POINTS', FALSE, TRUE, isExtensionDryRun());
307 // Register filter for all column names
308 registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', FALSE, TRUE, isExtensionDryRun());
310 // Update notes (these will be set as task text!)
311 setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");
314 case '0.5.5': // SQL queries for v0.5.5
316 registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', FALSE, TRUE, isExtensionDryRun());
318 // Update notes (these will be set as task text!)
319 setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");
322 case '0.5.6': // SQL queries for v0.5.6
324 registerFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', FALSE, TRUE, isExtensionDryRun());
326 // Update notes (these will be set as task text!)
327 setExtensionUpdateNotes("Filter für Spaltenname des gesperrten Werbeguthabens hinzugefügt.");
330 case '0.5.7': // SQL queries for v0.5.7
331 addDropTableSql('url_blacklist');
333 // Update notes (these will be set as task text!)
334 setExtensionUpdateNotes("Tabelle für URL-Sperrliste gelöscht (nach <strong>ext-blacklist</strong> verschoben).");
337 case '0.5.8': // SQL queries for v0.5.8
338 addConfigAddSql('order_multi_page', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
340 // Update notes (these will be set as task text!)
341 setExtensionUpdateNotes("Konfiguration wird nun in dieser Erweiterung hinzugefügt (vorher: allgemeine <strong>tables.sql</strong>).");
344 case '0.5.9': // SQL queries for v0.5.9
345 addConfigAddSql('max_unconfirmed', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 100');
346 addConfigChangeSql('unconfirmed', 'max_unconfirmed', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 100');
347 addConfigAddSql('autosend_member_mails', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
348 addConfigChangeSql('autosend_active', 'autosend_member_mails', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
349 addConfigAddSql('max_text_length', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000');
350 addConfigChangeSql('max_tlength', 'max_text_length', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000');
352 // Update notes (these will be set as task text!)
353 setExtensionUpdateNotes("Konfiguration wird nun in dieser Erweiterung hinzugefügt (vorher: allgemeine <strong>tables.sql</strong>).");
356 case '0.6.0': // SQL queries for v0.6.0
358 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_SUBJECT' , FALSE, TRUE, isExtensionDryRun());
359 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_TEXT' , FALSE, TRUE, isExtensionDryRun());
360 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_TYPE' , FALSE, TRUE, isExtensionDryRun());
361 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_URL' , FALSE, TRUE, isExtensionDryRun());
362 registerFilter(__FILE__, __LINE__, 'pre_mail_order', 'MAIL_ORDER_GENERIC_CHECK_RECEIVER', FALSE, TRUE, isExtensionDryRun());
364 // Update notes (these will be set as task text!)
365 setExtensionUpdateNotes("Filter für gesperrtes Werbeguthaben hinzugefügt.");