source: trunk/expressoMail1_2/setup/tables_update.inc.php @ 6185

Revision 6185, 11.4 KB checked in by marcieli, 12 years ago (diff)

Ticket #2731 - Corrigido listar destinatários no title da coluna Para da pasta Enviados.

Line 
1<?php
2        /**************************************************************************\
3        * ExpressoLivre - Setup                                                     *
4        * http://www.expressolivre.org                                              *
5        * --------------------------------------------                             *
6        * This program is free software; you can redistribute it and/or modify it  *
7        * under the terms of the GNU General Public License as published by the    *
8        * Free Software Foundation; either version 2 of the License, or (at your   *
9        * option) any later version.                                               *
10        \**************************************************************************/
11        //      Since Expresso 1.2 using ExpressoMail 1.233             
12        $test[] = '1.233';
13        function expressoMail1_2_upgrade1_233() {
14                $setup_info['expressoMail1_2']['currentver'] = '1.234';
15                return $setup_info['expressoMail1_2']['currentver'];
16        }
17        $test[] = '1.234';
18        function expressoMail1_2_upgrade1_234() {
19        $oProc = $GLOBALS['phpgw_setup']->oProc;           
20            $oProc->CreateTable('phpgw_certificados',array(
21                        'fd' => array(
22                                'email' => array( 'type' => 'varchar', 'precision' => 60, 'nullable' => false),
23                                'chave_publica' => array( 'type' => 'text'),
24                                'expirado' => array('type' => 'bool', 'default' => 'false'),
25                                'revogado' => array('type' => 'bool', 'default' => 'false'),
26                                'serialnumber' => array('type' => 'int', 'precision' => 8, 'nullable' => false),
27                                'authoritykeyidentifier' => array( 'type' => 'text', 'nullable' => false),
28                        ),
29                        'pk' => array('email','serialnumber','authoritykeyidentifier'),
30                        'fk' => array(),
31                        'ix' => array(),
32                        'uc' => array()
33                        )
34                );
35                $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '1.235';
36        return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
37        }
38        $test[] = '1.235';
39        function expressoMail1_2_upgrade1_235() {
40                $setup_info['expressoMail1_2']['currentver'] = '2.0.000';
41                return $setup_info['expressoMail1_2']['currentver'];
42        }               
43        $test[] = '2.0.000';
44        function expressoMail1_2_upgrade2_0_000() {
45                $setup_info['expressoMail1_2']['currentver'] = '2.0.001';
46                return $setup_info['expressoMail1_2']['currentver'];
47        }
48        $test[] = '2.0.001';
49        function expressoMail1_2_upgrade2_0_001() {
50                $setup_info['expressoMail1_2']['currentver'] = '2.0.002';
51                return $setup_info['expressoMail1_2']['currentver'];
52        }       
53        $test[] = '2.0.002';
54        function expressoMail1_2_upgrade2_0_002() {
55                $setup_info['expressoMail1_2']['currentver'] = '2.0.003';
56                return $setup_info['expressoMail1_2']['currentver'];
57        }
58        $test[] = '2.0.003';
59        function expressoMail1_2_upgrade2_0_003() {
60                $setup_info['expressoMail1_2']['currentver'] = '2.0.004';
61                return $setup_info['expressoMail1_2']['currentver'];
62        }
63        $test[] = '2.0.004';
64        function expressoMail1_2_upgrade2_0_004() {
65                $setup_info['expressoMail1_2']['currentver'] = '2.0.005';
66                return $setup_info['expressoMail1_2']['currentver'];
67        }       
68        $test[] = '2.0.005';
69        function expressoMail1_2_upgrade2_0_005() {
70                $setup_info['expressoMail1_2']['currentver'] = '2.0.006';
71                return $setup_info['expressoMail1_2']['currentver'];
72        }       
73        $test[] = '2.0.006';
74        function expressoMail1_2_upgrade2_0_006() {
75                $setup_info['expressoMail1_2']['currentver'] = '2.0.007';
76                return $setup_info['expressoMail1_2']['currentver'];
77        }               
78        $test[] = '2.0.007';
79        function expressoMail1_2_upgrade2_0_007() {
80                $setup_info['expressoMail1_2']['currentver'] = '2.0.008';
81                return $setup_info['expressoMail1_2']['currentver'];
82        }       
83        $test[] = '2.0.008';
84        function expressoMail1_2_upgrade2_0_008() {
85                $setup_info['expressoMail1_2']['currentver'] = '2.0.009';
86                return $setup_info['expressoMail1_2']['currentver'];
87        }
88        $test[] = '2.0.009';
89        function expressoMail1_2_upgrade2_0_009() {
90                $setup_info['expressoMail1_2']['currentver'] = '2.0.010';
91                return $setup_info['expressoMail1_2']['currentver'];
92        }
93        $test[] = '2.0.010';
94        function expressoMail1_2_upgrade2_0_010() {
95                $setup_info['expressoMail1_2']['currentver'] = '2.1.000';
96                return $setup_info['expressoMail1_2']['currentver'];
97        }
98        $test[] = '2.1.000';
99        function expressoMail1_2_upgrade2_1_000() {
100                $setup_info['expressoMail1_2']['currentver'] = '2.2.000';
101                return $setup_info['expressoMail1_2']['currentver'];
102        }       
103        $test[] = '2.2.000';
104        function expressoMail1_2_upgrade2_2_000() {
105                $setup_info['expressoMail1_2']['currentver'] = '2.2.1';
106                return $setup_info['expressoMail1_2']['currentver'];
107        }
108        $test[] = '2.2.1';
109        function expressoMail1_2_upgrade2_2_1() {
110            $setup_info['expressoMail1_2']['currentver'] = '2.2.2';
111            return $setup_info['expressoMail1_2']['currentver'];
112        }
113        $test[] = '2.2.2';
114        function expressoMail1_2_upgrade2_2_2() {
115            $setup_info['expressoMail1_2']['currentver'] = '2.2.4';
116            return $setup_info['expressoMail1_2']['currentver'];
117        }
118        $test[] = '2.2.4';
119        function expressoMail1_2_upgrade2_2_4() {
120                $setup_info['expressoMail1_2']['currentver'] = '2.2.6';
121                return $setup_info['expressoMail1_2']['currentver'];
122        }
123        $test[] = '2.2.6';
124        function expressoMail1_2_upgrade2_2_6() {
125                $setup_info['expressoMail1_2']['currentver'] = '2.2.8';
126                return $setup_info['expressoMail1_2']['currentver'];
127        }
128        $test[] = '2.2.8';
129        function expressoMail1_2_upgrade2_2_8() {
130                $setup_info['expressoMail1_2']['currentver'] = '2.2.10';
131                return $setup_info['expressoMail1_2']['currentver'];
132        }
133        $test[] = '2.2.10';
134        function expressoMail1_2_upgrade2_2_10() {
135                $setup_info['expressoMail1_2']['currentver'] = '2.3.0';
136                return $setup_info['expressoMail1_2']['currentver'];
137        }               
138        $test[] = '2.3.0';
139        function expressoMail1_2_upgrade2_3_0() {
140            $setup_info['expressoMail1_2']['currentver'] = '2.4.0';
141            return $setup_info['expressoMail1_2']['currentver'];
142        }
143        $test[] = '2.4.0';
144        function expressoMail1_2_upgrade2_4_0() {
145        $oProc = $GLOBALS['phpgw_setup']->oProc;           
146            $oProc->CreateTable('expressomail_label',array(
147                                'fd' => array(
148                                        'id' => array('type' => 'auto','nullable' => False),
149                                        'user_id' => array('type' => 'int', 'precision' => '8','nullable' => true),
150                                        'name' => array('type' => 'varchar','precision' => '255','nullable' => true),
151                                        'border_color' => array('type' => 'varchar','precision' => '7','nullable' => true),
152                                        'background_color' => array('type' => 'varchar','precision' => '7','nullable' => true),
153                                        'font_color' => array('type' => 'varchar','precision' => '7','nullable' => true)
154                                ),
155                                'pk' => array('id'),
156                                'fk' => array(),
157                                'ix' => array(),
158                                'uc' => array()
159                                )
160                        );
161                        $oProc->CreateTable('expressomail_followupflag',array(
162                                'fd' => array(
163                                        'id' => array('type' => 'auto','nullable' => False),
164                                        'user_id' => array('type' => 'int', 'precision' => '8','nullable' => true),
165                                        'name' => array('type' => 'varchar','precision' => '255','nullable' => False)
166                                ),
167                                'pk' => array('id'),
168                                'fk' => array(),
169                                'ix' => array(),
170                                'uc' => array()
171                                )
172                        );
173                        $oProc->CreateTable('expressomail_message_followupflag',array(
174                                'fd' => array(
175                                        'id' => array('type' => 'auto','nullable' => False),
176                                        'followupflag_id' => array('type' => 'int', 'precision' => '8','nullable' => False),
177                                        'border_color' => array('type' => 'varchar','precision' => '7','nullable' => true),
178                                        'background_color' => array('type' => 'varchar','precision' => '7','nullable' => true),
179                                        'font_color' => array('type' => 'varchar','precision' => '7','nullable' => true),
180                                        'alarm_deadline' => array('type' => 'timestamp', 'nullable' => true),
181                                        'done_deadline' => array('type' => 'timestamp', 'nullable' => true),
182                                        'is_done' => array('type' => 'int', 'precision' => '8','nullable' => true)
183                                ),
184                                'pk' => array('id'),
185                                'fk' => array(),
186                                'ix' => array(),
187                                'uc' => array()
188                                )
189                        );                     
190                        $oProc->query("ALTER TABLE expressomail_message_followupflag ADD CONSTRAINT expressomail_message_followupflag_followupflag_id_fkey FOREIGN KEY (followupflag_id) REFERENCES expressomail_followupflag (id);");
191                       
192                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Follow up');");
193                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Read');");
194                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Forward');");
195                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Answer');");
196                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Don''t forward');");
197                        $oProc->query("INSERT INTO expressomail_followupflag(name) VALUES ('Don''t answer');");
198
199                                               
200                $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.1';
201        return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
202        }
203        $test[] = '2.4.1';
204        function expressoMail1_2_upgrade2_4_1() {
205            $oProc = $GLOBALS['phpgw_setup']->oProc;           
206            $oProc->CreateTable('expressomail_attachment',array(
207                        'fd' => array(
208                                'id' => array('type' => 'auto','nullable' => False),
209                                'source' => array('type' => 'blob','nullable' => False),
210                                'type' => array('type' => 'varchar','precision' => '255','nullable' => False),
211                                'name' => array('type' => 'varchar','precision' => '255','nullable' => False),
212                                'disposition' => array('type' => 'varchar','precision' => '20','nullable' => true),
213                                'size' => array('type' => 'int','precision' => '16','nullable' => False),
214                                'dtstamp' => array('type' => 'int','precision' => '16','nullable' => False),
215                                'owner' => array('type' => 'int', 'precision' => '8','nullable' => True)
216                        ),
217                        'pk' => array('id'),
218                        'fk' => array(),
219                        'ix' => array(),
220                        'uc' => array()
221                )
222                        );                                             
223                $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.2';
224        return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
225        }
226       
227        $test[] = '2.4.2';
228        function expressoMail1_2_upgrade2_4_2() {
229            $oProc = $GLOBALS['phpgw_setup']->oProc;
230            $oProc->query('ALTER TABLE mail_attachment RENAME TO expressomail_attachment');
231            $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.3';
232            return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
233        }
234       
235        $test[] = '2.4.3';
236        function expressoMail1_2_upgrade2_4_3() {
237            $oProc = $GLOBALS['phpgw_setup']->oProc;
238            $oProc->query("ALTER TABLE expressomail_message_followupflag ADD COLUMN message_id character varying(100) not null default 'unknown' ");
239 
240            $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.4';
241            return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
242        }
243       
244        $test[] = '2.4.4';
245        function expressoMail1_2_upgrade2_4_4() {
246            $oProc = $GLOBALS['phpgw_setup']->oProc;
247                $oProc->query("DELETE FROM expressomail_label");
248            $oProc->query("ALTER TABLE expressomail_label ADD COLUMN slot bigint not null");
249 
250            $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.5';
251            return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
252        }
253       
254        $test[] = '2.4.5';
255        function expressoMail1_2_upgrade2_4_5() {
256                $oProc = $GLOBALS['phpgw_setup']->oProc;
257                /* Seta o valor padrão para a configuração de número mínimo de marcadores */
258                $oProc->query("INSERT INTO phpgw_config(config_app, config_name, config_value) VALUES ('expressoMail1_2', 'expressoMail_limit_labels', 20);");
259                /* Registra o hook de validação do administrador*/
260                $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoMail1_2', 'config_validate', 'hook_config_validate.inc.php')");
261
262            $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.6';
263            return $GLOBALS['setup_info']['expressoMail1_2']['currentver'];
264        }
265       
266?>
Note: See TracBrowser for help on using the repository browser.