From c9affcb8a2b83b77f9be5f11e28a359d7a33eafd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 Jul 2009 20:06:45 +0000 Subject: [PATCH] Fix: category type is missing after add or delete photo --- htdocs/categories/index.php | 4 ++-- htdocs/categories/photos.php | 15 +++++++-------- htdocs/categories/viewcat.php | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 675bf77dff6..21e05701d5b 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 �ric Seigne + * Copyright (C) 2005 Eric Seigne * Copyright (C) 2006-2009 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2009 Regis Houssin @@ -71,7 +71,7 @@ print ''; print ''; print $langs->trans("Name").':'; /* -// faire une rech dans une sous cat�gorie uniquement +// faire une rech dans une sous categorie uniquement print ''; print $langs->trans("SubCatOf").':'; diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 71a94cb0bb0..823c33b07ac 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2005-2009 Regis Houssin * * 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 @@ -121,7 +121,7 @@ if ($_GET["id"] || $_GET["ref"]) */ if ($_GET['action'] == 'delete') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$c->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$c->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); if ($ret == 'html') print '
'; } @@ -207,12 +207,12 @@ if ($_GET["id"] || $_GET["ref"]) { if (! empty($conf->global->MAIN_UPLOAD_DOC)) { - print ''; + print ''; print $langs->trans("AddPhoto").''; } else { - print 'e'; + print ''; print $langs->trans("AddPhoto").''; } } @@ -226,10 +226,9 @@ if ($_GET["id"] || $_GET["ref"]) { // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/categories/photos.php?id='.$c->id,$langs->trans("AddPhoto"),1); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/categories/photos.php?id='.$c->id.'&type='.$type,$langs->trans("AddPhoto"),1); } - // Affiche photos // Affiche photos if ($_GET["action"] != 'ajout_photo') { @@ -282,11 +281,11 @@ if ($_GET["id"] || $_GET["ref"]) // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites if (!$obj['photo_vignette'] && eregi('(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$',$obj['photo']) && ($c->imgWidth > $maxWidth || $c->imgHeight > $maxHeight)) { - print ''.img_refresh($langs->trans('GenerateThumb')).'  '; + print ''.img_refresh($langs->trans('GenerateThumb')).'  '; } if ($user->rights->categorie->creer) { - print ''; + print ''; print img_delete().''; } if ($nbbyrow) print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 7cb7b2be151..f51637b0648 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Matthieu Valleton * Copyright (C) 2006-2009 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2005-2008 Regis Houssin + * Copyright (C) 2005-2009 Regis Houssin * * 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