diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index af6b1a9d4f3..a8a08f823d9 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002-2005 Rodolphe Quiedeville * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2007 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -40,7 +40,7 @@ $socid=0; $id = GETPOST('id','int'); $ref = GETPOST("ref"); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propale', $id, 'propal'); +$result = restrictedArea($user, 'propal', $id); /* diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 86a7e434f8a..a0ee9f76a47 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -43,7 +43,7 @@ $action=GETPOST('action','alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propale', $id, 'propal'); +$result = restrictedArea($user, 'propal', $id); $object = new Propal($db); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index fd6e682b0fb..6d041e5e83e 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -27,8 +27,6 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT ."/comm/propal/class/propal.class.php"); -if (!$user->rights->propale->lire) accessforbidden(); - $langs->load("propal"); $langs->load("companies"); @@ -39,7 +37,7 @@ if (isset($user->societe_id) && $user->societe_id > 0) $action = ''; $socid = $user->societe_id; } - +$result = restrictedArea($user, 'propal'); /* @@ -65,7 +63,7 @@ print ''; */ $var=false; print ''; -print ''; +print ''; print ''; print ''; print '
'.$langs->trans("SearchPropal").'
'; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 5c2f9e0728e..eec618f987f 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2006 Laurent Destailleur - * Copyright (C) 2005 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2005-2012 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 @@ -31,11 +31,12 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/propal.lib.php"); $langs->load('propal'); $langs->load('compta'); -$id = isset($_GET["id"])?$_GET["id"]:''; +$id=GETPOST('id','int'); +$socid=GETPOST('socid','int'); // Security check -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propale', $id, 'propal'); +if (! empty($user->societe_id)) $socid=$user->societe_id; +$result = restrictedArea($user, 'propal', $id); /* @@ -44,25 +45,22 @@ $result = restrictedArea($user, 'propale', $id, 'propal'); llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); -$propal = new Propal($db); -$propal->fetch($_GET["id"]); +$object = new Propal($db); +$object->fetch($id); +$object->fetch_thirdparty(); -$societe = new Societe($db); -$societe->fetch($propal->socid); - -$head = propal_prepare_head($propal); +$head = propal_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans('Proposal'), 0, 'propal'); -$propal->info($propal->id); +$object->info($object->id); print '
'; -dol_print_object_info($propal); +dol_print_object_info($object); print '
'; print ''; -$db->close(); - llxFooter(); +$db->close(); ?> diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ab967914c48..06b7320e3d3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -67,7 +67,8 @@ $month=GETPOST("month"); $NBLINES=4; // Security check -$module='propale'; +$module='propal'; +$dbtable=''; if (isset($socid)) { $objectid=$socid; @@ -77,8 +78,6 @@ if (isset($socid)) else if (isset($id) && $id > 0) { $objectid=$id; - $module='propale'; - $dbtable='propal'; } if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, $module, $objectid, $dbtable);