Changeset 7228 for branches/2.4/expressoCalendar/setup
- Timestamp:
- 09/17/12 14:30:47 (12 years ago)
- Location:
- branches/2.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4
- Property svn:mergeinfo changed
-
branches/2.4/expressoCalendar/setup/default_records.inc.php
r7093 r7228 1 1 <?php 2 /** 3 * 4 * Copyright (C) 2011 Cons órcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 3 of the License, or 9 * any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 * details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * 20 * You can contact Prognus Software Livre headquarters at Av. Tancredo Neves, 21 * 6731, PTI, Edif Ãcio do Saber, 3º floor, room 306, Foz do Iguaçu - PR - Brasil22 * or at e-mail address prognus@prognus.com.br. 23 * 24 * Neste arquivo s ão inseridos os valores padrões nas tabelas do módulo expressoCalendar.25 * 26 * @license http://www.gnu.org/copyleft/gpl.html GPL 27 * @author Cons órcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)28 * @version 1.0 29 * @sponsor Caixa Econ ÃŽmica Federal30 * @since Arquivo disponibilizado na vers ão Expresso 2.4.031 */ 2 /** 3 * 4 * Copyright (C) 2011 Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 3 of the License, or 9 * any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 * details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * 20 * You can contact Prognus Software Livre headquarters at Av. Tancredo Neves, 21 * 6731, PTI, Edifício do Saber, 3º floor, room 306, Foz do Iguaçu - PR - Brasil 22 * or at e-mail address prognus@prognus.com.br. 23 * 24 * Neste arquivo são inseridos os valores padrões nas tabelas do módulo expressoCalendar. 25 * 26 * @license http://www.gnu.org/copyleft/gpl.html GPL 27 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 28 * @version 1.0 29 * @sponsor Caixa Econômica Federal 30 * @since Arquivo disponibilizado na versão Expresso 2.4.0 31 */ 32 32 33 33 //Problemas com cascade na forenkey … … 68 68 $oProc->query("ALTER TABLE calendar ALTER COLUMN dtstamp SET DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision);"); 69 69 70 $oProc->query("INSERT INTO calendar_object_type( \"id\", \"name\") VALUES ('1','VEVENT');"); 70 $oProc->query("INSERT INTO calendar_object_type( \"id\", \"name\") VALUES ('1','VEVENT');"); 71 $oProc->query("INSERT INTO calendar_object_type( \"id\", \"name\") VALUES ('2','TODO');"); 71 72 $oProc->query("INSERT INTO calendar_class( \"id\", \"name\") VALUES ('1','Public'),('2','Private'),('3','Confidential');"); 72 73 $oProc->query("INSERT INTO calendar_participant_status( \"id\", \"name\") VALUES ('1','CONFIRMED'),('2','TENTATIVE'),('3','CANCELLED'),('4','UNANSWERED'),('5', 'DELEGATED');"); -
branches/2.4/expressoCalendar/setup/setup.inc.php
r6255 r7228 13 13 $setup_info['expressoCalendar']['title'] = 'Expresso Calendar'; 14 14 /* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/ 15 $setup_info['expressoCalendar']['version'] = '1.00 7';15 $setup_info['expressoCalendar']['version'] = '1.009'; 16 16 $setup_info['expressoCalendar']['app_order'] = 10; 17 17 … … 33 33 $setup_info['expressoCalendar']['tables'][] = 'calendar_permission'; 34 34 $setup_info['expressoCalendar']['tables'][] = 'module_preference'; 35 $setup_info['expressoCalendar']['tables'][] = 'calendar_repeat_ranges'; 35 $setup_info['expressoCalendar']['tables'][] = 'calendar_repeat_ranges'; 36 $setup_info['expressoCalendar']['tables'][] = 'calendar_task_to_activity_object'; 37 $setup_info['expressoCalendar']['tables'][] = 'calendar_historic'; 36 38 37 39 $setup_info['expressoCalendar']['enable'] = 1; -
branches/2.4/expressoCalendar/setup/tables_current.inc.php
r6114 r7228 48 48 'duration' => array('type' => 'int', 'precision' => '8' ,'nullable' => True), 49 49 'tzid' => array('type' => 'varchar', 'precision' => '50' ,'nullable' => True), 50 'type' => array('type' => 'int', 'precision' => '2' ,'nullable' => false, 'default' => 0), 50 51 'dtstamp' => array('type' => 'int', 'precision' => '8' ,'nullable' => True) 51 52 ), … … 100 101 'uc' => array() 101 102 ), 103 104 'calendar_task_to_activity_object' => array( 105 'fd' => array( 106 'id' => array( 'type' => 'auto', 'nullable' => False), 107 'calendar_object_activity_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 108 'calendar_object_task_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 109 'owner' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 110 ), 111 'pk' => array('id'), 112 'fk' => array(), 113 'ix' => array(), 114 'uc' => array() 115 ), 102 116 103 117 … … 121 135 'tzid' => array('type' => 'varchar', 'precision' => '50' ,'nullable' => True), 122 136 'transp' => array( 'type' => 'int', 'precision' => '2', 'nullable' => FALSE , 'default' => 0 ), 123 'sequence' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ) 137 'sequence' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ), 138 'due' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ), 139 'percentage' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ), 140 'status' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ), 141 'priority' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 2 ) 124 142 ), 125 143 'pk' => array('id'), … … 130 148 131 149 132 150 'calendar_participant' => array( 133 151 'fd' => array( 134 152 'id' => array( 'type' => 'auto', 'nullable' => False), … … 165 183 'uc' => array() 166 184 ), 167 168 169 'calendar_signature_alarm' => array( 185 186 'calendar_historic' => array( 187 'fd' => array( 188 'id' => array( 'type' => 'auto', 'nullable' => False), 189 'object_id' => array('type' => 'int', 'precision' => '8','nullable' => True), 190 'user_uidnumber' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 191 'dtstamp' => array( 'type' => 'bigint', 'precision' => '16', 'nullable' => False), 192 'attribute' => array('type' => 'varchar','precision' => '50','nullable' => True), 193 'before_value' => array( 'type' => 'varchar', 'precision' => '255', 'nullable' => True), 194 'after_value' => array( 'type' => 'varchar', 'precision' => '255', 'nullable' => True) 195 ), 196 'pk' => array('id'), 197 'fk' => array(), 198 'ix' => array(), 199 'uc' => array() 200 ), 201 202 'calendar_signature_alarm' => array( 170 203 'fd' => array( 171 204 'id' => array( 'type' => 'auto', 'nullable' => False), … … 277 310 'msg_alarms' => array( 'type' => 'text', 'nullable' => True), 278 311 'font_color' => array( 'type' => 'varchar','precision' => '6', 'nullable' => True), 279 280 'border_color' => array( 'type' => 'varchar','precision' => '6', 'nullable' => True)281 312 'background_color' => array( 'type' => 'varchar','precision' => '6', 'nullable' => True), 313 'border_color' => array( 'type' => 'varchar','precision' => '6', 'nullable' => True), 314 'type' => array('type' => 'int', 'precision' => '2' ,'nullable' => false, 'default' => 0) 282 315 ), 283 316 'pk' => array('id'), -
branches/2.4/expressoCalendar/setup/tables_update.inc.php
r6255 r7228 57 57 58 58 $oProc->CreateTable('calendar_repeat_ranges', array( 59 60 61 62 63 64 65 66 67 68 69 59 'fd' => array( 60 'id' => array( 'type' => 'auto', 'nullable' => False), 61 'range_start' => array( 'type' => 'bigint','precision' => '16', 'nullable' => False), 62 'range_end' => array( 'type' => 'bigint', 'precision' => '16', 'nullable' => False), 63 'user_info_id' => array( 'type' => 'bigint', 'precision' => '16', 'nullable' => False) 64 ), 65 'pk' => array('id'), 66 'fk' => array(), 67 'ix' => array(), 68 'uc' => array() 69 ) 70 70 ); 71 71 … … 79 79 function expressoCalendar_upgrade1_002() { 80 80 81 81 $oProc = $GLOBALS['phpgw_setup']->oProc; 82 82 83 83 $oProc->query("ALTER TABLE calendar_repeat_occurrence ADD COLUMN exception smallint DEFAULT 0"); 84 84 85 86 85 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.003'; 86 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 87 87 }; 88 88 89 89 $test[] = '1.003'; 90 90 function expressoCalendar_upgrade1_003() { 91 92 91 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.004'; 92 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 93 93 }; 94 94 95 95 $test[] = '1.004'; 96 96 function expressoCalendar_upgrade1_004() { 97 98 97 $oProc = $GLOBALS['phpgw_setup']->oProc; 98 $oProc->query("ALTER TABLE calendar_repeat_occurrence ALTER COLUMN exception SET default 0"); 99 99 100 101 100 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.005'; 101 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 102 102 }; 103 103 104 104 $test[] = '1.005'; 105 105 function expressoCalendar_upgrade1_005() { 106 107 106 $oProc = $GLOBALS['phpgw_setup']->oProc; 107 $oProc->query("ALTER TABLE calendar_alarm ADD COLUMN alarm_offset bigint;"); 108 108 $oProc->query("UPDATE calendar_alarm SET alarm_offset = obj.range_start - calendar_alarm.range_start FROM calendar_object as obj WHERE obj.id = object_id;"); 109 109 $oProc->query("ALTER TABLE calendar_alarm DROP COLUMN range_start;"); 110 110 $oProc->query("ALTER TABLE calendar_alarm DROP COLUMN range_end;"); 111 112 111 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.006'; 112 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 113 113 }; 114 114 … … 120 120 }; 121 121 122 $test[] = '1.007'; 123 function expressoCalendar_upgrade1_007() { 124 $oProc = $GLOBALS['phpgw_setup']->oProc; 125 126 $oProc->query("ALTER TABLE calendar_object ADD COLUMN priority smallint DEFAULT 0;"); 127 $oProc->query("ALTER TABLE calendar_object ADD COLUMN percentage smallint DEFAULT 0;"); 128 $oProc->query("ALTER TABLE calendar_object ADD COLUMN status smallint DEFAULT 0;"); 129 130 $oProc->query("ALTER TABLE calendar_object ADD COLUMN due bigint DEFAULT 0;"); 131 132 $oProc->query("ALTER TABLE calendar ADD COLUMN type smallint DEFAULT 0;"); 133 $oProc->query("ALTER TABLE calendar_signature ADD COLUMN type smallint DEFAULT 0;"); 134 135 $oProc->query("INSERT INTO calendar_object_type(id, name) VALUES ('2', 'TODO');"); 136 137 $oProc->query("CREATE TABLE calendar_task_to_activity_object(id serial not null, calendar_object_activity_id integer not null, calendar_object_task_id integer not null, owner integer not null);"); 138 139 $oProc->CreateTable('calendar_historic', array( 140 'fd' => array( 141 'id' => array( 'type' => 'auto', 'nullable' => False), 142 'object_id' => array('type' => 'int', 'precision' => '8','nullable' => True), 143 'user_uidnumber' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 144 'dtstamp' => array( 'type' => 'bigint', 'precision' => '16', 'nullable' => False), 145 'attribute' => array('type' => 'varchar','precision' => '50','nullable' => True), 146 'before_value' => array( 'type' => 'varchar', 'precision' => '255', 'nullable' => True), 147 'after_value' => array( 'type' => 'varchar', 'precision' => '255', 'nullable' => True) 148 ), 149 'pk' => array('id'), 150 'fk' => array(), 151 'ix' => array(), 152 'uc' => array() 153 ) 154 ); 155 156 $oProc->CreateTable('calendar_task_to_activity_object', array( 157 'fd' => array( 158 'id' => array( 'type' => 'auto', 'nullable' => False), 159 'calendar_object_activity_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 160 'calendar_object_task_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 161 'owner' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False), 162 ), 163 'pk' => array('id'), 164 'fk' => array(), 165 'ix' => array(), 166 'uc' => array() 167 ) 168 ); 169 170 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.008'; 171 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 172 }; 173 174 $test[] = '1.008'; 175 function expressoCalendar_upgrade1_008() { 176 $oProc = $GLOBALS['phpgw_setup']->oProc; 177 178 $oProc->query("ALTER TABLE calendar_permission ADD COLUMN owner bigint;"); 179 $oProc->query("UPDATE calendar_permission SET owner = sig.user_uidnumber FROM calendar_signature as sig WHERE (sig.calendar_id = object_id AND sig.is_owner = '1');"); 180 181 $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.009'; 182 return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 183 }; 184 122 185 ?>
Note: See TracChangeset
for help on using the changeset viewer.