[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?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 12 /* $Id: tables_update_0_9_10.inc.php 16306 2004-08-09 12:40:51Z reinerj $ */ 13 14 $test[] = '0.9.9'; 15 function phpgwapi_upgrade0_9_9() 16 { 17 global $setup_info, $phpgw_setup; 18 19 $db2 = $phpgw_setup->db; 20 //convert user settings 21 $phpgw_setup->oProc->query("select account_id, account_permissions from accounts",__LINE__,__FILE__); 22 if($phpgw_setup->oProc->num_rows()) 23 { 24 while($phpgw_setup->oProc->next_record()) 25 { 26 $apps_perms = explode(":",$phpgw_setup->oProc->f('account_permissions')); 27 for($i=1;$i<count($apps_perms)-1;$i++) 28 { 29 if ($apps_perms[$i] != "") 30 { 31 $sql = "insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; 32 $sql .= " values('".$apps_perms[$i]."', 'run', ".$phpgw_setup->oProc->f("account_id").", 'u', 1)"; 33 $db2->query($sql ,__LINE__,__FILE__); 34 } 35 } 36 } 37 } 38 $phpgw_setup->oProc->query("update accounts set account_permissions = ''",__LINE__,__FILE__); 39 //convert group settings 40 $phpgw_setup->oProc->query("select group_id, group_apps from groups",__LINE__,__FILE__); 41 if($phpgw_setup->oProc->num_rows()) 42 { 43 while($phpgw_setup->oProc->next_record()) 44 { 45 $apps_perms = explode(":",$phpgw_setup->oProc->f('group_apps')); 46 for($i=1;$i<count($apps_perms)-1;$i++) 47 { 48 if ($apps_perms[$i] != '') 49 { 50 $sql = "insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; 51 $sql .= " values('".$apps_perms[$i]."', 'run', ".$phpgw_setup->oProc->f("group_id").", 'g', 1)"; 52 $db2->query($sql ,__LINE__,__FILE__); 53 } 54 } 55 } 56 } 57 $phpgw_setup->oProc->query("update groups set group_apps = ''",__LINE__,__FILE__); 58 59 $setup_info['phpgwapi']['currentver'] = '0.9.10pre1'; 60 return $setup_info['phpgwapi']['currentver']; 61 //return True; 62 } 63 64 $test[] = '0.9.10pre1'; 65 function phpgwapi_upgrade0_9_10pre1() 66 { 67 global $setup_info, $phpgw_setup; 68 69 $phpgw_setup->oProc->AddColumn('phpgw_categories','cat_access',array('type' => 'varchar', 'precision' => 25)); 70 71 $setup_info['phpgwapi']['currentver'] = '0.9.10pre2'; 72 return $setup_info['phpgwapi']['currentver']; 73 //return True; 74 } 75 76 $test[] = '0.9.10pre2'; 77 function phpgwapi_upgrade0_9_10pre2() 78 { 79 global $setup_info, $phpgw_setup; 80 81 $db2 = $phpgw_setup->oProc; 82 83 $phpgw_setup->oProc->query("SELECT account_groups,account_id FROM accounts",__LINE__,__FILE__); 84 if($phpgw_setup->oProc->num_rows()) 85 { 86 while($phpgw_setup->oProc->next_record()) 87 { 88 $gl = explode(',',$phpgw_setup->oProc->f('account_groups')); 89 for ($i=1; $i<(count($gl)-1); $i++) 90 { 91 $ga = explode(':',$gl[$i]); 92 $sql = "INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; 93 $sql .= " VALUES('phpgw_group', '".$ga[0]."', ".$phpgw_setup->oProc->f("account_id").", 'u', 1)"; 94 $db2->query($sql ,__LINE__,__FILE__); 95 } 96 } 97 } 98 $phpgw_setup->oProc->query("UPDATE accounts SET account_groups= ''",__LINE__,__FILE__); 99 100 $setup_info['phpgwapi']['currentver'] = '0.9.10pre3'; 101 return $setup_info['phpgwapi']['currentver']; 102 //return True; 103 } 104 105 $test[] = '0.9.10pre3'; 106 function phpgwapi_upgrade0_9_10pre3() 107 { 108 global $setup_info, $phpgw_setup; 109 110 $phpgw_setup->oProc->RenameTable('accounts','phpgw_accounts'); 111 112 $newtbldef = array( 113 'fd' => array( 114 'account_id' => array('type' => 'auto', 'nullable' => false), 115 'account_lid' => array('type' => 'varchar', 'precision' => 25, 'nullable' => false), 116 'account_pwd' => array('type' => 'varchar', 'precision' => 32, 'nullable' => false), 117 'account_firstname' => array('type' => 'varchar', 'precision' => 50), 118 'account_lastname' => array('type' => 'varchar', 'precision' => 50), 119 'account_groups' => array('type' => 'varchar', 'precision' => 30), 120 'account_lastlogin' => array('type' => 'int', 'precision' => 4), 121 'account_lastloginfrom' => array('type' => 'varchar', 'precision' => 255), 122 'account_lastpwd_change' => array('type' => 'int', 'precision' => 4), 123 'account_status' => array('type' => 'char', 'precision' => 1, 'nullable' => false, 'default' => 'A') 124 ), 125 'pk' => array('account_id'), 126 'fk' => array(), 127 'ix' => array(), 128 'uc' => array('account_lid') 129 ); 130 $phpgw_setup->oProc->DropColumn('phpgw_accounts',$newtbldef,'account_permissions'); 131 132 $newtbldef = array( 133 'fd' => array( 134 'account_id' => array('type' => 'auto', 'nullable' => false), 135 'account_lid' => array('type' => 'varchar', 'precision' => 25, 'nullable' => false), 136 'account_pwd' => array('type' => 'varchar', 'precision' => 32, 'nullable' => false), 137 'account_firstname' => array('type' => 'varchar', 'precision' => 50), 138 'account_lastname' => array('type' => 'varchar', 'precision' => 50), 139 'account_lastlogin' => array('type' => 'int', 'precision' => 4), 140 'account_lastloginfrom' => array('type' => 'varchar', 'precision' => 255), 141 'account_lastpwd_change' => array('type' => 'int', 'precision' => 4), 142 'account_status' => array('type' => 'char', 'precision' => 1, 'nullable' => false, 'default' => 'A') 143 ), 144 'pk' => array('account_id'), 145 'fk' => array(), 146 'ix' => array(), 147 'uc' => array('account_lid') 148 ); 149 $phpgw_setup->oProc->DropColumn('phpgw_accounts',$newtbldef,'account_groups'); 150 151 $phpgw_setup->oProc->AddColumn('phpgw_accounts','account_type', array('type' => 'char', 'precision' => 1)); 152 $phpgw_setup->oProc->query("update phpgw_accounts set account_type='u'",__LINE__,__FILE__); 153 154 $setup_info['phpgwapi']['currentver'] = '0.9.10pre4'; 155 return $setup_info['phpgwapi']['currentver']; 156 //return True; 157 } 158 159 // TODO see next function 160 /* 161 $tables = Array('addressbook','calendar_entry','f_forums','todo'); 162 $fields["addressbook"] = Array('ab_access','ab_id'); 163 $fields["calendar_entry"] = Array('cal_group','cal_id'); 164 $fields["f_forums"] = Array('groups','id'); 165 $fields["phpgw_categories"] = Array('cat_access','cat_id'); 166 $fields["todo"] = Array('todo_access','todo_id'); 167 */ 168 function change_groups($table,$field,$old_id,$new_id,$db2,$db3) 169 { 170 $sql = $field[0]; 171 for($i=1;$i<count($field);$i++) 172 { 173 $sql .= ", ".$field[$i]; 174 } 175 $db2->query("SELECT $sql FROM $table WHERE $field[0] like '%,".$old_id.",%'",__LINE__,__FILE__); 176 if($db2->num_rows()) 177 { 178 while($db2->next_record()) 179 { 180 $access = $db2->f($field[0]); 181 $id = $db2->f($field[1]); 182 $access = str_replace(','.$old_id.',' , ','.$new_id.',' , $access); 183 $db3->query("UPDATE $table SET ".$field[0]."='".$access."' WHERE ".$field[1]."=".$id,__LINE__,__FILE__); 184 } 185 } 186 } 187 188 $test[] = '0.9.10pre4'; 189 function phpgwapi_upgrade0_9_10pre4() 190 { 191 global $setup_info, $phpgw_setup; 192 193 $db2 = $phpgw_setup->oProc; 194 $db3 = $phpgw_setup->oProc; 195 196 $phpgw_setup->oProc->query("SELECT MAX(group_id) FROM groups",__LINE__,__FILE__); 197 $phpgw_setup->oProc->next_record(); 198 $max_group_id = $phpgw_setup->oProc->f(0); 199 200 // This is for use by former CORE apps to use in this version number's upgrade locally 201 $phpgw_setup->oProc->CreateTable( 202 'phpgw_temp_groupmap', array( 203 'fd' => array( 204 'oldid' => array('type' => 'int', 'precision' => 4, 'nullable' => False), 205 'oldlid' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True), 206 'newid' => array('type' => 'int', 'precision' => 4, 'nullable' => True), 207 'newlid' => array('type' => 'varchar', 'precision' => 255, 'nullable' => True) 208 ), 209 'pk' => array('oldid'), 210 'fk' => array(), 211 'ix' => array(), 212 'uc' => array() 213 ) 214 ); 215 216 $phpgw_setup->oProc->query("SELECT group_id, group_name FROM groups",__LINE__,__FILE__); 217 while($phpgw_setup->oProc->next_record()) 218 { 219 $old_group_id = $phpgw_setup->oProc->f('group_id'); 220 $old_group_name = $phpgw_setup->oProc->f('group_name'); 221 $group_name = $phpgw_setup->oProc->f('group_name'); 222 while(1) 223 { 224 $new_group_id = mt_rand ($max_group_id, 60000); 225 $db2->query("SELECT account_id FROM phpgw_accounts WHERE account_id=$new_group_id",__LINE__,__FILE__); 226 if(!$db2->num_rows()) { break; } 227 } 228 $db2->query("SELECT account_lid FROM phpgw_accounts WHERE account_lid='$group_name'",__LINE__,__FILE__); 229 if($db2->num_rows()) 230 { 231 $group_name .= '_group'; 232 } 233 $db2->query("INSERT INTO phpgw_accounts(account_id, account_lid, account_pwd, " 234 ."account_firstname, account_lastname, account_lastlogin, " 235 ."account_lastloginfrom, account_lastpwd_change, " 236 ."account_status, account_type) " 237 ."VALUES ($new_group_id,'$group_name','x','','',$old_group_id,NULL,NULL,'A','g')"); 238 239 // insert oldid/newid into temp table (for use by other apps in this version upgrade 240 $db2->query("INSERT INTO phpgw_temp_groupmap (oldid,oldlid,newid,newlid) VALUES ($old_group_id,'$old_group_name',$new_group_id,'$group_name')",__LINE__,__FILE__); 241 242 $db2->query("UPDATE phpgw_acl SET acl_location='$new_group_id' " 243 ."WHERE acl_appname='phpgw_group' AND acl_account_type='u' " 244 ."AND acl_location='$old_group_id'"); 245 $db2->query("UPDATE phpgw_acl SET acl_account=$new_group_id " 246 ."WHERE acl_location='run' AND acl_account_type='g' " 247 ."AND acl_account=$old_group_id"); 248 249 $db2->query("SELECT cat_access,cat_id FROM phpgw_categories WHERE cat_access LIKE '%,".$old_group_id.",%'",__LINE__,__FILE__); 250 if($db2->num_rows()) 251 { 252 while($db2->next_record()) 253 { 254 $access = $db2->f('cat_access'); 255 $id = $db2->f('cat_id'); 256 $access = str_replace(','.$old_group_id.',' , ','.$new_group_id.',' , $access); 257 $db3->query("UPDATE phpgw_categories SET cat_access='".$access."' WHERE cat_id=".$id,__LINE__,__FILE__); 258 } 259 } 260 } 261 262 $phpgw_setup->oProc->DropTable('groups'); 263 264 /* Moved back from addressbook */ 265 $phpgw_setup->oProc->query('SELECT oldid,newid FROM phpgw_temp_groupmap',__LINE__,__FILE__); 266 if($phpgw_setup->oProc->num_rows()) 267 { 268 while($phpgw_setup->oProc->next_record()) 269 { 270 $old_group_id = $phpgw_setup->oProc->f(0); 271 $new_group_id = $phpgw_setup->oProc->f(1); 272 $db2->query("SELECT ab_access,ab_id FROM addressbook WHERE ab_access LIKE '%,".$old_group_id.",%'",__LINE__,__FILE__); 273 if($db2->num_rows()) 274 { 275 while($db2->next_record()) 276 { 277 $access = $db2->f('cat_access'); 278 $id = $db2->f('cat_id'); 279 $access = str_replace(','.$old_group_id.',' , ','.$new_group_id.',' , $access); 280 $db3->query("UPDATE phpgw_categories SET cat_access='".$access."' WHERE cat_id=".$id,__LINE__,__FILE__); 281 } 282 } 283 } 284 } 285 286 $setup_info['phpgwapi']['currentver'] = '0.9.10pre5'; 287 return $setup_info['phpgwapi']['currentver']; 288 //return True; 289 } 290 291 $test[] = '0.9.10pre5'; 292 function phpgwapi_upgrade0_9_10pre5() 293 { 294 global $setup_info, $phpgw_setup; 295 296 /* This is only temp data, so we can kill it. */ 297 $phpgw_setup->oProc->DropTable('phpgw_app_sessions'); 298 $phpgw_setup->oProc->CreateTable( 299 'phpgw_app_sessions', array( 300 'fd' => array( 301 'sessionid' => array('type' => 'varchar', 'precision' => 255, 'nullable' => False), 302 'loginid' => array('type' => 'varchar', 'precision' => 20), 303 'location' => array('type' => 'varchar', 'precision' => 255), 304 'app' => array('type' => 'varchar', 'precision' => 20), 305 'content' => array('type' => 'text') 306 ), 307 'pk' => array(), 308 'fk' => array(), 309 'ix' => array(), 310 'uc' => array() 311 ) 312 ); 313 314 $setup_info['phpgwapi']['currentver'] = '0.9.10pre6'; 315 return $setup_info['phpgwapi']['currentver']; 316 //return True; 317 } 318 319 $test[] = '0.9.10pre6'; 320 function phpgwapi_upgrade0_9_10pre6() 321 { 322 global $setup_info, $phpgw_setup; 323 324 $phpgw_setup->oProc->RenameTable('config','phpgw_config'); 325 326 $setup_info['phpgwapi']['currentver'] = '0.9.10pre7'; 327 return $setup_info['phpgwapi']['currentver']; 328 //return True; 329 } 330 331 $test[] = '0.9.10pre7'; 332 function phpgwapi_upgrade0_9_10pre7() 333 { 334 global $setup_info, $phpgw_setup; 335 336 $phpgw_setup->oProc->RenameTable('applications','phpgw_applications'); 337 338 $setup_info['phpgwapi']['currentver'] = '0.9.10pre8'; 339 return $setup_info['phpgwapi']['currentver']; 340 //return True; 341 } 342 343 $test[] = '0.9.10pre8'; 344 function phpgwapi_upgrade0_9_10pre8() 345 { 346 global $setup_info, $phpgw_setup; 347 348 $phpgw_setup->oProc->RenameColumn('phpgw_sessions', 'session_info', 'session_action'); 349 $phpgw_setup->oProc->AlterColumn('phpgw_sessions', 'session_action', array('type' => 'varchar', 'precision' => '255')); 350 351 $setup_info['phpgwapi']['currentver'] = '0.9.10pre9'; 352 return $setup_info['phpgwapi']['currentver']; 353 //return True; 354 } 355 356 $test[] = '0.9.10pre9'; 357 function phpgwapi_upgrade0_9_10pre9() 358 { 359 global $setup_info, $phpgw_setup; 360 361 $phpgw_setup->oProc->RenameTable('preferences','phpgw_preferences'); 362 363 $setup_info['phpgwapi']['currentver'] = '0.9.10pre10'; 364 return $setup_info['phpgwapi']['currentver']; 365 //return True; 366 } 367 368 $test[] = '0.9.10pre10'; 369 function phpgwapi_upgrade0_9_10pre10() 370 { 371 global $setup_info, $phpgw_setup; 372 373 $newtbldef = array( 374 "fd" => array( 375 'acl_appname' => array('type' => 'varchar', 'precision' => 50), 376 'acl_location' => array('type' => 'varchar', 'precision' => 255), 377 'acl_account' => array('type' => 'int', 'precision' => 4), 378 'acl_rights' => array('type' => 'int', 'precision' => 4) 379 ), 380 'pk' => array(), 381 'ix' => array(), 382 'fk' => array(), 383 'uc' => array() 384 ); 385 386 $phpgw_setup->oProc->DropColumn('phpgw_acl',$newtbldef,'acl_account_type'); 387 388 $setup_info['phpgwapi']['currentver'] = '0.9.10pre11'; 389 return $setup_info['phpgwapi']['currentver']; 390 //return True; 391 } 392 393 $test[] = '0.9.10pre11'; 394 function phpgwapi_upgrade0_9_10pre11() 395 { 396 global $setup_info; 397 $setup_info['phpgwapi']['currentver'] = '0.9.10pre12'; 398 return $setup_info['phpgwapi']['currentver']; 399 //return True; 400 } 401 402 $test[] = '0.9.10pre12'; 403 function phpgwapi_upgrade0_9_10pre12() 404 { 405 global $setup_info, $phpgw_setup; 406 407 $db1 = $phpgw_setup->db; 408 409 $phpgw_setup->oProc->CreateTable( 410 'phpgw_addressbook', array( 411 'fd' => array( 412 'id' => array('type' => 'auto', 'nullable' => False), 413 'lid' => array('type' => 'varchar', 'precision' => 32), 414 'tid' => array('type' => 'char', 'precision' => 1), 415 'owner' => array('type' => 'int', 'precision' => 4), 416 'fn' => array('type' => 'varchar', 'precision' => 64), 417 'sound' => array('type' => 'varchar', 'precision' => 64), 418 'org_name' => array('type' => 'varchar', 'precision' => 64), 419 'org_unit' => array('type' => 'varchar', 'precision' => 64), 420 'title' => array('type' => 'varchar', 'precision' => 64), 421 'n_family' => array('type' => 'varchar', 'precision' => 64), 422 'n_given' => array('type' => 'varchar', 'precision' => 64), 423 'n_middle' => array('type' => 'varchar', 'precision' => 64), 424 'n_prefix' => array('type' => 'varchar', 'precision' => 64), 425 'n_suffix' => array('type' => 'varchar', 'precision' => 64), 426 'label' => array('type' => 'text'), 427 'adr_poaddr' => array('type' => 'varchar', 'precision' => 64), 428 'adr_extaddr' => array('type' => 'varchar', 'precision' => 64), 429 'adr_street' => array('type' => 'varchar', 'precision' => 64), 430 'adr_locality' => array('type' => 'varchar', 'precision' => 32), 431 'adr_region' => array('type' => 'varchar', 'precision' => 32), 432 'adr_postalcode' => array('type' => 'varchar', 'precision' => 32), 433 'adr_countryname' => array('type' => 'varchar', 'precision' => 32), 434 'adr_work' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 435 'adr_home' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 436 'adr_parcel' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 437 'adr_postal' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 438 'tz' => array('type' => 'varchar', 'precision' => 8), 439 'geo' => array('type' => 'varchar', 'precision' => 32), 440 'a_tel' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 441 'a_tel_work' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 442 'a_tel_home' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 443 'a_tel_voice' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 444 'a_tel_msg' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 445 'a_tel_fax' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 446 'a_tel_prefer' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 447 'b_tel' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 448 'b_tel_work' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 449 'b_tel_home' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 450 'b_tel_voice' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 451 'b_tel_msg' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 452 'b_tel_fax' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 453 'b_tel_prefer' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 454 'c_tel' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 455 'c_tel_work' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 456 'c_tel_home' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 457 'c_tel_voice' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 458 'c_tel_msg' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 459 'c_tel_fax' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 460 'c_tel_prefer' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 461 'd_emailtype' => array('type' => 'varchar', 'precision' => 32), 462 'd_email' => array('type' => 'varchar', 'precision' => 64), 463 'd_email_work' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False), 464 'd_email_home' => array('type' => 'char', 'precision' => '1', 'default' => 'n', 'nullable' => False) 465 ), 466 'pk' => array('id'), 467 'fk' => array(), 468 'ix' => array(), 469 'uc' => array('id') 470 ) 471 ); 472 473 $phpgw_setup->oProc->CreateTable( 474 'phpgw_addressbook_extra', array( 475 'fd' => array( 476 'contact_id' => array('type' => 'int', 'precision' => 4), 477 'contact_owner' => array('type' => 'int', 'precision' => 4), 478 'contact_name' => array('type' => 'varchar', 'precision' => 255), 479 'contact_value' => array('type' => 'varchar', 'precision' => 255) 480 ), 481 'pk' => array(), 482 'fk' => array(), 483 'ix' => array(), 484 'uc' => array() 485 ) 486 ); 487 488 $phpgw_setup->oProc->query("SELECT * FROM addressbook"); 489 /* echo '<br>numrows: ' . $phpgw_setup->oProc->num_rows; */ 490 491 while ($phpgw_setup->oProc->next_record()) 492 { 493 $fields = $extra = array(); 494 495 $fields['id'] = $phpgw_setup->oProc->f('ab_id'); 496 $fields['owner'] = addslashes($phpgw_setup->oProc->f('ab_owner')); 497 $fields['n_given'] = addslashes($phpgw_setup->oProc->f('ab_firstname')); 498 $fields['n_family'] = addslashes($phpgw_setup->oProc->f('ab_lastname')); 499 $fields['d_email'] = addslashes($phpgw_setup->oProc->f('ab_email')); 500 $fields['b_tel'] = addslashes($phpgw_setup->oProc->f('ab_hphone')); 501 $fields['a_tel'] = addslashes($phpgw_setup->oProc->f('ab_wphone')); 502 $fields['c_tel'] = addslashes($phpgw_setup->oProc->f('ab_fax')); 503 $fields['fn'] = addslashes($phpgw_setup->oProc->f('ab_firstname').' '.$phpgw_setup->oProc->f('ab_lastname')); 504 $fields['a_tel_work'] = 'y'; 505 $fields['b_tel_home'] = 'y'; 506 $fields['c_tel_fax'] = 'y'; 507 $fields['org_name'] = addslashes($phpgw_setup->oProc->f('ab_company')); 508 $fields['title'] = addslashes($phpgw_setup->oProc->f('ab_title')); 509 $fields['adr_street'] = addslashes($phpgw_setup->oProc->f('ab_street')); 510 $fields['adr_locality'] = addslashes($phpgw_setup->oProc->f('ab_city')); 511 $fields['adr_region'] = addslashes($phpgw_setup->oProc->f('ab_state')); 512 $fields['adr_postalcode'] = addslashes($phpgw_setup->oProc->f('ab_zip')); 513 514 $extra['pager'] = $phpgw_setup->oProc->f('ab_pager'); 515 $extra['mphone'] = $phpgw_setup->oProc->f('ab_mphone'); 516 $extra['ophone'] = $phpgw_setup->oProc->f('ab_ophone'); 517 $extra['bday'] = $phpgw_setup->oProc->f('ab_bday'); 518 $extra['notes'] = $phpgw_setup->oProc->f('ab_notes'); 519 $extra['address2'] = $phpgw_setup->oProc->f('ab_address2'); 520 $extra['url'] = $phpgw_setup->oProc->f('ab_url'); 521 522 $sql = "INSERT INTO phpgw_addressbook (org_name,n_given,n_family,fn,d_email,title,a_tel,a_tel_work," 523 . "b_tel,b_tel_home,c_tel,c_tel_fax,adr_street,adr_locality,adr_region,adr_postalcode,owner)" 524 . " VALUES ('".$fields['org_name']."','".$fields['n_given']."','".$fields['n_family']."','" 525 . $fields['fn']."','".$fields['d_email']."','".$fields['title']."','".$fields['a_tel']."','" 526 . $fields['a_tel_work']."','".$fields['b_tel']."','".$fields['b_tel_home']."','" 527 . $fields['c_tel']."','".$fields['c_tel_fax']."','".$fields['adr_street']."','" 528 . $fields['adr_locality']."','".$fields['adr_region']."','".$fields['adr_postalcode']."','" 529 . $fields['owner'] ."')"; 530 531 $db1->query($sql); 532 533 while (list($name,$value) = each($extra)) 534 { 535 $sql = "INSERT INTO phpgw_addressbook_extra VALUES ('".$fields['id']."','" . $fields['owner'] . "','" 536 . addslashes($name) . "','" . addslashes($value) . "')"; 537 $db1->query($sql); 538 } 539 } 540 $setup_info['phpgwapi']['currentver'] = '0.9.10pre13'; 541 return $setup_info['phpgwapi']['currentver']; 542 //return True; 543 // Note we are still leaving the old addressbook table alone here... for third party apps if they need it 544 } 545 546 $test[] = '0.9.10pre13'; 547 function phpgwapi_upgrade0_9_10pre13() 548 { 549 global $setup_info, $phpgw_setup; 550 551 $db1 = $phpgw_setup->db; 552 553 $phpgw_setup->oProc->AddColumn('phpgw_addressbook', 'url', array('type' => 'varchar', 'precision' => 128)); 554 $phpgw_setup->oProc->AddColumn('phpgw_addressbook', 'bday', array('type' => 'varchar', 'precision' => 32)); 555 $phpgw_setup->oProc->AddColumn('phpgw_addressbook', 'note', array('type' => 'text')); 556 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook_extra', 'contact_value', array('type' => 'text')); 557 558 $sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='url'"; 559 $phpgw_setup->oProc->query($sql,__LINE__,__FILE__); 560 561 while($phpgw_setup->oProc->next_record()) 562 { 563 $cid = $phpgw_setup->oProc->f('contact_id'); 564 $cvalu = $phpgw_setup->oProc->f('contact_value'); 565 if ($cid && $cvalu) 566 { 567 $update = "UPDATE phpgw_addressbook SET url='" . $cvalu . "' WHERE id=" . $cid; 568 $db1->query($update); 569 $delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='url'"; 570 $db1->query($delete); 571 } 572 } 573 574 $sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='bday'"; 575 $phpgw_setup->oProc->query($sql,__LINE__,__FILE__); 576 577 while($phpgw_setup->oProc->next_record()) 578 { 579 $cid = $phpgw_setup->oProc->f('contact_id'); 580 $cvalu = $phpgw_setup->oProc->f('contact_value'); 581 if ($cid && $cvalu) 582 { 583 $update = "UPDATE phpgw_addressbook set bday='" . $cvalu . "' WHERE id=" . $cid; 584 $db1->query($update); 585 $delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='bday'"; 586 $db1->query($delete); 587 } 588 } 589 590 $sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='notes'"; 591 $phpgw_setup->oProc->query($sql,__LINE__,__FILE__); 592 593 while($phpgw_setup->oProc->next_record()) 594 { 595 $cid = $phpgw_setup->oProc->f('contact_id'); 596 $cvalu = $phpgw_setup->oProc->f('contact_value'); 597 if ($cvalu) 598 { 599 $update = "UPDATE phpgw_addressbook set note='" . $cvalu . "' WHERE id=" . $cid; 600 $db1->query($update); 601 $delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='notes'"; 602 $db1->query($delete); 603 } 604 } 605 $setup_info['phpgwapi']['currentver'] = '0.9.10pre14'; 606 return $setup_info['phpgwapi']['currentver']; 607 //return True; 608 } 609 610 $test[] = '0.9.10pre14'; 611 function phpgwapi_upgrade0_9_10pre14() 612 { 613 global $setup_info, $phpgw_setup; 614 615 $phpgw_setup->oProc->AddColumn('phpgw_sessions','session_flags', array('type' => 'char', 'precision' => 2)); 616 617 $setup_info['phpgwapi']['currentver'] = '0.9.10pre15'; 618 return $setup_info['phpgwapi']['currentver']; 619 //return True; 620 } 621 622 $test[] = '0.9.10pre15'; 623 function phpgwapi_upgrade0_9_10pre15() 624 { 625 global $setup_info, $phpgw_setup; 626 627 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'adr_work', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 628 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'adr_home', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 629 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'adr_parcel', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 630 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'adr_postal', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 631 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'a_tel_work', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 632 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'a_tel_home', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 633 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'a_tel_voice', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 634 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'a_tel_msg', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 635 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'a_tel_fax', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 636 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'a_tel_prefer', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 637 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'b_tel_work', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 638 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'b_tel_home', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 639 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'b_tel_voice', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 640 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'b_tel_msg', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 641 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'b_tel_fax', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 642 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'b_tel_prefer', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 643 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'c_tel_work', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 644 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'c_tel_home', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 645 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'c_tel_voice', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 646 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'c_tel_msg', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 647 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'c_tel_fax', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 648 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'c_tel_prefer', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 649 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'd_email_work', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 650 $phpgw_setup->oProc->AlterColumn('phpgw_addressbook', 'd_email_home', array('type' => 'char', 'precision' => 1, 'default' => 'n', 'nullable' => False)); 651 652 $setup_info['addressbook']['currentver'] = '0.9.10pre16'; 653 return $setup_info['addressbook']['currentver']; 654 //return True; 655 } 656 657 $test[] = '0.9.10pre16'; 658 function phpgwapi_upgrade0_9_10pre16() 659 { 660 global $setup_info, $phpgw_setup; 661 662 $db1 = $phpgw_setup->db; 663 664 $phpgw_setup->oProc->RenameTable('phpgw_addressbook', 'phpgw_addressbook_old'); 665 $phpgw_setup->oProc->CreateTable( 666 'phpgw_addressbook', array( 667 'fd' => array( 668 'id' => array('type' => 'auto', 'nullable' => False), 669 'lid' => array('type' => 'varchar', 'precision' => 32), 670 'tid' => array('type' => 'char', 'precision' => 1), 671 'owner' => array('type' => 'int', 'precision' => 4), 672 'fn' => array('type' => 'varchar', 'precision' => 64), 673 'n_family' => array('type' => 'varchar', 'precision' => 64), 674 'n_given' => array('type' => 'varchar', 'precision' => 64), 675 'n_middle' => array('type' => 'varchar', 'precision' => 64), 676 'n_prefix' => array('type' => 'varchar', 'precision' => 64), 677 'n_suffix' => array('type' => 'varchar', 'precision' => 64), 678 'sound' => array('type' => 'varchar', 'precision' => 64), 679 'bday' => array('type' => 'varchar', 'precision' => 32), 680 'note' => array('type' => 'text'), 681 'tz' => array('type' => 'varchar', 'precision' => 8), 682 'geo' => array('type' => 'varchar', 'precision' => 32), 683 'url' => array('type' => 'varchar', 'precision' => 128), 684 'org_name' => array('type' => 'varchar', 'precision' => 64), 685 'org_unit' => array('type' => 'varchar', 'precision' => 64), 686 'title' => array('type' => 'varchar', 'precision' => 64), 687 'adr_one_street' => array('type' => 'varchar', 'precision' => 64), 688 'adr_one_locality' => array('type' => 'varchar', 'precision' => 32), 689 'adr_one_region' => array('type' => 'varchar', 'precision' => 32), 690 'adr_one_postalcode' => array('type' => 'varchar', 'precision' => 32), 691 'adr_one_countryname' => array('type' => 'varchar', 'precision' => 32), 692 'adr_one_type' => array('type' => 'varchar', 'precision' => 64), 693 'label' => array('type' => 'text'), 694 'adr_two_street' => array('type' => 'varchar', 'precision' => 64), 695 'adr_two_locality' => array('type' => 'varchar', 'precision' => 32), 696 'adr_two_region' => array('type' => 'varchar', 'precision' => 32), 697 'adr_two_postalcode' => array('type' => 'varchar', 'precision' => 32), 698 'adr_two_type' => array('type' => 'varchar', 'precision' => 64), 699 'tel_work' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 700 'tel_home' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 701 'tel_voice' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 702 'tel_fax' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 703 'tel_msg' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 704 'tel_cell' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 705 'tel_pager' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 706 'tel_bbs' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 707 'tel_modem' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 708 'tel_car' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 709 'tel_isdn' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 710 'tel_video' => array('type' => 'varchar', 'precision' => 40, 'default' => '+1 (000) 000-0000', 'nullable' => False), 711 'tel_prefer' => array('type' => 'varchar', 'precision' => 32), 712 'email' => array('type' => 'varchar', 'precision' => 64), 713 'email_type' => array('type' => 'varchar', 'precision' => 32, 'default' => 'INTERNET'), 714 'email_home' => array('type' => 'varchar', 'precision' => 64), 715 'email_home_type' => array('type' => 'varchar', 'precision' => 32, 'default' => 'INTERNET') 716 ), 717 'pk' => array('id'), 718 'fk' => array(), 719 'ix' => array(), 720 'uc' => array() 721 ) 722 ); 723 724 $phpgw_setup->oProc->query("SELECT * FROM phpgw_addressbook_old"); 725 while ($phpgw_setup->oProc->next_record()) 726 { 727 $fields['id'] = $phpgw_setup->oProc->f("id"); 728 $fields['owner'] = $phpgw_setup->oProc->f("owner"); 729 $fields['n_given'] = $phpgw_setup->oProc->f("firstname"); 730 $fields['n_family'] = $phpgw_setup->oProc->f("lastname"); 731 $fields['email'] = $phpgw_setup->oProc->f("d_email"); 732 $fields['email_type'] = $phpgw_setup->oProc->f("d_emailtype"); 733 $fields['tel_home'] = $phpgw_setup->oProc->f("b_tel"); 734 $fields['tel_work'] = $phpgw_setup->oProc->f("a_tel"); 735 $fields['tel_fax'] = $phpgw_setup->oProc->f("c_tel"); 736 $fields['fn'] = $phpgw_setup->oProc->f("fn"); 737 $fields['org_name'] = $phpgw_setup->oProc->f("org_name"); 738 $fields['title'] = $phpgw_setup->oProc->f("title"); 739 $fields['adr_one_street'] = $phpgw_setup->oProc->f("adr_street"); 740 $fields['adr_one_locality'] = $phpgw_setup->oProc->f("adr_locality"); 741 $fields['adr_one_region'] = $phpgw_setup->oProc->f("adr_region"); 742 $fields['adr_one_postalcode'] = $phpgw_setup->oProc->f("adr_postalcode"); 743 $fields['adr_one_countryname'] = $phpgw_setup->oProc->f("adr_countryname"); 744 $fields['bday'] = $phpgw_setup->oProc->f("bday"); 745 $fields['note'] = $phpgw_setup->oProc->f("note"); 746 $fields['url'] = $phpgw_setup->oProc->f("url"); 747 748 $sql="INSERT INTO phpgw_addressbook (org_name,n_given,n_family,fn,email,email_type,title,tel_work," 749 . "tel_home,tel_fax,adr_one_street,adr_one_locality,adr_one_region,adr_one_postalcode,adr_one_countryname," 750 . "owner,bday,url,note)" 751 . " VALUES ('".$fields["org_name"]."','".$fields["n_given"]."','".$fields["n_family"]."','" 752 . $fields["fn"]."','".$fields["email"]."','".$fields["email_type"]."','".$fields["title"]."','".$fields["tel_work"]."','" 753 . $fields["tel_home"]."','".$fields["tel_fax"] ."','".$fields["adr_one_street"]."','" 754 . $fields["adr_one_locality"]."','".$fields["adr_one_region"]."','".$fields["adr_one_postalcode"]."','" 755 . $fields["adr_one_countryname"]."','".$fields["owner"] ."','".$fields["bday"]."','".$fields["url"]."','".$fields["note"]."')"; 756 757 $db1->query($sql,__LINE__,__FILE__); 758 } 759 760 $phpgw_setup->oProc->query("DROP TABLE phpgw_addressbook_old"); 761 762 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_home='' WHERE tel_home='n' OR tel_home='y'"); 763 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_work='' WHERE tel_work='n' OR tel_work='y'"); 764 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_cell='' WHERE tel_cell='n' OR tel_cell='y'"); 765 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_voice='' WHERE tel_voice='n' OR tel_voice='y'"); 766 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_fax='' WHERE tel_fax='n' OR tel_fax='y'"); 767 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_car='' WHERE tel_car='n' OR tel_car='y'"); 768 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_pager='' WHERE tel_pager='n' OR tel_pager='y'"); 769 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_msg='' WHERE tel_msg='n' OR tel_msg='y'"); 770 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_bbs='' WHERE tel_bbs='n' OR tel_bbs='y'"); 771 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_modem='' WHERE tel_modem='n' OR tel_modem='y'"); 772 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_prefer='' WHERE tel_prefer='n' OR tel_prefer='y'"); 773 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_video='' WHERE tel_video='n' OR tel_video='y'"); 774 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tel_isdn='' WHERE tel_isdn='n' OR tel_isdn='y'"); 775 776 $sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='mphone'"; 777 $phpgw_setup->oProc->query($sql,__LINE__,__FILE__); 778 779 while($phpgw_setup->oProc->next_record()) 780 { 781 $cid = $phpgw_setup->oProc->f('contact_id'); 782 $cvalu = $phpgw_setup->oProc->f('contact_value'); 783 if ($cvalu) 784 { 785 $update = "UPDATE phpgw_addressbook SET tel_cell='" . $cvalu . "' WHERE id=" . $cid; 786 $db1->query($update); 787 $delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='mphone'"; 788 $db1->query($delete); 789 } 790 } 791 $setup_info['phpgwapi']['currentver'] = '0.9.10pre17'; 792 return $setup_info['phpgwapi']['currentver']; 793 //return True; 794 } 795 796 $test[] = '0.9.10pre17'; 797 function phpgwapi_upgrade0_9_10pre17() 798 { 799 global $phpgw_info, $phpgw_setup; 800 801 $phpgw_setup->oProc->AddColumn('phpgw_addressbook','pubkey', array('type' => 'text')); 802 $phpgw_setup->oProc->AddColumn('phpgw_addressbook','adr_two_countryname', array('type' => 'varchar', 'precision' => 32)); 803 804 $setup_info['phpgwapi']['currentver'] = '0.9.10pre18'; 805 return $setup_info['phpgwapi']['currentver']; 806 //return True; 807 } 808 809 $test[] = '0.9.10pre18'; 810 function phpgwapi_upgrade0_9_10pre18() 811 { 812 global $setup_info, $phpgw_setup; 813 814 $phpgw_setup->oProc->CreateTable( 815 'phpgw_nextid', array( 816 'fd' => array( 817 'appname' => array('type' => 'varchar', 'precision' => 25), 818 'id' => array('type' => 'int', 'precision' => 4) 819 ), 820 'pk' => array(), 821 'fk' => array(), 822 'ix' => array(), 823 'uc' => array('appname') 824 ) 825 ); 826 827 $setup_info['phpgwapi']['currentver'] = '0.9.10pre19'; 828 return $setup_info['phpgwapi']['currentver']; 829 //return True; 830 } 831 832 $test[] = '0.9.10pre19'; 833 function phpgwapi_upgrade0_9_10pre19() 834 { 835 global $setup_info, $phpgw_setup; 836 837 $phpgw_setup->oProc->DropTable('phpgw_nextid'); 838 839 $phpgw_setup->oProc->CreateTable( 840 'phpgw_nextid', array( 841 'fd' => array( 842 'appname' => array('type' => 'varchar', 'precision' => 25, 'nullable' => False), 843 'id' => array('type' => 'int', 'precision' => 4) 844 ), 845 'pk' => array(), 846 'fk' => array(), 847 'ix' => array(), 848 'uc' => array('appname') 849 ) 850 ); 851 852 $setup_info['phpgwapi']['currentver'] = '0.9.10pre20'; 853 return $setup_info['phpgwapi']['currentver']; 854 //return True; 855 } 856 $test[] = '0.9.10pre20'; 857 function phpgwapi_upgrade0_9_10pre20() 858 { 859 global $setup_info, $phpgw_setup; 860 861 $phpgw_setup->oProc->AddColumn('phpgw_addressbook', 'access', array('type' => 'char', 'precision' => 7)); 862 863 $setup_info['phpgwapi']['currentver'] = '0.9.10pre21'; 864 return $setup_info['phpgwapi']['currentver']; 865 //return True; 866 } 867 868 $test[] = '0.9.10pre21'; 869 function phpgwapi_upgrade0_9_10pre21() 870 { 871 global $setup_info, $phpgw_setup; 872 873 $phpgw_setup->oProc->AddColumn('phpgw_addressbook', 'cat_id', array('type' => 'varchar', 'precision' => 32)); 874 875 $setup_info['phpgwapi']['currentver'] = '0.9.10pre22'; 876 return $setup_info['phpgwapi']['currentver']; 877 //return True; 878 } 879 880 $test[] = '0.9.10pre22'; 881 function phpgwapi_upgrade0_9_10pre22() 882 { 883 global $setup_info; 884 $setup_info['phpgwapi']['currentver'] = '0.9.10pre23'; 885 return $setup_info['phpgwapi']['currentver']; 886 //return True; 887 } 888 889 $test[] = '0.9.10pre23'; 890 function phpgwapi_upgrade0_9_10pre23() 891 { 892 global $setup_info, $phpgw_setup; 893 894 $phpgw_setup->oProc->query("UPDATE phpgw_addressbook SET tid='n' WHERE tid is null"); 895 896 $setup_info['phpgwapi']['currentver'] = '0.9.10pre24'; 897 return $setup_info['phpgwapi']['currentver']; 898 //return True; 899 } 900 901 $test[] = '0.9.10pre24'; 902 function phpgwapi_upgrade0_9_10pre24() 903 { 904 global $setup_info, $phpgw_setup; 905 906 $phpgw_setup->oProc->AlterColumn('phpgw_categories','cat_access', array('type' => 'char', 'precision' => 7)); 907 908 $setup_info['phpgwapi']['currentver'] = '0.9.10pre25'; 909 return $setup_info['phpgwapi']['currentver']; 910 //return True; 911 } 912 913 $test[] = '0.9.10pre25'; 914 function phpgwapi_upgrade0_9_10pre25() 915 { 916 global $setup_info, $phpgw_setup; 917 918 $phpgw_setup->oProc->AddColumn('phpgw_app_sessions','session_dla', array('type' => 'int', 'precision' => 4)); 919 920 $setup_info['phpgwapi']['currentver'] = '0.9.10pre26'; 921 return $setup_info['phpgwapi']['currentver']; 922 //return True; 923 } 924 925 $test[] = '0.9.10pre26'; 926 function phpgwapi_upgrade0_9_10pre26() 927 { 928 global $setup_info; 929 $setup_info['phpgwapi']['currentver'] = '0.9.10pre27'; 930 return $setup_info['phpgwapi']['currentver']; 931 //return True; 932 } 933 934 $test[] = '0.9.10pre27'; 935 function phpgwapi_upgrade0_9_10pre27() 936 { 937 global $setup_info, $phpgw_setup; 938 939 $phpgw_setup->oProc->AlterColumn('phpgw_app_sessions', 'content', array('type' => 'longtext')); 940 941 $setup_info['phpgwapi']['currentver'] = '0.9.10pre28'; 942 return $setup_info['phpgwapi']['currentver']; 943 //return True; 944 } 945 946 $test[] = '0.9.10pre28'; 947 function phpgwapi_upgrade0_9_10pre28() 948 { 949 global $setup_info; 950 $setup_info['phpgwapi']['currentver'] = '0.9.10'; 951 return $setup_info['phpgwapi']['currentver']; 952 //return True; 953 } 954 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |