From 940bd3d924649655af8ba2e81f3e9773cfb96af8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Dec 2007 16:05:16 +0000 Subject: [PATCH] Fix: bug #21894 : liens de certains munus KO --- htdocs/boutique/index.php | 12 ++++++------ htdocs/boutique/osc_master.inc.php | 14 ++++++++------ htdocs/boutique/produits/index.php | 1 - htdocs/boutique/produits/osc-liste.php | 1 - 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/boutique/index.php b/htdocs/boutique/index.php index 1a50e18e0f9..3634dbb38a6 100644 --- a/htdocs/boutique/index.php +++ b/htdocs/boutique/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * * 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 @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -58,10 +57,11 @@ $sql .= " FROM ".OSC_DB_NAME.".orders_total as t"; $sql .= " JOIN ".OSC_DB_NAME.".orders as o ON o.orders_id = t.orders_id"; $sql .= " WHERE t.class = 'ot_subtotal' AND YEAR(o.date_purchased) = YEAR(now()) "; $sql .= " GROUP BY mois ORDER BY mois"; - -if ( $dbosc->query($sql) ) + +$result=$dbosc->query($sql); +if ($result) { - $num = $dbosc->num_rows(); + $num = $dbosc->num_rows($result); $var=True; $i=0; @@ -69,7 +69,7 @@ if ( $dbosc->query($sql) ) { while ($i < $num) { - $objp = $dbosc->fetch_object(); + $objp = $dbosc->fetch_object($result); $var=!$var; print ""; print ''.$objp->mois.''; diff --git a/htdocs/boutique/osc_master.inc.php b/htdocs/boutique/osc_master.inc.php index c91936b332c..62d845a0b89 100644 --- a/htdocs/boutique/osc_master.inc.php +++ b/htdocs/boutique/osc_master.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2007 Laurent Destailleur * * 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 @@ -16,26 +16,28 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** - \file htdocs/boutique/master.inc.php + \file htdocs/boutique/osc_master.inc.php \brief Fichier de preparation de l'environnement Dolibarr pour OSCommerce \version $Revision$ */ require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php"); - /* * Creation objet $dbosc */ $dbosc = new DoliDb($conf->db->type,$conf->global->OSC_DB_HOST,$conf->global->OSC_DB_USER,$conf->global->OSC_DB_PASS,$conf->global->OSC_DB_NAME); if (! $dbosc->connected) { - dolibarr_print_error($dbosc,"host=".$conf->global->OSC_DB_HOST.", user=".$conf->global->OSC_DB_USER.", databasename=".$conf->global->OSC_DB_NAME.", ".$db->error); - exit; + dolibarr_syslog($dbosc,"host=".$conf->global->OSC_DB_HOST.", user=".$conf->global->OSC_DB_USER.", databasename=".$conf->global->OSC_DB_NAME.", ".$db->error,LOG_ERR); + + llxHeader("",$langs->trans("OSCommerceShop"),""); + print '
Failed to connect to oscommerce database. Check your module setup
'; + llxFooter(); + exit; } ?> diff --git a/htdocs/boutique/produits/index.php b/htdocs/boutique/produits/index.php index 0e7cc22bcb4..8acea35525a 100644 --- a/htdocs/boutique/produits/index.php +++ b/htdocs/boutique/produits/index.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** diff --git a/htdocs/boutique/produits/osc-liste.php b/htdocs/boutique/produits/osc-liste.php index b2d0a1ef237..818a7f813b2 100644 --- a/htdocs/boutique/produits/osc-liste.php +++ b/htdocs/boutique/produits/osc-liste.php @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /**