Happy 2009! Updating copyright years.
[bugdar.git] / install / upgrade3.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright (c)2004-2009 Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 define('STOP_MARK', 4);
23 define('ACTIVE_SITE', 'upgrade3.php');
24
25 require_once('./global.php');
26
27 page_start();
28
29 // ###################################################################
30
31 if ($input->in['mark'] == 0)
32 {
33 ?>
34 <h1>Welcome to Bugdar</h1>
35
36 <p>This upgrade will take from Bugdar 1.1.0 Beta 1 to Bugdar 1.1.0 Beta 2.</p>
37
38 <p>The following steps will make changes to your database schema so that you can run Bugdar 1.1.0 Beta 2.</p>
39
40 <p>To begin the process, please click the button below.</p>
41 <?php
42 }
43
44 // ###################################################################
45
46 if ($input->in['mark'] == 1)
47 {
48 ?>
49 <h1>Language System Updates</h1>
50
51 <p>In Bugdar 1.1.0 Beta 2, the language system was changed to use Gettext. These schema changes reflect that change.</p>
52 <?php
53
54 $db->query("DROP TABLE " . TABLE_PREFIX . "localization");
55
56 echo "Dropping the strings cache table<br />\n";
57
58 $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP filename");
59
60 echo "Dropping language.filename<br />\n";
61
62 $db->query("ALTER TABLE " . TABLE_PREFIX . "language CHANGE languagecode langcode VARCHAR(5) NOT NULL");
63
64 echo "Adding language.langcode for the Gettext language code<br />\n";
65
66 $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP debug");
67
68 echo "Dropping language.debug as language debug mode no longer exists<br />\n";
69
70 $db->query("UPDATE " . TABLE_PREFIX . "language SET langcode = 'en_US' WHERE languageid = 1");
71
72 echo "Setting the correct langcode for English (US)<br />\n";
73 }
74
75 // ###################################################################
76
77 if ($input->in['mark'] == 2)
78 {
79 ?>
80 <h1>English US Changes</h1>
81
82 <p>These changes bring the schema into English (US) compliance.</p>
83 <?php
84
85 $db->query("ALTER TABLE " . TABLE_PREFIX . "favourite RENAME " . TABLE_PREFIX . "favorite");
86
87 echo "Renaming table 'favourite' to 'favorite'<br />\n";
88
89 $db->query("ALTER TABLE " . TABLE_PREFIX . "user CHANGE showcolours showcolors BOOL NULL");
90
91 echo "Renaming user.showcolours to user.showcolors<br />\n";
92 }
93
94 // ###################################################################
95
96 if ($input->in['mark'] == 3)
97 {
98 ?>
99 <h1>Adding New Permission Mask</h1>
100
101 <p>Bugdar 1.1.0 Beta 2 introduces a new permission called "canviewownhidden" which enables users to view hidden bugs that they reported. This is being turned on for registered users, developers, and administrators.</p>
102 <?php
103
104 $db->query("UPDATE " . TABLE_PREFIX . "usergroup SET permissions = permissions + 33554432 WHERE usergroupid IN (2, 5, 6)");
105
106 echo "Increased permission levels<br />\n";
107 }
108
109 // ###################################################################
110
111 if ($input->in['mark'] == 4)
112 {
113 ?>
114 <h1>Version Number Change</h1>
115
116 <p>This step finishes the upgrade by inreasing your version number.</p>
117
118 <?php
119
120 $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Beta 2' WHERE varname = 'trackerversion'");
121
122 build_settings();
123
124 ?>
125
126 ... done.
127
128 <?php
129 }
130
131 // ###################################################################
132
133 page_end();
134
135 ?>