From 37cca4231aac30a6dda9b677eb106223f7045ae8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 25 Oct 2011 11:24:06 +0200 Subject: [PATCH] Fix: uniform and clean code --- htdocs/admin/const.php | 20 +++---- htdocs/admin/facture.php | 122 ++++++++++++++------------------------- 2 files changed, 52 insertions(+), 90 deletions(-) diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 86fc8eaa77c..59237e73711 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2011 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 @@ -28,9 +28,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); $langs->load("admin"); -if (!$user->admin) -accessforbidden(); -//var_dump($_POST); +if (! $user->admin) accessforbidden(); + +$action = GETPOST('action'); $typeconst=array('yesno','texte','chaine'); @@ -39,7 +39,7 @@ $typeconst=array('yesno','texte','chaine'); * Actions */ -if ($_POST["action"] == 'add') +if ($action == 'add') { $error=0; @@ -93,9 +93,9 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De } // Delete line from delete picto -if ($_GET["action"] == 'delete') +if ($action == 'delete') { - if (dolibarr_del_const($db, $_GET["rowid"],$_GET["entity"]) < 0) + if (dolibarr_del_const($db, $_GET["rowid"], $_GET["entity"]) < 0) { dolibarr_print_error($db); } @@ -112,7 +112,7 @@ llxHeader('',$langs->trans("OtherSetup")); if ($conf->use_javascript_ajax) { ?> -