From d6f7018be68e8fbdc4c4d7612aa783b0b9f3fce4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Feb 2010 02:37:04 +0000 Subject: [PATCH] Qual: Uniformize code --- htdocs/societe/agenda.php | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 49a06b240d1..d4867f94b98 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2005 Brice Davoleau * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2006-2010 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * * This program is free software; you can redistribute it and/or modify @@ -35,27 +35,10 @@ $langs->load("companies"); $mesg=isset($_GET["mesg"])?'
'.$_GET["mesg"].'
':''; -$dbtablename = ''; -if ($_REQUEST["socid"]) -{ - if ($_REQUEST["typeid"] == 1) { $type = 'fournisseur'; $socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; } - if ($_REQUEST["typeid"] == 2) { $type = 'societe'; $socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; } - $objecttype = 'societe&categorie'; - $objectid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:''; - $fieldid = 'rowid'; -} -else if ($_REQUEST["id"] || $_REQUEST["ref"]) -{ - $type = 'produit'; - $objecttype = 'produit|service&categorie'; - $objectid = isset($_REQUEST["id"])?$_REQUEST["id"]:(isset($_REQUEST["ref"])?$_REQUEST["ref"]:''); - $dbtablename = 'product'; - $fieldid = isset($_REQUEST["ref"])?'ref':'rowid'; -} - // Security check +$socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user,$objecttype,$objectid,$dbtablename,'','',$fieldid); +$result = restrictedArea($user, 'societe', $socid); /*