diff --git a/htdocs/product/info.php b/htdocs/product/info.php index f725d0e17d9..e29d1a168cb 100644 --- a/htdocs/product/info.php +++ b/htdocs/product/info.php @@ -74,8 +74,6 @@ llxHeader('', $title, $helpurl); $form=new Form($b); -llxHeader('', $title, $help_url); - if ($id > 0 || $ref) { $result = $object->fetch($id,$ref); diff --git a/htdocs/product/note.php b/htdocs/product/note.php index ef53946460f..39f461a4a0e 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -30,17 +30,20 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -$action = GETPOST('action'); - $langs->load("companies"); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action'); + // Security check -$id = GETPOST('id')?GETPOST('id','int'):GETPOST('socid','int'); -if ($user->societe_id) $id=$user->societe_id; -$result = restrictedArea($user, 'societe', $id, '&societe'); +$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); +$fieldtype = (! empty($ref) ? 'ref' : 'rowid'); +if ($user->societe_id) $socid=$user->societe_id; +$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype); $object = new Product($db); -if ($id > 0) $object->fetch($id); +if ($id > 0 || ! empty($ref)) $object->fetch($id, $ref); $permissionnote=$user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php @@ -64,7 +67,7 @@ $form = new Form($db); llxHeader('', $langs->trans("ThirdParty").' - '.$langs->trans("Notes"), $help_url); -if ($id > 0) +if ($id > 0 || ! empty($ref)) { /* * Affichage onglets @@ -81,13 +84,14 @@ if ($id > 0) print '