From f998f64db0c7934a83f26ba333dd9309bbc8fba4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 18 Jun 2018 15:48:51 +0200 Subject: [PATCH] Works on use new list engine instead template for canvas Conflicts: htdocs/product/list.php --- htdocs/core/lib/security.lib.php | 3 +-- htdocs/product/card.php | 2 +- htdocs/product/list.php | 12 ++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index d157cafd5f8..f7ce5712c76 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -174,11 +174,10 @@ function dol_verifyHash($chain, $hash, $type='0') * @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'level1|level2'. * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) - * @param Canvas $objcanvas Object canvas * @return int Always 1, die process if not allowed * @see dol_check_secure_access_document */ -function restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null) +function restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') { global $db, $conf; global $hookmanager; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 39a5697ad72..b01aa8bc3f1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -112,7 +112,7 @@ if (! empty($canvas)) // Security check $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldtype = (! empty($id) ? 'rowid' : 'ref'); -$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype,$objcanvas); +$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productcard','globalcard')); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d1ea3d08a4c..884034453f7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013-2016 Juanjo Menent * Copyright (C) 2013-2015 Raphaël Doursenaud @@ -104,19 +104,19 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search if (empty($action)) $action='list'; // Get object canvas (By default, this is not defined, so standard usage of dolibarr) -$canvas=GETPOST("canvas"); +/*$canvas=GETPOST("canvas"); $objcanvas=null; if (! empty($canvas)) { require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; $objcanvas = new Canvas($db,$action); $objcanvas->getCanvas('product','list',$canvas); -} +}*/ // Security check -if ($search_type=='0') $result=restrictedArea($user,'produit','','','','','',$objcanvas); -else if ($search_type=='1') $result=restrictedArea($user,'service','','','','','',$objcanvas); -else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); +if ($search_type=='0') $result=restrictedArea($user,'produit'); +else if ($search_type=='1') $result=restrictedArea($user,'service'); +else $result=restrictedArea($user,'produit|service'); // Define virtualdiffersfromphysical $virtualdiffersfromphysical=0;