From 4363bb493d675732ba9bdfd716bf92eef347315f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2010 08:57:27 +0000 Subject: [PATCH] Fix: Fix a lot of broken features when renaming produit to product --- htdocs/core/class/conf.class.php | 4 +++- htdocs/core/photos_resize.php | 14 ++++++++------ htdocs/product/photos.php | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index d7eaada15c3..321e7a0e577 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -248,7 +248,9 @@ class Conf $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp"; $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; - // Module service + // Module product/service + $this->product->dir_output=$rootfordata."/produit"; + $this->product->dir_temp =$rootfordata."/produit/temp"; $this->service->dir_output=$rootfordata."/produit"; $this->service->dir_temp =$rootfordata."/produit/temp"; // Module contrat diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 8a352b52211..fe1fdbce0da 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -46,6 +46,7 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is { $product=new Product($db); $result=$product->fetch($_POST["id"]); + if ($result <= 0) dol_print_error($db,'Failed to load object'); $dir=$conf->product->dir_output; // By default if ($product->type == 0) $dir=$conf->product->dir_output; if ($product->type == 1) $dir=$conf->service->dir_output; @@ -55,7 +56,7 @@ if ($_POST["action"] == 'confirm_resize' && (isset($_POST["file"]) != "") && (is if ($result == $fullpath) { - header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["product"].'&action=addthumb&file='.urldecode($_POST["file"])); + header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["id"].'&action=addthumb&file='.urldecode($_POST["file"])); exit; } else @@ -71,6 +72,7 @@ if ($_POST["action"] == 'confirm_crop') { $product=new Product($db); $result=$product->fetch($_POST["id"]); + if ($result <= 0) dol_print_error($db,'Failed to load object'); $dir=$conf->product->dir_output; // By default if ($product->type == 0) $dir=$conf->product->dir_output; if ($product->type == 1) $dir=$conf->service->dir_output; @@ -80,7 +82,7 @@ if ($_POST["action"] == 'confirm_crop') if ($result == $fullpath) { - header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["product"].'&action=addthumb&file='.urldecode($_POST["file"])); + header("Location: ".DOL_URL_ROOT."/product/photos.php?id=".$_POST["id"].'&action=addthumb&file='.urldecode($_POST["file"])); exit; } else @@ -123,8 +125,8 @@ print $langs->trans("NewLength").': trans("NewHeight").': px  
'; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print '
'; print ''; print '
'; @@ -157,8 +159,8 @@ print '
- - + +
'; print ''; diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 89fb60e8968..4e82ef8f192 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -46,6 +46,7 @@ $result=restrictedArea($user,'produit|service',$id,'product','','',$fieldid); $mesg = ''; $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output); + /* * Actions */