diff --git a/setup/config.php b/setup/config.php index 1a7fb75f08..1ff2258279 100644 --- a/setup/config.php +++ b/setup/config.php @@ -17,11 +17,11 @@ // Authorize the user to use setup app and load the database // Does not return unless user is authorized - if (!auth()){ + if (!$phpgw_setup->auth()){ Header("Location: index.php"); exit; } - loaddb(); + $phpgw_setup->loaddb(); /* Guessing default paths. */ $current_config["files_dir"] = ereg_replace("/setup","/files",dirname($SCRIPT_FILENAME)); @@ -32,19 +32,19 @@ } if ($submit) { - @$db->query("delete from config"); + @$phpgw_setup->db->query("delete from config"); while ($newsetting = each($newsettings)) { if ($newsetting[0] == "nntp_server") { - $db->query("select config_value FROM config WHERE config_name='nntp_server'"); - if ($db->num_rows()) { - $db->next_record(); - if ($db->f("config_value") <> $newsetting[1]) { - $db->query("DELETE FROM newsgroups"); - $db->query("DELETE FROM users_newsgroups"); + $phpgw_setup->db->query("select config_value FROM config WHERE config_name='nntp_server'"); + if ($phpgw_setup->db->num_rows()) { + $phpgw_setup->db->next_record(); + if ($phpgw_setup->db->f("config_value") <> $newsetting[1]) { + $phpgw_setup->db->query("DELETE FROM newsgroups"); + $phpgw_setup->db->query("DELETE FROM users_newsgroups"); } } } - $db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0]) + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0]) . "','" . addslashes($newsetting[1]) . "')"); } if ($newsettings["auth_type"] == "ldap") { @@ -58,12 +58,12 @@ } if ($newsettings["auth_type"] != "ldap") { - show_header("Configuration"); + $phpgw_setup->show_header("Configuration"); } - @$db->query("select * from config"); - while (@$db->next_record()) { - $current_config[$db->f("config_name")] = $db->f("config_value"); + @$phpgw_setup->db->query("select * from config"); + while (@$phpgw_setup->db->next_record()) { + $current_config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value"); } if ($current_config["files_dir"] == "/path/to/dir/phpgroupware/files") { diff --git a/setup/createheader.php b/setup/createheader.php index 376d3a83e1..6598cd5856 100644 --- a/setup/createheader.php +++ b/setup/createheader.php @@ -8,34 +8,34 @@ header("Content-type: application/octet-stream"); header("Pragma: no-cache"); header("Expires: 0"); - $newheader = generate_header(); + $newheader = $phpgw_setup->generate_header(); echo $newheader; break; case "view": - show_header("Generated header.inc.php"); + $phpgw_setup->show_header("Generated header.inc.php"); echo "
Save this text as contents of your header.inc.php

"; - $newheader = generate_header(); + $newheader = $phpgw_setup->generate_header(); echo "
";
       echo htmlentities($newheader);
       echo "
"; break; case "write config": if(is_writeable ("../header.inc.php")|| (!file_exists ("../header.inc.php") && is_writeable ("../"))){ - show_header("Saved header.inc.php"); - $newheader = generate_header(); + $phpgw_setup->show_header("Saved header.inc.php"); + $newheader = $phpgw_setup->generate_header(); $fsetup = fopen("../header.inc.php","w"); fwrite($fsetup,$newheader); fclose($fsetup); echo "Created header.inc.php!
"; }else{ - show_header("Error generating header.inc.php"); + $phpgw_setup->show_header("Error generating header.inc.php"); echo "Could not open header.inc.php for writing!
\n"; echo "Please check read/write permissions on directories or back up and use another option.
"; echo ""; } break; default: - show_header("Create/Edit your header.inc.php"); + $phpgw_setup->show_header("Create/Edit your header.inc.php"); echo '\n"; - echo " \n"; - echo " \n"; - } - */ - } - - function setup_header($title = "",$nologoutbutton = False) { - global $phpgw_info, $PHP_SELF, $dontshowtheheaderagain; - - // Ok, so it isn't the greatest idea, but it works for now. Setup needs to be rewritten. - if ($dontshowtheheaderagain) { - return False; - } - - $dontshowtheheaderagain = True; - ?> - - - phpGroupWare setup <?php echo $title; ?> - - - -
Analysis
'; diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index b60161819e..d16af85341 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -10,6 +10,8 @@ \**************************************************************************/ /* $Id$ */ + + /* ######## Start security check ########## */ $d1 = strtolower(substr($phpgw_info["server"]["api_inc"],0,3)); $d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3)); $d3 = strtolower(substr($phpgw_info["server"]["app_inc"],0,3)); @@ -17,6 +19,7 @@ echo "Failed attempt to break in via an old Security Hole!
\n"; exit; } unset($d1);unset($d2);unset($d3); + /* ######## End security check ########## */ // Include to check user authorization against the // password in ../header.inc.php to protect all of the setup @@ -30,291 +33,10 @@ $phpgw_info["server"]["app_images"] = "templates/default/images"; - function show_header($title = "",$nologoutbutton = False) - { - global $phpgw_info, $PHP_SELF; - echo ' - - - phpGroupWare Setup'; - if ($title != ""){echo " - ".$title;} - echo' - - - - - - -
 phpGroupWare version '.$phpgw_info["server"]["versions"]["phpgwapi"].' setup - '; - if ($nologoutbutton) { - echo " "; - } else { - echo 'Logout '; - } - echo "
"; - } - function loginForm($err="") - { - global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF; - echo "

\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - if ($err != "") { - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; - echo "
 Setup Login
".$err."
\n"; - if (count($phpgw_domain) > 1){ - echo " \n"; - echo "
Domain:
Password:
\n"; - }else{ - reset($phpgw_domain); - $default_domain = each($phpgw_domain); - echo " \n"; - echo " \n"; - } - echo " \n"; - echo "
\n"; - echo "\n"; - } - - function check_header() - { - global $phpgw_domain, $phpgw_info, $stage, $header_msg; - if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) { - $stage = 1.1; - $header_msg = "Stage One"; - }else{ - include("../header.inc.php"); - if (!isset($phpgw_domain) || $phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]) { - $stage = 1.2; - $header_msg = "Stage One (Upgrade your header.inc.php)"; - }else{ /* header.inc.php part settled. Moving to authentication */ - $stage = 1.3; - $header_msg = "Stage One (Completed)"; - } - } - } - - function generate_header(){ - Global $SCRIPT_FILENAME, $HTTP_POST_VARS, $k, $v; - $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); - if($ftemplate){ - $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); - $template = fread($ftemplate,filesize(dirname($SCRIPT_FILENAME)."/../header.inc.php.template")); - fclose($ftemplate); - while(list($k,$v) = each($HTTP_POST_VARS)) { - $template = ereg_replace("__".strtoupper($k)."__",$v,$template); - } - return $template; - }else{ - echo "Could not open the header template for reading!
"; - exit; - } - } - - function auth() - { - global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $db, $HTTP_POST_VARS, $login_msg; - if (isset($FormLogout)) { - setcookie("SetupPW"); // scrub the old one - setcookie("SetupDomain"); // scrub the old one - $login_msg = "You have sucessfully logged out"; - return False; - } elseif (isset($SetupPW)) { - if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) { - setcookie("SetupPW"); // scrub the old one - setcookie("SetupDomain"); // scrub the old one - $login_msg = "Invalid session cookie (cookies must be enabled)"; - return False; - }else{ - return True; - } - } elseif (isset($FormPW)) { - if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) { - setcookie("SetupPW",$FormPW); - setcookie("SetupDomain",$FormDomain); - $SetupDomain = $FormDomain; - return True; - }else{ - $login_msg = "Invalid password"; - return False; - } - } else { - return False; - } - } - - function loaddb() - { - global $phpgw_info, $phpgw_domain, $SetupDomain, $db; - /* Database setup */ - if (!isset($phpgw_info["server"]["api_inc"])) { - $phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["server_root"]."/phpgwapi/inc"; - } - include($phpgw_info["server"]["api_inc"] . "/phpgw_db_".$phpgw_domain[$SetupDomain]["db_type"].".inc.php"); - $db = new db; - $db->Host = $phpgw_domain[$SetupDomain]["db_host"]; - $db->Type = $phpgw_domain[$SetupDomain]["db_type"]; - $db->Database = $phpgw_domain[$SetupDomain]["db_name"]; - $db->User = $phpgw_domain[$SetupDomain]["db_user"]; - $db->Password = $phpgw_domain[$SetupDomain]["db_pass"]; - } - - function check_db() - { - global $phpgw_info, $oldversion, $db, $stage, $header_msg; - $db->Halt_On_Error = "no"; - $tables = $db->table_names(); - if (is_array($tables) && count($tables) > 0){ - /* tables exists. checking for post beta version */ - $db->query("select app_version from applications where app_name='admin'"); - $db->next_record(); - $oldversion = $db->f("app_version"); - if (isset($oldversion)){ - if ($oldversion == $phpgw_info["server"]["versions"]["phpgwapi"]){ - $db->query("select config_value from config where config_name='freshinstall'"); - $db->next_record(); - $configed = $db->f("config_value"); - if ($configed){ - $stage = 3.1; - $header_msg = "Stage 3 (Needs Configuration)"; - }else{ - $stage = 3.2; - $header_msg = "Stage 3 (Configuration OK)"; - } - }else{ - $stage = 2.4; - $header_msg = "Stage 2 (Tables need upgrading)"; - } - }else{ - $stage = 2.2; - $header_msg = "Stage 2 (Tables appear to be pre-beta)"; - } - }else{ - /* no tables, so checking if we can create them */ - - /* I cannot get either to work properly - $isdb = $db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3"); - */ - - $db_rights = $db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )"); - - if (isset($db_rights)){ - //if (isset($isdb)){ - $stage = 2.3; - $header_msg = "Stage 2 (Create tables)"; - }else{ - $stage = 2.1; - $header_msg = "Stage 2 (Create Database)"; - } - $db->query("DROP TABLE phpgw_testrights"); - } - } - - function app_setups($appname = ""){ - global $phpgw_info; - $d = dir($phpgw_info["server"]["server_root"]); - while($entry=$d->read()) { - if (is_dir ($phpgw_info["server"]["server_root"]."/".$entry."/setup")){ - echo $entry."
\n"; - } - } - $d->close(); - } - - function execute_script($script, $appname = ""){ - global $phpgw_info, $currentver, $oldversion, $phpgw_domain, $db; - if ($appname == ""){ - $d = dir($phpgw_info["server"]["server_root"]); - while($entry=$d->read()) { - $f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/".$script.".inc.php"; - if (file_exists ($f)){include($f);} - } - $d->close(); - }else{ - $f = $phpgw_info["server"]["server_root"]."/".$appname."/setup/".$script.".inc.php"; - if (file_exists ($f)){include($f);} - } - } - - function update_app_version($appname, $tableschanged = True){ - global $currentver, $phpgw_info, $db, $tablechanges; - if ($tableschanged == True){$tablechanges = True;} - $db->query("update applications set app_version='".$currentver."' where app_name='".$appname."'"); - } - - function manage_tables(){ - global $currentver, $tablechanges, $phpgw_domain, $phpgw_info, $db; - if ($currentver == "drop"){ - execute_script("droptables"); - } - if ($currentver == "new") { - execute_script("newtables"); - execute_script("common_default_records"); - execute_script("lang"); - } - - if ($currentver == "oldversion") { - $currentver = $oldversion; - execute_script("upgradetables"); - } - - /* Not yet implemented - if (!$tablechanges == True){ - echo "

No table changes were needed. The script only updated your version setting.
- - -
 phpGroupWare version setup - - Logout '; - } - - echo "
"; - } - + include("./inc/phpgw_setup.inc.php"); include("./inc/phpgw_schema_proc.inc.php"); -// $phpgw_schema_proc = new phpgw_schema_proc($phpgw_domain[$SetupDomain]["db_type"]); - $phpgw_schema_proc = new phpgw_schema_proc("mysql"); + include("./inc/phpgw_template.inc.php"); -?> + $phpgw_setup = new phpgw_setup; + $phpgw_setup->template = new Template("../"); +?> \ No newline at end of file diff --git a/setup/inc/phpgw_setup.inc.php b/setup/inc/phpgw_setup.inc.php new file mode 100644 index 0000000000..13ff27d304 --- /dev/null +++ b/setup/inc/phpgw_setup.inc.php @@ -0,0 +1,361 @@ + + + phpGroupWare Setup'; + if ($title != ""){echo " - ".$title;} + echo' + + + + + + +
 phpGroupWare version '.$phpgw_info["server"]["versions"]["phpgwapi"].' setup + '; + if ($nologoutbutton) { + echo " "; + } else { + echo 'Logout '; + } + echo "
"; + } + function loginForm($err="") + { + global $phpgw_info, $phpgw_domain, $SetupDomain, $SetupPW, $PHP_SELF; + echo "

\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + if ($err != "") { + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + + echo " \n"; + echo " \n"; + echo " \n"; + if ($err != "") { + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + + echo "
 Setup/Config Admin Login
".$err."
\n"; + if (count($phpgw_domain) > 1){ + echo " \n"; + echo "
Domain:
Password:
\n"; + }else{ + reset($phpgw_domain); + $default_domain = each($phpgw_domain); + echo " \n"; + echo " \n"; + } + echo " \n"; + echo "
 Header Admin Login
".$err."
\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo "\n"; + } + + function check_header() + { + global $phpgw_domain, $phpgw_info; + if(!file_exists("../header.inc.php") || !is_file("../header.inc.php")) { + $phpgw_info["setup"]["stage"] = 1.1; + $phpgw_info["setup"]["header_msg"] = "Stage One"; + }else{ + include("../header.inc.php"); + if (!isset($phpgw_domain) || $phpgw_info["server"]["versions"]["header"] != $phpgw_info["server"]["versions"]["current_header"]) { + $phpgw_info["setup"]["stage"] = 1.2; + $phpgw_info["setup"]["header_msg"] = "Stage One (Upgrade your header.inc.php)"; + }else{ /* header.inc.php part settled. Moving to authentication */ + $phpgw_info["setup"]["stage"] = 1.3; + $phpgw_info["setup"]["header_msg"] = "Stage One (Completed)"; + } + } + } + + function generate_header(){ + global $SCRIPT_FILENAME, $HTTP_POST_VARS, $k, $v; + $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); + if($ftemplate){ + $ftemplate = fopen(dirname($SCRIPT_FILENAME)."/../header.inc.php.template","r"); + $template = fread($ftemplate,filesize(dirname($SCRIPT_FILENAME)."/../header.inc.php.template")); + fclose($ftemplate); + while(list($k,$v) = each($HTTP_POST_VARS)) { + $template = ereg_replace("__".strtoupper($k)."__",$v,$template); + } + return $template; + }else{ + echo "Could not open the header template for reading!
"; + exit; + } + } + + function config_auth() + { + global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $HTTP_POST_VARS, $login_msg; + if (isset($FormLogout)) { + setcookie("SetupPW"); // scrub the old one + setcookie("SetupDomain"); // scrub the old one + $login_msg = "You have sucessfully logged out"; + return False; + } elseif (isset($SetupPW)) { + if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) { + setcookie("SetupPW"); // scrub the old one + setcookie("SetupDomain"); // scrub the old one + $login_msg = "Invalid session cookie (cookies must be enabled)"; + return False; + }else{ + return True; + } + } elseif (isset($FormPW)) { + if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) { + setcookie("SetupPW",$FormPW); + setcookie("SetupDomain",$FormDomain); + $SetupDomain = $FormDomain; + return True; + }else{ + $login_msg = "Invalid password"; + return False; + } + } else { + return False; + } + } + + function header_auth() + { + global $phpgw_domain, $FormLogout, $FormDomain, $FormPW, $SetupPW, $SetupDomain, $HTTP_POST_VARS, $login_msg; + if (isset($FormLogout)) { + setcookie("SetupPW"); // scrub the old one + setcookie("SetupDomain"); // scrub the old one + $login_msg = "You have sucessfully logged out"; + return False; + } elseif (isset($SetupPW)) { + if ($SetupPW != $phpgw_domain[$SetupDomain]["config_passwd"]) { + setcookie("SetupPW"); // scrub the old one + setcookie("SetupDomain"); // scrub the old one + $login_msg = "Invalid session cookie (cookies must be enabled)"; + return False; + }else{ + return True; + } + } elseif (isset($FormPW)) { + if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"]) { + setcookie("SetupPW",$FormPW); + setcookie("SetupDomain",$FormDomain); + $SetupDomain = $FormDomain; + return True; + }else{ + $login_msg = "Invalid password"; + return False; + } + } else { + return False; + } + } + + + function loaddb() + { + global $phpgw_info, $phpgw_domain, $SetupDomain; + /* Database setup */ + if (!isset($phpgw_info["server"]["api_inc"])) { + $phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["server_root"]."/phpgwapi/inc"; + } + include($phpgw_info["server"]["api_inc"] . "/phpgw_db_".$phpgw_domain[$SetupDomain]["db_type"].".inc.php"); + $this->db = new db; + $this->db->Host = $phpgw_domain[$SetupDomain]["db_host"]; + $this->db->Type = $phpgw_domain[$SetupDomain]["db_type"]; + $this->db->Database = $phpgw_domain[$SetupDomain]["db_name"]; + $this->db->User = $phpgw_domain[$SetupDomain]["db_user"]; + $this->db->Password = $phpgw_domain[$SetupDomain]["db_pass"]; + + $phpgw_schema_proc = new phpgw_schema_proc($phpgw_domain[$SetupDomain]["db_type"]); + } + + function check_db() + { + global $phpgw_info; + $this->db->Halt_On_Error = "no"; + $tables = $this->db->table_names(); + if (is_array($tables) && count($tables) > 0){ + /* tables exists. checking for post beta version */ + $this->db->query("select * from applications"); + while (@$this->db->next_record()) { + if ($this->db->f("app_name") == "admin"){$phpgw_info["setup"]["oldver"]["phpgwapi"] = $this->db->f("app_version");} + $phpgw_info["setup"]["oldver"][$this->db->f("app_name")] = $this->db->f("app_version"); + $phpgw_info["setup"][$this->db->f("app_name")]["title"] = $this->db->f("app_title"); + } + if (isset($phpgw_info["setup"]["oldver"]["phpgwapi"])){ + if ($phpgw_info["setup"]["oldver"]["phpgwapi"] == $phpgw_info["server"]["versions"]["phpgwapi"]){ + $this->db->query("select config_value from config where config_name='freshinstall'"); + $this->db->next_record(); + $configed = $this->db->f("config_value"); + if ($configed){ + $phpgw_info["setup"]["stage"] = 3.1; + $phpgw_info["setup"]["header_msg"] = "Stage 3 (Needs Configuration)"; + }else{ + $phpgw_info["setup"]["stage"] = 3.2; + $phpgw_info["setup"]["header_msg"] = "Stage 3 (Configuration OK)"; + } + }else{ + $phpgw_info["setup"]["stage"] = 2.4; + $phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables need upgrading)"; + } + }else{ + $phpgw_info["setup"]["stage"] = 2.2; + $phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables appear to be pre-beta)"; + } + }else{ + /* no tables, so checking if we can create them */ + + /* I cannot get either to work properly + $isdb = $this->db->connect("kljkjh", "localhost", "phpgroupware", "phpgr0upwar3"); + */ + + $db_rights = $this->db->query("CREATE TABLE phpgw_testrights ( testfield varchar(5) NOT NULL )"); + + if (isset($db_rights)){ + //if (isset($isdb)){ + $phpgw_info["setup"]["stage"] = 2.3; + $phpgw_info["setup"]["header_msg"] = "Stage 2 (Create tables)"; + }else{ + $phpgw_info["setup"]["stage"] = 2.1; + $phpgw_info["setup"]["header_msg"] = "Stage 2 (Create Database)"; + } + $this->db->query("DROP TABLE phpgw_testrights"); + } + } + + function app_setups($appname = ""){ + global $phpgw_info; + $d = dir($phpgw_info["server"]["server_root"]); + while($entry=$d->read()) { + if (is_dir ($phpgw_info["server"]["server_root"]."/".$entry."/setup")){ + echo $entry."
\n"; + } + } + $d->close(); + } + + function execute_script($script, $appname = ""){ + global $phpgw_info, $phpgw_domain; + if ($appname == ""){ + $d = dir($phpgw_info["server"]["server_root"]); + while($entry=$d->read()) { + $f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/version.inc.php"; + if (file_exists ($f)){ + include($f); + }else{ + $phpgw_info["server"]["versions"][$entry] = $phpgw_info["setup"]["currentver"]["phpgwapi"]; + } + + $f = $phpgw_info["server"]["server_root"]."/".$entry."/setup/".$script.".inc.php"; + if (file_exists ($f)){include($f);} + } + $d->close(); + }else{ + $f = $phpgw_info["server"]["server_root"]."/".$appname."/setup/".$script.".inc.php"; + if (file_exists ($f)){include($f);} + } + } + + function update_app_version($appname, $tableschanged = True){ + global $phpgw_info; + if ($tableschanged == True){$phpgw_info["setup"]["tableschanged"] = True;} + $this->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where app_name='".$appname."'"); + } + + function manage_tables(){ + global $phpgw_domain, $phpgw_info; + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "drop"){ + $this->execute_script("droptables"); + } + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "new") { + $this->execute_script("newtables"); + $this->execute_script("common_default_records"); + $this->execute_script("lang"); + } + + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "oldversion") { + $phpgw_info["setup"]["currentver"]["phpgwapi"] = $phpgw_info["setup"]["oldver"]["phpgwapi"]; + $this->execute_script("upgradetables"); + } + + /* Not yet implemented + if (!$phpgw_info["setup"]["tableschanged"] == True){ + echo " \n"; + echo " No table changes were needed. The script only updated your version setting.\n"; + echo " \n"; + } + */ + } + + function setup_header($title = "",$nologoutbutton = False) { + global $phpgw_info, $PHP_SELF; + + // Ok, so it isn't the greatest idea, but it works for now. Setup needs to be rewritten. + if ($phpgw_info["setup"]["dontshowtheheaderagain"]) { + return False; + } + + $phpgw_info["setup"]["dontshowtheheaderagain"] = True; + ?> + + + phpGroupWare setup <?php echo $title; ?> + + + + + + +
 phpGroupWare version setup + + Logout '; + } + + echo "
"; + } + } +?> \ No newline at end of file diff --git a/setup/inc/phpgw_template.inc.php b/setup/inc/phpgw_template.inc.php new file mode 100644 index 0000000000..40f4a17290 --- /dev/null +++ b/setup/inc/phpgw_template.inc.php @@ -0,0 +1,346 @@ + remove undefined variables + * "comment" => replace undefined variables with comments + * "keep" => keep undefined variables + */ + var $unknowns = "remove"; + + /* "yes" => halt, "report" => report error, continue, "no" => ignore error quietly */ + var $halt_on_error = "yes"; + + /* last error message is retained here */ + var $last_error = ""; + + + /***************************************************************************/ + /* public: Constructor. + * root: template directory. + * unknowns: how to handle unknown variables. + */ + function Template($root = ".", $unknowns = "remove") { + $this->set_root($root); + $this->set_unknowns($unknowns); + } + + /* public: setroot(pathname $root) + * root: new template directory. + */ + function set_root($root) { + if (!is_dir($root)) { + $this->halt("set_root: $root is not a directory."); + return false; + } + + $this->root = $root; + return true; + } + + /* public: set_unknowns(enum $unknowns) + * unknowns: "remove", "comment", "keep" + * + */ + function set_unknowns($unknowns = "keep") { + $this->unknowns = $unknowns; + } + + /* public: set_file(array $filelist) + * filelist: array of handle, filename pairs. + * + * public: set_file(string $handle, string $filename) + * handle: handle for a filename, + * filename: name of template file + */ + function set_file($handle, $filename = "") { + if (!is_array($handle)) { + if ($filename == "") { + $this->halt("set_file: For handle $handle filename is empty."); + return false; + } + $this->file[$handle] = $this->filename($filename); + } else { + reset($handle); + while(list($h, $f) = each($handle)) { + $this->file[$h] = $this->filename($f); + } + } + } + + /* public: set_block(string $parent, string $handle, string $name = "") + * extract the template $handle from $parent, + * place variable {$name} instead. + */ + function set_block($parent, $handle, $name = "") { + if (!$this->loadfile($parent)) { + $this->halt("subst: unable to load $parent."); + return false; + } + if ($name == "") + $name = $handle; + + $str = $this->get_var($parent); + $reg = "/(.*)\n\s*/sm"; + preg_match_all($reg, $str, $m); + $str = preg_replace($reg, "{" . "$name}", $str); + $this->set_var($handle, $m[1][0]); + $this->set_var($parent, $str); + } + + /* public: set_var(array $values) + * values: array of variable name, value pairs. + * + * public: set_var(string $varname, string $value) + * varname: name of a variable that is to be defined + * value: value of that variable + */ + function set_var($varname, $value = "") { + if (!is_array($varname)) { + if (!empty($varname)) + if ($this->debug) print "scalar: set *$varname* to *$value*
\n"; + $this->varkeys[$varname] = "/".$this->varname($varname)."/"; + $this->varvals[$varname] = $value; + } else { + reset($varname); + while(list($k, $v) = each($varname)) { + if (!empty($k)) + if ($this->debug) print "array: set *$k* to *$v*
\n"; + $this->varkeys[$k] = "/".$this->varname($k)."/"; + $this->varvals[$k] = $v; + } + } + } + + /* public: subst(string $handle) + * handle: handle of template where variables are to be substituted. + */ + function subst($handle) { + if (!$this->loadfile($handle)) { + $this->halt("subst: unable to load $handle."); + return false; + } + + $str = $this->get_var($handle); + $str = @preg_replace($this->varkeys, $this->varvals, $str); + return $str; + } + + /* public: psubst(string $handle) + * handle: handle of template where variables are to be substituted. + */ + function psubst($handle) { + print $this->subst($handle); + + return false; + } + + /* public: parse(string $target, string $handle, boolean append) + * public: parse(string $target, array $handle, boolean append) + * target: handle of variable to generate + * handle: handle of template to substitute + * append: append to target handle + */ + function parse($target, $handle, $append = false) { + if (!is_array($handle)) { + $str = $this->subst($handle); + if ($append) { + $this->set_var($target, $this->get_var($target) . $str); + } else { + $this->set_var($target, $str); + } + } else { + reset($handle); + while(list($i, $h) = each($handle)) { + $str = $this->subst($h); + $this->set_var($target, $str); + } + } + + return $str; + } + + function pparse($target, $handle, $append = false) { + print $this->parse($target, $handle, $append); + return false; + } + + /* public: get_vars() + */ + function get_vars() { + reset($this->varkeys); + while(list($k, $v) = each($this->varkeys)) { + $result[$k] = $this->varvals[$k]; + } + + return $result; + } + + /* public: get_var(string varname) + * varname: name of variable. + * + * public: get_var(array varname) + * varname: array of variable names + */ + function get_var($varname) { + if (!is_array($varname)) { + return $this->varvals[$varname]; + } else { + reset($varname); + while(list($k, $v) = each($varname)) { + $result[$k] = $this->varvals[$k]; + } + + return $result; + } + } + + /* public: get_undefined($handle) + * handle: handle of a template. + */ + function get_undefined($handle) { + if (!$this->loadfile($handle)) { + $this->halt("get_undefined: unable to load $handle."); + return false; + } + + preg_match_all("/\{([^}]+)\}/", $this->get_var($handle), $m); + $m = $m[1]; + if (!is_array($m)) + return false; + + reset($m); + while(list($k, $v) = each($m)) { + if (!isset($this->varkeys[$v])) + $result[$v] = $v; + } + + if (count($result)) + return $result; + else + return false; + } + + /* public: finish(string $str) + * str: string to finish. + */ + function finish($str) { + switch ($this->unknowns) { + case "keep": + break; + + case "remove": + $str = preg_replace('/{[^ \t\r\n}]+}/', "", $str); + break; + + case "comment": + $str = preg_replace('/{([^ \t\r\n}]+)}/', "", $str); + break; + } + + return $str; + } + + /* public: p(string $varname) + * varname: name of variable to print. + */ + function p($varname) { + print $this->finish($this->get_var($varname)); + } + + function get($varname) { + return $this->finish($this->get_var($varname)); + } + + /***************************************************************************/ + /* private: filename($filename) + * filename: name to be completed. + */ + function filename($filename) { + if (substr($filename, 0, 1) != "/") { + $filename = $this->root."/".$filename; + } + + if (!file_exists($filename)) + $this->halt("filename: file $filename does not exist."); + + return $filename; + } + + /* private: varname($varname) + * varname: name of a replacement variable to be protected. + */ + function varname($varname) { + return preg_quote("{".$varname."}"); + } + + /* private: loadfile(string $handle) + * handle: load file defined by handle, if it is not loaded yet. + */ + function loadfile($handle) { + if (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle])) + return true; + + if (!isset($this->file[$handle])) { + $this->halt("loadfile: $handle is not a valid handle."); + return false; + } + $filename = $this->file[$handle]; + + $str = implode("", @file($filename)); + if (empty($str)) { + $this->halt("loadfile: While loading $handle, $filename does not exist or is empty."); + return false; + } + + $this->set_var($handle, $str); + + return true; + } + + /***************************************************************************/ + /* public: halt(string $msg) + * msg: error message to show. + */ + function halt($msg) { + $this->last_error = $msg; + + if ($this->halt_on_error != "no") + $this->haltmsg($msg); + + if ($this->halt_on_error == "yes") + die("Halted."); + + return false; + } + + /* public, override: haltmsg($msg) + * msg: error message to show. + */ + function haltmsg($msg) { + printf("Template Error: %s
\n", $msg); + } +} diff --git a/setup/index.php b/setup/index.php index 2b4a42f89a..840ba56188 100644 --- a/setup/index.php +++ b/setup/index.php @@ -19,15 +19,15 @@ include("./inc/functions.inc.php"); /* processing and discovery phase */ - check_header(); - if ( $stage >= 1.3){ - if (!auth()){ - show_header("Please login",True); - loginForm($login_msg); + $phpgw_setup->check_header(); + if ( $phpgw_info["setup"]["stage"] >= 1.3){ + if (!$phpgw_setup->config_auth()){ + $phpgw_setup->show_header("Please login",True); + $phpgw_setup->loginForm($login_msg); exit; }else{ /* authentication settled. Moving to the database portion. */ - loaddb(); - check_db(); + $phpgw_setup->loaddb(); + $phpgw_setup->check_db(); } } @@ -36,28 +36,28 @@ $subtitle = "Deleting Tables"; $submsg = "At your request, this script is going to take the evil action of deleting your existing tables and re-creating them in the new format."; $subaction = "deleted"; - $currentver = "drop"; - $stage = 2.5; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "drop"; + $phpgw_info["setup"]["stage"] = 2.5; break; case "Upgrade": $subtitle = "Upgrading Tables"; $submsg = "At your request, this script is going to attempt to upgrade your old tables to the new format."; $subaction = "upgraded"; - $currentver = "oldversion"; - $stage = 2.5; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "oldversion"; + $phpgw_info["setup"]["stage"] = 2.5; break; case "Create": $subtitle = "Creating Tables"; $submsg = "At your request, this script is going to attempt to the tables for you."; $subaction = "created"; - $currentver = "new"; - $stage = 2.5; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "new"; + $phpgw_info["setup"]["stage"] = 2.5; break; } /* Display code */ - show_header($header_msg); + $phpgw_setup->show_header($phpgw_info["setup"]["header_msg"]); if (PHP_VERSION < "3.0.16") { echo "You appear to be running an old version of PHP. It its recommend that you upgrade " . "to a new version. Older version of PHP might not run phpGroupWare correctly, if at all."; @@ -85,20 +85,20 @@ echo ''; echo ' '; - if ($stage == 1.1) { + if ($phpgw_info["setup"]["stage"] == 1.1) { echo ''; - }elseif ($stage == 1.2) { + }elseif ($phpgw_info["setup"]["stage"] == 1.2) { echo ''; - }elseif ($stage >= 1.3) { + }elseif ($phpgw_info["setup"]["stage"] >= 1.3) { echo ''; } echo ' '; - if ($stage < 2.1) { + if ($phpgw_info["setup"]["stage"] < 2.1) { echo ''; - }elseif ($stage == 2.1) { + }elseif ($phpgw_info["setup"]["stage"] == 2.1) { echo ''; - }elseif ($stage == 2.2) { + }elseif ($phpgw_info["setup"]["stage"] == 2.2) { echo ''; - }elseif ($stage == 2.3) { + }elseif ($phpgw_info["setup"]["stage"] == 2.3) { /* commented out because I cannot accuratly figure out if the DB exists */ //echo ''; echo ''; - }elseif ($stage == 2.4) { + }elseif ($phpgw_info["setup"]["stage"] == 2.4) { echo ''; - }elseif ($stage == 2.5) { + }elseif ($phpgw_info["setup"]["stage"] == 2.5) { echo ''; - }elseif ($stage >= 2.6) { + }elseif ($phpgw_info["setup"]["stage"] >= 2.6) { echo ''; } echo ' '; - if ($stage < 3.1) { + if ($phpgw_info["setup"]["stage"] < 3.1) { echo ''; - }elseif ($stage == 3.1) { + }elseif ($phpgw_info["setup"]["stage"] == 3.1) { echo ''; - }elseif ($stage == 3.2) { + }elseif ($phpgw_info["setup"]["stage"] == 3.2) { echo ''; } echo ' '; - if ($stage < 3.1) { - echo ''; - } - - if ($stage < 4.1 || $stage > 3.1) { - echo ''; - }elseif ($stage == 4.1) { + if ($phpgw_info["setup"]["stage"] < 4.1) { + echo ''; + }elseif ($phpgw_info["setup"]["stage"] == 4.1) { echo ''; - }elseif ($stage == 4.2) { + }elseif ($phpgw_info["setup"]["stage"] == 4.2) { echo ''; } echo ' '; - if ($stage < 5.1) { - echo ''; - }elseif ($stage == 5.1) { + if ($phpgw_info["setup"]["stage"] < 5.1) { + echo ''; + }elseif ($phpgw_info["setup"]["stage"] == 5.1) { echo ''; - }elseif ($stage == 5.2) { + }elseif ($phpgw_info["setup"]["stage"] == 5.2) { echo ''; } diff --git a/setup/lang.php b/setup/lang.php index 938a16f840..0eac91c762 100644 --- a/setup/lang.php +++ b/setup/lang.php @@ -11,120 +11,167 @@ /* $Id$ */ - if (! $included) { - - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); - include("./inc/functions.inc.php"); + $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, + "currentapp" => "home", "noapi" => True); include("../header.inc.php"); + include("./inc/functions.inc.php"); + // Authorize the user to use setup app and load the database + // include("./inc/setup_auth.inc.php"); // Does not return unless user is authorized - if (!auth()){ - Header("Location: index.php"); - exit; - } - loaddb(); + $phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["include_root"]."/phpgwapi/inc"; + include($phpgw_info["server"]["api_inc"] . "/phpgw_common.inc.php"); - echo "phpGroupWare Setup\n"; - echo "\n"; + $common = new common; + $phpgw_setup->loaddb(); - include($phpgw_info["server"]["include_root"]."/phpgwapi/inc/phpgw_common.inc.php"); - $common = new common; - $sep = $common->filesystem_separator(); - } else { - $newinstall = True; - $lang_selected["en"] = "en"; - $submit = True; + $phpgw_setup->db->query("select config_name,config_value from config where config_name like 'ldap%'",__LINE__,__FILE__); + while ($phpgw_setup->db->next_record()) { + $config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value"); } + // First, see if we can connect to the LDAP server, if not send `em back to config.php with an + // error message. + + // connect to ldap server + if (! $ldap = @ldap_connect($config["ldap_host"])) { + $noldapconnection = True; + } + + // bind as admin, we not to able to do everything + if (! @ldap_bind($ldap,$config["ldap_root_dn"],$config["ldap_root_pw"])) { + $noldapconnection = True; + } + + if ($noldapconnection) { + Header("Location: config.php?error=badldapconnection"); + exit; + } + + $sr = ldap_search($ldap,$config["ldap_context"],"(|(uid=*))",array("sn","givenname","uid","uidnumber")); + $info = ldap_get_entries($ldap, $sr); + + for ($i=0; $i<$info["count"]; $i++) { + if (! $phpgw_info["server"]["global_denied_users"][$info[$i]["uid"][0]]) { + $account_info[$i]["account_id"] = $info[$i]["uidnumber"][0]; + $account_info[$i]["account_lid"] = $info[$i]["uid"][0]; + $account_info[$i]["account_lastname"] = $info[$i]["givenname"][0]; + $account_info[$i]["account_firstname"] = $info[$i]["sn"][0]; + } + } + + $phpgw_setup->db->query("select app_name,app_title from applications where app_enabled != '0' and " + . "app_name != 'admin'",__LINE__,__FILE__); + while ($phpgw_setup->db->next_record()) { + $apps[$phpgw_setup->db->f("app_name")] = $phpgw_setup->db->f("app_title"); + } + if ($submit) { - if (count($lang_selected)) { - if ($upgrademethod == "dumpold") { - $db->query("delete from lang"); - //echo "
Test: dumpold"; + if (! count($admins)) { + $error = "
You must select at least 1 admin"; + } + + if (! count($s_apps)) { + $error .= "
You must select at least 1 application"; + } + + if (! $error) { + include($phpgw_info["server"]["api_inc"] . "/phpgw_accounts_ldap.inc.php"); + include($phpgw_info["server"]["api_inc"] . "/phpgw_accounts_shared.inc.php"); + $accounts = new accounts; + + while ($app = each($s_apps)) { + $permissions_string = $accounts->add_app($app[1]); } - while (list($null,$lang) = each($lang_selected)) { - $addlang = False; - if ($upgrademethod == "addonlynew") { - //echo "
Test: addonlynew - select count(*) from lang where lang='$lang'"; - $db->query("select count(*) from lang where lang='$lang'"); - $db->next_record(); - - if ($db->f(0) == 0) { - //echo "
Test: addonlynew - True"; - $addlang = True; - } + $permissions_string = $accounts->add_app("",True); + $admin_permissions_string = $permissions_string . "admin:"; + + while ($admin = each($admins)) { + $s_admin[$admin[1]] = True; + } + + while ($account = each($account_info)) { + if ($s_admin[$account[1]["account_id"]]) { + $np = $admin_permissions_string; + } else { + $np = $permissions_string; } - if (($addlang && $upgrademethod == "addonlynew") || ($upgrademethod != "addonlynew")) { - //echo '
Test: loop above file()'; - $raw_file = file($phpgw_info["server"]["server_root"] . "/setup/phpgw_" . strtolower($lang) . ".lang"); - while (list($null,$line) = each($raw_file)) { - $addit = False; - list($message_id,$app_name,$db_lang,$content) = explode("\t",$line); - $message_id = addslashes(chop($message_id)); - $app_name = addslashes(chop($app_name)); - $db_lang = addslashes(chop($db_lang)); - $content = addslashes(chop($content)); - if ($upgrademethod == "addmissing") { - //echo "
Test: addmissing"; - $db->query("select count(*) from lang where message_id='$message_id' and lang='$db_lang'"); - $db->next_record(); - - if ($db->f(0) == 0) { - //echo "
Test: addmissing - True - Total: " . $db->f(0); - $addit = True; - } - } - - if ($addit || ($upgrademethod == "dumpold" || $newinstall || $upgrademethod == "addonlynew")) { - //echo "
adding - insert into lang values ('$message_id','$app_name','$db_lang','$content')"; - $db->query("insert into lang values ('$message_id','$app_name','$db_lang','$content')"); - } - } - } - } - } - - if (! $included) { - echo "
Language files have been installed
"; - exit; - } - - } else { - if (! $included) { - setup_header(); -?> -

Step 1 - header.inc.php 
O
You have not created your header.inc.php yet.
O
Your header.inc.php is out of date. Please upgrade it.
X
Your header.inc.php is in place and current.
Step 2 - database management 
ONot ready for this stage yet.
O
Your database does not exist.
O'; echo ' You appear to be running a pre-beta version of phpGroupWare
@@ -121,7 +121,7 @@ '; echo '
O
Your database exist, would you like to create your tables now?
OMake sure that your database is created and the account permissions are set.
'; @@ -146,13 +146,13 @@ echo '
'; echo "\n"; echo 'Once the database is setup correctly
the tables
O'; - echo "You appear to be running version $oldversion of phpGroupWare.
\n"; + echo "You appear to be running version ".$phpgw_info["setup"]["oldver"]["phpgwapi"]." of phpGroupWare.
\n"; echo "We will automaticly update your tables/records to ".$phpgw_info["server"]["versions"]["phpgwapi"].", but we highly recommend backing up your tables in case the script causes damage to your data.\n"; echo "These automated scripts can easily destroy your data. Please backup before going any further!\n"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -161,15 +161,15 @@ echo "\n"; echo "
\n"; echo '
O'; echo "\n"; echo " \n"; echo " \n"; echo " \n"; - $db->Halt_On_Error = "report"; + $phpgw_setup->db->Halt_On_Error = "report"; include ("./sql/common_main.inc.php"); - $db->Halt_On_Error = "no"; + $phpgw_setup->db->Halt_On_Error = "no"; echo " \n"; echo " \n"; echo "
 $subtitle
$submsg
 Table Change Messages
 Status
If you did not recieve any errors, your tables have been $subaction.
\n"; @@ -177,7 +177,7 @@ echo "
\n"; echo ''; echo '
XYour tables are current.'; echo "
\n"; echo "\n"; @@ -186,35 +186,31 @@ echo '
Step 3 - Configuration 
ONot ready for this stage yet.
OPlease phpGroupWare for your environment.'; echo ""; echo '
XConfiguration completed.'; echo "
"; echo '
Step 4 - language management 
ONot ready for this stage yet.
OClick here for now
ONot ready for this stage yet.
Ostage 4.1.
Ostage 4.2.
Step 5 - Add-on Application Installation 
ONot ready for this stage yet. (under construction)
ONot ready for this stage yet.
Ostage 5.1.
Ostage 5.2.
"> - - - - - - - - >Select which languages you would like to use. -
- ':""); ?> - - - Select which method of upgrade you would like to do' - . '
 Delete all old langagues and install new ones' - . '
 Only add new pharses' - . '
 only add languages that are not in the database already.' - . ''; - } - ?> -
-
"> Multi-Language support setup
">This program will help you upgrade or installing different languages for phpGroupWare
-'; + // do some checks before we try to import the data + if (!empty($account[1]["account_id"]) && !empty($account[1]["account_lid"])) + $phpgw_setup->db->query("insert into accounts (account_id,account_lid,account_pwd,account_permissions," + . "account_groups,account_status,account_lastpwd_change) values ('" . $account[1]["account_id"] . "','" + . $account[1]["account_lid"] . "','x','$np',',1:0,','A','".time()."')",__LINE__,__FILE__); + } + $setup_complete = True; + } } - } \ No newline at end of file + + // Add a check to see if there is no users in LDAP, if not create a default user. + + $phpgw_setup->setup_header(); + + if ($error) { + echo "

Error: $error
"; + } + + if ($setup_complete) { + $phpgw_setup->db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + echo '
Setup has been completed! Click here to login
'; + exit; + } +?> + + + + + + + + + + + + + + + + + + + + + + + + +
 LDAP import users
 This section will help you import users from your LDAP tree into phpGroupWare's account tables.
 
+  Select which user(s) will have the admin privileges + + +
+  Select the default applications your users will have access to. +
 Note: You will be able to customize this later. +
+ +
+ +
+ diff --git a/setup/ldap.php b/setup/ldap.php index 74316557e9..8763013f8a 100644 --- a/setup/ldap.php +++ b/setup/ldap.php @@ -23,11 +23,11 @@ include($phpgw_info["server"]["include_root"] . "/phpgwapi/inc/phpgw_common.inc.php"); $common = new common; - loaddb(); + $phpgw_setup->loaddb(); - $db->query("select config_name,config_value from config where config_name like 'ldap%'",__LINE__,__FILE__); - while ($db->next_record()) { - $config[$db->f("config_name")] = $db->f("config_value"); + $phpgw_setup->db->query("select config_name,config_value from config where config_name like 'ldap%'",__LINE__,__FILE__); + while ($phpgw_setup->db->next_record()) { + $config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value"); } // First, see if we can connect to the LDAP server, if not send `em back to config.php with an @@ -60,10 +60,10 @@ } } - $db->query("select app_name,app_title from applications where app_enabled != '0' and " + $phpgw_setup->db->query("select app_name,app_title from applications where app_enabled != '0' and " . "app_name != 'admin'",__LINE__,__FILE__); - while ($db->next_record()) { - $apps[$db->f("app_name")] = $db->f("app_title"); + while ($phpgw_setup->db->next_record()) { + $apps[$phpgw_setup->db->f("app_name")] = $phpgw_setup->db->f("app_title"); } if ($submit) { @@ -98,7 +98,7 @@ } // do some checks before we try to import the data if (!empty($account[1]["account_id"]) && !empty($account[1]["account_lid"])) - $db->query("insert into accounts (account_id,account_lid,account_pwd,account_permissions," + $phpgw_setup->db->query("insert into accounts (account_id,account_lid,account_pwd,account_permissions," . "account_groups,account_status,account_lastpwd_change) values ('" . $account[1]["account_id"] . "','" . $account[1]["account_lid"] . "','x','$np',',1:0,','A','".time()."')",__LINE__,__FILE__); } @@ -108,16 +108,16 @@ // Add a check to see if there is no users in LDAP, if not create a default user. - setup_header(); + $phpgw_setup->setup_header(); if ($error) { echo "
Error: $error
"; } if ($setup_complete) { - $db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__); - $db->next_record(); - echo '
Setup has been completed! Click db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + echo '
Setup has been completed! Click here to login
'; exit; } @@ -175,5 +175,3 @@ - - diff --git a/setup/setup_demo.php b/setup/setup_demo.php index 3a75041b9d..bc6f1d6abf 100644 --- a/setup/setup_demo.php +++ b/setup/setup_demo.php @@ -53,60 +53,59 @@ loaddb(); /* First clear out exsisting tables */ $defaultprefs = 'a:5:{s:6:"common";a:1:{s:0:"";s:2:"en";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}i:8;a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}'; - $db->query("delete from accounts"); - $db->query("delete from preferences"); - $db->query("delete from phpgw_acl"); + $phpgw_setup->db->query("delete from accounts"); + $phpgw_setup->db->query("delete from preferences"); + $phpgw_setup->db->query("delete from phpgw_acl"); /* Create records for demo accounts */ $sql = "insert into accounts"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "values (1, 'demo', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:', ',1:0,', ".time().", 'A')"; - $db->query($sql); - $db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); + $phpgw_setup->db->query($sql); + $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $sql = "insert into phpgw_acl"; $sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; $sql .= "values('preferences', 'changepassword', 1, 'u', 0)"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "insert into accounts"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "values (2, 'demo2', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:manual:', ',1:0,', ".time().", 'A')"; - $db->query($sql); - $db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); + $phpgw_setup->db->query($sql); + $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $sql = "insert into phpgw_acl"; $sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; $sql .= "values('preferences', 'changepassword', 2, 'u', 0)"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "insert into accounts"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "values (3, 'demo3', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ':addressbook:filemanager:calendar:email:notes:todo:transy:manual:', ',1:0,', ".time().", 'A')"; - $db->query($sql); - $db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); + $phpgw_setup->db->query($sql); + $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); $sql = "insert into phpgw_acl"; $sql .= "(acl_appname, acl_location, acl_account, acl_account_type, acl_rights)"; $sql .= "values('preferences', 'changepassword', 3, 'u', 0)"; - $db->query($sql); + $phpgw_setup->db->query($sql); /* Create records for administrator account */ $sql = "insert into accounts"; $sql .= "(account_id, account_lid, account_pwd, account_firstname, account_lastname, account_permissions, account_groups, account_lastpwd_change, account_status)"; $sql .= "values (4, '$username', '".md5($passwd)."', '$fname', '$lname', ':admin:addressbook:filemanager:calendar:email:nntp:notes:todo:transy:manual:', ',1:0,', ".time().", 'A')"; - $db->query($sql); - $db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); + $phpgw_setup->db->query($sql); + $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); /* Create system records */ $this_dir = dirname($SCRIPT_FILENAME); $rootdir = ereg_replace("/setup","",$this_dir); - $db->query("update config set config_value = '/tmp' where config_name = 'temp_dir'"); - $db->query("update config set config_value = '$rootdir/files' where config_name = 'files_dir'"); - $db->query("update config set config_value = '$mail_suffix' where config_name = 'mail_suffix'"); - $db->query("update config set config_value = '$mail_login_type' where config_name = 'mail_login_type'"); - $db->query("delete from config where config_name = 'freshinstall'"); + $phpgw_setup->db->query("update config set config_value = '/tmp' where config_name = 'temp_dir'"); + $phpgw_setup->db->query("update config set config_value = '$rootdir/files' where config_name = 'files_dir'"); + $phpgw_setup->db->query("update config set config_value = '$mail_suffix' where config_name = 'mail_suffix'"); + $phpgw_setup->db->query("update config set config_value = '$mail_login_type' where config_name = 'mail_login_type'"); + $phpgw_setup->db->query("delete from config where config_name = 'freshinstall'"); echo "Done"; } - ?> \ No newline at end of file diff --git a/setup/sql/common_default_records.inc.php b/setup/sql/common_default_records.inc.php index abbcf97c17..668d431fa5 100644 --- a/setup/sql/common_default_records.inc.php +++ b/setup/sql/common_default_records.inc.php @@ -19,79 +19,79 @@ } unset($d1);unset($d2); function add_default_server_config(){ - global $db, $phpgw_info, $currentver; - $db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); - $db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); - $db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); - $db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')"); - $db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); - $db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); - $db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); - $db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('ldap_context', 'ou=People,dc=my-domain,dc=com')"); - $db->query("insert into config (config_name, config_value) values ('ldap_encryption_type', 'DES')"); - $db->query("insert into config (config_name, config_value) values ('ldap_root_dn', 'cn=Manager,dc=my-domain,dc=com')"); - $db->query("insert into config (config_name, config_value) values ('ldap_root_pw', 'secret')"); - $db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); - $db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); - $db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); - $db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); - $db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); - $db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); - $db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); - $db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); - $db->query("insert into config (config_name, config_value) values ('charset', 'iso-8859-1')"); - $db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); - $db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); - $db->query("insert into config (config_name, config_value) values ('htmlcompliant', 'False')"); - $db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); - $db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'ou=People,dc=my-domain,dc=com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_encryption_type', 'DES')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_root_dn', 'cn=Manager,dc=my-domain,dc=com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_root_pw', 'secret')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('charset', 'iso-8859-1')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('htmlcompliant', 'False')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')"); } if ($useglobalconfigsettings == "on"){ if (is_file($basedir)){ include ($phpgw_info["server"]["include_root"]."/globalconfig.inc.php"); - $db->query("insert into config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')"); - $db->query("insert into config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')"); - $db->query("insert into config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')"); - $db->query("insert into config (config_name, config_value) values ('encryptkey', '".$phpgw_info["server"]["encryptkey"]."')"); - $db->query("insert into config (config_name, config_value) values ('site_title', '".$phpgw_info["server"]["site_title"]."')"); - $db->query("insert into config (config_name, config_value) values ('hostname', '".$phpgw_info["server"]["hostname"]."')"); - $db->query("insert into config (config_name, config_value) values ('webserver_url', '".$phpgw_info["server"]["webserver_url"].")"); - $db->query("insert into config (config_name, config_value) values ('auth_type', '".$phpgw_info["server"]["auth_type"]."')"); - $db->query("insert into config (config_name, config_value) values ('ldap_host', '".$phpgw_info["server"]["ldap_host"]."')"); - $db->query("insert into config (config_name, config_value) values ('ldap_context', '".$phpgw_info["server"]["ldap_context"]."')"); - $db->query("insert into config (config_name, config_value) values ('usecookies', '".$phpgw_info["server"]["usecookies"]."')"); - $db->query("insert into config (config_name, config_value) values ('mail_server', '".$phpgw_info["server"]["mail_server"]."')"); - $db->query("insert into config (config_name, config_value) values ('mail_server_type', '".$phpgw_info["server"]["mail_server_type"]."')"); - $db->query("insert into config (config_name, config_value) values ('imap_server_type', '".$phpgw_info["server"]["imap_server_type"]."')"); - $db->query("insert into config (config_name, config_value) values ('mail_suffix', '".$phpgw_info["server"]["mail_suffix"]."')"); - $db->query("insert into config (config_name, config_value) values ('mail_login_type', '".$phpgw_info["server"]["mail_login_type"]."')"); - $db->query("insert into config (config_name, config_value) values ('smtp_server', '".$phpgw_info["server"]["smtp_server"]."')"); - $db->query("insert into config (config_name, config_value) values ('smtp_port', '".$phpgw_info["server"]["smtp_port"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_server', '".$phpgw_info["server"]["nntp_server"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_port', '".$phpgw_info["server"]["nntp_port"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_sender', '".$phpgw_info["server"]["nntp_sender"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_organization', '".$phpgw_info["server"]["nntp_organization"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_admin', '".$phpgw_info["server"]["nntp_admin"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_username', '".$phpgw_info["server"]["nntp_login_username"]."')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_password', '".$phpgw_info["server"]["nntp_login_password"]."')"); - $db->query("insert into config (config_name, config_value) values ('charset', '".$phpgw_info["server"]["charset"]."')"); - $db->query("insert into config (config_name, config_value) values ('default_ftp_server', '".$phpgw_info["server"]["default_ftp_server"]."')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_server', '".$phpgw_info["server"]["httpproxy_server"]."')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_port', '".$phpgw_info["server"]["httpproxy_port"]."')"); - $db->query("insert into config (config_name, config_value) values ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')"); - $db->query("insert into config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', '".$phpgw_info["server"]["encryptkey"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', '".$phpgw_info["server"]["site_title"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', '".$phpgw_info["server"]["hostname"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '".$phpgw_info["server"]["webserver_url"].")"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', '".$phpgw_info["server"]["auth_type"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', '".$phpgw_info["server"]["ldap_host"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', '".$phpgw_info["server"]["ldap_context"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', '".$phpgw_info["server"]["usecookies"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', '".$phpgw_info["server"]["mail_server"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', '".$phpgw_info["server"]["mail_server_type"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', '".$phpgw_info["server"]["imap_server_type"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', '".$phpgw_info["server"]["mail_suffix"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', '".$phpgw_info["server"]["mail_login_type"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', '".$phpgw_info["server"]["smtp_server"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '".$phpgw_info["server"]["smtp_port"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', '".$phpgw_info["server"]["nntp_server"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '".$phpgw_info["server"]["nntp_port"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', '".$phpgw_info["server"]["nntp_sender"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', '".$phpgw_info["server"]["nntp_organization"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', '".$phpgw_info["server"]["nntp_admin"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '".$phpgw_info["server"]["nntp_login_username"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '".$phpgw_info["server"]["nntp_login_password"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('charset', '".$phpgw_info["server"]["charset"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', '".$phpgw_info["server"]["default_ftp_server"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '".$phpgw_info["server"]["httpproxy_server"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '".$phpgw_info["server"]["httpproxy_port"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')"); }else{ echo "\n"; echo " \n"; @@ -109,147 +109,146 @@ include($phpgw_info["server"]["server_root"] . "/setup/sql/default_applications.inc.php"); - $db->query("insert into groups (group_name) values ('Default')"); - $db->query("insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,account_permissions,account_groups,account_status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',':admin:email:todo:addressbook:calendar:',',1:0,','A')"); + $phpgw_setup->db->query("insert into groups (group_name) values ('Default')"); + $phpgw_setup->db->query("insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,account_permissions,account_groups,account_status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',':admin:email:todo:addressbook:calendar:',',1:0,','A')"); $defaultprefs = 'a:5:{s:6:"common";a:1:{s:0:"";s:2:"en";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}i:8;a:1:{s:0:"";s:13:"workdaystarts";}i:15;a:1:{s:0:"";s:11:"workdayends";}s:6:"Monday";a:1:{s:0:"";s:13:"weekdaystarts";}}'; - $db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); + $phpgw_setup->db->query("insert into preferences (preference_owner, preference_value) values ('1', '$defaultprefs')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); - -?> + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); +?> \ No newline at end of file diff --git a/setup/sql/common_main.inc.php b/setup/sql/common_main.inc.php index 123b832ecd..5565329aab 100644 --- a/setup/sql/common_main.inc.php +++ b/setup/sql/common_main.inc.php @@ -18,32 +18,32 @@ } unset($d1); function update_version_table($tableschanged = True){ - global $currentver, $phpgw_info, $db, $tablechanges; - if ($tableschanged == True){$tablechanges = True;} - $db->query("update applications set app_version='".$currentver."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')"); + global $phpgw_info, $phpgw_setup; + if ($tableschanged == True){$phpgw_info["setup"]["tableschanged"] = True;} + $phpgw_setup->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')"); } - if ($currentver == "drop"){ + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "drop"){ include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_droptables.inc.php"); } - if ($currentver == "new") { + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "new") { include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_newtables.inc.php"); include("./sql/common_default_records.inc.php"); $included = True; include($phpgw_info["server"]["server_root"] . "/setup/lang.php"); - $currentver = "oldversion"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "oldversion"; } - if ($currentver == "oldversion") { - $currentver = $oldversion; - if ($currentver == "7122000" || $currentver == "8032000" || $currentver == "8072000" || $currentver == "8212000" || $currentver == "9052000" || $currentver == "9072000") { + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "oldversion") { + $phpgw_info["setup"]["currentver"]["phpgwapi"] = $phpgw_info["setup"]["oldver"]["phpgwapi"]; + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == "7122000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "8032000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "8072000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "8212000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "9052000" || $phpgw_info["setup"]["currentver"]["phpgwapi"] == "9072000") { include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_upgrade_prebeta.inc.php"); } include("./sql/".$phpgw_domain[$SetupDomain]["db_type"]."_upgrade_beta.inc.php"); } /* Not yet implemented - if (!$tablechanges == True){ + if (!$phpgw_info["setup"]["tableschanged"] == True){ echo " \n"; echo " \n"; echo " \n"; diff --git a/setup/sql/default_applications.inc.php b/setup/sql/default_applications.inc.php index 5c830fb938..f63e332f62 100644 --- a/setup/sql/default_applications.inc.php +++ b/setup/sql/default_applications.inc.php @@ -13,22 +13,22 @@ // This is so we can enable or disable apps for the phpGroupWare and phpGroupWare Plus packges // This is for the base apps, which should always be included - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '$currentver')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); // This is for the add-on application, which are enabled/disabled based being in the regular or plus version - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '$currentver')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '$currentver')"); -?> + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); +?> \ No newline at end of file diff --git a/setup/sql/default_applications_plus.inc.php b/setup/sql/default_applications_plus.inc.php index 5c830fb938..17899a46c8 100644 --- a/setup/sql/default_applications_plus.inc.php +++ b/setup/sql/default_applications_plus.inc.php @@ -13,22 +13,22 @@ // This is so we can enable or disable apps for the phpGroupWare and phpGroupWare Plus packges // This is for the base apps, which should always be included - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '$currentver')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'calendar_entry,calendar_entry_users,calendar_entry_repeats', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); // This is for the add-on application, which are enabled/disabled based being in the regular or plus version - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$currentver."')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '$currentver')"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '$currentver')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 1, 13, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 1, 2, NULL, '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 1, 3, NULL, '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 1, 4, NULL, '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 1, 5, 'news_sites,news_headlines', '0.0.0')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('bookmarks', 'Book Marks', 1, 15, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('manual', 'Manual', 1, 16, NULL, '".$phpgw_info["setup"]["currentver"]["phpgwapi"]."')"); ?> diff --git a/setup/sql/mysql_droptables.inc.php b/setup/sql/mysql_droptables.inc.php index b1b790ef4e..db46a738bc 100644 --- a/setup/sql/mysql_droptables.inc.php +++ b/setup/sql/mysql_droptables.inc.php @@ -11,26 +11,26 @@ /* $Id$ */ - $db->query("DROP TABLE config"); - $db->query("DROP TABLE applications"); - $db->query("DROP TABLE accounts"); - $db->query("DROP TABLE groups"); - $db->query("DROP TABLE preferences"); - $db->query("DROP TABLE phpgw_sessions"); - $db->query("DROP TABLE phpgw_app_sessions"); - $db->query("DROP TABLE phpgw_acl"); - $db->query("DROP TABLE phpgw_access_log"); - $db->query("DROP TABLE profiles"); - $db->query("DROP TABLE addressbook"); - $db->query("DROP TABLE todo"); - $db->query("DROP TABLE calendar_entry"); - $db->query("DROP TABLE calendar_entry_repeats"); - $db->query("DROP TABLE calendar_entry_user"); - $db->query("DROP TABLE newsgroups"); - $db->query("DROP TABLE news_msg"); - $db->query("DROP TABLE lang"); - $db->query("DROP TABLE languages"); - $db->query("DROP TABLE customers"); - $db->query("DROP TABLE categories"); - $db->query("DROP TABLE notes"); + $phpgw_setup->db->query("DROP TABLE config"); + $phpgw_setup->db->query("DROP TABLE applications"); + $phpgw_setup->db->query("DROP TABLE accounts"); + $phpgw_setup->db->query("DROP TABLE groups"); + $phpgw_setup->db->query("DROP TABLE preferences"); + $phpgw_setup->db->query("DROP TABLE phpgw_sessions"); + $phpgw_setup->db->query("DROP TABLE phpgw_app_sessions"); + $phpgw_setup->db->query("DROP TABLE phpgw_acl"); + $phpgw_setup->db->query("DROP TABLE phpgw_access_log"); + $phpgw_setup->db->query("DROP TABLE profiles"); + $phpgw_setup->db->query("DROP TABLE addressbook"); + $phpgw_setup->db->query("DROP TABLE todo"); + $phpgw_setup->db->query("DROP TABLE calendar_entry"); + $phpgw_setup->db->query("DROP TABLE calendar_entry_repeats"); + $phpgw_setup->db->query("DROP TABLE calendar_entry_user"); + $phpgw_setup->db->query("DROP TABLE newsgroups"); + $phpgw_setup->db->query("DROP TABLE news_msg"); + $phpgw_setup->db->query("DROP TABLE lang"); + $phpgw_setup->db->query("DROP TABLE languages"); + $phpgw_setup->db->query("DROP TABLE customers"); + $phpgw_setup->db->query("DROP TABLE categories"); + $phpgw_setup->db->query("DROP TABLE notes"); ?> \ No newline at end of file diff --git a/setup/sql/mysql_newtables.inc.php b/setup/sql/mysql_newtables.inc.php index 27cfc436d1..f691523514 100644 --- a/setup/sql/mysql_newtables.inc.php +++ b/setup/sql/mysql_newtables.inc.php @@ -18,7 +18,7 @@ config_value varchar(100), UNIQUE config_name (config_name) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE applications ( app_name varchar(25) NOT NULL, @@ -29,7 +29,7 @@ app_version varchar(20) NOT NULL default '0.0', UNIQUE app_name (app_name) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE accounts ( account_id int(11) DEFAULT '0' NOT NULL auto_increment, @@ -46,7 +46,7 @@ PRIMARY KEY (account_id), UNIQUE account_lid (account_lid) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table groups ( group_id int NOT NULL auto_increment, @@ -54,13 +54,13 @@ group_apps varchar(255), primary key(group_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE preferences ( preference_owner int, preference_value text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_sessions ( session_id varchar(255) NOT NULL, @@ -71,7 +71,7 @@ session_info text, UNIQUE sessionid (session_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_acl ( acl_appname varchar(50), @@ -80,7 +80,7 @@ acl_account_type char(1), acl_rights int )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_app_sessions ( sessionid varchar(255) NOT NULL, @@ -88,7 +88,7 @@ app varchar(20), content text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table phpgw_access_log ( sessionid varchar(255), @@ -97,7 +97,7 @@ li int, lo varchar(255) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE profiles ( con int(11) DEFAULT '0' NOT NULL auto_increment, @@ -109,7 +109,7 @@ picture blob, PRIMARY KEY (con) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE addressbook ( ab_id int(11) NOT NULL auto_increment, @@ -137,7 +137,7 @@ ab_url varchar(255), PRIMARY KEY (ab_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE customers ( @@ -154,7 +154,7 @@ notes text, PRIMARY KEY (company_id) );"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE todo ( todo_id int(11) DEFAULT '0' NOT NULL auto_increment, @@ -169,7 +169,7 @@ todo_enddate int(11), PRIMARY KEY (todo_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE calendar_entry ( cal_id int(11) DEFAULT '0' NOT NULL auto_increment, @@ -185,7 +185,7 @@ cal_description text, PRIMARY KEY (cal_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE calendar_entry_repeats ( cal_id int(11) DEFAULT '0' NOT NULL, @@ -195,7 +195,7 @@ cal_frequency int(11) DEFAULT '1', cal_days char(7) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE calendar_entry_user ( cal_id int(11) DEFAULT '0' NOT NULL, @@ -203,7 +203,7 @@ cal_status char(1) DEFAULT 'A', PRIMARY KEY (cal_id, cal_login) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE newsgroups ( con int(11) NOT NULL auto_increment, @@ -215,7 +215,7 @@ PRIMARY KEY (con), UNIQUE name (name) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE news_msg ( con int(11) NOT NULL, @@ -251,7 +251,7 @@ body longtext NOT NULL, primary key(con,msg) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE lang ( message_id varchar(150) DEFAULT '' NOT NULL, @@ -260,7 +260,7 @@ content text NOT NULL, PRIMARY KEY (message_id,app_name,lang) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE categories ( cat_id int(9) DEFAULT '0' NOT NULL auto_increment, @@ -270,7 +270,7 @@ cat_description text NOT NULL, PRIMARY KEY (cat_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE languages ( lang_id varchar(2) NOT NULL, @@ -278,7 +278,7 @@ available char(3) NOT NULL DEFAULT 'No', PRIMARY KEY (lang_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE notes ( note_id int(20) NOT NULL auto_increment, @@ -287,7 +287,7 @@ note_content text, PRIMARY KEY (note_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table phpgw_hooks ( hook_id int not null auto_increment, @@ -296,9 +296,10 @@ hook_filename varchar(255), primary key hook_id (hook_id) );"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $currentver = "0.9.8pre5"; - $oldversion = $currentver; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5"; + $phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"]; update_version_table(); +// $phpgw_setup->update_version_table(); ?> diff --git a/setup/sql/mysql_upgrade_beta.inc.php b/setup/sql/mysql_upgrade_beta.inc.php index 13f000b0ba..37b578fb95 100644 --- a/setup/sql/mysql_upgrade_beta.inc.php +++ b/setup/sql/mysql_upgrade_beta.inc.php @@ -13,12 +13,12 @@ $test[] = "0.9.1"; function upgrade0_9_1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table access_log change lo lo varchar(255)"); - $db->query("alter table addressbook change ab_id ab_id int(11) NOT NULL auto_increment"); - $db->query("alter table addressbook add ab_company_id int(10) unsigned"); - $db->query("alter table addressbook add ab_title varchar(60)"); - $db->query("alter table addressbook add ab_address2 varchar(60)"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table access_log change lo lo varchar(255)"); + $phpgw_setup->db->query("alter table addressbook change ab_id ab_id int(11) NOT NULL auto_increment"); + $phpgw_setup->db->query("alter table addressbook add ab_company_id int(10) unsigned"); + $phpgw_setup->db->query("alter table addressbook add ab_title varchar(60)"); + $phpgw_setup->db->query("alter table addressbook add ab_address2 varchar(60)"); $sql = "CREATE TABLE customers ( company_id int(10) unsigned NOT NULL auto_increment, @@ -34,94 +34,94 @@ notes text, PRIMARY KEY (company_id) );"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("update lang set lang='da' where lang='dk'"); - $db->query("update lang set lang='ko' where lang='kr'"); + $phpgw_setup->db->query("update lang set lang='da' where lang='dk'"); + $phpgw_setup->db->query("update lang set lang='ko' where lang='kr'"); - $db->query("update preferences set preference_name='da' where preference_name='dk'"); - $db->query("update preferences set preference_name='ko' where preference_name='kr'"); + $phpgw_setup->db->query("update preferences set preference_name='da' where preference_name='dk'"); + $phpgw_setup->db->query("update preferences set preference_name='ko' where preference_name='kr'"); //install weather support - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); - $db->query("INSERT INTO lang (message_id, app_name, lang, content) VALUES( 'weather','Weather','en','weather')"); - $currentver = "0.9.2"; + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); + $phpgw_setup->db->query("INSERT INTO lang (message_id, app_name, lang, content) VALUES( 'weather','Weather','en','weather')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.2"; } function v0_9_2to0_9_3update_owner($table,$field){ - global $db; - $db->query("select distinct($field) from $table"); - if ($db->num_rows()) { - while($db->next_record()) { - $owner[count($owner)] = $db->f($field); + global $phpgw_setup; + $phpgw_setup->db->query("select distinct($field) from $table"); + if ($phpgw_setup->db->num_rows()) { + while($phpgw_setup->db->next_record()) { + $owner[count($owner)] = $phpgw_setup->db->f($field); } for($i=0;$iquery("select account_id from accounts where account_lid='".$owner[$i]."'"); - $db->next_record(); - $db->query("update $table set $field=".$db->f("account_id")." where $field='".$owner[$i]."'"); + $phpgw_setup->db->query("select account_id from accounts where account_lid='".$owner[$i]."'"); + $phpgw_setup->db->next_record(); + $phpgw_setup->db->query("update $table set $field=".$phpgw_setup->db->f("account_id")." where $field='".$owner[$i]."'"); } } - $db->query("alter table $table change $field $field int(11) NOT NULL"); + $phpgw_setup->db->query("alter table $table change $field $field int(11) NOT NULL"); } $test[] = "0.9.2"; function upgrade0_9_2(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; v0_9_2to0_9_3update_owner("addressbook","ab_owner"); v0_9_2to0_9_3update_owner("todo","todo_owner"); v0_9_2to0_9_3update_owner("webcal_entry","cal_create_by"); v0_9_2to0_9_3update_owner("webcal_entry_user","cal_login"); - $currentver = "0.9.3pre1"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre1"; } $test[] = "0.9.3pre1"; function upgrade0_9_3pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; v0_9_2to0_9_3update_owner("addressbook","ab_owner"); v0_9_2to0_9_3update_owner("todo","todo_owner"); v0_9_2to0_9_3update_owner("webcal_entry","cal_create_by"); v0_9_2to0_9_3update_owner("webcal_entry_user","cal_login"); - $currentver = "0.9.3pre2"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre2"; } $test[] = "0.9.3pre2"; function upgrade0_9_3pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("select owner, newsgroup from users_newsgroups"); - if($db->num_rows()) { - while($db->next_record()) { - $owner[count($owner)] = $db->f("owner"); - $newsgroup[count($newsgroup)] = $db->f("newsgroup"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("select owner, newsgroup from users_newsgroups"); + if($phpgw_setup->db->num_rows()) { + while($phpgw_setup->db->next_record()) { + $owner[count($owner)] = $phpgw_setup->db->f("owner"); + $newsgroup[count($newsgroup)] = $phpgw_setup->db->f("newsgroup"); } for($i=0;$iquery("insert into preferences (preference_owner,preference_name," + $phpgw_setup->db->query("insert into preferences (preference_owner,preference_name," ."preference_value,preference_appname) values ('".$owner[$i]."','".$newsgroup[$i]."','True'," ."'nntp')"); } - $db->query("drop table users_newsgroups"); - $db->query("update applications set app_tables='newsgroups' where app_name='nntp'"); + $phpgw_setup->db->query("drop table users_newsgroups"); + $phpgw_setup->db->query("update applications set app_tables='newsgroups' where app_name='nntp'"); } - $currentver = "0.9.3pre3"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre3"; } $test[] = "0.9.3pre3"; function upgrade0_9_3pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table todo add todo_id_parent int(11) DEFAULT '0' NOT NULL"); - $currentver = "0.9.3pre4"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table todo add todo_id_parent int(11) DEFAULT '0' NOT NULL"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre4"; } $test[] = "0.9.3pre4"; function upgrade0_9_3pre4(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table config change config_name config_name varchar(255) NOT NULL"); - $currentver = "0.9.3pre5"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table config change config_name config_name varchar(255) NOT NULL"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre5"; } $test[] = "0.9.3pre5"; function upgrade0_9_3pre5(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("CREATE TABLE categories ( + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("CREATE TABLE categories ( cat_id int(9) DEFAULT '0' NOT NULL auto_increment, account_id int(11) DEFAULT '0' NOT NULL, app_name varchar(25) NOT NULL, @@ -129,193 +129,193 @@ cat_description text NOT NULL, PRIMARY KEY (cat_id))" ); - $currentver = "0.9.3pre6"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre6"; } $test[] = "0.9.3pre6"; function upgrade0_9_3pre6(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table addressbook add ab_url varchar(255)"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 0, 13, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); - $currentver = "0.9.3pre7"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table addressbook add ab_url varchar(255)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 0, 13, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre7"; } $test[] = "0.9.3pre7"; function upgrade0_9_3pre7(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("CREATE TABLE languages ( + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("CREATE TABLE languages ( lang_id varchar(2) NOT NULL, lang_name varchar(50) NOT NULL, available char(3) NOT NULL DEFAULT 'No', PRIMARY KEY (lang_id) )"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AA','Afar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AB','Abkhazian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AF','Afrikaans','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AM','Amharic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AR','Arabic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AS','Assamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AY','Aymara','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AZ','Azerbaijani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BA','Bashkir','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BE','Byelorussian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BG','Bulgarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BH','Bihari','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BI','Bislama','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BN','Bengali / Bangla','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BO','Tibetan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BR','Breton','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CA','Catalan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CO','Corsican','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CS','Czech','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CY','Welsh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DA','Danish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DE','German','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DZ','Bhutani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EL','Greek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EN','English / American','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EO','Esperanto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ES','Spanish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ET','Estonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EU','Basque','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FA','Persian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FI','Finnish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FJ','Fiji','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FO','Faeroese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FR','French','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FY','Frisian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GA','Irish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GD','Gaelic / Scots Gaelic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GL','Galician','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GN','Guarani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GU','Gujarati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HA','Hausa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HI','Hindi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HR','Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HU','Hungarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HY','Armenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IA','Interlingua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IE','Interlingue','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IK','Inupiak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IN','Indonesian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IS','Icelandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IT','Italian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IW','Hebrew','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JA','Japanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JI','Yiddish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JW','Javanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KA','Georgian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KK','Kazakh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KL','Greenlandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KM','Cambodian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KN','Kannada','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KO','Korean','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KS','Kashmiri','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KU','Kurdish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KY','Kirghiz','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LA','Latin','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LN','Lingala','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LO','Laothian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LT','Lithuanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LV','Latvian / Lettish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MG','Malagasy','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MI','Maori','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MK','Macedonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ML','Malayalam','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MN','Mongolian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MO','Moldavian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MR','Marathi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MS','Malay','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MT','Maltese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MY','Burmese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NA','Nauru','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NE','Nepali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NL','Dutch','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NO','Norwegian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OC','Occitan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OM','Oromo / Afan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OR','Oriya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PA','Punjabi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PL','Polish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PS','Pashto / Pushto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PT','Portuguese','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('QU','Quechua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RM','Rhaeto-Romance','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RN','Kirundi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RO','Romanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RU','Russian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RW','Kinyarwanda','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SA','Sanskrit','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SD','Sindhi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SG','Sangro','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SH','Serbo-Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SI','Singhalese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SK','Slovak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SL','Slovenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SM','Samoan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SN','Shona','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SO','Somali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SQ','Albanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SR','Serbian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SS','Siswati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ST','Sesotho','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SU','Sudanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SV','Swedish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SW','Swahili','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TA','Tamil','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TE','Tegulu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TG','Tajik','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TH','Thai','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TI','Tigrinya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TK','Turkmen','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TL','Tagalog','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TN','Setswana','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TO','Tonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TR','Turkish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TS','Tsonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TT','Tatar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TW','Twi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UK','Ukrainian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UR','Urdu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UZ','Uzbek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VI','Vietnamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VO','Volapuk','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('WO','Wolof','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('XH','Xhosa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('YO','Yoruba','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZH','Chinese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZU','Zulu','No')"); - $currentver = "0.9.3pre8"; + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AA','Afar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AB','Abkhazian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AF','Afrikaans','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AM','Amharic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AR','Arabic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AS','Assamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AY','Aymara','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AZ','Azerbaijani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BA','Bashkir','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BE','Byelorussian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BG','Bulgarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BH','Bihari','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BI','Bislama','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BN','Bengali / Bangla','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BO','Tibetan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BR','Breton','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CA','Catalan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CO','Corsican','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CS','Czech','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CY','Welsh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DA','Danish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DE','German','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DZ','Bhutani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EL','Greek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EN','English / American','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EO','Esperanto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ES','Spanish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ET','Estonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EU','Basque','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FA','Persian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FI','Finnish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FJ','Fiji','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FO','Faeroese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FR','French','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FY','Frisian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GA','Irish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GD','Gaelic / Scots Gaelic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GL','Galician','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GN','Guarani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GU','Gujarati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HA','Hausa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HI','Hindi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HR','Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HU','Hungarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HY','Armenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IA','Interlingua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IE','Interlingue','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IK','Inupiak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IN','Indonesian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IS','Icelandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IT','Italian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IW','Hebrew','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JA','Japanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JI','Yiddish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JW','Javanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KA','Georgian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KK','Kazakh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KL','Greenlandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KM','Cambodian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KN','Kannada','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KO','Korean','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KS','Kashmiri','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KU','Kurdish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KY','Kirghiz','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LA','Latin','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LN','Lingala','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LO','Laothian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LT','Lithuanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LV','Latvian / Lettish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MG','Malagasy','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MI','Maori','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MK','Macedonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ML','Malayalam','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MN','Mongolian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MO','Moldavian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MR','Marathi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MS','Malay','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MT','Maltese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MY','Burmese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NA','Nauru','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NE','Nepali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NL','Dutch','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NO','Norwegian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OC','Occitan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OM','Oromo / Afan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OR','Oriya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PA','Punjabi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PL','Polish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PS','Pashto / Pushto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PT','Portuguese','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('QU','Quechua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RM','Rhaeto-Romance','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RN','Kirundi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RO','Romanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RU','Russian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RW','Kinyarwanda','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SA','Sanskrit','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SD','Sindhi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SG','Sangro','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SH','Serbo-Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SI','Singhalese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SK','Slovak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SL','Slovenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SM','Samoan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SN','Shona','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SO','Somali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SQ','Albanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SR','Serbian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SS','Siswati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ST','Sesotho','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SU','Sudanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SV','Swedish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SW','Swahili','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TA','Tamil','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TE','Tegulu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TG','Tajik','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TH','Thai','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TI','Tigrinya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TK','Turkmen','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TL','Tagalog','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TN','Setswana','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TO','Tonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TR','Turkish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TS','Tsonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TT','Tatar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TW','Twi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UK','Ukrainian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UR','Urdu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UZ','Uzbek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VI','Vietnamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VO','Volapuk','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('WO','Wolof','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('XH','Xhosa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('YO','Yoruba','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZH','Chinese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZU','Zulu','No')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre8"; } $test[] = "0.9.3pre8"; function upgrade0_9_3pre8(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.3pre9"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre9"; } $test[] = "0.9.3pre9"; function upgrade0_9_3pre9(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.3pre10"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre10"; } $test[] = "0.9.3pre10"; function upgrade0_9_3pre10(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.3"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3"; } $test[] = "0.9.3"; function upgrade0_9_3(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.4pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre1"; } $test[] = "0.9.4pre1"; function upgrade0_9_4pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "CREATE TABLE notes ( note_id int(20) NOT NULL auto_increment, note_owner int(11), @@ -323,192 +323,192 @@ note_content text, PRIMARY KEY (note_id) )"; - $db->query($sql); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); - $currentver = "0.9.4pre2"; + $phpgw_setup->db->query($sql); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 14, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre2"; } $test[] = "0.9.4pre2"; function upgrade0_9_4pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table webcal_entry change cal_create_by cal_owner int(11) NOT NULL"); - $currentver = "0.9.4pre3"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table webcal_entry change cal_create_by cal_owner int(11) NOT NULL"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre3"; } $test[] = "0.9.4pre3"; function upgrade0_9_4pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "ALTER TABLE todo ADD todo_startdate int(11) not null"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "ALTER TABLE todo CHANGE todo_datedue todo_enddate int(11) not null"; - $db->query($sql); - $currentver = "0.9.4pre4"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre4"; } $test[] = "0.9.4pre4"; function upgrade0_9_4pre4(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "ALTER TABLE todo ADD todo_startdate int(11) not null"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "alter table sessions change session_lid session_lid varchar(255)"; - $db->query($sql); - $currentver = "0.9.4pre5"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre5"; } $test[] = "0.9.4pre5"; function upgrade0_9_4pre5(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.4"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4"; } $test[] = "0.9.4"; function upgrade0_9_4(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("delete from languages"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); - $currentver = "0.9.5pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("delete from languages"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.5pre1"; } $test[] = "0.9.5pre1"; function upgrade0_9_5pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("DROP TABLE sessions"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("DROP TABLE sessions"); $sql = "CREATE TABLE phpgw_sessions ( session_id varchar(255) NOT NULL, session_lid varchar(255), @@ -518,7 +518,7 @@ session_dla int(11), UNIQUE sessionid (session_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_acl ( acl_appname varchar(50), @@ -527,18 +527,18 @@ acl_account_type char(1), acl_rights int )"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("DROP TABLE app_sessions"); + $phpgw_setup->db->query("DROP TABLE app_sessions"); $sql = "CREATE TABLE phpgw_app_sessions ( sessionid varchar(255) NOT NULL, loginid varchar(20), app varchar(20), content text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("DROP TABLE access_log"); + $phpgw_setup->db->query("DROP TABLE access_log"); $sql = "create table phpgw_access_log ( sessionid varchar(255), loginid varchar(30), @@ -546,32 +546,32 @@ li int, lo varchar(255) )"; - $db->query($sql); - $currentver = "0.9.5pre2"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.5pre2"; } $test[] = "0.9.5pre2"; function upgrade0_9_5pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.5"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.5"; } $test[] = "0.9.5"; function upgrade0_9_5(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.6"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.6"; } $test[] = "0.9.6"; function upgrade0_9_6(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.7pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7pre1"; } $test[] = "0.9.7pre1"; function upgrade0_9_7pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db2 = $db; + global $phpgw_info, $phpgw_setup; + $db2 = $phpgw_setup->db; $sql = "CREATE TABLE calendar_entry ( cal_id int(11) DEFAULT '0' NOT NULL auto_increment, cal_owner int(11) DEFAULT '0' NOT NULL, @@ -586,22 +586,22 @@ cal_description text, PRIMARY KEY (cal_id) )"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT count(*) FROM webcal_entry",__LINE__,__FILE__); - $db->next_record(); - if($db->f(0)) { - $db->query("SELECT cal_id,cal_owner,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description,cal_id,cal_date,cal_time,cal_mod_date,cal_mod_time FROM webcal_entry ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $cal_id = $db->f("cal_id"); - $cal_owner = $db->f("cal_owner"); - $cal_duration = $db->f("cal_duration"); - $cal_priority = $db->f("cal_priority"); - $cal_type = $db->f("cal_type"); - $cal_access = $db->f("cal_access"); - $cal_name = $db->f("cal_name"); - $cal_description = $db->f("cal_description"); - $datetime = mktime(intval(strrev(substr(strrev($db->f("cal_time")),4))),intval(strrev(substr(strrev($db->f("cal_time")),2,2))),intval(strrev(substr(strrev($db->f("cal_time")),0,2))),intval(substr($db->f("cal_date"),4,2)),intval(substr($db->f("cal_date"),6,2)),intval(substr($db->f("cal_date"),0,4))); - $moddatetime = mktime(intval(strrev(substr(strrev($db->f("cal_mod_time")),4))),intval(strrev(substr(strrev($db->f("cal_mod_time")),2,2))),intval(strrev(substr(strrev($db->f("cal_mod_time")),0,2))),intval(substr($db->f("cal_mod_date"),4,2)),intval(substr($db->f("cal_mod_date"),6,2)),intval(substr($db->f("cal_mod_date"),0,4))); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT count(*) FROM webcal_entry",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + if($phpgw_setup->db->f(0)) { + $phpgw_setup->db->query("SELECT cal_id,cal_owner,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description,cal_id,cal_date,cal_time,cal_mod_date,cal_mod_time FROM webcal_entry ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_owner = $phpgw_setup->db->f("cal_owner"); + $cal_duration = $phpgw_setup->db->f("cal_duration"); + $cal_priority = $phpgw_setup->db->f("cal_priority"); + $cal_type = $phpgw_setup->db->f("cal_type"); + $cal_access = $phpgw_setup->db->f("cal_access"); + $cal_name = $phpgw_setup->db->f("cal_name"); + $cal_description = $phpgw_setup->db->f("cal_description"); + $datetime = mktime(intval(strrev(substr(strrev($phpgw_setup->db->f("cal_time")),4))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_time")),2,2))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_time")),0,2))),intval(substr($phpgw_setup->db->f("cal_date"),4,2)),intval(substr($phpgw_setup->db->f("cal_date"),6,2)),intval(substr($phpgw_setup->db->f("cal_date"),0,4))); + $moddatetime = mktime(intval(strrev(substr(strrev($phpgw_setup->db->f("cal_mod_time")),4))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_mod_time")),2,2))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_mod_time")),0,2))),intval(substr($phpgw_setup->db->f("cal_mod_date"),4,2)),intval(substr($phpgw_setup->db->f("cal_mod_date"),6,2)),intval(substr($phpgw_setup->db->f("cal_mod_date"),0,4))); $db2->query("SELECT groups FROM webcal_entry_groups WHERE cal_id=".$cal_id,__LINE__,__FILE__); $db2->next_record(); $cal_group = $db2->f("groups"); @@ -609,8 +609,8 @@ ."VALUES(".$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')",__LINE__,__FILE__); } } - $db->query("DROP TABLE webcal_entry_groups"); - $db->query("DROP TABLE webcal_entry"); + $phpgw_setup->db->query("DROP TABLE webcal_entry_groups"); + $phpgw_setup->db->query("DROP TABLE webcal_entry"); $sql = "CREATE TABLE calendar_entry_user ( cal_id int(11) DEFAULT '0' NOT NULL, @@ -618,19 +618,19 @@ cal_status char(1) DEFAULT 'A', PRIMARY KEY (cal_id, cal_login) )"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT count(*) FROM webcal_entry_user",__LINE__,__FILE__); - $db->next_record(); - if($db->f(0)) { - $db->query("SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $cal_id = $db->f("cal_id"); - $cal_login = $db->f("cal_login"); - $cal_status = $db->f("cal_status"); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT count(*) FROM webcal_entry_user",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + if($phpgw_setup->db->f(0)) { + $phpgw_setup->db->query("SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_login = $phpgw_setup->db->f("cal_login"); + $cal_status = $phpgw_setup->db->f("cal_status"); $db2->query("INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES(".$cal_id.",".$cal_login.",'".$cal_status."')",__LINE__,__FILE__); } } - $db->query("DROP TABLE webcal_entry_user",__LINE__,__FILE__); + $phpgw_setup->db->query("DROP TABLE webcal_entry_user",__LINE__,__FILE__); $sql = "CREATE TABLE calendar_entry_repeats ( cal_id int(11) DEFAULT 0 NOT NULL, @@ -640,106 +640,106 @@ cal_frequency int DEFAULT '1', cal_days char(7) )"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT count(*) FROM webcal_entry_repeats",__LINE__,__FILE__); - $db->next_record(); - if($db->f(0)) { - $db->query("SELECT cal_id,cal_type,cal_end,cal_frequency,cal_days FROM webcal_entry_repeats ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $cal_id = $db->f("cal_id"); - $cal_type = $db->f("cal_type"); - if(isset($db->Record["cal_end"])) { - $enddate = mktime(0,0,0,intval(substr($db->f("cal_end"),4,2)),intval(substr($db->f("cal_end"),6,2)),intval(substr($db->f("cal_end"),0,4))); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT count(*) FROM webcal_entry_repeats",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + if($phpgw_setup->db->f(0)) { + $phpgw_setup->db->query("SELECT cal_id,cal_type,cal_end,cal_frequency,cal_days FROM webcal_entry_repeats ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_type = $phpgw_setup->db->f("cal_type"); + if(isset($phpgw_setup->db->Record["cal_end"])) { + $enddate = mktime(0,0,0,intval(substr($phpgw_setup->db->f("cal_end"),4,2)),intval(substr($phpgw_setup->db->f("cal_end"),6,2)),intval(substr($phpgw_setup->db->f("cal_end"),0,4))); $useend = 1; } else { $enddate = 0; $useend = 0; } - $cal_frequency = $db->f("cal_frequency"); - $cal_days = $db->f("cal_days"); + $cal_frequency = $phpgw_setup->db->f("cal_frequency"); + $cal_days = $phpgw_setup->db->f("cal_days"); $db2->query("INSERT INTO calendar_entry_repeats(cal_id,cal_type,cal_use_end,cal_end,cal_frequency,cal_days) VALUES(".$cal_id.",'".$cal_type."',".$useend.",".$enddate.",".$cal_frequency.",'".$cal_days."')",__LINE__,__FILE__); } } - $db->query("DROP TABLE webcal_entry_repeats",__LINE__,__FILE__); - $db->query("UPDATE applications SET app_tables='calendar_entry,calendar_entry_user,calendar_entry_repeats' WHERE app_name='calendar'",__LINE__,__FILE__); + $phpgw_setup->db->query("DROP TABLE webcal_entry_repeats",__LINE__,__FILE__); + $phpgw_setup->db->query("UPDATE applications SET app_tables='calendar_entry,calendar_entry_user,calendar_entry_repeats' WHERE app_name='calendar'",__LINE__,__FILE__); - $currentver = "0.9.7pre2"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7pre2"; } $test[] = "0.9.7pre2"; function upgrade0_9_7pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db2 = $db; + global $phpgw_info, $phpgw_setup; + $db2 = $phpgw_setup->db; $sql = "ALTER TABLE calendar_entry CHANGE cal_duration cal_edatetime int(11)"; - $db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); - $db->query("SELECT cal_id,cal_datetime,cal_owner,cal_edatetime,cal_mdatetime FROM calendar_entry ORDER BY cal_id",__LINE__,__FILE__); - if($db->num_rows()) { - while($db->next_record()) { - $db2->query("SELECT preference_value FROM preferences WHERE preference_name='tz_offset' AND preference_appname='common' AND preference_owner=".$db->f("cal_owner"),__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT cal_id,cal_datetime,cal_owner,cal_edatetime,cal_mdatetime FROM calendar_entry ORDER BY cal_id",__LINE__,__FILE__); + if($phpgw_setup->db->num_rows()) { + while($phpgw_setup->db->next_record()) { + $db2->query("SELECT preference_value FROM preferences WHERE preference_name='tz_offset' AND preference_appname='common' AND preference_owner=".$phpgw_setup->db->f("cal_owner"),__LINE__,__FILE__); $db2->next_record(); $tz = $db2->f("preference_value"); - $cal_id = $db->f("cal_id"); - $datetime = $db->f("cal_datetime") - ((60 * 60) * $tz); - $mdatetime = $db->f("cal_mdatetime") - ((60 * 60) * $tz); - $edatetime = $datetime + (60 * $db->f("cal_edatetime")); + $cal_id = $phpgw_setup->db->f("cal_id"); + $datetime = $phpgw_setup->db->f("cal_datetime") - ((60 * 60) * $tz); + $mdatetime = $phpgw_setup->db->f("cal_mdatetime") - ((60 * 60) * $tz); + $edatetime = $datetime + (60 * $phpgw_setup->db->f("cal_edatetime")); $db2->query("UPDATE calendar_entry SET cal_datetime=".$datetime.", cal_edatetime=".$edatetime.", cal_mdatetime=".$mdatetime." WHERE cal_id=".$cal_id,__LINE__,__FILE__); } } - $currentver = "0.9.7pre3"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7pre3"; } $test[] = "0.9.7pre3"; function upgrade0_9_7pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.7"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7"; } $test[] = "0.9.7"; function upgrade0_9_7(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.8pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre1"; } $test[] = "0.9.8pre1"; function upgrade0_9_8pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("select * from preferences order by preference_owner"); - while ($db->next_record()) { - $t[$db->f("preference_owner")][$db->f("preference_appname")][$db->f("preference_var")] = $db->f("preference_value"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("select * from preferences order by preference_owner"); + while ($phpgw_setup->db->next_record()) { + $t[$phpgw_setup->db->f("preference_owner")][$phpgw_setup->db->f("preference_appname")][$phpgw_setup->db->f("preference_var")] = $phpgw_setup->db->f("preference_value"); } - $db->query("drop table preferences"); + $phpgw_setup->db->query("drop table preferences"); $sql = "create table preferences ( preference_owner int, preference_value text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); while ($tt = each($t)) { - $db->query("insert into preferences values ('$tt[0]','" . serialize($tt[1]) . "')"); + $phpgw_setup->db->query("insert into preferences values ('$tt[0]','" . serialize($tt[1]) . "')"); } - $currentver = "0.9.8pre2"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre2"; } $test[] = "0.9.8pre2"; function upgrade0_9_8pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "CREATE TABLE config ( config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL )"; - @$db->query($sql); + @$phpgw_setup->db->query($sql); - $db->query($sql); - $currentver = "0.9.8pre3"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre3"; } $test[] = "0.9.8pre3"; function upgrade0_9_8pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; - $db->query("DROP TABLE phpgw_sessions",__LINE__,__FILE__); + $phpgw_setup->db->query("DROP TABLE phpgw_sessions",__LINE__,__FILE__); $sql = "CREATE TABLE phpgw_sessions ( session_id varchar(255) NOT NULL, session_lid varchar(255), @@ -749,13 +749,13 @@ session_info text, UNIQUE sessionid (session_id) )"; - $db->query($sql); - $currentver = "0.9.8pre4"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre4"; } $test[] = "0.9.8pre4"; function upgrade0_9_8pre4(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "create table phpgw_hooks ( hook_id int not null auto_increment, @@ -764,25 +764,24 @@ hook_filename varchar(255), primary key hook_id (hook_id) );"; - $db->query($sql); - $currentver = "0.9.8pre5"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5"; } reset ($test); while (list ($key, $value) = each ($test)){ - if ($currentver == $value) { + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { $ver = "upgrade".ereg_replace("\.","_",$value); $ver(); echo "
No table changes were needed. The script only updated your version setting.
"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
Upgrade from $value to $currentver is completed.Upgrade from $value to $phpgw_info["setup"]["currentver"]["phpgwapi"] is completed.
"; if ($tableschanged == True){$tablechanges = True;} - if (!$prebeta){ - $db->query("update applications set app_version='".$currentver."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')"); + if (!$phpgw_info["setup"]["prebeta"]){ + $phpgw_setup->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')"); } } } - -?> +?> \ No newline at end of file diff --git a/setup/sql/mysql_upgrade_prebeta.inc.php b/setup/sql/mysql_upgrade_prebeta.inc.php index 982cc148ae..0b1ce7cea9 100644 --- a/setup/sql/mysql_upgrade_prebeta.inc.php +++ b/setup/sql/mysql_upgrade_prebeta.inc.php @@ -13,161 +13,160 @@ $test[] = "7122000"; function upgrade7122000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; echo "Upgrading from 7122000 is not yet ready.
You can do this manually if you choose, otherwise dump your tables and start over.
\n"; - $prebeta = True; - $currentver = "8032000"; + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8032000"; } $test[] = "8032000"; function upgrade8032000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; echo "Upgrading from 8032000 is not yet ready.
You can do this manually if you choose, otherwise dump your tables and start over.
\n"; - $prebeta = True; - $currentver = "8072000"; + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8072000"; } $test[] = "8072000"; function upgrade8072000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; $sql = "CREATE TABLE applications (" ."app_name varchar(25) NOT NULL," ."app_title varchar(50)," ."app_enabled int," ."UNIQUE app_name (app_name)" .")"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)"); - $prebeta = True; - $currentver = "8212000"; + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)"); + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8212000"; } $test[] = "8212000"; function upgrade8212000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; - $db->query("alter table chat_channel change name name varchar(10) not null"); - $db->query("alter table chat_messages change channel channel char(20) not null"); - $db->query("alter table chat_messages change loginid loginid varchar(20) not null"); - $db->query("alter table chat_currentin change loginid loginid varchar(25) not null"); - $db->query("alter table chat_currentin change channel channel char(20)"); - $db->query("alter table chat_privatechat change user1 user1 varchar(25) not null"); - $db->query("alter table chat_privatechat change user2 user2 varchar(25) not null"); - $prebeta = True; - $currentver = "9052000"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table chat_channel change name name varchar(10) not null"); + $phpgw_setup->db->query("alter table chat_messages change channel channel char(20) not null"); + $phpgw_setup->db->query("alter table chat_messages change loginid loginid varchar(20) not null"); + $phpgw_setup->db->query("alter table chat_currentin change loginid loginid varchar(25) not null"); + $phpgw_setup->db->query("alter table chat_currentin change channel channel char(20)"); + $phpgw_setup->db->query("alter table chat_privatechat change user1 user1 varchar(25) not null"); + $phpgw_setup->db->query("alter table chat_privatechat change user2 user2 varchar(25) not null"); + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9052000"; } $test[] = "9052000"; function upgrade9052000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; echo "Upgrading from 9052000 is not available.
I dont believe there were any changes, so this should be fine.
\n"; - $prebeta = True; - $currentver = "9072000"; + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9072000"; } $test[] = "9072000"; function upgrade9072000(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment"); - $db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL"); - $db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL"); - $db->query("alter table accounts change firstname account_firstname varchar(50)"); - $db->query("alter table accounts change lastname account_lastname varchar(50)"); - $db->query("alter table accounts change permissions account_permissions text"); - $db->query("alter table accounts change groups account_groups varchar(30)"); - $db->query("alter table accounts change lastlogin account_lastlogin int(11)"); - $db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)"); - $db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)"); - $db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL"); - $db->query("alter table applications add app_order int"); - $db->query("alter table applications add app_tables varchar(255)"); - $db->query("alter table applications add app_version varchar(20) not null default '0.0'"); - $db->query("alter table preferences change owner preference_owner varchar(20)"); - $db->query("alter table preferences change name preference_name varchar(50)"); - $db->query("alter table preferences change value preference_value varchar(50)"); - $db->query("alter table preferences add preference_appname varchar(50) default ''"); - $db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL"); - $db->query("alter table sessions change loginid session_lid varchar(20)"); - $db->query("alter table sessions change passwd session_pwd varchar(255)"); - $db->query("alter table sessions change ip session_ip varchar(255)"); - $db->query("alter table sessions change logintime session_logintime int(11)"); - $db->query("alter table sessions change dla session_dla int(11)"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment"); + $phpgw_setup->db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL"); + $phpgw_setup->db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL"); + $phpgw_setup->db->query("alter table accounts change firstname account_firstname varchar(50)"); + $phpgw_setup->db->query("alter table accounts change lastname account_lastname varchar(50)"); + $phpgw_setup->db->query("alter table accounts change permissions account_permissions text"); + $phpgw_setup->db->query("alter table accounts change groups account_groups varchar(30)"); + $phpgw_setup->db->query("alter table accounts change lastlogin account_lastlogin int(11)"); + $phpgw_setup->db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)"); + $phpgw_setup->db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)"); + $phpgw_setup->db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL"); + $phpgw_setup->db->query("alter table applications add app_order int"); + $phpgw_setup->db->query("alter table applications add app_tables varchar(255)"); + $phpgw_setup->db->query("alter table applications add app_version varchar(20) not null default '0.0'"); + $phpgw_setup->db->query("alter table preferences change owner preference_owner varchar(20)"); + $phpgw_setup->db->query("alter table preferences change name preference_name varchar(50)"); + $phpgw_setup->db->query("alter table preferences change value preference_value varchar(50)"); + $phpgw_setup->db->query("alter table preferences add preference_appname varchar(50) default ''"); + $phpgw_setup->db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL"); + $phpgw_setup->db->query("alter table sessions change loginid session_lid varchar(20)"); + $phpgw_setup->db->query("alter table sessions change passwd session_pwd varchar(255)"); + $phpgw_setup->db->query("alter table sessions change ip session_ip varchar(255)"); + $phpgw_setup->db->query("alter table sessions change logintime session_logintime int(11)"); + $phpgw_setup->db->query("alter table sessions change dla session_dla int(11)"); - $db->query("alter table todo change con todo_id int(11)"); - $db->query("alter table todo change owner todo_owner varchar(25)"); - $db->query("alter table todo change access todo_access varchar(255)"); - $db->query("alter table todo change des todo_des text"); - $db->query("alter table todo change pri todo_pri int(11)"); - $db->query("alter table todo change status todo_status int(11)"); - $db->query("alter table todo change datecreated todo_datecreated int(11)"); - $db->query("alter table todo change datedue todo_datedue int(11)"); + $phpgw_setup->db->query("alter table todo change con todo_id int(11)"); + $phpgw_setup->db->query("alter table todo change owner todo_owner varchar(25)"); + $phpgw_setup->db->query("alter table todo change access todo_access varchar(255)"); + $phpgw_setup->db->query("alter table todo change des todo_des text"); + $phpgw_setup->db->query("alter table todo change pri todo_pri int(11)"); + $phpgw_setup->db->query("alter table todo change status todo_status int(11)"); + $phpgw_setup->db->query("alter table todo change datecreated todo_datecreated int(11)"); + $phpgw_setup->db->query("alter table todo change datedue todo_datedue int(11)"); // The addressbook section is missing. - $db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'"); - $db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'"); - $db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'"); - $db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'"); - $db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'"); - $db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'"); - $db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'"); - $db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'"); - $db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'"); - $db->query("update applications set app_order=10,app_tables=NULL where app_name='email'"); - $db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'"); - $db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'"); + $phpgw_setup->db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'"); + $phpgw_setup->db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'"); + $phpgw_setup->db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'"); + $phpgw_setup->db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'"); + $phpgw_setup->db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'"); + $phpgw_setup->db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'"); + $phpgw_setup->db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'"); + $phpgw_setup->db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'"); + $phpgw_setup->db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'"); + $phpgw_setup->db->query("update applications set app_order=10,app_tables=NULL where app_name='email'"); + $phpgw_setup->db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'"); + $phpgw_setup->db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'"); $sql = "CREATE TABLE config (" ."config_name varchar(25) NOT NULL," ."config_value varchar(100)," ."UNIQUE config_name (config_name)" .")"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); - $db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); - $db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); - $db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'"); - $db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); - $db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); - $db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); - $db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); - $db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); - $db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); - $db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); - $db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); - $db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); - $db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); - $db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); - $db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); - $db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); - $db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); - $currentver = "0.9.1"; + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.1"; } - ?> \ No newline at end of file diff --git a/setup/sql/pgsql_droptables.inc.php b/setup/sql/pgsql_droptables.inc.php index 296b481c41..a037c61286 100644 --- a/setup/sql/pgsql_droptables.inc.php +++ b/setup/sql/pgsql_droptables.inc.php @@ -11,35 +11,35 @@ /* $Id$ */ - $db->query("DROP TABLE config"); - $db->query("DROP TABLE applications"); - $db->query("drop sequence accounts_account_id_seq"); - $db->query("DROP TABLE accounts"); - $db->query("drop sequence groups_group_id_seq"); - $db->query("DROP TABLE groups"); - $db->query("DROP TABLE preferences"); - $db->query("DROP TABLE phpgw_sessions"); - $db->query("DROP TABLE phpgw_app_sessions"); - $db->query("DROP TABLE phpgw_acl"); - $db->query("DROP TABLE phpgw_access_log"); - $db->query("drop sequence profiles_con_seq"); - $db->query("DROP TABLE profiles"); - $db->query("drop sequence addressbook_ab_id_seq"); - $db->query("DROP TABLE addressbook"); - $db->query("drop sequence calendar_entry_cal_id_seq"); - $db->query("drop sequence todo_todo_id_seq"); - $db->query("DROP TABLE todo"); - $db->query("DROP TABLE calendar_entry"); - $db->query("DROP TABLE calendar_entry_user"); - $db->query("DROP TABLE calendar_entry_repeats"); - $db->query("drop sequence newsgroups_con_seq"); - $db->query("DROP TABLE newsgroups"); - $db->query("DROP TABLE lang"); - $db->query("drop sequence news_msg_con_seq"); - $db->query("DROP TABLE news_msg"); - $db->query("DROP TABLE languages"); - $db->query("drop sequence categories_cat_id_seq"); - $db->query("DROP TABLE categories"); - $db->query("DROP sequence notes_note_id_seq"); - $db->query("DROP TABLE notes"); + $phpgw_setup->db->query("DROP TABLE config"); + $phpgw_setup->db->query("DROP TABLE applications"); + $phpgw_setup->db->query("drop sequence accounts_account_id_seq"); + $phpgw_setup->db->query("DROP TABLE accounts"); + $phpgw_setup->db->query("drop sequence groups_group_id_seq"); + $phpgw_setup->db->query("DROP TABLE groups"); + $phpgw_setup->db->query("DROP TABLE preferences"); + $phpgw_setup->db->query("DROP TABLE phpgw_sessions"); + $phpgw_setup->db->query("DROP TABLE phpgw_app_sessions"); + $phpgw_setup->db->query("DROP TABLE phpgw_acl"); + $phpgw_setup->db->query("DROP TABLE phpgw_access_log"); + $phpgw_setup->db->query("drop sequence profiles_con_seq"); + $phpgw_setup->db->query("DROP TABLE profiles"); + $phpgw_setup->db->query("drop sequence addressbook_ab_id_seq"); + $phpgw_setup->db->query("DROP TABLE addressbook"); + $phpgw_setup->db->query("drop sequence calendar_entry_cal_id_seq"); + $phpgw_setup->db->query("drop sequence todo_todo_id_seq"); + $phpgw_setup->db->query("DROP TABLE todo"); + $phpgw_setup->db->query("DROP TABLE calendar_entry"); + $phpgw_setup->db->query("DROP TABLE calendar_entry_user"); + $phpgw_setup->db->query("DROP TABLE calendar_entry_repeats"); + $phpgw_setup->db->query("drop sequence newsgroups_con_seq"); + $phpgw_setup->db->query("DROP TABLE newsgroups"); + $phpgw_setup->db->query("DROP TABLE lang"); + $phpgw_setup->db->query("drop sequence news_msg_con_seq"); + $phpgw_setup->db->query("DROP TABLE news_msg"); + $phpgw_setup->db->query("DROP TABLE languages"); + $phpgw_setup->db->query("drop sequence categories_cat_id_seq"); + $phpgw_setup->db->query("DROP TABLE categories"); + $phpgw_setup->db->query("DROP sequence notes_note_id_seq"); + $phpgw_setup->db->query("DROP TABLE notes"); ?> \ No newline at end of file diff --git a/setup/sql/pgsql_newtables.inc.php b/setup/sql/pgsql_newtables.inc.php index 1baad65056..e6a0789af6 100644 --- a/setup/sql/pgsql_newtables.inc.php +++ b/setup/sql/pgsql_newtables.inc.php @@ -17,7 +17,7 @@ config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table applications ( app_name varchar(25) NOT NULL, @@ -28,7 +28,7 @@ app_version varchar(20) NOT NULL default '0.0', unique(app_name) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table accounts ( @@ -45,14 +45,14 @@ account_status char(1), unique(account_lid) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table groups ( group_id serial, group_name varchar(50), group_apps varchar(255) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table phpgw_sessions ( session_id varchar(255), @@ -63,7 +63,7 @@ session_info text, unique(session_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_acl ( acl_appname varchar(50), @@ -72,7 +72,7 @@ acl_account_type char(1), acl_rights int )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_app_sessions ( sessionid varchar(255) NOT NULL, @@ -80,7 +80,7 @@ app varchar(20), content text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table phpgw_access_log ( sessionid varchar(255), @@ -89,13 +89,13 @@ li int, lo varchar(255) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table preferences ( preference_owner int, preference_value text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE profiles ( con serial, @@ -106,7 +106,7 @@ picture_format varchar(255), picture text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table addressbook ( ab_id serial, @@ -133,7 +133,7 @@ ab_address2 varchar(60), ab_url varchar(255) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table todo ( todo_id serial, @@ -147,7 +147,7 @@ todo_startdate int, todo_enddate int )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE calendar_entry ( cal_id serial, @@ -162,14 +162,14 @@ cal_name varchar(80) NOT NULL, cal_description text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE calendar_entry_user ( cal_id int DEFAULT 0 NOT NULL, cal_login int DEFAULT 0 NOT NULL, cal_status char(1) DEFAULT 'A' )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table calendar_entry_repeats ( cal_id int DEFAULT 0 NOT NULL, @@ -179,7 +179,7 @@ cal_frequency int default 1, cal_days char(7) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE newsgroups ( con serial, @@ -189,7 +189,7 @@ active char DEFAULT 'N' NOT NULL, lastread int )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE news_msg ( con serial, @@ -224,7 +224,7 @@ msglines int DEFAULT 0, body text NOT NULL )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE lang ( @@ -234,7 +234,7 @@ content text NOT NULL, unique(message_id,app_name,lang) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE categories ( cat_id serial, @@ -243,14 +243,14 @@ cat_name varchar(150) NOT NULL, cat_description text NOT NULL )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE languages ( lang_id varchar(2) NOT NULL, lang_name varchar(50) NOT NULL, available varchar(3) NOT NULL DEFAULT 'No' )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE notes ( note_id serial, @@ -258,7 +258,7 @@ note_date int, note_content text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table phpgw_hooks ( hook_id serial, @@ -266,9 +266,9 @@ hook_location varchar(255), hook_filename varchar(255) );"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $currentver = "0.9.8pre5"; - $oldversion = $currentver; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5"; + $phpgw_info["setup"]["oldver"]["phpgwapi"] = $phpgw_info["setup"]["currentver"]["phpgwapi"]; update_version_table(); -?> +?> \ No newline at end of file diff --git a/setup/sql/pgsql_upgrade_beta.inc.php b/setup/sql/pgsql_upgrade_beta.inc.php index 2a5095f56c..7316a43234 100644 --- a/setup/sql/pgsql_upgrade_beta.inc.php +++ b/setup/sql/pgsql_upgrade_beta.inc.php @@ -13,12 +13,12 @@ $test[] = "0.9.1"; function upgrade0_9_1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table access_log change lo lo varchar(255)"); - $db->query("alter table addressbook change ab_id ab_id int(11) NOT NULL auto_increment"); - $db->query("alter table addressbook add ab_company_id int(10) unsigned"); - $db->query("alter table addressbook add ab_title varchar(60)"); - $db->query("alter table addressbook add ab_address2 varchar(60)"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table access_log change lo lo varchar(255)"); + $phpgw_setup->db->query("alter table addressbook change ab_id ab_id int(11) NOT NULL auto_increment"); + $phpgw_setup->db->query("alter table addressbook add ab_company_id int(10) unsigned"); + $phpgw_setup->db->query("alter table addressbook add ab_title varchar(60)"); + $phpgw_setup->db->query("alter table addressbook add ab_address2 varchar(60)"); $sql = "CREATE TABLE customers ( company_id int(10) unsigned NOT NULL auto_increment, @@ -34,324 +34,324 @@ notes text, PRIMARY KEY (company_id) );"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("update lang set lang='da' where lang='dk'"); - $db->query("update lang set lang='ko' where lang='kr'"); + $phpgw_setup->db->query("update lang set lang='da' where lang='dk'"); + $phpgw_setup->db->query("update lang set lang='ko' where lang='kr'"); - $db->query("update preferences set preference_name='da' where preference_name='dk'"); - $db->query("update preferences set preference_name='ko' where preference_name='kr'"); + $phpgw_setup->db->query("update preferences set preference_name='da' where preference_name='dk'"); + $phpgw_setup->db->query("update preferences set preference_name='ko' where preference_name='kr'"); //add weather support - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); - $db->query("INSERT INTO lang (message_id, app_name, lang, content) VALUES( 'weather','Weather','en','weather')"); - $currentver = "0.9.2"; + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('weather', 'Weather', 1, 12, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); + $phpgw_setup->db->query("INSERT INTO lang (message_id, app_name, lang, content) VALUES( 'weather','Weather','en','weather')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.2"; } function v0_9_2to0_9_3update_owner($table,$field){ - global $db; - $db->query("select distinct($field) from $table"); - if ($db->num_rows()) { - while($db->next_record()) { - $owner[count($owner)] = $db->f($field); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("select distinct($field) from $table"); + if ($phpgw_setup->db->num_rows()) { + while($phpgw_setup->db->next_record()) { + $owner[count($owner)] = $phpgw_setup->db->f($field); } for($i=0;$iquery("select account_id from accounts where account_lid='".$owner[$i]."'"); - $db->next_record(); - $db->query("update $table set $field=".$db->f("account_id")." where $field='".$owner[$i]."'"); + $phpgw_setup->db->query("select account_id from accounts where account_lid='".$owner[$i]."'"); + $phpgw_setup->db->next_record(); + $phpgw_setup->db->query("update $table set $field=".$phpgw_setup->db->f("account_id")." where $field='".$owner[$i]."'"); } } - $db->query("alter table $table change $field $field int(11) NOT NULL"); + $phpgw_setup->db->query("alter table $table change $field $field int(11) NOT NULL"); } $test[] = "0.9.2"; function upgrade0_9_2(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; v0_9_2to0_9_3update_owner("addressbook","ab_owner"); v0_9_2to0_9_3update_owner("todo","todo_owner"); v0_9_2to0_9_3update_owner("webcal_entry","cal_create_by"); v0_9_2to0_9_3update_owner("webcal_entry_user","cal_login"); - $currentver = "0.9.3pre1"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre1"; } $test[] = "0.9.3pre1"; function upgrade0_9_3pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; v0_9_2to0_9_3update_owner("addressbook","ab_owner"); v0_9_2to0_9_3update_owner("todo","todo_owner"); v0_9_2to0_9_3update_owner("webcal_entry","cal_create_by"); v0_9_2to0_9_3update_owner("webcal_entry_user","cal_login"); - $currentver = "0.9.3pre2"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre2"; } $test[] = "0.9.3pre2"; function upgrade0_9_3pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("select owner, newsgroup from users_newsgroups"); - if($db->num_rows()) { - while($db->next_record()) { - $owner[count($owner)] = $db->f("owner"); - $newsgroup[count($newsgroup)] = $db->f("newsgroup"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("select owner, newsgroup from users_newsgroups"); + if($phpgw_setup->db->num_rows()) { + while($phpgw_setup->db->next_record()) { + $owner[count($owner)] = $phpgw_setup->db->f("owner"); + $newsgroup[count($newsgroup)] = $phpgw_setup->db->f("newsgroup"); } for($i=0;$iquery("insert into preferences (preference_owner,preference_name," + $phpgw_setup->db->query("insert into preferences (preference_owner,preference_name," ."preference_value,preference_appname) values ('".$owner[$i]."','".$newsgroup[$i]."','True'," ."'nntp')"); } - $db->query("drop table users_newsgroups"); - $db->query("update applications set app_tables='newsgroups' where app_name='nntp'"); + $phpgw_setup->db->query("drop table users_newsgroups"); + $phpgw_setup->db->query("update applications set app_tables='newsgroups' where app_name='nntp'"); } - $currentver = "0.9.3pre3"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre3"; } $test[] = "0.9.3pre3"; function upgrade0_9_3pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table todo add todo_id_parent int(11) DEFAULT '0' NOT NULL"); - $currentver = "0.9.3pre4"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table todo add todo_id_parent int(11) DEFAULT '0' NOT NULL"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre4"; } $test[] = "0.9.3pre4"; function upgrade0_9_3pre4(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("create table temp as select * from config"); - $db->query("drop table config"); - $db->query("create table config config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL"); - $db->query("insert into config select * from temp"); - $db->query("drop table config"); - $currentver = "0.9.3pre5"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("create table temp as select * from config"); + $phpgw_setup->db->query("drop table config"); + $phpgw_setup->db->query("create table config config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL"); + $phpgw_setup->db->query("insert into config select * from temp"); + $phpgw_setup->db->query("drop table config"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre5"; } $test[] = "0.9.3pre5"; function upgrade0_9_3pre5(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("CREATE TABLE categories ( + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("CREATE TABLE categories ( cat_id serial, account_id int DEFAULT '0' NOT NULL, app_name varchar(25) NOT NULL, cat_name varchar(150) NOT NULL, cat_description text NOT NULL)" ); - $currentver = "0.9.3pre6"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre6"; } $test[] = "0.9.3pre6"; function upgrade0_9_3pre6(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table addressbook add ab_url varchar(255)"); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 0, 13, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); - $currentver = "0.9.3pre7"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table addressbook add ab_url varchar(255)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('transy', 'Translation Management', 0, 13, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre7"; } $test[] = "0.9.3pre7"; function upgrade0_9_3pre7(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("CREATE TABLE languages ( + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("CREATE TABLE languages ( lang_id varchar(2) NOT NULL, lang_name varchar(50) NOT NULL, available varchar(3) NOT NULL DEFAULT 'No' )"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AA','Afar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AB','Abkhazian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AF','Afrikaans','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AM','Amharic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AR','Arabic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AS','Assamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AY','Aymara','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AZ','Azerbaijani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BA','Bashkir','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BE','Byelorussian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BG','Bulgarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BH','Bihari','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BI','Bislama','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BN','Bengali / Bangla','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BO','Tibetan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BR','Breton','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CA','Catalan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CO','Corsican','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CS','Czech','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CY','Welsh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DA','Danish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DE','German','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DZ','Bhutani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EL','Greek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EN','English / American','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EO','Esperanto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ES','Spanish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ET','Estonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EU','Basque','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FA','Persian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FI','Finnish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FJ','Fiji','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FO','Faeroese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FR','French','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FY','Frisian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GA','Irish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GD','Gaelic / Scots Gaelic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GL','Galician','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GN','Guarani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GU','Gujarati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HA','Hausa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HI','Hindi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HR','Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HU','Hungarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HY','Armenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IA','Interlingua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IE','Interlingue','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IK','Inupiak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IN','Indonesian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IS','Icelandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IT','Italian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IW','Hebrew','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JA','Japanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JI','Yiddish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JW','Javanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KA','Georgian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KK','Kazakh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KL','Greenlandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KM','Cambodian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KN','Kannada','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KO','Korean','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KS','Kashmiri','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KU','Kurdish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KY','Kirghiz','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LA','Latin','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LN','Lingala','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LO','Laothian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LT','Lithuanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LV','Latvian / Lettish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MG','Malagasy','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MI','Maori','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MK','Macedonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ML','Malayalam','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MN','Mongolian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MO','Moldavian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MR','Marathi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MS','Malay','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MT','Maltese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MY','Burmese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NA','Nauru','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NE','Nepali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NL','Dutch','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NO','Norwegian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OC','Occitan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OM','Oromo / Afan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OR','Oriya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PA','Punjabi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PL','Polish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PS','Pashto / Pushto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PT','Portuguese','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('QU','Quechua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RM','Rhaeto-Romance','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RN','Kirundi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RO','Romanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RU','Russian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RW','Kinyarwanda','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SA','Sanskrit','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SD','Sindhi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SG','Sangro','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SH','Serbo-Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SI','Singhalese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SK','Slovak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SL','Slovenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SM','Samoan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SN','Shona','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SO','Somali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SQ','Albanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SR','Serbian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SS','Siswati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ST','Sesotho','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SU','Sudanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SV','Swedish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SW','Swahili','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TA','Tamil','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TE','Tegulu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TG','Tajik','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TH','Thai','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TI','Tigrinya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TK','Turkmen','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TL','Tagalog','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TN','Setswana','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TO','Tonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TR','Turkish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TS','Tsonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TT','Tatar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TW','Twi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UK','Ukrainian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UR','Urdu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UZ','Uzbek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VI','Vietnamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VO','Volapuk','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('WO','Wolof','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('XH','Xhosa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('YO','Yoruba','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZH','Chinese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZU','Zulu','No')"); - $currentver = "0.9.3pre8"; + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AA','Afar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AB','Abkhazian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AF','Afrikaans','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AM','Amharic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AR','Arabic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AS','Assamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AY','Aymara','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('AZ','Azerbaijani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BA','Bashkir','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BE','Byelorussian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BG','Bulgarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BH','Bihari','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BI','Bislama','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BN','Bengali / Bangla','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BO','Tibetan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('BR','Breton','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CA','Catalan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CO','Corsican','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CS','Czech','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('CY','Welsh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DA','Danish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DE','German','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('DZ','Bhutani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EL','Greek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EN','English / American','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EO','Esperanto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ES','Spanish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ET','Estonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('EU','Basque','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FA','Persian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FI','Finnish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FJ','Fiji','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FO','Faeroese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FR','French','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('FY','Frisian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GA','Irish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GD','Gaelic / Scots Gaelic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GL','Galician','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GN','Guarani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('GU','Gujarati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HA','Hausa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HI','Hindi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HR','Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HU','Hungarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('HY','Armenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IA','Interlingua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IE','Interlingue','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IK','Inupiak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IN','Indonesian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IS','Icelandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IT','Italian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('IW','Hebrew','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JA','Japanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JI','Yiddish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('JW','Javanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KA','Georgian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KK','Kazakh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KL','Greenlandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KM','Cambodian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KN','Kannada','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KO','Korean','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KS','Kashmiri','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KU','Kurdish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('KY','Kirghiz','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LA','Latin','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LN','Lingala','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LO','Laothian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LT','Lithuanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('LV','Latvian / Lettish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MG','Malagasy','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MI','Maori','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MK','Macedonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ML','Malayalam','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MN','Mongolian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MO','Moldavian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MR','Marathi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MS','Malay','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MT','Maltese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('MY','Burmese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NA','Nauru','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NE','Nepali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NL','Dutch','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('NO','Norwegian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OC','Occitan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OM','Oromo / Afan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('OR','Oriya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PA','Punjabi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PL','Polish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PS','Pashto / Pushto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('PT','Portuguese','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('QU','Quechua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RM','Rhaeto-Romance','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RN','Kirundi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RO','Romanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RU','Russian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('RW','Kinyarwanda','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SA','Sanskrit','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SD','Sindhi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SG','Sangro','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SH','Serbo-Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SI','Singhalese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SK','Slovak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SL','Slovenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SM','Samoan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SN','Shona','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SO','Somali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SQ','Albanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SR','Serbian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SS','Siswati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ST','Sesotho','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SU','Sudanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SV','Swedish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('SW','Swahili','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TA','Tamil','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TE','Tegulu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TG','Tajik','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TH','Thai','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TI','Tigrinya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TK','Turkmen','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TL','Tagalog','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TN','Setswana','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TO','Tonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TR','Turkish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TS','Tsonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TT','Tatar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('TW','Twi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UK','Ukrainian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UR','Urdu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('UZ','Uzbek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VI','Vietnamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('VO','Volapuk','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('WO','Wolof','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('XH','Xhosa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('YO','Yoruba','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZH','Chinese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ZU','Zulu','No')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre8"; } $test[] = "0.9.3pre8"; function upgrade0_9_3pre8(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.3pre9"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre9"; } $test[] = "0.9.3pre9"; function upgrade0_9_3pre9(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.3pre10"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre10"; } $test[] = "0.9.3pre10"; function upgrade0_9_3pre10(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.3"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3"; } $test[] = "0.9.3"; function upgrade0_9_3(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.4pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre1"; } $test[] = "0.9.4pre1"; function upgrade0_9_4pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "CREATE TABLE notes ( note_id serial, note_owner int, note_date int, note_content text )"; - $db->query($sql); - $db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 13, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); - $currentver = "0.9.4pre2"; + $phpgw_setup->db->query($sql); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('notes', 'Notes', 1, 13, NULL, '".$phpgw_info["server"]["versions"]["phpgwapi"]."')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre2"; } $test[] = "0.9.4pre2"; function upgrade0_9_4pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table webcal_entry change cal_create_by cal_owner int NOT NULL"); - $currentver = "0.9.4pre3"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table webcal_entry change cal_create_by cal_owner int NOT NULL"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre3"; } $test[] = "0.9.4pre3"; function upgrade0_9_4pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "ALTER TABLE todo ADD todo_startdate int not null"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "ALTER TABLE todo CHANGE todo_datedue todo_enddate int not null"; - $db->query($sql); - $currentver = "0.9.4pre4"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre4"; } $test[] = "0.9.4pre4"; function upgrade0_9_4pre4(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "DROP TABLE sessions"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "create table sessions ( session_id varchar(255), session_lid varchar(255), @@ -361,163 +361,163 @@ session_dla int, unique(session_id) )"; - $db->query($sql); - $currentver = "0.9.4pre5"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4pre5"; } $test[] = "0.9.4pre5"; function upgrade0_9_4pre5(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.4"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.4"; } $test[] = "0.9.4"; function upgrade0_9_4(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("delete from languages"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); - @$db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); - $currentver = "0.9.5pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("delete from languages"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('aa','Afar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ab','Abkhazian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('af','Afrikaans','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('am','Amharic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ar','Arabic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('as','Assamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ay','Aymara','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('az','Azerbaijani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ba','Bashkir','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('be','Byelorussian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bg','Bulgarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bh','Bihari','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bi','Bislama','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bn','Bengali / Bangla','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('bo','Tibetan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('br','Breton','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ca','Catalan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('co','Corsican','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cs','Czech','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('cy','Welsh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('da','Danish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('de','German','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('dz','Bhutani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('el','Greek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('en','English / American','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eo','Esperanto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('es','Spanish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('et','Estonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('eu','Basque','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fa','Persian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fi','Finnish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fj','Fiji','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fo','Faeroese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fr','French','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('fy','Frisian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ga','Irish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gd','Gaelic / Scots Gaelic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gl','Galician','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gn','Guarani','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('gu','Gujarati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ha','Hausa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hi','Hindi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hr','Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hu','Hungarian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('hy','Armenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ia','Interlingua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ie','Interlingue','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ik','Inupiak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('in','Indonesian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('is','Icelandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('it','Italian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('iw','Hebrew','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ja','Japanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ji','Yiddish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('jw','Javanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ka','Georgian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kk','Kazakh','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kl','Greenlandic','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('km','Cambodian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('kn','Kannada','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ko','Korean','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ks','Kashmiri','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ku','Kurdish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ky','Kirghiz','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('la','Latin','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ln','Lingala','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lo','Laothian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lt','Lithuanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('lv','Latvian / Lettish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mg','Malagasy','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mi','Maori','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mk','Macedonian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ml','Malayalam','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mn','Mongolian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mo','Moldavian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mr','Marathi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ms','Malay','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('mt','Maltese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('my','Burmese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('na','Nauru','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ne','Nepali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('nl','Dutch','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('no','Norwegian','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('oc','Occitan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('om','Oromo / Afan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('or','Oriya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pa','Punjabi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pl','Polish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ps','Pashto / Pushto','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('pt','Portuguese','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('qu','Quechua','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rm','Rhaeto-Romance','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rn','Kirundi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ro','Romanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ru','Russian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('rw','Kinyarwanda','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sa','Sanskrit','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sd','Sindhi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sg','Sangro','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sh','Serbo-Croatian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('si','Singhalese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sk','Slovak','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sl','Slovenian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sm','Samoan','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sn','Shona','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('so','Somali','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sq','Albanian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sr','Serbian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ss','Siswati','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('st','Sesotho','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('su','Sudanese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sv','Swedish','Yes')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('sw','Swahili','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ta','Tamil','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('te','Tegulu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tg','Tajik','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('th','Thai','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ti','Tigrinya','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tk','Turkmen','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tl','Tagalog','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tn','Setswana','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('to','Tonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tr','Turkish','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ts','Tsonga','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tt','Tatar','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('tw','Twi','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uk','Ukrainian','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('ur','Urdu','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('uz','Uzbek','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vi','Vietnamese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('vo','Volapuk','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('wo','Wolof','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('xh','Xhosa','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('yo','Yoruba','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zh','Chinese','No')"); + @$phpgw_setup->db->query("INSERT INTO languages (lang_id, lang_name, available) values ('zu','Zulu','No')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.5pre1"; } $test[] = "0.9.5pre1"; function upgrade0_9_5pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("DROP TABLE sessions"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("DROP TABLE sessions"); $sql = "create table phpgw_sessions ( session_id varchar(255), session_lid varchar(255), @@ -527,7 +527,7 @@ session_dla int, unique(session_id) )"; - $db->query($sql); + $phpgw_setup->db->query($sql); $sql = "CREATE TABLE phpgw_acl ( acl_appname varchar(50), @@ -536,18 +536,18 @@ acl_account_type char(1), acl_rights int )"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("DROP TABLE app_sessions"); + $phpgw_setup->db->query("DROP TABLE app_sessions"); $sql = "CREATE TABLE phpgw_app_sessions ( sessionid varchar(255) NOT NULL, loginid varchar(20), app varchar(20), content text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("DROP TABLE access_log"); + $phpgw_setup->db->query("DROP TABLE access_log"); $sql = "create table phpgw_access_log ( sessionid varchar(255), loginid varchar(30), @@ -555,33 +555,33 @@ li int, lo varchar(255) )"; - $db->query($sql); - $currentver = "0.9.5pre2"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.5pre2"; } $test[] = "0.9.5pre2"; function upgrade0_9_5pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.5"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.5"; } $test[] = "0.9.5"; function upgrade0_9_5(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.6"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.6"; } $test[] = "0.9.6"; function upgrade0_9_6(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.7pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7pre1"; } $test[] = "0.9.7pre1"; function upgrade0_9_7pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db2 = $db; - $db3 = $db; + global $phpgw_info, $phpgw_setup; + $db2 = $phpgw_setup->db; + $phpgw_setup->db3 = $phpgw_setup->db; $sql = "CREATE TABLE calendar_entry ( cal_id serial, cal_owner int DEFAULT 0 NOT NULL, @@ -594,22 +594,22 @@ cal_access varchar(10), cal_name varchar(80) NOT NULL, cal_description text)"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT count(*) FROM webcal_entry",__LINE__,__FILE__); - $db->next_record(); - if($db->f(0)) { - $db->query("SELECT cal_id,cal_owner,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description,cal_id,cal_date,cal_time,cal_mod_date,cal_mod_time FROM webcal_entry ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $cal_id = $db->f("cal_id"); - $cal_owner = $db->f("cal_owner"); - $cal_duration = $db->f("cal_duration"); - $cal_priority = $db->f("cal_priority"); - $cal_type = $db->f("cal_type"); - $cal_access = $db->f("cal_access"); - $cal_name = $db->f("cal_name"); - $cal_description = $db->f("cal_description"); - $datetime = mktime(intval(strrev(substr(strrev($db->f("cal_time")),4))),intval(strrev(substr(strrev($db->f("cal_time")),2,2))),intval(strrev(substr(strrev($db->f("cal_time")),0,2))),intval(substr($db->f("cal_date"),4,2)),intval(substr($db->f("cal_date"),6,2)),intval(substr($db->f("cal_date"),0,4))); - $moddatetime = mktime(intval(strrev(substr(strrev($db->f("cal_mod_time")),4))),intval(strrev(substr(strrev($db->f("cal_mod_time")),2,2))),intval(strrev(substr(strrev($db->f("cal_mod_time")),0,2))),intval(substr($db->f("cal_mod_date"),4,2)),intval(substr($db->f("cal_mod_date"),6,2)),intval(substr($db->f("cal_mod_date"),0,4))); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT count(*) FROM webcal_entry",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + if($phpgw_setup->db->f(0)) { + $phpgw_setup->db->query("SELECT cal_id,cal_owner,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description,cal_id,cal_date,cal_time,cal_mod_date,cal_mod_time FROM webcal_entry ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_owner = $phpgw_setup->db->f("cal_owner"); + $cal_duration = $phpgw_setup->db->f("cal_duration"); + $cal_priority = $phpgw_setup->db->f("cal_priority"); + $cal_type = $phpgw_setup->db->f("cal_type"); + $cal_access = $phpgw_setup->db->f("cal_access"); + $cal_name = $phpgw_setup->db->f("cal_name"); + $cal_description = $phpgw_setup->db->f("cal_description"); + $datetime = mktime(intval(strrev(substr(strrev($phpgw_setup->db->f("cal_time")),4))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_time")),2,2))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_time")),0,2))),intval(substr($phpgw_setup->db->f("cal_date"),4,2)),intval(substr($phpgw_setup->db->f("cal_date"),6,2)),intval(substr($phpgw_setup->db->f("cal_date"),0,4))); + $moddatetime = mktime(intval(strrev(substr(strrev($phpgw_setup->db->f("cal_mod_time")),4))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_mod_time")),2,2))),intval(strrev(substr(strrev($phpgw_setup->db->f("cal_mod_time")),0,2))),intval(substr($phpgw_setup->db->f("cal_mod_date"),4,2)),intval(substr($phpgw_setup->db->f("cal_mod_date"),6,2)),intval(substr($phpgw_setup->db->f("cal_mod_date"),0,4))); $db2->query("SELECT groups FROM webcal_entry_groups WHERE cal_id=".$cal_id,__LINE__,__FILE__); $db2->next_record(); $cal_group = $db2->f("groups"); @@ -617,26 +617,26 @@ ."VALUES(".$cal_id.",'".$cal_owner."','".$cal_group."',".$datetime.",".$moddatetime.",".$cal_duration.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')",__LINE__,__FILE__); } } - $db->query("DROP TABLE webcal_entry_groups"); - $db->query("DROP TABLE webcal_entry"); + $phpgw_setup->db->query("DROP TABLE webcal_entry_groups"); + $phpgw_setup->db->query("DROP TABLE webcal_entry"); $sql = "CREATE TABLE calendar_entry_user ( cal_id int DEFAULT 0 NOT NULL, cal_login int DEFAULT 0 NOT NULL, cal_status char(1) DEFAULT 'A')"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT count(*) FROM webcal_entry_user",__LINE__,__FILE__); - $db->next_record(); - if($db->f(0)) { - $db->query("SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $cal_id = $db->f("cal_id"); - $cal_login = $db->f("cal_login"); - $cal_status = $db->f("cal_status"); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT count(*) FROM webcal_entry_user",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + if($phpgw_setup->db->f(0)) { + $phpgw_setup->db->query("SELECT cal_id,cal_login,cal_status FROM webcal_entry_user ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_login = $phpgw_setup->db->f("cal_login"); + $cal_status = $phpgw_setup->db->f("cal_status"); $db2->query("INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) VALUES(".$cal_id.",".$cal_login.",'".$cal_status."')",__LINE__,__FILE__); } } - $db->query("DROP TABLE webcal_entry_user",__LINE__,__FILE__); + $phpgw_setup->db->query("DROP TABLE webcal_entry_user",__LINE__,__FILE__); $sql = "CREATE TABLE calendar_entry_repeats ( cal_id int DEFAULT 0 NOT NULL, @@ -644,41 +644,41 @@ cal_end int4, cal_frequency int default 1, cal_days char(7))"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT count(*) FROM webcal_entry_repeats",__LINE__,__FILE__); - $db->next_record(); - if($db->f(0)) { - $db->query("SELECT cal_id,cal_type,cal_end,cal_frequency,cal_days FROM webcal_entry_repeats ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $cal_id = $db->f("cal_id"); - $cal_type = $db->f("cal_type"); - if(isset($db->Record["cal_end"])) { - $enddate = mktime(0,0,0,intval(substr($db->f("cal_end"),4,2)),intval(substr($db->f("cal_end"),6,2)),intval(substr($db->f("cal_end"),0,4))); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT count(*) FROM webcal_entry_repeats",__LINE__,__FILE__); + $phpgw_setup->db->next_record(); + if($phpgw_setup->db->f(0)) { + $phpgw_setup->db->query("SELECT cal_id,cal_type,cal_end,cal_frequency,cal_days FROM webcal_entry_repeats ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_type = $phpgw_setup->db->f("cal_type"); + if(isset($phpgw_setup->db->Record["cal_end"])) { + $enddate = mktime(0,0,0,intval(substr($phpgw_setup->db->f("cal_end"),4,2)),intval(substr($phpgw_setup->db->f("cal_end"),6,2)),intval(substr($phpgw_setup->db->f("cal_end"),0,4))); $useend = 1; } else { $enddate = 0; $useend = 0; } - $cal_frequency = $db->f("cal_frequency"); - $cal_days = $db->f("cal_days"); + $cal_frequency = $phpgw_setup->db->f("cal_frequency"); + $cal_days = $phpgw_setup->db->f("cal_days"); $db2->query("INSERT INTO calendar_entry_repeats(cal_id,cal_type,cal_use_end,cal_end,cal_frequency,cal_days) VALUES(".$cal_id.",'".$cal_type."',".$useend.",".$enddate.",".$cal_frequency.",'".$cal_days."')",__LINE__,__FILE__); } } - $db->query("DROP TABLE webcal_entry_repeats",__LINE__,__FILE__); - $db->query("UPDATE applications SET app_tables='calendar_entry,calendar_entry_user,calendar_entry_repeats' WHERE app_name='calendar'",__LINE__,__FILE__); + $phpgw_setup->db->query("DROP TABLE webcal_entry_repeats",__LINE__,__FILE__); + $phpgw_setup->db->query("UPDATE applications SET app_tables='calendar_entry,calendar_entry_user,calendar_entry_repeats' WHERE app_name='calendar'",__LINE__,__FILE__); - $currentver = "0.9.7pre2"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7pre2"; } $test[] = "0.9.7pre2"; function upgrade0_9_7pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db2 = $db; + global $phpgw_info, $phpgw_setup; + $db2 = $phpgw_setup->db; $sql = "CREATE TABLE TEMP AS SELECT * FROM calendar_entry"; - $db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); $sql = "DROP TABLE calendar_entry"; - $db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); $sql = "CREATE TABLE calendar_entry ( cal_id serial, @@ -692,79 +692,79 @@ cal_access varchar(10), cal_name varchar(80) NOT NULL, cal_description text)"; - $db->query($sql,__LINE__,__FILE__); - $db->query("SELECT cal_id,cal_owner,cal_group,cal_datetime,cal_mdatetime,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description FROM TEMP ORDER BY cal_id",__LINE__,__FILE__); - while($db->next_record()) { - $db2->query("SELECT preference_value FROM preferences WHERE preference_name='tz_offset' AND preference_appname='common' AND preference_owner=".$db->f("cal_owner"),__LINE__,__FILE__); + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_setup->db->query("SELECT cal_id,cal_owner,cal_group,cal_datetime,cal_mdatetime,cal_duration,cal_priority,cal_type,cal_access,cal_name,cal_description FROM TEMP ORDER BY cal_id",__LINE__,__FILE__); + while($phpgw_setup->db->next_record()) { + $db2->query("SELECT preference_value FROM preferences WHERE preference_name='tz_offset' AND preference_appname='common' AND preference_owner=".$phpgw_setup->db->f("cal_owner"),__LINE__,__FILE__); $db2->next_record(); $tz = $db2->f("preference_value"); - $cal_id = $db->f("cal_id"); - $cal_owner = $db->f("cal_owner"); - $cal_group = $db->f("cal_group"); - $cal_datetime = $db->f("cal_datetime") - ((60 * 60) * $tz); - $cal_mdatetime = $db->f("cal_mdatetime") - ((60 * 60) * $tz); - $cal_edatetime = $cal_datetime + (60 * $db->f("cal_duration")); - $cal_priority = $db->f("cal_priority"); - $cal_type = $db->f("cal_type"); - $cal_access = $db->f("cal_access"); - $cal_name = $db->f("cal_name"); - $cal_description = $db->f("cal_description"); + $cal_id = $phpgw_setup->db->f("cal_id"); + $cal_owner = $phpgw_setup->db->f("cal_owner"); + $cal_group = $phpgw_setup->db->f("cal_group"); + $cal_datetime = $phpgw_setup->db->f("cal_datetime") - ((60 * 60) * $tz); + $cal_mdatetime = $phpgw_setup->db->f("cal_mdatetime") - ((60 * 60) * $tz); + $cal_edatetime = $cal_datetime + (60 * $phpgw_setup->db->f("cal_duration")); + $cal_priority = $phpgw_setup->db->f("cal_priority"); + $cal_type = $phpgw_setup->db->f("cal_type"); + $cal_access = $phpgw_setup->db->f("cal_access"); + $cal_name = $phpgw_setup->db->f("cal_name"); + $cal_description = $phpgw_setup->db->f("cal_description"); $db2->query("INSERT INTO calendar_entry(cal_id,cal_owner,cal_group,cal_datetime,cal_mdatetime,cal_edatetime,cal_priority,cal_type,cal_access,cal_name,cal_description) VALUES(".$cal_id.",".$cal_owner.",'".$cal_group."',".cal_datetime.",".$cal_mdatetime.",".$cal_edatetime.",".$cal_priority.",'".$cal_type."','".$cal_access."','".$cal_name."','".$cal_description."')",__LINE__,__FILE__); } $sql = "DROP TABLE TEMP"; - $db->query($sql,__LINE__,__FILE__); - $currentver = "0.9.7pre3"; + $phpgw_setup->db->query($sql,__LINE__,__FILE__); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7pre3"; } $test[] = "0.9.7pre3"; function upgrade0_9_7pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.7"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.7"; } $test[] = "0.9.7"; function upgrade0_9_7(){ - global $currentver, $oldversion, $phpgw_info, $db; - $currentver = "0.9.8pre1"; + global $phpgw_info, $phpgw_setup; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre1"; } $test[] = "0.9.8pre1"; function upgrade0_9_8pre1(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("select * from preferences order by preference_owner"); - while ($db->next_record()) { - $t[$db->f("preference_owner")][$db->f("preference_appname")][$db->f("preference_var")] = $db->f("preference_value"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("select * from preferences order by preference_owner"); + while ($phpgw_setup->db->next_record()) { + $t[$phpgw_setup->db->f("preference_owner")][$phpgw_setup->db->f("preference_appname")][$phpgw_setup->db->f("preference_var")] = $phpgw_setup->db->f("preference_value"); } - $db->query("drop table preferences"); + $phpgw_setup->db->query("drop table preferences"); $sql = "create table preferences ( preference_owner int, preference_value text )"; - $db->query($sql); + $phpgw_setup->db->query($sql); while ($tt = each($t)) { - $db->query("insert into preferences values ('$tt[0]','" . serialize($tt[1]) . "')"); + $phpgw_setup->db->query("insert into preferences values ('$tt[0]','" . serialize($tt[1]) . "')"); } - $currentver = "0.9.8pre2"; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre2"; } $test[] = "0.9.8pre2"; function upgrade0_9_8pre2(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "CREATE TABLE config ( config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL )"; - @$db->query($sql); - $currentver = "0.9.8pre3"; + @$phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre3"; } $test[] = "0.9.8pre3"; function upgrade0_9_8pre3(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; - $db->query("DROP TABLE phpgw_sessions",__LINE__,__FILE__); + $phpgw_setup->db->query("DROP TABLE phpgw_sessions",__LINE__,__FILE__); $sql = "create table phpgw_sessions ( session_id varchar(255), session_lid varchar(255), @@ -774,13 +774,13 @@ session_info text, unique(session_id) )"; - $db->query($sql); - $currentver = "0.9.8pre4"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre4"; } $test[] = "0.9.8pre4"; function upgrade0_9_8pre4(){ - global $currentver, $oldversion, $phpgw_info, $db; + global $phpgw_info, $phpgw_setup; $sql = "create table phpgw_hooks ( hook_id serial, @@ -788,23 +788,23 @@ hook_location varchar(255), hook_filename varchar(255) );"; - $db->query($sql); - $currentver = "0.9.8pre5"; + $phpgw_setup->db->query($sql); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.8pre5"; } reset ($test); while (list ($key, $value) = each ($test)){ - if ($currentver == $value) { + if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { $ver = "upgrade".ereg_replace("\.","_",$value); $ver(); echo ""; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
Upgrade from $value to $currentver is completed.Upgrade from $value to $phpgw_info["setup"]["currentver"]["phpgwapi"] is completed.
"; if ($tableschanged == True){$tablechanges = True;} - if (!$prebeta){ - $db->query("update applications set app_version='".$currentver."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')"); + if (!$phpgw_info["setup"]["prebeta"]){ + $phpgw_setup->db->query("update applications set app_version='".$phpgw_info["setup"]["currentver"]["phpgwapi"]."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps' or app_name='notes')"); } } } diff --git a/setup/sql/pgsql_upgrade_prebeta.inc.php b/setup/sql/pgsql_upgrade_prebeta.inc.php index 85194fb8df..d7501cd343 100644 --- a/setup/sql/pgsql_upgrade_prebeta.inc.php +++ b/setup/sql/pgsql_upgrade_prebeta.inc.php @@ -14,149 +14,149 @@ $test[] = "7122000"; function upgrade7122000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; echo "Upgrading from 7122000 is not yet ready.
You can do this manually if you choose, otherwise dump your tables and start over.
\n"; - $prebeta = True; - $currentver = "8032000"; + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8032000"; } $test[] = "8032000"; function upgrade8032000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; echo "Upgrading from 8032000 is not yet ready.
You can do this manually if you choose, otherwise dump your tables and start over.
\n"; - $prebeta = True; - $currentver = "8072000"; + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8072000"; } $test[] = "8072000"; function upgrade8072000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; $sql = "CREATE TABLE applications (" ."app_name varchar(25) NOT NULL," ."app_title varchar(50)," ."app_enabled int," ."UNIQUE app_name (app_name)" .")"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)"); - $db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)"); - $prebeta = True; - $currentver = "8212000"; + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('tts', 'Trouble Ticket System', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('inv', 'Inventory', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('chat', 'Chat', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('headlines', 'Headlines', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('ftp', 'FTP', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('bookmarks', 'Bookmarks', 0)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0)"); + $phpgw_setup->db->query("insert into applications (app_name, app_title, app_enabled) values ('napster', 'Napster', 0)"); + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "8212000"; } $test[] = "8212000"; function upgrade8212000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; - $db->query("alter table chat_channel change name name varchar(10) not null"); - $db->query("alter table chat_messages change channel channel char(20) not null"); - $db->query("alter table chat_messages change loginid loginid varchar(20) not null"); - $db->query("alter table chat_currentin change loginid loginid varchar(25) not null"); - $db->query("alter table chat_currentin change channel channel char(20)"); - $db->query("alter table chat_privatechat change user1 user1 varchar(25) not null"); - $db->query("alter table chat_privatechat change user2 user2 varchar(25) not null"); - $prebeta = True; - $currentver = "9052000"; + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table chat_channel change name name varchar(10) not null"); + $phpgw_setup->db->query("alter table chat_messages change channel channel char(20) not null"); + $phpgw_setup->db->query("alter table chat_messages change loginid loginid varchar(20) not null"); + $phpgw_setup->db->query("alter table chat_currentin change loginid loginid varchar(25) not null"); + $phpgw_setup->db->query("alter table chat_currentin change channel channel char(20)"); + $phpgw_setup->db->query("alter table chat_privatechat change user1 user1 varchar(25) not null"); + $phpgw_setup->db->query("alter table chat_privatechat change user2 user2 varchar(25) not null"); + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9052000"; } $test[] = "9052000"; function upgrade9052000(){ - global $currentver, $oldversion, $phpgw_info, $db, $prebeta; + global $phpgw_info, $phpgw_setup; echo "Upgrading from 9052000 is not available.
I dont believe there were any changes, so this should be fine.
\n"; - $prebeta = True; - $currentver = "9072000"; + $phpgw_info["setup"]["prebeta"] = True; + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "9072000"; } $test[] = "9072000"; function upgrade9072000(){ - global $currentver, $oldversion, $phpgw_info, $db; - $db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment"); - $db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL"); - $db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL"); - $db->query("alter table accounts change firstname account_firstname varchar(50)"); - $db->query("alter table accounts change lastname account_lastname varchar(50)"); - $db->query("alter table accounts change permissions account_permissions text"); - $db->query("alter table accounts change groups account_groups varchar(30)"); - $db->query("alter table accounts change lastlogin account_lastlogin int(11)"); - $db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)"); - $db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)"); - $db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL"); - $db->query("alter table applications add app_order int"); - $db->query("alter table applications add app_tables varchar(255)"); - $db->query("alter table applications add app_version varchar(20) not null default '0.0'"); - $db->query("alter table preferences change owner preference_owner varchar(20)"); - $db->query("alter table preferences change name preference_name varchar(50)"); - $db->query("alter table preferences change value preference_value varchar(50)"); - $db->query("alter table preferences add preference_appname varchar(50) default ''"); - $db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL"); - $db->query("alter table sessions change loginid session_lid varchar(20)"); - $db->query("alter table sessions change passwd session_pwd varchar(255)"); - $db->query("alter table sessions change ip session_ip varchar(255)"); - $db->query("alter table sessions change logintime session_logintime int(11)"); - $db->query("alter table sessions change dla session_dla int(11)"); + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table accounts change con account_id int(11) DEFAULT '0' NOT NULL auto_increment"); + $phpgw_setup->db->query("alter table accounts change loginid account_lid varchar(25) NOT NULL"); + $phpgw_setup->db->query("alter table accounts change passwd account_pwd varchar(32) NOT NULL"); + $phpgw_setup->db->query("alter table accounts change firstname account_firstname varchar(50)"); + $phpgw_setup->db->query("alter table accounts change lastname account_lastname varchar(50)"); + $phpgw_setup->db->query("alter table accounts change permissions account_permissions text"); + $phpgw_setup->db->query("alter table accounts change groups account_groups varchar(30)"); + $phpgw_setup->db->query("alter table accounts change lastlogin account_lastlogin int(11)"); + $phpgw_setup->db->query("alter table accounts change lastloginfrom account_lastloginfrom varchar(255)"); + $phpgw_setup->db->query("alter table accounts change lastpasswd_change account_lastpwd_change int(11)"); + $phpgw_setup->db->query("alter table accounts change status account_status enum('A','L') DEFAULT 'A' NOT NULL"); + $phpgw_setup->db->query("alter table applications add app_order int"); + $phpgw_setup->db->query("alter table applications add app_tables varchar(255)"); + $phpgw_setup->db->query("alter table applications add app_version varchar(20) not null default '0.0'"); + $phpgw_setup->db->query("alter table preferences change owner preference_owner varchar(20)"); + $phpgw_setup->db->query("alter table preferences change name preference_name varchar(50)"); + $phpgw_setup->db->query("alter table preferences change value preference_value varchar(50)"); + $phpgw_setup->db->query("alter table preferences add preference_appname varchar(50) default ''"); + $phpgw_setup->db->query("alter table sessions change sessionid session_id varchar(255) NOT NULL"); + $phpgw_setup->db->query("alter table sessions change loginid session_lid varchar(20)"); + $phpgw_setup->db->query("alter table sessions change passwd session_pwd varchar(255)"); + $phpgw_setup->db->query("alter table sessions change ip session_ip varchar(255)"); + $phpgw_setup->db->query("alter table sessions change logintime session_logintime int(11)"); + $phpgw_setup->db->query("alter table sessions change dla session_dla int(11)"); - $db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'"); - $db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'"); - $db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'"); - $db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'"); - $db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'"); - $db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'"); - $db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'"); - $db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'"); - $db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'"); - $db->query("update applications set app_order=10,app_tables=NULL where app_name='email'"); - $db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'"); - $db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'"); + $phpgw_setup->db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'"); + $phpgw_setup->db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'"); + $phpgw_setup->db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'"); + $phpgw_setup->db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'"); + $phpgw_setup->db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'"); + $phpgw_setup->db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'"); + $phpgw_setup->db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'"); + $phpgw_setup->db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'"); + $phpgw_setup->db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'"); + $phpgw_setup->db->query("update applications set app_order=10,app_tables=NULL where app_name='email'"); + $phpgw_setup->db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'"); + $phpgw_setup->db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'"); $sql = "CREATE TABLE config (" ."config_name varchar(25) NOT NULL," ."config_value varchar(100)," ."UNIQUE config_name (config_name)" .")"; - $db->query($sql); + $phpgw_setup->db->query($sql); - $db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); - $db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); - $db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); - $db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'"); - $db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); - $db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); - $db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); - $db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); - $db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); - $db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); - $db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); - $db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); - $db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); - $db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); - $db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); - $db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); - $db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); - $db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); - $db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); - $db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); - $db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); - $currentver = "0.9.1"; + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'default')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')"); + $phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')"); + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.1"; } ?> \ No newline at end of file diff --git a/setup/test.php b/setup/test.php index 48046ba8fc..bdf14a7f92 100644 --- a/setup/test.php +++ b/setup/test.php @@ -7,7 +7,7 @@ loaddb(); // $currentver = "drop"; $currentver = "new"; - manage_tables(); + $phpgw_setup->manage_tables(); - execute_script("create_tables"); + $phpgw_setup->execute_script("create_tables"); ?> \ No newline at end of file