diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php
index 4332bb80508..4fb55892173 100644
--- a/htdocs/admin/produit.php
+++ b/htdocs/admin/produit.php
@@ -248,7 +248,7 @@ print "
";
print '| '.$langs->trans("UseSearchToSelectProduct").' | ';
if (! $conf->use_ajax)
{
- print '';
+ print ' | ';
print $langs->trans("NotAvailableWhenAjaxDisabled");
print " | ";
}
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index b23a6613721..e24a4a7dcd0 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1479,7 +1479,7 @@ if ($_GET['propalid'] > 0)
{
$html->select_produits('','idprod','',$conf->produit->limit_size);
}
- if (! $conf->use_ajax) print '
';
+ if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
print '';
print '';
print ' | ';
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index ab8f01d8176..6ea90dd6938 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1617,7 +1617,7 @@ else
$html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
else
$html->select_produits('','idprod','',$conf->produit->limit_size);
- if (! $conf->use_ajax) print '
';
+ if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
print '';
print '';
print ' | ';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index ebc52e5bf3f..2e006b3caa2 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2361,7 +2361,7 @@ else
$html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
else
$html->select_produits('','idprod','',$conf->produit->limit_size);
- if (! $conf->use_ajax) print '
';
+ if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
print '';
print ' | ';
print ' | ';
diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php
index 45a7978278a..1a047e90a2a 100644
--- a/htdocs/conf/conf.class.php
+++ b/htdocs/conf/conf.class.php
@@ -340,6 +340,11 @@ class Conf
// conf->use_ajax
$this->use_ajax=0; // Pas d' Ajax par defaut
if (isset($this->global->MAIN_DISABLE_AJAX)) $this->use_ajax=! $this->global->MAIN_DISABLE_AJAX;
+ if ($this->global->MAIN_DISABLE_AJAX)
+ {
+ // If no Ajax, Ajax features are disabled.
+ $this->global->PRODUIT_USE_SEARCH_TO_SELECT=0;
+ }
// conf->use_popup_calendar
$this->use_popup_calendar=""; // Pas de date popup par defaut
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index 51c5dc9fd41..43277ecdcd3 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -902,7 +902,7 @@ else
$html->select_produits('','p_idprod','',$conf->produit->limit_size,$contrat->societe->price_level);
else
$html->select_produits('','p_idprod','',$conf->produit->limit_size);
- if (! $conf->use_ajax) print '
';
+ if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
';
print '';
print '';
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 9ca11af2a01..797e98245ab 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -730,7 +730,7 @@ class Form
function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0)
{
global $langs,$conf,$user;
- if ($conf->use_ajax && $conf->global->PRODUIT_USE_SEARCH_TO_SELECT)
+ if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)
{
print $langs->trans("Ref").': ';
print $langs->trans("Label").':';
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 93537235684..8a9d8edd596 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -515,10 +515,6 @@ function top_htmlhead($head, $title="", $target="")
if ($conf->use_javascript || $conf->use_ajax)
{
print ''."\n";
- if (file_exists(DOL_DOCUMENT_ROOT.'/lib/lib_head_perso.js'))
- {
- print '';
- }
}
if ($conf->use_ajax)
{