From ba5e5d07025afad536c9d190df330241fd6c0f90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Jan 2010 09:54:04 +0000 Subject: [PATCH] Remove duplicate code --- htdocs/categories/fiche.php | 14 ++++---------- htdocs/comm/action/fiche.php | 7 ------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 6df86f1c8f3..0f26d395ef4 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -38,6 +38,7 @@ if (! empty($_REQUEST['socid_id'])) } // Security check +$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; if (!$user->rights->categorie->lire) accessforbidden(); if (isset ($_REQUEST['choix'])) @@ -61,18 +62,11 @@ if ($_REQUEST['catorigin']) if ($_GET['type'] == 0) $idCatOrigin = $_REQUEST['catorigin']; } -// If socid provided by ajax company selector -if (! empty($_REQUEST['socid_id'])) -{ - $_GET['socid'] = $_GET['socid_id']; - $_POST['socid'] = $_POST['socid_id']; - $_REQUEST['socid'] = $_REQUEST['socid_id']; -} /* -* Actions -*/ + * Actions + */ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) { @@ -247,7 +241,7 @@ if ($user->rights->categorie->creer) else { print ''.$langs->trans ("AssignedToCustomer").''; - print $html->select_societes($_REQUEST['socid_id'],'socid','s.client IN (1, 3) AND s.fournisseur = 0',1); + print $html->select_societes($socid,'socid','s.client IN (1, 3) AND s.fournisseur = 0',1); print ''; print ''; print ''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index a58b88128d7..b86f581e580 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -64,13 +64,6 @@ $cactioncomm = new CActionComm($db); $actioncomm = new ActionComm($db); $contact = new Contact($db); -// If socid provided by ajax company selector -if (! empty($_REQUEST['socid_id'])) -{ - $_GET['socid'] = $_GET['socid_id']; - $_POST['socid'] = $_POST['socid_id']; - $_REQUEST['socid'] = $_REQUEST['socid_id']; -} /*