Fix phpcs

This commit is contained in:
Laurent Destailleur 2022-04-29 19:30:04 +02:00
parent 6a2526ae65
commit 316ef3371d

View File

@ -224,10 +224,12 @@ if ($action == 'getProducts') {
$sql .= ', ps.reel'; $sql .= ', ps.reel';
} }
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters = array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters);
$sql .= $hookmanager->resPrint; if ($reshook >= 0) {
$sql .= $hookmanager->resPrint;
}
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1) { if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1) {
@ -237,9 +239,11 @@ if ($action == 'getProducts') {
} }
// Add tables from hooks // Add tables from hooks
$parameters=array(); $parameters = array();
$reshook=$hookmanager->executeHooks('printFieldListTables', $parameters); $reshook = $hookmanager->executeHooks('printFieldListTables', $parameters);
$sql .= $hookmanager->resPrint; if ($reshook >= 0) {
$sql .= $hookmanager->resPrint;
}
$sql .= ' WHERE entity IN ('.getEntity('product').')'; $sql .= ' WHERE entity IN ('.getEntity('product').')';
if ($filteroncategids) { if ($filteroncategids) {
@ -251,9 +255,11 @@ if ($action == 'getProducts') {
} }
$sql .= natural_search(array('ref', 'label', 'barcode'), $term); $sql .= natural_search(array('ref', 'label', 'barcode'), $term);
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters = array();
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters);
$sql .= $hookmanager->resPrint; if ($reshook >= 0) {
$sql .= $hookmanager->resPrint;
}
// load only one page of products // load only one page of products
$sql.= $db->plimit($search_limit, $search_start); $sql.= $db->plimit($search_limit, $search_start);