From 6c2dc008f7d4550da1380cbb479a0af843f145ec Mon Sep 17 00:00:00 2001 From: opensides Date: Thu, 26 Aug 2004 12:38:31 +0000 Subject: [PATCH] correction etape2, requete llx_const, boucle pour executer les requetes --- htdocs/install/etape2.php | 81 +++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index f4dedfffa81..d7df7813ed9 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -1,8 +1,6 @@ * Copyright (C) 2004 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Sebastien Di Cintio * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -208,28 +206,30 @@ if ($HTTP_POST_VARS["action"] == "set") $dir = "../../pgsql/data/"; $file = "data.sql"; $fp = fopen($dir.$file,"r"); + $buffer=''; if ($fp) { while (!feof ($fp)) { - $buffer = fgets($fp, 4096); - } - if ($db->query($buffer)) - { - $ok = 1; - } - else - { - if ($db->errno() == 1062) - { - // print "Insertion ligne : $bufferDéja existante"; - } - else - { - $ok = 0; - print "Erreur SQL ".$db->errno()." sur requete '$buffer': ".$db->error()."
"; - } - } + $buffer .= fgets($fp, 4096); + } + if ($db->query($buffer)) + { + $ok = 1; + } + else + { + if ($db->errno() == 1062) + { + // print "Insertion ligne : $bufferDéja existante"; + } + else + { + $ok = 0; + print "Erreur SQL ".$db->errno()." sur requete '$buffer': ".$db->error()."
"; + } + } + //}//while fclose($fp); } }//else @@ -259,29 +259,45 @@ if ($HTTP_POST_VARS["action"] == "set") { $chem1 = "/facture"; - $sql[0] = "UPDATE llx_const SET value = '".$dolibarr_main_data_root."/facture' + $sql[0] = "UPDATE llx_const SET value = '".$dolibarr_main_data_root."/facture', + type = 'chaine', + visible = 0 where name ='FAC_OUTPUTDIR';" ; - $sql[1] = "UPDATE llx_const SET value = '".$dolibarr_main_data_url."/document/facture' + $sql[1] = "UPDATE llx_const SET value = '".$dolibarr_main_data_url."/document/facture', + type = 'chaine', + visible = 0 where name = 'FAC_OUTPUT_URL';" ; - $sql[2] = "UPDATE llx_const SET value = '".$dolibarr_main_data_root."/propale' + $sql[2] = "UPDATE llx_const SET value = '".$dolibarr_main_data_root."/propale', + type = 'chaine', + visible = 0 where name = 'PROPALE_OUTPUTDIR';" ; - $sql[3] = "UPDATE llx_const SET value = '".$dolibarr_main_url_root."/document/propale' + $sql[3] = "UPDATE llx_const SET value = '".$dolibarr_main_url_root."/document/propale', + type = 'chaine', + visible = 0 where name = 'PROPALE_OUTPUT_URL';" ; - $sql[4] = "UPDATE llx_const SET value = '".$dolibarr_main_data_root."/ficheinter' - where name = 'FICHEINTER_OUTPUTDIR';" ; + $sql[4] = "UPDATE llx_const SET value = '".$dolibarr_main_data_root."/ficheinter', + type = 'chaine', + visible = 0 + where name = 'FICHEINTER_OUTPUTDIR';" ; - $sql[5] = "UPDATE llx_const SET value='".$dolibarr_main_url_root."/document/ficheinter' - where name = 'FICHEINTER_OUTPUT_URL';" ; + $sql[5] = "UPDATE llx_const SET value='".$dolibarr_main_url_root."/document/ficheinter', + type = 'chaine', + visible = 0 + where name = 'FICHEINTER_OUTPUT_URL';" ; - $sql[6] = "UPDATE llx_const SET value='".$dolibarr_main_data_root."/societe' - where name = 'SOCIETE_OUTPUTDIR';" ; + $sql[6] = "UPDATE llx_const SET value='".$dolibarr_main_data_root."/societe', + type = 'chaine', + visible = 0 + where name = 'SOCIETE_OUTPUTDIR';" ; - $sql[7] = "UPDATE llx_const SET value='".$dolibarr_main_url_root."/document/societe' - where name = 'SOCIETE_OUTPUT_URL';" ; + $sql[7] = "UPDATE llx_const SET value='".$dolibarr_main_url_root."/document/societe', + type = 'chaine', + visible = 0 + where name = 'SOCIETE_OUTPUT_URL';" ; $result = 0; @@ -290,6 +306,7 @@ if ($HTTP_POST_VARS["action"] == "set") if ($db->query($sql[$i])) { $result++; + } }