diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b5ff0827d7888bdd921379dc2dff227dda4a0187..8e4be407b3137bf7528d77fc61c631aa95219d89 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -228,7 +228,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') $var=!$var; print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>'; - $form->select_pays($conf->global->MAIN_INFO_SOCIETE_PAYS,'pays_id',($conf->use_javascript?' onChange="company_save_refresh()"':'')); + $form->select_pays($conf->global->MAIN_INFO_SOCIETE_PAYS,'pays_id',($conf->use_javascript_ajax?' onChange="company_save_refresh()"':'')); print '</td></tr>'; $var=!$var; @@ -632,7 +632,7 @@ else } // TVA - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { print "\n"; print '<script language="JavaScript" type="text/javascript">'; @@ -654,7 +654,7 @@ else $s.='<input type="hidden" name="tva_intra_code" size="1" maxlength="2" value="'.$code.'">'; $s.='<input type="hidden" name="tva_intra_num" size="12" maxlength="18" value="'.$num.'">'; $s.=' '; - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra_code.value,document.formsoc.tva_intra_num.value);" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.$langs->trans("VATIntraCheck").'</a>'; print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 37b8f5c6225f48a46821b94a55ab1de2e5952ddc..48b9a81cb51f6d0a15e1c3823aba9416086c81a8 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -50,7 +50,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"]); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"]); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"]); - dolibarr_set_const($db, "MAIN_DISABLE_AJAX", $_POST["main_disable_ajax"]); dolibarr_set_const($db, "MAIN_CONFIRM_AJAX", $_POST["main_confirm_ajax"]); dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["main_popup_calendar"]); dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"]); @@ -134,15 +133,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print '<td width="20"> </td>'; print '</tr>'; - // D�sactiver ajax - $var=!$var; - print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableAjax").'</td><td>'; - print $html->selectyesno('main_disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1,1); - print ' ('.$langs->trans("AutomaticIfJavascriptDisabled").')'; - print '</td>'; - print '<td width="20"> </td>'; - print '</tr>'; - // Confirmation par popup ajax if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { @@ -268,12 +258,6 @@ else print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>'; print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)."</td></tr>"; - // Disable ajax - $var=!$var; - print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableAjax").'</td><td>'; - if ($conf->global->MAIN_DISABLE_JAVASCRIPT) print $langs->trans("Yes").' ('.$langs->trans("JavascriptDisabled").')'; - else print yn(isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1)."</td></tr>"; - // Confirm ajax if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 8c0a21cafef411a9e7318b612f2f28462272e057..caefe736d2ce1d85b5ef0fc5dfc9df5326b509e5 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -248,7 +248,7 @@ print '<td>'; $rangLast = 0; $idLast = -1; -if ($conf->use_javascript) +if ($conf->use_javascript_ajax) { print '<script src="menu.js" type="text/javascript"></script>'; } @@ -260,7 +260,7 @@ function affiche($tab,$rang) { global $rangLast, $idLast, $menu_handler; - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { if($rang == $rangLast) { diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 7b4cc5f3555c1a075ec7081b36b2cfb354f75ed8..0bffb7a37dc11e5ab2bcd3932da0f3eab7d532a8 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -213,7 +213,7 @@ print "<form method=\"post\" action=\"produit.php\">"; print "<input type=\"hidden\" name=\"action\" value=\"usesearchtoselectproduct\">"; print "<tr ".$bc[$var].">"; print '<td>'.$langs->trans("UseSearchToSelectProduct").'</td>'; -if (! $conf->use_ajax) +if (! $conf->use_javascript_ajax) { print '<td nowrap="nowrap" align="right" colspan="2">'; print $langs->trans("NotAvailableWhenAjaxDisabled"); diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index 521e60b34890a97ca98db5fb827071f1a6984f39..a2044f6e225a3418511f55751c5e5b204090384f 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -257,7 +257,7 @@ print "<form method=\"post\" action=\"societe.php\">"; print "<input type=\"hidden\" name=\"action\" value=\"usesearchtoselectcompany\">"; print "<tr ".$bc[$var].">"; print '<td width="80%">'.$langs->trans("UseSearchToSelectCompany").'</td>'; -if (! $conf->use_ajax) +if (! $conf->use_javascript_ajax) { print '<td nowrap="nowrap" align="right" colspan="2">'; print $langs->trans("NotAvailableWhenAjaxDisabled"); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index a5bef2cbf418f55dcc4a18aa60c454303535a97c..937b5007b4a80b4ecdfd099877b197b6957e6e12 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -120,7 +120,7 @@ $cate_arbo = $c->get_full_arbo($_GET['type']); */ -if ($conf->use_javascript) +if ($conf->use_javascript_ajax) { print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>'.$langs->trans("CategoriesTree").'</td>'; diff --git a/htdocs/comm/adresse_livraison.php b/htdocs/comm/adresse_livraison.php index c3af249862ecea558e1532f381e07004f6e50d95..0916fd0ed3358816aa06bdd98a0286e818ad4a61 100644 --- a/htdocs/comm/adresse_livraison.php +++ b/htdocs/comm/adresse_livraison.php @@ -230,9 +230,9 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create') print '</textarea></td></tr>'; print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$livraison->cp.'"'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; print '>'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; print '</td></tr>'; print '<tr><td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$livraison->ville.'"></td></tr>'; @@ -335,9 +335,9 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') print '</textarea></td></tr>'; print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$livraison->cp.'"'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; print '>'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; print '</td></tr>'; print '<tr><td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$livraison->ville.'"></td></tr>'; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index d177637c1392ff894387934de47de7b3844d5486..77bc62da942f75da272f407dd2d5ad09bcf2a071 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1161,7 +1161,7 @@ if ($_GET['propalid'] > 0) print "</td>\n"; } - if ($conf->global->PRODUIT_USE_MARKUP && $conf->use_ajax) + if ($conf->global->PRODUIT_USE_MARKUP && $conf->use_javascript_ajax) { $formMarkup = '<form id="formMarkup" action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'" method="post">'."\n"; $formMarkup.= '<table class="border" width="100%">'."\n"; @@ -1268,7 +1268,7 @@ if ($_GET['propalid'] > 0) print '<td align="center">'; if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) { - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&lineid='.$objp->rowid.'&action=confirm_deleteline&confirm=yes'; print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProductLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">'; @@ -1548,7 +1548,7 @@ if ($_GET['propalid'] > 0) $form_close.= '</td></tr>'; $form_close.= '<tr><td align="center" colspan="2">'; $form_close.= '<input type="submit" class="button" name="validate" value="'.$langs->trans('Validate').'">'; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $form_close.= ' <input onClick="Dialog.closeInfo()" type="button" class="button" name="cancel" value="'.$langs->trans('Cancel').'">'; } @@ -1577,7 +1577,7 @@ if ($_GET['propalid'] > 0) if ($propal->statut == 0 && $propal->total_ttc > 0 && $user->rights->propale->valider) { print '<a class="butAction" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=confirm_validate&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmValidateProp').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"'; @@ -1614,7 +1614,7 @@ if ($_GET['propalid'] > 0) print '</div>'."\n"; print '<a class="butAction" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { print 'href="#" onClick="dialogInfo($(\'confirm_close\').innerHTML)"'."\n"; } @@ -1629,7 +1629,7 @@ if ($_GET['propalid'] > 0) if ($propal->statut == 0 && $user->rights->propale->supprimer) { print '<a class="butActionDelete" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=confirm_delete&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProp').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 1e77ae07e93934a80778e9adf9c93c08bb881e59..72b5257637bf5559608c12d4c005a14261d22978 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1425,7 +1425,7 @@ else print '<td align="center">'; if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) { - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$objp->rowid.'&action=confirm_deleteline&confirm=yes'; print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProductLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">'; @@ -1657,7 +1657,7 @@ else if ($commande->statut == 0 && $commande->total_ttc > 0 && $user->rights->commande->valider) { print '<a class="butAction" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { // on v�rifie si la commande est en num�rotation provisoire $ref = substr($commande->ref, 1, 4); @@ -1727,7 +1727,7 @@ else if ($user->rights->commande->cloturer) { print '<a class="butAction" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_close&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmCloseOrder').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'close\')"'; @@ -1747,7 +1747,7 @@ else if ($user->rights->commande->annuler && $nb_expedition == 0) { print '<a class="butActionDelete" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_cancel&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmCancelOrder').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'cancel\')"'; @@ -1764,7 +1764,7 @@ else if ($commande->statut == 0 && $user->rights->commande->supprimer) { print '<a class="butActionDelete" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_delete&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteOrder').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"'; diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index e090922629816738a7b64600e4e4045ca5ea0850..3833ae14d8158a0eab40dac8b02c677153ff5943 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -407,7 +407,7 @@ class CommonObject // On recherche les societes $sql = "SELECT s.rowid, s.nom FROM"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if ($conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { $sql.= " WHERE rowid = ".$selected; } @@ -416,7 +416,7 @@ class CommonObject $resql = $object->db->query($sql); if ($resql) { - if ($conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { $langs->load("companies"); $obj = $this->db->fetch_object($resql); diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index deda6233da21b4363144be172ced6baf21983f4d..04ae8c54b0e395cc4b9e5d7ab58beac8c7f979fd 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -365,17 +365,11 @@ class Conf $this->use_preview_tabs=1; if (isset($this->global->MAIN_USE_PREVIEW_TABS)) $this->use_preview_tabs=$this->global->MAIN_USE_PREVIEW_TABS; - // conf->use_javascript - $this->use_javascript=1; - if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) $this->use_javascript=! $this->global->MAIN_DISABLE_JAVASCRIPT; - - // conf->use_ajax - $this->use_ajax=0; // No Ajax by default - if (isset($this->global->MAIN_DISABLE_AJAX)) $this->use_ajax=! $this->global->MAIN_DISABLE_AJAX; - // If no Javascript, Ajax is disabled. - if (! $this->use_javascript) $this->use_ajax=0; - // If no Ajax, Ajax features are disabled. - if (! $this->use_ajax) + // conf->use_javascript_ajax + $this->use_javascript_ajax=1; + if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) $this->use_javascript_ajax=! $this->global->MAIN_DISABLE_JAVASCRIPT; + // If no javascript_ajax, Ajax features are disabled. + if (! $this->use_javascript_ajax) { $this->global->PRODUIT_USE_SEARCH_TO_SELECT=0; $this->global->MAIN_CONFIRM_AJAX=0; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 9569dc8160b1ca101a40b9237ea9af946c3819a9..b9c1e9256af2286656e022c2a3086ae414a762e6 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -43,12 +43,12 @@ $langs->load("interventions"); $fichinterid = isset($_GET["id"])?$_GET["id"]:''; -// S�curit� d'acc�s client et commerciaux +// Securite d'acces client et commerciaux $socid = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); -//R�cup�re le r�sultat de la recherche Ajax +//Recupere le resultat de la recherche Ajax //Todo: voir pour le supprimer par la suite -if ($conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && $_POST['socid_id']) +if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && $_POST['socid_id']) { $_POST['socid'] = $_POST['socid_id']; } @@ -695,7 +695,7 @@ elseif ($_GET["id"] > 0) print '<td align="center">'; if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) { - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$objp->rowid.'&action=confirm_deleteline&confirm=yes'; print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteInterventionLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">'; @@ -861,7 +861,7 @@ elseif ($_GET["id"] > 0) if ($fichinter->statut == 0 && $user->rights->ficheinter->creer) { print '<a class="butAction" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_validate&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmValidateIntervention').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"'; @@ -877,7 +877,7 @@ elseif ($_GET["id"] > 0) if ($fichinter->statut == 0 && $user->rights->ficheinter->supprimer) { print '<a class="butActionDelete" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_delete&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans("ConfirmDeleteIntervention").'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"'; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 23e15998cafd97721af16deee54559f321f69746..6c843b2233f895ff54a3877bac8da738c47fd373 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -86,7 +86,7 @@ class Form $htmltext=ereg_replace("'","\'",$htmltext); $htmltext=ereg_replace("'","\'",$htmltext); - if ($conf->use_ajax && $tooltipon == 4) + if ($conf->use_javascript_ajax && $tooltipon == 4) { $s = '<div id="tip'.$i.'">'."\n"; $s.= $text; @@ -101,7 +101,7 @@ class Form } else { - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { $htmltext=eregi_replace('"',"\'",$htmltext); if ($tooltipon==1 || $tooltipon==3) @@ -378,7 +378,8 @@ class Form $sql = "SELECT rowid, code, libelle, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " WHERE active = 1"; - if ($conf->use_ajax && $conf->global->CODE_DE_TEST == 1) + // \TODO A virer + if ($conf->use_javascript_ajax && $conf->global->CODE_DE_TEST) { if (is_numeric($selected)) { @@ -394,7 +395,8 @@ class Form $resql=$this->db->query($sql); if ($resql) { - if ($conf->use_ajax && $conf->global->CODE_DE_TEST == 1) + // \TODO A virer + if ($conf->use_javascript_ajax && $conf->global->CODE_DE_TEST) { $langs->load("companies"); $obj = $this->db->fetch_object($resql); @@ -681,7 +683,7 @@ class Form $sql = "SELECT s.rowid, s.nom FROM"; $sql.= " ".MAIN_DB_PREFIX ."societe as s"; if ($filter) $sql.= " WHERE ".$filter; - if ($selected && $conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($selected && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { if ($filter) { @@ -699,7 +701,7 @@ class Form $resql=$this->db->query($sql); if ($resql) { - if ($conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { $socid = 0; if ($selected) @@ -1072,7 +1074,7 @@ class Form { $num = $this->db->num_rows($result); - if ($conf->use_ajax) + if ($conf->use_javascript_ajax) { if (! $num) { @@ -1227,7 +1229,7 @@ class Form $num = $this->db->num_rows($result); - if ($conf->use_ajax) + if ($conf->use_javascript_ajax) { if (! $num) { @@ -2767,7 +2769,7 @@ class Form /* * Affiche date en popup */ - if ($conf->use_javascript && $conf->use_popup_calendar) + if ($conf->use_javascript_ajax && $conf->use_popup_calendar) { //print "e".$set_time." t ".$conf->format_date_short; if ($set_time > 0) @@ -2818,7 +2820,7 @@ class Form /* * Affiche date en select */ - if (! $conf->use_javascript || ! $conf->use_popup_calendar) + if (! $conf->use_javascript_ajax || ! $conf->use_popup_calendar) { /* if ($set_time == -1) diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php index 8e6e8a713137b8bac588a8b26aada0c4c74c0440..0727bd0ba368cbbb8eb5ebf39a90b1d81e3e1944 100644 --- a/htdocs/includes/boxes/modules_boxes.php +++ b/htdocs/includes/boxes/modules_boxes.php @@ -124,7 +124,7 @@ class ModeleBoxes print '<td'; if ($nbcol > 0) { print ' colspan="'.$nbcol.'"'; } print '>'; - if ($conf->use_ajax) + if ($conf->use_javascript_ajax) { print '<table class="nobordernopadding" width="100%"><tr><td align="left">'; } @@ -138,7 +138,7 @@ class ModeleBoxes { print ' <a href="'.$head['sublink'].'" target="_new">'.img_picto($head['subtext'],$head['subpicto']).'</a>'; } - if ($conf->use_ajax) + if ($conf->use_javascript_ajax) { print '</td><td class="nocellnopadd" width="14">'; print img_picto($langs->trans("MoveBox",$this->box_id),'uparrow','style="cursor:move;"'); diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 05ee0bffe2ca22f444bc2e19d937b44ddfe40707..48765c57f64e817a64fd79e04010ad1b9c996f73 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -183,7 +183,7 @@ class MenuLeft { if ($user->rights->societe->creer) { $newmenu->add_submenu(DOL_URL_ROOT."/soc.php?action=create", $langs->trans("MenuNewThirdParty")); - if (! $conf->use_javascript) $newmenu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&private=1",$langs->trans("MenuNewPrivateIndividual")); + if (! $conf->use_javascript_ajax) $newmenu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&private=1",$langs->trans("MenuNewPrivateIndividual")); } if(is_dir("societe/groupe")) diff --git a/htdocs/index.php b/htdocs/index.php index 38182ff159b8102371b966422c9094f32f68a431..d2fb1e8e86117a21b6237e887acaf03067f75217 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -619,7 +619,7 @@ if (sizeof($boxarray)) print "</table>"; } -if ($conf->use_ajax) +if ($conf->use_javascript_ajax) { print "\n"; print '<script type="text/javascript" language="javascript"> diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f0c03b2a3aadea930e8f990ed164602a66d30ecc..550858c29593ab68fba3ae14fe8c2414b3000baf 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -80,7 +80,7 @@ require_once("master.inc.php"); // Chargement des includes complementaire de presentation if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); if (! defined('NOREQUIREHTML')) require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php"); -if (! defined('NOREQUIREAJAX') && $conf->use_ajax) require_once(DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php'); +if (! defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) require_once(DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php'); // Init session $sessionname="DOLSESSID_".$dolibarr_main_db_name; @@ -321,7 +321,7 @@ if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php"; if (isset($user->conf->MAIN_DISABLE_JAVASCRIPT) && $user->conf->MAIN_DISABLE_JAVASCRIPT) { - $conf->use_javascript=! $user->conf->MAIN_DISABLE_JAVASCRIPT; + $conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT; } // Defini gestionnaire de menu a utiliser @@ -659,7 +659,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0) print '<link rel="stylesheet" type="text/css" media="print" href="'.DOL_URL_ROOT.'/theme/print.css">'."\n"; // Style sheets pour la class Window - if (! $disablejs && ($conf->use_javascript && $conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX)) + if (! $disablejs && $conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/window/default.css">'."\n"; print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/common/window/alphacube.css">'."\n"; @@ -678,11 +678,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0) print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">'."\n"; print '<link rel="author" title="Dolibarr Development Team" href="http://www.dolibarr.org">'."\n"; - if (! $disablejs && ($conf->use_javascript || $conf->use_ajax)) + if (! $disablejs && $conf->use_javascript_ajax) { print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_head.js"></script>'."\n"; } - if (! $disablejs && $conf->use_ajax) + if (! $disablejs && $conf->use_javascript_ajax) { require_once DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php'; @@ -976,7 +976,7 @@ function llxFooter($foot='',$limitIEbug=1) print "\n"; } - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_foot.js"></script>'; } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 9f7515dccb2a5e8d7dc962d055b387974623cdb7..8f629a76ad6560486603da0ea22ff30a08c42f42 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -48,7 +48,7 @@ if (! $user->rights->produit->lire) accessforbidden(); //R�cup�re le r�sultat de la recherche Ajax //Todo: voir pour le supprimer par la suite -if ($conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && $_POST['id_fourn_id']) +if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && $_POST['id_fourn_id']) { $_POST['id_fourn'] = $_POST['id_fourn_id']; } diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 92fe3ab1e79dc32a16e55ed0d5778fb0afd0b7fc..af23a7e3b13d438ba20314f03e1dd0c531416772 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -233,7 +233,7 @@ if ($_GET["id"] || $_GET["ref"]) } if ($user->rights->produit->creer) { - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?id='.$product->id.'&file='.urlencode($pdir.$viewfilename).'&action=confirm_delete&confirm=yes'; print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeletePicture').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"'; diff --git a/htdocs/soc.php b/htdocs/soc.php index 32e2145e5fb0feea77baed29f05e4864e03a3c60..27287cb322790f622975847bdb16833a597c8b75 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -309,8 +309,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || print_titre($langs->trans("NewCompany")); - //$conf->use_javascript=0; - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { print "<br>\n"; print $langs->trans("ThirdPartyType").': '; @@ -414,14 +413,14 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || print '</textarea></td></tr>'; print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; print '>'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; print '</td>'; print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">'; - $form->select_pays($soc->pays_id,'pays_id',$conf->use_javascript?' onChange="autofilltownfromzip_save_refresh_create()"':''); + $form->select_pays($soc->pays_id,'pays_id',$conf->use_javascript_ajax?' onChange="autofilltownfromzip_save_refresh_create()"':''); print '</td></tr>'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; @@ -526,7 +525,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || print '</td>'; // Code TVA - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { print "\n"; print '<script language="JavaScript" type="text/javascript">'; @@ -541,7 +540,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || $s ='<input type="text" class="flat" name="tva_intra_code" size="1" maxlength="2" value="'.$soc->tva_intra_code.'">'; $s.='<input type="text" class="flat" name="tva_intra_num" size="12" maxlength="18" value="'.$soc->tva_intra_num.'">'; $s.=' '; - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra_code.value,document.formsoc.tva_intra_num.value);" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.$langs->trans("VATIntraCheck").'</a>'; print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); @@ -768,15 +767,15 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') print '</textarea></td></tr>'; print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' onChange="autofilltownfromzip_PopupPostalCode(cp.value,ville)"'; print '>'; - if ($conf->use_javascript && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; + if ($conf->use_javascript_ajax && $conf->global->MAIN_AUTO_FILLTOWNFROMZIP) print ' <input class="button" type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="autofilltownfromzip_PopupPostalCode(cp.value,ville)">'; print '</td>'; print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; - $form->select_pays($soc->pays_id,'pays_id',$conf->use_javascript?' onChange="autofilltownfromzip_save_refresh_edit()"':''); + $form->select_pays($soc->pays_id,'pays_id',$conf->use_javascript_ajax?' onChange="autofilltownfromzip_save_refresh_edit()"':''); print '</td></tr>'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; @@ -836,7 +835,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') print '</td>'; // Code TVA - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { print "\n"; print '<script language="JavaScript" type="text/javascript">'; @@ -851,7 +850,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') $s ='<input type="text" class="flat" name="tva_intra_code" size="1" maxlength="2" value="'.$soc->tva_intra_code.'">'; $s.='<input type="text" class="flat" name="tva_intra_num" size="12" maxlength="18" value="'.$soc->tva_intra_num.'">'; $s.=' '; - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra_code.value,document.formsoc.tva_intra_num.value);" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.$langs->trans("VATIntraCheck").'</a>'; print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); @@ -1033,7 +1032,7 @@ else print '</td>'; // VAT Code - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { print "\n"; print '<script language="JavaScript" type="text/javascript">'; @@ -1053,7 +1052,7 @@ else $s.='<input type="hidden" name="tva_intra_code" size="1" maxlength="2" value="'.$code.'">'; $s.='<input type="hidden" name="tva_intra_num" size="12" maxlength="18" value="'.$num.'">'; $s.=' '; - if ($conf->use_javascript) + if ($conf->use_javascript_ajax) { $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra_code.value,document.formsoc.tva_intra_num.value);" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.$langs->trans("VATIntraCheck").'</a>'; print $form->textwithhelp($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); @@ -1181,7 +1180,7 @@ else if ($user->rights->societe->supprimer) { print '<a class="butActionDelete" '; - if ($conf->use_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { $url = $_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action=confirm_delete&confirm=yes'; print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteCompany').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';