Works on use new list engine instead template for canvas

Conflicts:
	htdocs/product/list.php
This commit is contained in:
Regis Houssin 2018-06-18 15:48:51 +02:00
parent 16b4d2aee7
commit f998f64db0
3 changed files with 8 additions and 9 deletions

View File

@ -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;

View File

@ -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'));

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -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;