Fix avoid error 500 when searching product with no criteria
This commit is contained in:
parent
11e4411400
commit
e064a954d2
@ -48,12 +48,11 @@ if ($action=="getProducts") {
|
||||
$prods = $object->getObjectsInCateg("product");
|
||||
echo json_encode($prods);
|
||||
}
|
||||
|
||||
elseif ($action=="search") {
|
||||
elseif ($action=="search" && $term != '') {
|
||||
$sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'product';
|
||||
$sql .= ' WHERE entity IN ('.getEntity('product').')';
|
||||
$sql .= ' AND tosell = 1';
|
||||
$sql .= natural_search(array('label','barcode'), $term);
|
||||
$sql.= ' WHERE entity IN ('.getEntity('product').')';
|
||||
$sql.= ' AND tosell = 1';
|
||||
$sql.= natural_search(array('label','barcode'), $term);
|
||||
$resql = $db->query($sql);
|
||||
$rows = array();
|
||||
while ($row = $db->fetch_array($resql)) {
|
||||
|
||||
@ -60,7 +60,7 @@ if ($action=="freezone") echo '<input type="text" id="number" name="number" styl
|
||||
if ($action=="addnote") echo '<input type="hidden" id="number" name="number" value="'.$idline.'">';
|
||||
?>
|
||||
<input type="hidden" name="place" value="<?php echo $place;?>">
|
||||
<input type="button" style="width:15%;font-size: 200%;" value="OK" onclick="Save();">
|
||||
<input type="button" class="button" style="width:15%; font-size: 200%;" value="OK" onclick="Save();">
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
@ -26,7 +26,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
|
||||
$_GET['theme']="md"; // Force theme. MD theme provides better look and feel to TakePOS
|
||||
//$_GET['theme']="md"; // Force theme. MD theme provides better look and feel to TakePOS
|
||||
|
||||
require '../main.inc.php'; // Load $user and permissions
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user