Ignore:
Timestamp:
09/17/12 14:30:47 (12 years ago)
Author:
douglas
Message:

Ticket #0000 - Copiadas as alterações do Trunk. Versão final da 2.4.2.

Location:
branches/2.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4

  • branches/2.4/expressoCalendar/index.php

    r5764 r7228  
    11<?php 
    2          
     2 
    33        $GLOBALS['phpgw_info']['flags'] = Array(   'currentapp'    =>      'expressoCalendar', 
    44                                                   'noheader'      =>      false, 
  • branches/2.4/expressoCalendar/setup/default_records.inc.php

    r7093 r7228  
    11<?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 - 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         */  
     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        */ 
    3232         
    3333                //Problemas com cascade na forenkey 
     
    6868                $oProc->query("ALTER TABLE calendar ALTER COLUMN dtstamp SET DEFAULT (date_part('epoch'::text, ('now'::text)::timestamp(3) with time zone) * (1000)::double precision);"); 
    6969         
    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');"); 
    7172                $oProc->query("INSERT INTO calendar_class( \"id\", \"name\") VALUES ('1','Public'),('2','Private'),('3','Confidential');"); 
    7273                $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  
    1313        $setup_info['expressoCalendar']['title']        = 'Expresso Calendar'; 
    1414        /* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/ 
    15         $setup_info['expressoCalendar']['version']      = '1.007'; 
     15        $setup_info['expressoCalendar']['version']      = '1.009'; 
    1616        $setup_info['expressoCalendar']['app_order']    = 10; 
    1717 
     
    3333        $setup_info['expressoCalendar']['tables'][]             =  'calendar_permission'; 
    3434        $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'; 
    3638 
    3739        $setup_info['expressoCalendar']['enable']               = 1; 
  • branches/2.4/expressoCalendar/setup/tables_current.inc.php

    r6114 r7228  
    4848                'duration' => array('type' => 'int', 'precision' => '8' ,'nullable' => True), 
    4949                'tzid' => array('type' => 'varchar', 'precision' => '50' ,'nullable' => True), 
     50                'type' => array('type' => 'int', 'precision' => '2' ,'nullable' => false, 'default' => 0), 
    5051                'dtstamp' => array('type' => 'int', 'precision' => '8' ,'nullable' => True) 
    5152            ), 
     
    100101            'uc' => array() 
    101102                ), 
     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        ), 
    102116             
    103117             
     
    121135                'tzid' => array('type' => 'varchar', 'precision' => '50' ,'nullable' => True), 
    122136                '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 ) 
    124142            ), 
    125143            'pk' => array('id'), 
     
    130148                 
    131149             
    132             'calendar_participant' => array( 
     150        'calendar_participant' => array( 
    133151            'fd' => array( 
    134152                'id' => array( 'type' => 'auto', 'nullable' => False), 
     
    165183            'uc' => array() 
    166184                ), 
    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( 
    170203            'fd' => array( 
    171204                'id' => array( 'type' => 'auto', 'nullable' => False), 
     
    277310                                'msg_alarms' => array( 'type' => 'text', 'nullable' => True), 
    278311                                'font_color' => array(  'type' => 'varchar','precision' => '6', 'nullable' => True), 
    279                                 'background_color' => array(  'type' => 'varchar','precision' => '6', 'nullable' => True), 
    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) 
    282315            ), 
    283316            'pk' => array('id'), 
  • branches/2.4/expressoCalendar/setup/tables_update.inc.php

    r6255 r7228  
    5757 
    5858                $oProc->CreateTable('calendar_repeat_ranges', array( 
    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                                     ) 
     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                            ) 
    7070                ); 
    7171 
     
    7979        function expressoCalendar_upgrade1_002() { 
    8080 
    81             $oProc = $GLOBALS['phpgw_setup']->oProc; 
     81        $oProc = $GLOBALS['phpgw_setup']->oProc; 
    8282 
    83             $oProc->query("ALTER TABLE calendar_repeat_occurrence ADD COLUMN exception smallint DEFAULT 0"); 
     83        $oProc->query("ALTER TABLE calendar_repeat_occurrence ADD COLUMN exception smallint DEFAULT 0"); 
    8484 
    85             $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.003'; 
    86             return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
     85        $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.003'; 
     86        return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
    8787        }; 
    8888         
    8989        $test[] = '1.003'; 
    9090        function expressoCalendar_upgrade1_003() { 
    91             $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.004'; 
    92             return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
     91        $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.004'; 
     92        return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
    9393        }; 
    9494 
    9595        $test[] = '1.004'; 
    9696        function expressoCalendar_upgrade1_004() { 
    97             $oProc = $GLOBALS['phpgw_setup']->oProc; 
    98             $oProc->query("ALTER TABLE calendar_repeat_occurrence  ALTER COLUMN exception SET default 0"); 
     97        $oProc = $GLOBALS['phpgw_setup']->oProc; 
     98        $oProc->query("ALTER TABLE calendar_repeat_occurrence  ALTER COLUMN exception SET default 0"); 
    9999 
    100             $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.005'; 
    101             return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
     100        $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.005'; 
     101        return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
    102102        }; 
    103103         
    104104        $test[] = '1.005'; 
    105105        function expressoCalendar_upgrade1_005() { 
    106             $oProc = $GLOBALS['phpgw_setup']->oProc; 
    107             $oProc->query("ALTER TABLE calendar_alarm ADD COLUMN alarm_offset bigint;"); 
     106        $oProc = $GLOBALS['phpgw_setup']->oProc; 
     107        $oProc->query("ALTER TABLE calendar_alarm ADD COLUMN alarm_offset bigint;"); 
    108108            $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;"); 
    109109            $oProc->query("ALTER TABLE calendar_alarm DROP COLUMN range_start;"); 
    110110            $oProc->query("ALTER TABLE calendar_alarm DROP COLUMN range_end;"); 
    111             $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.006'; 
    112             return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
     111        $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.006'; 
     112        return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
    113113        }; 
    114114         
     
    120120        }; 
    121121         
     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         
    122185?> 
Note: See TracChangeset for help on using the changeset viewer.