';
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index ac1c3429658..eb6446ae13d 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2013-2014 Alexandre Spangaro
- * Copyright (C) 2014 Ari Elbaz (elarifr)
+ * Copyright (C) 2013-2015 Alexandre Spangaro
+ * Copyright (C) 2014-2015 Ari Elbaz (elarifr)
* Copyright (C) 2013-2014 Florian Henry
* Copyright (C) 2014 Juanjo Menent
*
@@ -31,16 +31,52 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
// Langs
$langs->load("compta");
$langs->load("bills");
+$langs->load("other");
$langs->load("main");
$langs->load("accountancy");
$action = GETPOST('action');
$codeventil = GETPOST('codeventil', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array');
+$search_ref = GETPOST('search_ref','alpha');
+$search_label = GETPOST('search_label','alpha');
+$search_desc = GETPOST('search_desc','alpha');
+
+$sortfield = GETPOST('sortfield','alpha');
+$sortorder = GETPOST('sortorder','alpha');
+//Should move to top with all GETPOST
+$page = GETPOST('page');
+if ($page < 0) $page = 0;
+
+if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
+ $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
+} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
+ $limit = $conf->liste_limit;
+} else {
+ $limit = $conf->liste_limit;
+}
+$offset = $limit * $page;
+//End Should move to top with all GETPOST
+
+// TODO : remove comment
+//elarifr we can not use only
+//$sql .= " ORDER BY l.rowid";
+// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04...
+// f.facnumber will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA
+// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered
+//if (! $sortfield) $sortfield="l.rowid";
+if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid";
+//if (! $sortorder) $sortorder="DESC";
+if (! $sortorder) {
+ if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
+ $sortorder = " DESC ";
+ }
+}
// Security check
if ($user->societe_id > 0)
@@ -50,8 +86,31 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db);
+//Defaut AccountingAccount RowId Product / Service
+//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
+//so we need to get those default value rowid first
+$accounting = new AccountingAccount($db);
+//TODO: we should need to check if result is a really exist accountaccount rowid.....
+$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT);
+$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
+
+// Purge search criteria
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+{
+ $search_ref='';
+ $search_label='';
+ $search_desc='';
+}
+/*
+ * View
+ */
+
llxHeader('', $langs->trans("Ventilation"));
+//debug
+//print_r($aarowid_s);
+//print_r($aarowid_p);
+
print '';
+
/*
* Action
*/
@@ -123,7 +183,13 @@ $offset = $limit * $page;
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell";
+// A REVOIR elarifr si vraiment necessaire de rajouter , p.fk_product_type as type. le type produit / service est de facto defini pour chaque ligne de facturedet.product_type
+// il est donc plus logique de se servir de l.product_type au lieu de p.fk_product_type
$sql .= " , aa.rowid as aarowid";
+// we need f.datef to reorder lines
+$sql .= " , f.datef";
+// we need to use llx_facturedet l.product_type as used at the time on invoice. if llx_product fk_product_type is changed later it could not change the sell already made !
+$sql .= " , l.product_type as type_l";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
@@ -131,14 +197,27 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountan
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
+// Add search filter like
+if (strlen(trim($search_ref))) {
+ $sql .= " AND (p.ref like '%" . $search_ref . "%')";
+}
+if (strlen(trim($search_label))) {
+ $sql .= " AND (p.label like '%" . $search_label . "%')";
+}
+if (strlen(trim($search_desc))) {
+ $sql .= " AND (l.description like '%" . $search_desc . "%')";
+}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
+//TODO: Remove comment
+//replaced by default value $sortfield,$sortorder
+//$sql .= " ORDER BY l.rowid";
+//if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
+// $sql .= " DESC ";
+//}
+$sql.= $db->order($sortfield,$sortorder);
-$sql .= " ORDER BY l.rowid";
-if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
- $sql .= " DESC ";
-}
$sql .= $db->plimit($limit + 1, $offset);
dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
@@ -156,58 +235,96 @@ if ($result) {
print '';
print '
';
+// We add search filter
+/* But Hit Enter will validate ventilation....
+ print '
';
+ print '
';
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+ print '
';
+ print '';
+ print ' ';
+ print '';
+ print '
';
+ print '
';
+*/
$facture_static = new Facture($db);
$product_static = new Product($db);
$form = new Form($db);
- $var = True;
+ $var = true;
while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);
$var = ! $var;
// product_type: 0 = service ? 1 = product
- // if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
- // issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
- $code_sell_notset = '';
+ // C'est le contraire dans les base !!!!!! IT IS INVERTED IN LLX_PRODUCT & LLX_FACTUREDET
+ // elarifr define account numbercode comptable si pas defini dans la fiche produit a partir des lignes de facturation
+ // product_type: 1 = service ? 0 = product
+ // because some modules like subtotal module l.product_type can be other than 0 or 1 ! and we don't put in account lines with product_type=9
+ // first we check product.fk_product_type as type and l.product_type as type_l
+ // if product does not exist we use the value of l.product_type provided in facturedet to define if this is a product or service
+ // issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB ! so we report both and user make choice of accounting account.
+ $objp->code_sell_l = '';
+ $objp->code_sell_p = '';
+ $objp->aarowid_suggest = '';
+ $code_sell_p_l_differ = '';
- if (empty($objp->code_sell)) {
- $code_sell_notset = 'color:red';
-
- if (! empty($objp->type)) {
- if ($objp->type == 1) {
- $objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
- } else {
- $objp->code_sell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
- }
- } else {
- $code_sell_notset = 'color:blue';
-
- if ($objp->type == 1) {
- $objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
- } else {
- $objp->code_sell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
- }
+ //check if code_sell defined in product or set default value according p.fk_product_type do not care lines when product_type value not 0 || 1
+ //and we set suggested accounting account rowid as $objp->aarowid_s
+ $code_sell_p_notset = '';
+ $objp->aarowid_suggest = $objp->aarowid;
+ if ( ! empty($objp->code_sell)) {
+ $objp->code_sell_p = $objp->code_sell;
+ } else {
+ $code_sell_p_notset = 'color:red';
+ if ($objp->type == 1) {
+ $objp->code_sell_p = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
+ }
+ elseif ($objp->type == 0) {
+ $objp->code_sell_p = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
}
}
+ // check facturedet.product_type & set default value according l.type_l, do not care lines when product_type value not 0 || 1
+// if ( ! empty($objp->type_l)) {
+// $objp->code_sell_l = $objp->type_l;
+// } else {
+ if ($objp->type_l == 1) {
+ $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
+ if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_s;
+ }
+ elseif ($objp->type_l == 0) {
+ $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
+ if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_p;
+ }
+// }
+
+
+ //if not same code for product fk_prouct_type and facturedet.product_type, product has been change after sale and must report
+ if ($objp->code_sell_l <> $objp->code_sell_p) $code_sell_p_l_differ = 'color:red';
print "
';
+ //TODO: we should set a user defined value to adjust user square / wide screen size
+ $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
+ print '
';
+ // if not same kind of product_type stored in product & facturedet we display both account and let user choose
+ if ($objp->code_sell_l == $objp->code_sell_p) {
+ print $objp->code_sell_l;
+ } else {
+ print 'lines='.$objp->code_sell_l . ' product=' . $objp->code_sell_p;
+ }
print '
';
// Colonne choix du compte
print '
';
- print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1);
+ // TODO: we should set a user defined value to adjust user square / wide screen size
+ // $trunclengthform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
+ print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1);
print '
';
+ print '
' . $objp->rowid . '
';
// Colonne choix ligne a ventiler
print '
';
- print 'aarowid ? "checked" : "") . '/>';
+ //TODO checked only if account exist in product, if only suggested do not check, user must validate
+ print 'aarowid_suggest ? "checked" : "") . '/>';
print '
';
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index bf14ebc185e..02057b31255 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2013-2014 Alexandre Spangaro
- * Copyright (C) 2014 Ari Elbaz (elarifr)
+ * Copyright (C) 2013-2015 Alexandre Spangaro
+ * Copyright (C) 2014-2015 Ari Elbaz (elarifr)
* Copyright (C) 2013-2014 Florian Henry
* Copyright (C) 2014 Juanjo Menent s
*
@@ -31,6 +31,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
// Langs
$langs->load("compta");
@@ -42,6 +43,42 @@ $langs->load("accountancy");
$action = GETPOST('action');
$codeventil = GETPOST('codeventil', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array');
+$search_ref = GETPOST('search_ref','alpha');
+$search_label = GETPOST('search_label','alpha');
+$search_desc = GETPOST('search_desc','alpha');
+
+$sortfield = GETPOST('sortfield','alpha');
+$sortorder = GETPOST('sortorder','alpha');
+//Should move to top with all GETPOST
+$page = GETPOST('page');
+if ($page < 0) $page = 0;
+
+
+if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
+ $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
+} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
+ $limit = $conf->liste_limit;
+} else {
+ $limit = $conf->liste_limit;
+}
+$offset = $limit * $page;
+//End Should move to top with all GETPOST
+
+
+// TODO : remove comment
+//elarifr we can not use only
+//$sql .= " ORDER BY l.rowid";
+// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04...
+// f.ref will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA
+// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered
+//if (! $sortfield) $sortfield="l.rowid";
+if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";
+//if (! $sortorder) $sortorder="DESC";
+if (! $sortorder) {
+ if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
+ $sortorder = " DESC ";
+ }
+}
// Security check
if ($user->societe_id > 0)
@@ -51,8 +88,31 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db);
+//Defaut AccountingAccount RowId Product / Service
+//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
+//so we need to get those default value rowid first
+$accounting = new AccountingAccount($db);
+
+//TODO: we should need to check if result is a really exist accountaccount rowid.....
+$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT);
+$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT);
+
+// Purge search criteria
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+{
+ $search_ref='';
+ $search_label='';
+ $search_desc='';
+}
+
+/*
+ * View
+ */
llxHeader('', $langs->trans("Ventilation"));
+//debug
+//print_r($aarowid_s);
+//print_r($aarowid_p);
print '';
+dolibarr_install_syslog("--- check: end");
pFooter(true); // Never display next button
diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php
index 04f8a3caf4c..92d2fc963a8 100644
--- a/htdocs/install/fileconf.php
+++ b/htdocs/install/fileconf.php
@@ -36,7 +36,7 @@ $langs->setDefaultLang($setuplang);
$langs->load("install");
$langs->load("errors");
-dolibarr_install_syslog("Fileconf: Entering fileconf.php page");
+dolibarr_install_syslog("--- fileconf: entering fileconf.php page");
// You can force preselected values of the config step of Dolibarr by adding a file
// install.forced.php into directory htdocs/install (This is the case with some wizard
@@ -71,12 +71,14 @@ if (@file_exists($forcedfile)) {
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
-pHeader($langs->trans("ConfigurationFile"),"etape1","set","",(empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/'));
+pHeader($langs->trans("ConfigurationFile"),"step1","set","",(empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/'));
// Test if we can run a first install process
if (! is_writable($conffile))
{
- print $langs->trans("ConfFileIsNotWritable",$conffiletoshow);
+ print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
+ dolibarr_install_syslog("fileconf: config file is not writable", LOG_WARNING);
+ dolibarr_install_syslog("--- fileconf: end");
pFooter(1,$setuplang,'jscheckparam');
exit;
}
@@ -584,4 +586,5 @@ function jscheckparam()
// $db->close(); Not database connexion yet
+dolibarr_install_syslog("--- fileconf: end");
pFooter($err,$setuplang,'jscheckparam');
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index bac0ffe6eda..36d12421055 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -375,13 +375,13 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
print ''."\n";
if ($jQueryUiCustomPath) print ''."\n"; // JQuery
- else print ''."\n"; // JQuery
+ else print ''."\n"; // JQuery
print ''."\n";
if ($jQueryCustomPath) print ''."\n";
- else print ''."\n";
+ else print ''."\n";
if ($jQueryUiCustomPath) print ''."\n";
- else print ''."\n";
+ else print ''."\n";
print ''.$langs->trans("DolibarrSetup").''."\n";
print ''."\n";
diff --git a/htdocs/install/index.php b/htdocs/install/index.php
index 4508a266b08..9b0ac71931b 100644
--- a/htdocs/install/index.php
+++ b/htdocs/install/index.php
@@ -28,8 +28,7 @@ include_once '../core/class/html.formadmin.class.php';
$err = 0;
-// Si fichier conf existe deja et rempli, on est pas sur une premiere install,
-// on ne passe donc pas par la page de choix de langue
+// If the config file exists and is filled, we're not on first install so we skip the language selection page
if (file_exists($conffile) && isset($dolibarr_main_url_root))
{
header("Location: check.php?testget=ok");
@@ -45,7 +44,7 @@ $langs->load("admin");
$formadmin=new FormAdmin(''); // Note: $db does not exist yet but we don't need it, so we put ''.
-pHeader("", "check"); // Etape suivante = check
+pHeader("", "check"); // Next step = check
// Ask installation language
@@ -62,6 +61,6 @@ print '
';
print '
'.$langs->trans("SomeTranslationAreUncomplete");
-// Si pas d'erreur, on affiche le bouton pour passer a l'etape suivante
+// If there's no error, we display the next step button
if ($err == 0) pFooter(0);
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index 786a8efb430..c8a77e9d8e7 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville
* Copyright (C) 2004-2012 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2015 Raphaël Doursenaud
*
* 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
@@ -18,7 +19,7 @@
*/
/**
- * \file htdocs/install/repair.php
+ * \file htdocs/install/repair.php
* \brief Run repair script
*/
@@ -29,7 +30,7 @@ require_once $dolibarr_main_document_root.'/core/class/extrafields.class.php';
require_once 'lib/repair.lib.php';
$grant_query='';
-$etape = 2;
+$step = 2;
$ok = 0;
@@ -54,8 +55,8 @@ if ($dolibarr_main_db_type == "pgsql") $choix=2;
if ($dolibarr_main_db_type == "mssql") $choix=3;
-dolibarr_install_syslog("repair: Entering upgrade.php page");
-if (! is_object($conf)) dolibarr_install_syslog("repair: conf file not initialized",LOG_ERR);
+dolibarr_install_syslog("--- repair: entering upgrade.php page");
+if (! is_object($conf)) dolibarr_install_syslog("repair: conf file not initialized", LOG_ERR);
/*
@@ -105,13 +106,13 @@ if ($db->connected)
{
print '
';
print $langs->trans("UserCreation").' : ';
print $dolibarr_main_db_user;
@@ -569,7 +571,7 @@ if (! $error && $db->connected && $action == "set")
// If database creation is asked, we create it
if (! $error && (isset($_POST["db_create_database"]) && $_POST["db_create_database"] == "on"))
{
- dolibarr_install_syslog("etape1: Create database : ".$dolibarr_main_db_name." ".$dolibarr_main_db_character_set." ".$dolibarr_main_db_collation." ".$dolibarr_main_db_user, LOG_DEBUG);
+ dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user);
$newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
//print 'eee'.$conf->db->type." ".$conf->db->host." ".$userroot." ".$passroot." ".$conf->db->port." ".$newdb->connected." ".$newdb->forcecharset;exit;
@@ -587,11 +589,11 @@ if (! $error && $db->connected && $action == "set")
$check1=$newdb->getDefaultCharacterSetDatabase();
$check2=$newdb->getDefaultCollationDatabase();
- dolibarr_install_syslog('etape1: Note that default server was charset='.$check1.' collation='.$check2, LOG_DEBUG);
+ dolibarr_install_syslog('step1: note that default server was charset=' . $check1 . ' collation=' . $check2);
// If values differs, we save conf file again
- //if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('etape1: Value for character_set is not the one asked for database creation', LOG_WARNING);
- //if ($check2 != $dolibarr_main_db_collation) dolibarr_install_syslog('etape1: Value for collation is not the one asked for database creation', LOG_WARNING);
+ //if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('step1: value for character_set is not the one asked for database creation', LOG_WARNING);
+ //if ($check2 != $dolibarr_main_db_collation) dolibarr_install_syslog('step1: value for collation is not the one asked for database creation', LOG_WARNING);
}
else
{
@@ -603,7 +605,7 @@ if (! $error && $db->connected && $action == "set")
print ' ';
print '
';
- dolibarr_install_syslog('etape1: Failed to create database '.$dolibarr_main_db_name.' '.$newdb->lasterrno().' '.$newdb->lasterror(), LOG_ERR);
+ dolibarr_install_syslog('step1: failed to create database ' . $dolibarr_main_db_name . ' ' . $newdb->lasterrno() . ' ' . $newdb->lasterror(), LOG_ERR);
$error++;
}
$newdb->close();
@@ -632,14 +634,14 @@ if (! $error && $db->connected && $action == "set")
// We test access with dolibarr database user (not admin)
if (! $error)
{
- dolibarr_install_syslog("etape1: connexion de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name, LOG_DEBUG);
+ dolibarr_install_syslog("step1: connection type=" . $conf->db->type . " on host=" . $conf->db->host . " port=" . $conf->db->port . " user=" . $conf->db->user . " name=" . $conf->db->name);
//print "connexion de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name;
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
if ($db->connected)
{
- dolibarr_install_syslog("etape1: connexion to server by user ".$conf->db->user." is ok", LOG_DEBUG);
+ dolibarr_install_syslog("step1: connection to server by user " . $conf->db->user . " ok");
print "
";
print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : ";
print $dolibarr_main_db_host;
@@ -650,7 +652,7 @@ if (! $error && $db->connected && $action == "set")
// si acces serveur ok et acces base ok, tout est ok, on ne va pas plus loin, on a meme pas utilise le compte root.
if ($db->database_selected)
{
- dolibarr_install_syslog("etape1: connexion to database : ".$conf->db->name.", by user : ".$conf->db->user." is ok", LOG_DEBUG);
+ dolibarr_install_syslog("step1: connection to database " . $conf->db->name . " by user " . $conf->db->user . " ok");
print "
";
print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : ";
print $dolibarr_main_db_name;
@@ -662,7 +664,7 @@ if (! $error && $db->connected && $action == "set")
}
else
{
- dolibarr_install_syslog("etape1: connexion to database ".$conf->db->name.", by user : ".$conf->db->user." has failed", LOG_ERR);
+ dolibarr_install_syslog("step1: connection to database " . $conf->db->name . " by user " . $conf->db->user . " failed", LOG_ERR);
print "
";
print $langs->trans("DatabaseConnection")." (".$langs->trans("User")." ".$conf->db->user.") : ";
print $dolibarr_main_db_name;
@@ -682,7 +684,7 @@ if (! $error && $db->connected && $action == "set")
}
else
{
- dolibarr_install_syslog("etape1: la connexion au serveur par le user ".$conf->db->user." est rate");
+ dolibarr_install_syslog("step1: connection to server by user " . $conf->db->user . " failed", LOG_ERR);
print "
";
print $langs->trans("ServerConnection")." (".$langs->trans("User")." ".$conf->db->user.") : ";
print $dolibarr_main_db_host;
@@ -723,7 +725,7 @@ function jsinfo()
');
fclose($fp);
}
}
@@ -766,7 +767,6 @@ function write_master_file($masterfile,$main_dir)
fputs($fp, '');
fclose($fp);
}
}
@@ -928,7 +928,6 @@ function write_conf_file($conffile)
fputs($fp, '$dolibarr_font_DOL_DEFAULT_TTF_BOLD=\''.$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD.'\';');
fputs($fp,"\n");
- fputs($fp, '?>');
fclose($fp);
if (file_exists("$conffile"))
diff --git a/htdocs/install/etape2.php b/htdocs/install/step2.php
similarity index 91%
rename from htdocs/install/etape2.php
rename to htdocs/install/step2.php
index 8de44812222..8f27aa53767 100644
--- a/htdocs/install/etape2.php
+++ b/htdocs/install/step2.php
@@ -1,7 +1,8 @@
* Copyright (C) 2004-2010 Laurent Destailleur
- * Copyright (C) 2015 Cedric GROSS
+ * Copyright (C) 2015 Cedric GROSS
+ * Copyright (C) 2015 Raphaël Doursenaud
*
* 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
@@ -18,8 +19,8 @@
*/
/**
- * \file htdocs/install/etape2.php
- * \ingroup install
+ * \file htdocs/install/step2.php
+ * \ingroup install
* \brief Create tables, primary keys, foreign keys, indexes and functions into database and then load reference data
*/
@@ -27,7 +28,7 @@ include 'inc.php';
require_once $dolibarr_main_document_root.'/core/class/conf.class.php';
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
-$etape = 2;
+$step = 2;
$ok = 0;
@@ -54,7 +55,7 @@ if ($dolibarr_main_db_type == "mssql") $choix=3;
if ($dolibarr_main_db_type == "sqlite") $choix=4;
if ($dolibarr_main_db_type == "sqlite3") $choix=5;
-//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into etape2.php page');
+//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into step2.php page');
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
@@ -62,14 +63,14 @@ $forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once $forcedfile; }
-dolibarr_install_syslog("--- etape2: Entering etape2.php page");
+dolibarr_install_syslog("--- step2: entering step2.php page");
/*
* View
*/
-pHeader($langs->trans("CreateDatabaseObjects"),"etape4");
+pHeader($langs->trans("CreateDatabaseObjects"),"step4");
// Test if we can run a first install process
if (! is_writable($conffile))
@@ -103,11 +104,11 @@ if ($action == "set")
{
if($db->database_selected)
{
- dolibarr_install_syslog("etape2: Connexion successful to database : ".$conf->db->name);
+ dolibarr_install_syslog("step2: successful connection to database: " . $conf->db->name);
}
else
{
- dolibarr_install_syslog("etape2: Connexion failed to database : ".$conf->db->name);
+ dolibarr_install_syslog("step2: failed connection to database :" . $conf->db->name, LOG_ERR);
print "
Failed to select database ".$conf->db->name.'
';
$ok = 0 ;
}
@@ -131,7 +132,7 @@ if ($action == "set")
$requestnb=0;
// To disable some code, so you can call step2 with url like
- // http://localhost/dolibarrnew/install/etape2.php?action=set&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements
+ // http://localhost/dolibarrnew/install/step2.php?action=set&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements
$createtables=isset($_GET['createtables'])?GETPOST('createtables'):1;
$createkeys=isset($_GET['createkeys'])?GETPOST('createkeys'):1;
$createfunctions=isset($_GET['createfunctions'])?GETPOST('createfunction'):1;
@@ -155,7 +156,7 @@ if ($action == "set")
$ok = 0;
$handle=opendir($dir);
- dolibarr_install_syslog("Open tables directory ".$dir." handle=".$handle,LOG_DEBUG);
+ dolibarr_install_syslog("step2: open tables directory " . $dir . " handle=" . $handle);
$tablefound = 0;
$tabledata=array();
if (is_resource($handle))
@@ -211,7 +212,7 @@ if ($action == "set")
//print "
Creation de la table $name/td>";
$requestnb++;
- dolibarr_install_syslog("Request: ".$buffer,LOG_DEBUG);
+ dolibarr_install_syslog("step2: request: " . $buffer);
$resql=$db->query($buffer,0,'dml');
if ($resql)
{
@@ -241,7 +242,7 @@ if ($action == "set")
print "
";
print '
'.$langs->trans("Error").' Failed to open file '.$dir.$file.'
';
$error++;
- dolibarr_install_syslog("Failed to open file ".$dir.$file,LOG_ERR);
+ dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR);
}
}
@@ -257,7 +258,7 @@ if ($action == "set")
else
{
print '