Ignore:
Timestamp:
06/15/12 17:00:17 (12 years ago)
Author:
gustavo
Message:

Ticket #2766 - Merge do branch das novas funcionalidaes para o trunk

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/expressoMail1_2/setup/default_records.inc.php

    r5988 r6528  
    11<?php 
     2  /**************************************************************************\ 
     3  * eGroupWare - Setup                                                       * 
     4  * http://www.egroupware.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 
    212                        $oProc->query("ALTER TABLE expressomail_message_followupflag ADD CONSTRAINT expressomail_message_followupflag_followupflag_id_fkey FOREIGN KEY (followupflag_id) REFERENCES expressomail_followupflag (id);"); 
    313                         
     
    1525                        $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoMail1_2', 'config_validate', 'hook_config_validate.inc.php')"); 
    1626 
    17                  
     27                        /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner  */ 
     28                        $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 
    1829?> 
  • trunk/expressoMail1_2/setup/setup.inc.php

    r6255 r6528  
    1313$setup_info['expressoMail1_2']['name'] = 'expressoMail1_2'; 
    1414$setup_info['expressoMail1_2']['title'] = 'Expresso Mail'; 
    15 $setup_info['expressoMail1_2']['version'] = '2.4.7'; 
     15$setup_info['expressoMail1_2']['version'] = '2.4.8'; 
    1616$setup_info['expressoMail1_2']['app_order'] = 2; 
    17 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressomail_contacts'; 
    1817$setup_info['expressoMail1_2']['tables'][] = 'phpgw_certificados'; 
    1918 
     
    2221$setup_info['expressoMail1_2']['tables'][] = 'expressomail_message_followupflag'; 
    2322$setup_info['expressoMail1_2']['tables'][] = 'expressomail_followupflag'; 
     23$setup_info['expressoMail1_2']['tables'][] = 'expressomail_dynamic_contact'; 
    2424 
    2525 
     
    4848    'versions' => Array('2.4') 
    4949); 
     50 
     51$setup_info['expressoMail1_2']['depends'][] = array( 
     52    'appname' => 'rest', 
     53    'versions' => Array('1.0') 
     54); 
     55 
    5056?> 
  • trunk/expressoMail1_2/setup/tables_current.inc.php

    r5981 r6528  
    1010        \**************************************************************************/ 
    1111        $phpgw_baseline = array( 
    12                 'phpgw_expressomail_contacts' => array( 
     12                'expressomail_dynamic_contact' => array( 
    1313                        'fd' => array( 
    14                                 'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false), 
    15                                 'data' => array( 'type' => 'text') 
     14                                'id' => array('type' => 'auto','nullable' => False), 
     15                                'owner' => array('type' => 'int','precision' => '16','nullable' => False), 
     16                                'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 
     17                                'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 
     18                                'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 
     19                                'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 
    1620                        ), 
    17                         'pk' => array('id_owner'), 
     21                        'pk' => array('id'), 
    1822                        'fk' => array(), 
    1923                        'ix' => array(), 
    2024                        'uc' => array() 
    2125                ), 
     26                 
    2227        'phpgw_certificados' => array( 
    2328            'fd' => array( 
  • trunk/expressoMail1_2/setup/tables_update.inc.php

    r6255 r6528  
    267267            return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 
    268268        } 
    269          
     269 
     270        $test[] = '2.4.7'; 
     271        function expressoMail1_2_upgrade2_4_7() { 
     272                $oProc = $GLOBALS['phpgw_setup']->oProc; 
     273 
     274                //Criando nova tabela de contatos dinamicos 
     275                $oProc->CreateTable('expressomail_dynamic_contact',array( 
     276                        'fd' => array( 
     277                                'id' => array('type' => 'auto','nullable' => False), 
     278                                'owner' => array('type' => 'int','precision' => '16','nullable' => False), 
     279                                'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 
     280                                'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 
     281                                'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 
     282                                'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 
     283                        ), 
     284                        'pk' => array('id'), 
     285                        'fk' => array(), 
     286                        'ix' => array(), 
     287                        'uc' => array() 
     288                        ) 
     289                ); 
     290 
     291                /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner  */ 
     292                $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 
     293 
     294                //Migra dados antigos para nova tabela 
     295                $oProc->query('SELECT * FROM phpgw_expressomail_contacts'); 
     296                $return = array(); 
     297                while($oProc->next_record()) 
     298                        $return[$oProc->f('id_owner')] = $oProc->f('data'); 
     299 
     300                foreach ($return as $owner => &$value) { 
     301                        $contacts = unserialize($value); 
     302                        foreach ($contacts as &$contact) { 
     303                                $info = explode('#', $contact['email']); 
     304                                $oProc->query("INSERT INTO expressomail_dynamic_contact (owner, name ,mail , number_of_messages ,timestamp) values ('".$owner."', '".$info[0]."', '".$info[1]."', 1, '".$contact['timestamp']."');"); 
     305                        } 
     306                } 
     307 
     308                //Deleta tabela antiga 
     309                $oProc->DropTable('phpgw_expressomail_contacts'); 
     310 
     311                /* Remove a restricao de quantidade de contatos recentes */ 
     312                $oProc->query("DELETE FROM phpgw_config WHERE config_app = 'expressoMail1_2' AND config_name = 'expressoMail_Number_of_dynamic_contacts'"); 
     313 
     314                $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.8'; 
     315            return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 
     316        } 
    270317?> 
Note: See TracChangeset for help on using the changeset viewer.