Added update_year.sh (still not fully flexible) and updated all years with it.
[mailer.git] / inc / extensions / order / mode-update.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 01/22/2013 *
4  * ===================                          Last change: 01/22/2013 *
5  *                                                                      *
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                      *
16  *                                                                      *
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.                                  *
21  *                                                                      *
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.                         *
26  *                                                                      *
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,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
35         die();
36 } // END - if
37
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);
43
44                                 // Update notes (these will be set as task text!)
45                                 setExtensionUpdateNotes("Maximale Mailbuchungen sind nun vom maximalen Empfang abh&auml;gig.");
46                                 break;
47
48                         case '0.1.1': // SQL queries for v0.1.1
49                                 addExtensionAddTableColumnSql('user_data', 'mail_orders', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
50
51                                 // Update notes (these will be set as task text!)
52                                 setExtensionUpdateNotes("Maximale Mailbuchung vervollst&auml;ndigt (Admin-Bereich und im Buchungsformular selber).");
53                                 break;
54
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&auml;hlt und bei t&auml;glichem Reset auf 0 gesetzt).");
58                                 break;
59
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&ouml;scht, um Probleme zu vermeiden. Fehlende Spalte <span class=\"bad\">mail_order</span> korregiert auf <span class=\"bad\">mail_orders</span>.");
63                                 break;
64
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.");
68                                 break;
69
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.");
73                                 break;
74
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.");
78                                 break;
79
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.");
83                                 break;
84
85                         case '0.1.9': // SQL queries for v0.1.9
86                                 // Update notes (these will be set as task text!)
87                                 setExtensionUpdateNotes("Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
88                                 break;
89
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> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
93                                 break;
94
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.");
98                                 break;
99
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 &uuml;berpr&uuml;ft ob auch gen&uuml;gend Empf&auml;nger eingegeben worden sind und ob auch gen&uuml;gend empfangsbereit sind.");
103                                 break;
104
105                         case '0.2.3': // SQL queries for v0.2.3
106                                 addConfigAddSql('order_min', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 10');
107
108                                 // Update notes (these will be set as task text!)
109                                 setExtensionUpdateNotes("Minimum an Empf&auml;nger pro Mailbuchung einstellbar. Standard: 10 Empf&auml;nger");
110                                 break;
111
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&auml;nger wird nun auch angezeigt.");
115                                 break;
116
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.");
120                                 break;
121
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&ouml;tigen {?POINTS?} die maximale Anzahl von Usern in der Kategorie gew&auml;hlt und
125 nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der User h&auml;tte nicht gen&uuml;gend {?POINTS?} auf dem Konto. Ein Rechenbeispiel:
126 <ol>
127   <li>Das Mitglied w&auml;hlt eine Kategorie XYZ mit maximal 15 Empf&auml;ngern aus.</li>
128   <li>Es stellt die Mailart <u>&quot;3 {?POINTS?} Kosten / Mail&quot;</u> ein.</li>
129   <li>Es hat aber nur {?POINTS?} f&uuml;r 10 Empf&auml;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
131   auf.</li>
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>
134 </ol>");
135                                 break;
136
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.");
140                                 break;
141
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.");
145                                 break;
146
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.");
150                                 break;
151
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.");
155                                 break;
156
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'");
160
161                                 // Update notes (these will be set as task text!)
162                                 setExtensionUpdateNotes("Beworbene URL wird nun getestet.");
163                                 break;
164
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&uuml;hrlich.");
168                                 break;
169
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&auml;hlt.");
173                                 break;
174
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.");
178                                 break;
179
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&auml;nderbar ist und zur Festellung der Maximalen Mailbuchungen herangezogen wurde.");
183                                 break;
184
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.");
188                                 break;
189
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.");
193                                 break;
194
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.");
198                                 break;
199
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.");
203                                 break;
204
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!");
208                                 break;
209
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.");
213                                 break;
214
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.");
218                                 break;
219
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.");
223                                 break;
224
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 &#96;ext_active&#96;='Y'</strong> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.");
228                                 break;
229
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&uuml;pften Modules eingebunden.");
233                                 break;
234
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");
239
240                                 // Update notes (these will be set as task text!)
241                                 setExtensionUpdateNotes("Mitgliedsmen&uuml; komplett umgebaut.");
242                                 break;
243
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.");
247                                 break;
248
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");
251
252                                 // Update notes (these will be set as task text!)
253                                 setExtensionUpdateNotes("Men&uuml;punkt &quot;Mailbuchungsseite&quot; nach &quot;Mailbuchung&quot; umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben.");
254                                 break;
255
256                         case '0.4.9': // SQL queries for v0.4.9
257                                 addConfigAddSql('repay_deleted_mails', "ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'");
258
259                                 // Update notes (these will be set as task text!)
260                                 setExtensionUpdateNotes("Bei L&ouml;schung von Mailbuchungen kann nun scripteweit entschieden werden (Einstellungen also), ob die verbliebenen {?POINTS?} wieder gutgeschrieben werden sollen oder in den Jackpot landen.");
261                                 break;
262
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&uuml;ltiges Update.");
266                                 break;
267
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&uuml;ltiges Update.");
271                                 break;
272
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'");
278
279                                 // Update notes (these will be set as task text!)
280                                 setExtensionUpdateNotes("Inkonsistenz in Konfigurationsnamen korregiert.");
281                                 break;
282
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');
286
287                                 // This update depends on ext-user
288                                 addExtensionDependency('user');
289
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());
293
294                                 // Update notes (these will be set as task text!)
295                                 setExtensionUpdateNotes("Weiteres Verwendungszwecke &quot;Werbeguthaben&quot; hinzugef&uuml;gt (verschoben von ext-user) und neue Filter zum Zur&uuml;ckliefern des Werbeguthabens hinzugef&uuml;gt.");
296                                 break;
297
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());
301
302                                 // Register filter for all column names
303                                 registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_ORDER_POINTS_COLUMN_NAMES', FALSE, TRUE, isExtensionDryRun());
304
305                                 // Update notes (these will be set as task text!)
306                                 setExtensionUpdateNotes("Filter f&uuml;r gesperrtes Werbeguthaben hinzugef&uuml;gt.");
307                                 break;
308
309                         case '0.5.5': // SQL queries for v0.5.5
310                                 // Register filter
311                                 registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'ORDER_ZIP_CODE_SQL', FALSE, TRUE, isExtensionDryRun());
312
313                                 // Update notes (these will be set as task text!)
314                                 setExtensionUpdateNotes("Filter f&uuml;r gesperrtes Werbeguthaben hinzugef&uuml;gt.");
315                                 break;
316
317                         case '0.5.6': // SQL queries for v0.5.6
318                                 // Register filter
319                                 registerFilter(__FILE__, __LINE__, 'locked_points_columns_array', 'ORDER_POINTS_COLUMNS', FALSE, TRUE, isExtensionDryRun());
320
321                                 // Update notes (these will be set as task text!)
322                                 setExtensionUpdateNotes("Filter f&uuml;r Spaltenname des gesperrten Werbeguthabens hinzugef&uuml;gt.");
323                                 break;
324
325                         case '0.5.7': // SQL queries for v0.5.7
326                                 addDropTableSql('url_blacklist');
327
328                                 // Update notes (these will be set as task text!)
329                                 setExtensionUpdateNotes("Tabelle f&uuml;r URL-Sperrliste gel&ouml;scht (nach <strong>ext-blacklist</strong> verschoben).");
330                                 break;
331
332                         case '0.5.8': // SQL queries for v0.5.8
333                                 addConfigAddSql('order_multi_page', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
334
335                                 // Update notes (these will be set as task text!)
336                                 setExtensionUpdateNotes("Konfiguration wird nun in dieser Erweiterung hinzugef&uuml;gt (vorher: allgemeine <strong>tables.sql</strong>).");
337                                 break;
338
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');
346
347                                 // Update notes (these will be set as task text!)
348                                 setExtensionUpdateNotes("Konfiguration wird nun in dieser Erweiterung hinzugef&uuml;gt (vorher: allgemeine <strong>tables.sql</strong>).");
349                                 break;
350
351                         case '0.6.0': // SQL queries for v0.6.0
352                                 // Register filters
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());
358
359                                 // Update notes (these will be set as task text!)
360                                 setExtensionUpdateNotes("Filter f&uuml;r gesperrtes Werbeguthaben hinzugef&uuml;gt.");
361                                 break;
362                 } // END - switch
363
364 // [EOF]
365 ?>