[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/projectmanager/setup/ -> tables_update.inc.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare - Setup                                                       *
   4      * http://www.eGroupWare.org                                                *
   5      * Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
   6      * --------------------------------------------                             *
   7      * This program is free software; you can redistribute it and/or modify it  *
   8      * under the terms of the GNU General Public License as published by the    *
   9      * Free Software Foundation; either version 2 of the License, or (at your   *
  10      * option) any later version.                                               *
  11      \**************************************************************************/
  12      
  13      /* tables_update.inc.php,v 1.10 2006/01/11 05:15:43 ralfbecker Exp */
  14  
  15      $test[] = '0.1.008';
  16  	function projectmanager_upgrade0_1_008()
  17      {
  18          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_projects','pm_planed_start','pm_planned_start');
  19          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_projects','pm_planed_end','pm_planned_end');
  20          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_projects','pm_planed_time','pm_planned_time');
  21          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_projects','pm_planed_budget','pm_planned_budget');
  22  
  23          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.001';
  24          return $GLOBALS['setup_info']['projectmanager']['currentver'];
  25      }
  26  
  27  
  28      $test[] = '0.2.001';
  29  	function projectmanager_upgrade0_2_001()
  30      {
  31          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_elements','pe_planed_time','pe_planned_time');
  32          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_elements','pe_planed_budget','pe_planned_budget');
  33          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_elements','pe_planed_start','pe_planned_start');
  34          $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_pm_elements','pe_planed_end','pe_planned_end');
  35  
  36          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.002';
  37          return $GLOBALS['setup_info']['projectmanager']['currentver'];
  38      }
  39  
  40  
  41      $test[] = '0.2.002';
  42  	function projectmanager_upgrade0_2_002()
  43      {
  44          $GLOBALS['phpgw_setup']->oProc->CreateTable('egw_pm_constrains',array(
  45              'fd' => array(
  46                  'pm_id' => array('type' => 'int','precision' => '4'),
  47                  'pe_id_end' => array('type' => 'int','precision' => '4'),
  48                  'pe_id_start' => array('type' => 'int','precision' => '4'),
  49                  'ms_id' => array('type' => 'int','precision' => '4')
  50              ),
  51              'pk' => array('pm_id','pe_id_end','pe_id_start','ms_id'),
  52              'fk' => array(),
  53              'ix' => array(array('pm_id','pe_id_start'),array('pm_id','ms_id')),
  54              'uc' => array()
  55          ));
  56  
  57          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.003';
  58          return $GLOBALS['setup_info']['projectmanager']['currentver'];
  59      }
  60  
  61  
  62      $test[] = '0.2.003';
  63  	function projectmanager_upgrade0_2_003()
  64      {
  65          $GLOBALS['phpgw_setup']->oProc->CreateTable('egw_pm_milestones',array(
  66              'fd' => array(
  67                  'ms_id' => array('type' => 'auto','nullable' => False),
  68                  'pm_id' => array('type' => 'int','precision' => '4'),
  69                  'ms_date' => array('type' => 'int','precision' => '8','nullable' => False),
  70                  'ms_title' => array('type' => 'varchar','precision' => '255'),
  71                  'ms_description' => array('type' => 'text')
  72              ),
  73              'pk' => array('ms_id'),
  74              'fk' => array(),
  75              'ix' => array('pm_id'),
  76              'uc' => array()
  77          ));
  78  
  79          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.004';
  80          return $GLOBALS['setup_info']['projectmanager']['currentver'];
  81      }
  82  
  83  
  84      $test[] = '0.2.004';
  85  	function projectmanager_upgrade0_2_004()
  86      {
  87          $GLOBALS['phpgw_setup']->oProc->RenameTable('egw_pm_constrains','egw_pm_constraints');
  88  
  89          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.005';
  90          return $GLOBALS['setup_info']['projectmanager']['currentver'];
  91      }
  92  
  93  
  94      $test[] = '0.2.005';
  95  	function projectmanager_upgrade0_2_005()
  96      {
  97          $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_pm_milestones','pm_id',array(
  98              'type' => 'int',
  99              'precision' => '4',
 100              'nullable' => False
 101          ));
 102  
 103          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.006';
 104          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 105      }
 106  
 107  
 108      $test[] = '0.2.006';
 109  	function projectmanager_upgrade0_2_006()
 110      {
 111          $GLOBALS['phpgw_setup']->oProc->CreateTable('egw_pm_roles',array(
 112              'fd' => array(
 113                  'role_id' => array('type' => 'auto','nullable' => False),
 114                  'pm_id' => array('type' => 'int','precision' => '4','default' => '0'),
 115                  'role_title' => array('type' => 'varchar','precision' => '80','nullable' => False),
 116                  'role_description' => array('type' => 'varchar','precision' => '255'),
 117                  'role_acl' => array('type' => 'int','precision' => '4','nullable' => False)
 118              ),
 119              'pk' => array('role_id'),
 120              'fk' => array(),
 121              'ix' => array('pm_id'),
 122              'uc' => array()
 123          ));
 124  
 125          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.007';
 126          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 127      }
 128  
 129  
 130      $test[] = '0.2.007';
 131  	function projectmanager_upgrade0_2_007()
 132      {
 133          $GLOBALS['phpgw_setup']->oProc->CreateTable('egw_pm_members',array(
 134              'fd' => array(
 135                  'pm_id' => array('type' => 'int','precision' => '4','nullable' => False),
 136                  'member_uid' => array('type' => 'int','precision' => '4','nullable' => False),
 137                  'role_id' => array('type' => 'int','precision' => '4','default' => '0')
 138              ),
 139              'pk' => array('pm_id','member_uid'),
 140              'fk' => array(),
 141              'ix' => array(),
 142              'uc' => array()
 143          ));
 144  
 145          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.008';
 146          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 147      }
 148  
 149  
 150      $test[] = '0.2.008';
 151  	function projectmanager_upgrade0_2_008()
 152      {
 153          // adding some default roles
 154          foreach(array(
 155              1 => array(
 156                  'role_title'       => 'Coordinator',
 157                  'role_description' => 'full access',
 158                  'role_acl'         => 0xffff),
 159              2 => array(
 160                  'role_title'       => 'Accounting',
 161                  'role_description' => 'edit access, incl. editing budget and elements',
 162                  'role_acl'         => 1|2|4|64|128),
 163              3 => array(
 164                  'role_title'       => 'Assistant',
 165                  'role_description' => 'read access, incl. budget and adding elements',
 166                  'role_acl'         => 1|2|64),
 167              4 => array(
 168                  'role_title'       => 'Projectmember',
 169                  'role_description' => 'read access, no budget',
 170                  'role_acl'         => 1),
 171          ) as $role_id => $data)
 172          {
 173              $GLOBALS['phpgw_setup']->oProc->insert('egw_pm_roles',$data,array('role_id'=>$role_id),__LINE__,__FILE__,'projectmanager');
 174          }
 175          // copying the existing coordinators to the new egw_pm_members table, before droping the column
 176          $GLOBALS['phpgw_setup']->db->select('egw_pm_projects','pm_id,pm_coordinator',false,__LINE__,__FILE__,false,'','projectmanager');
 177          while(($row = $GLOBALS['phpgw_setup']->db->row(true)))
 178          {
 179              if ($row['pm_coordinator'])
 180              {
 181                  $GLOBALS['phpgw_setup']->oProc->insert('egw_pm_members',array(
 182                      'pm_id'      => $row['pm_id'],
 183                      'member_uid' => $row['pm_coordinator'],
 184                      'role_id'    => 1,
 185                  ),false,__LINE__,__FILE__,'projectmanager');
 186              }
 187          }
 188          $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_pm_projects',array(
 189              'fd' => array(
 190                  'pm_id' => array('type' => 'auto','nullable' => False),
 191                  'pm_number' => array('type' => 'varchar','precision' => '64','nullable' => False),
 192                  'pm_title' => array('type' => 'varchar','precision' => '255','nullable' => False),
 193                  'pm_description' => array('type' => 'text','default' => ''),
 194                  'pm_creator' => array('type' => 'int','precision' => '4','nullable' => False),
 195                  'pm_created' => array('type' => 'int','precision' => '8','nullable' => False),
 196                  'pm_modifier' => array('type' => 'int','precision' => '4'),
 197                  'pm_modified' => array('type' => 'int','precision' => '8'),
 198                  'pm_planned_start' => array('type' => 'int','precision' => '8'),
 199                  'pm_planned_end' => array('type' => 'int','precision' => '8'),
 200                  'pm_real_start' => array('type' => 'int','precision' => '8'),
 201                  'pm_real_end' => array('type' => 'int','precision' => '8'),
 202                  'cat_id' => array('type' => 'int','precision' => '4','default' => '0'),
 203                  'pm_access' => array('type' => 'varchar','precision' => '7','default' => 'public'),
 204                  'pm_priority' => array('type' => 'int','precision' => '2','default' => '1'),
 205                  'pm_status' => array('type' => 'varchar','precision' => '9','default' => 'active'),
 206                  'pm_completion' => array('type' => 'int','precision' => '2','default' => '0'),
 207                  'pm_used_time' => array('type' => 'int','precision' => '4'),
 208                  'pm_planned_time' => array('type' => 'int','precision' => '4'),
 209                  'pm_used_budget' => array('type' => 'decimal','precision' => '20','scale' => '2'),
 210                  'pm_planned_budget' => array('type' => 'decimal','precision' => '20','scale' => '2'),
 211                  'pm_overwrite' => array('type' => 'int','precision' => '4','default' => '0')
 212              ),
 213              'pk' => array('pm_id'),
 214              'fk' => array(),
 215              'ix' => array('pm_title'),
 216              'uc' => array('pm_number')
 217          ),'pm_coordinator');
 218  
 219          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.2.009';
 220          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 221      }
 222  
 223  
 224      $test[] = '0.2.009';
 225  	function projectmanager_upgrade0_2_009()
 226      {
 227          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_pm_elements','pe_share',array(
 228              'type' => 'int',
 229              'precision' => '4'
 230          ));
 231          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_pm_elements','pe_health',array(
 232              'type' => 'int',
 233              'precision' => '2'
 234          ));
 235  
 236          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.3.001';
 237          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 238      }
 239  
 240  
 241      $test[] = '0.3.001';
 242  	function projectmanager_upgrade0_3_001()
 243      {
 244          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_pm_projects','pm_accounting_type',array(
 245              'type' => 'varchar',
 246              'precision' => '10',
 247              'default' => 'times'
 248          ));
 249  
 250          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.3.002';
 251          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 252      }
 253  
 254  
 255      $test[] = '0.3.002';
 256  	function projectmanager_upgrade0_3_002()
 257      {
 258          $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_pm_members','member_availibility',array(
 259              'type' => 'float',
 260              'precision' => '4',
 261              'default' => '100.0'
 262          ));
 263  
 264          $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.4.001';
 265          return $GLOBALS['setup_info']['projectmanager']['currentver'];
 266      }
 267  
 268  
 269      $test[] = '0.4.001';
 270  	function projectmanager_upgrade0_4_001()
 271      {
 272          $GLOBALS['egw_setup']->oProc->AddColumn('egw_pm_elements','pe_resources',array(
 273              'type' => 'varchar',
 274              'precision' => '255'
 275          ));
 276          $GLOBALS['egw_setup']->oProc->AddColumn('egw_pm_elements','pe_details',array(
 277              'type' => 'text'
 278          ));
 279  
 280          return $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.5.001';
 281      }
 282  
 283  
 284      $test[] = '0.5.001';
 285  	function projectmanager_upgrade0_5_001()
 286      {
 287          $GLOBALS['egw_setup']->oProc->CreateTable('egw_pm_pricelist',array(
 288              'fd' => array(
 289                  'pl_id' => array('type' => 'auto','nullable' => False),
 290                  'pl_title' => array('type' => 'varchar','precision' => '255','nullable' => False),
 291                  'pl_description' => array('type' => 'text','default' => ''),
 292                  'cat_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
 293                  'pl_unit' => array('type' => 'varchar','precision' => '20','nullable' => False)
 294              ),
 295              'pk' => array('pl_id'),
 296              'fk' => array(),
 297              'ix' => array(),
 298              'uc' => array()
 299          ));
 300  
 301          return $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.5.002';
 302      }
 303  
 304  
 305      $test[] = '0.5.002';
 306  	function projectmanager_upgrade0_5_002()
 307      {
 308          $GLOBALS['egw_setup']->oProc->CreateTable('egw_pm_prices',array(
 309              'fd' => array(
 310                  'pm_id' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
 311                  'pl_id' => array('type' => 'int','precision' => '4','nullable' => False),
 312                  'pl_validsince' => array('type' => 'int','precision' => '8', 'nullable' => False,'default' => '0'),
 313                  'pl_price' => array('type' => 'float','precision' => '8'),
 314                  'pl_modifier' => array('type' => 'int','precision' => '4','nullable' => False),
 315                  'pl_modified' => array('type' => 'int','precision' => '8','nullable' => False),
 316                  'pl_customertitle' => array('type' => 'varchar','precision' => '255'),
 317                  'pl_billable' => array('type' => 'int','precision' => '2','default' => '1')
 318              ),
 319              'pk' => array('pm_id','pl_id','pl_validsince'),
 320              'fk' => array(),
 321              'ix' => array(),
 322              'uc' => array()
 323          ));
 324  
 325          return $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.5.003';
 326      }
 327  
 328  
 329      $test[] = '0.5.003';
 330  	function projectmanager_upgrade0_5_003()
 331      {
 332          $GLOBALS['egw_setup']->oProc->RenameColumn('egw_pm_elements','pe_activity_id','pl_id');
 333  
 334          return $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.5.004';
 335      }
 336  
 337  
 338      $test[] = '0.5.004';
 339  	function projectmanager_upgrade0_5_004()
 340      {
 341          $GLOBALS['egw_setup']->oProc->RenameColumn('egw_pm_elements','pe_cost_per_time','pe_unitprice');
 342          $GLOBALS['egw_setup']->oProc->AddColumn('egw_pm_elements','pe_planned_quantity',array(
 343              'type' => 'float',
 344              'precision' => '8'
 345          ));
 346          $GLOBALS['egw_setup']->oProc->AddColumn('egw_pm_elements','pe_used_quantity',array(
 347              'type' => 'float',
 348              'precision' => '8'
 349          ));
 350  
 351          return $GLOBALS['setup_info']['projectmanager']['currentver'] = '0.5.005';
 352      }
 353  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7