Merge pull request #11551 from atm-quentin/NEW_global_search_product

NEW Add hidden option to set fields for the quick search on products
This commit is contained in:
Laurent Destailleur 2019-08-15 20:26:05 +02:00 committed by GitHub
commit fa53641221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View File

@ -146,6 +146,7 @@ if ($action == 'other')
$value = GETPOST('activate_useProdFournDesc', 'alpha'); $value = GETPOST('activate_useProdFournDesc', 'alpha');
$res = dolibarr_set_const($db, "PRODUIT_FOURN_TEXTS", $value, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "PRODUIT_FOURN_TEXTS", $value, 'chaine', 0, '', $conf->entity);
if ($value) { if ($value) {
$sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1"; $sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
$resql = $db->query($sql_test); $resql = $db->query($sql_test);
@ -678,6 +679,7 @@ if (! empty($conf->fournisseur->enabled))
print '</tr>'; print '</tr>';
} }
if (! empty($conf->global->PRODUCT_CANVAS_ABILITY)) if (! empty($conf->global->PRODUCT_CANVAS_ABILITY))
{ {
// Add canvas feature // Add canvas feature

View File

@ -136,6 +136,7 @@ $fieldstosearchall = array(
'p.label'=>"ProductLabel", 'p.label'=>"ProductLabel",
'p.description'=>"Description", 'p.description'=>"Description",
"p.note"=>"Note", "p.note"=>"Note",
); );
// multilang // multilang
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS))
@ -148,6 +149,8 @@ if (! empty($conf->barcode->enabled)) {
$fieldstosearchall['p.barcode']='Gencod'; $fieldstosearchall['p.barcode']='Gencod';
$fieldstosearchall['pfp.barcode']='GencodBuyPrice'; $fieldstosearchall['pfp.barcode']='GencodBuyPrice';
} }
// Personalized search criterias. Example: $conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS = 'p.ref=ProductRef;p.label=ProductLabel'
if (! empty($conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS)) $fieldstosearchall=dolExplodeIntoArray($conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS);
if (empty($conf->global->PRODUIT_MULTIPRICES)) if (empty($conf->global->PRODUIT_MULTIPRICES))
{ {