From 1a8a5a22384c79c36b90ff41dcc25d8c0c92b11e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 21 Feb 2006 11:21:48 +0000 Subject: [PATCH] =?UTF-8?q?d=E9but=20restructuration=20du=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/categories/categorie.class.php | 7 ++++--- htdocs/categories/create.php | 7 ++++--- htdocs/categories/docreate.php | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index 9505372d6c6..c9f6016251d 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2005 Davoleau Brice - * Copyright (C) 2005 Rodolphe Quiedeville +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2005 Davoleau Brice + * Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2006 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 diff --git a/htdocs/categories/create.php b/htdocs/categories/create.php index 611a590ebc9..3691ee2fcff 100644 --- a/htdocs/categories/create.php +++ b/htdocs/categories/create.php @@ -1,6 +1,7 @@ - * Copyright (C) 2006 Laurent Destailleur +/* Copyright (C) 2005 Matthieu Valleton + * Copyright (C) 2006 Laurent Destailleur + * Copyright (C) 2006 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 @@ -150,7 +151,7 @@ print ''; echo "

".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Label")."\"

"; $OK = false; } - else if ($c->already_exists($_POST["nom"],$cat_mere)) // on regarde si le nom n'existe pas déjà en tant que catégorie ou sous-catégorie + else if ($categorie->already_exists($_POST["nom"],$cat_mere)) // on regarde si le nom n'existe pas déjà en tant que catégorie ou sous-catégorie { echo "

".$langs->trans ("ErrCatAlreadyExists")."

"; $OK = false; diff --git a/htdocs/categories/docreate.php b/htdocs/categories/docreate.php index 54b9b5372fa..57df480405f 100644 --- a/htdocs/categories/docreate.php +++ b/htdocs/categories/docreate.php @@ -1,5 +1,6 @@ + * Copyright (C) 2006 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 @@ -47,10 +48,10 @@ $categorie = new Categorie($db); $categorie->label = $_REQUEST["nom"]; $categorie->description = $_REQUEST["description"]; -$cats_meres = isset($_REQUEST['cats_meres']) ? $_REQUEST['cats_meres'] : array (); +$cats_meres = isset($_REQUEST['cats_meres']) ? $_REQUEST['cats_meres'] : array(); $res = $categorie->create(); - + if ($res < 0) { print "

Impossible d'ajouter la catégorie ".$categorie->label.".

";