Replace javascript by jQuery
This commit is contained in:
parent
54489e6050
commit
cc55568723
@ -378,7 +378,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print 'jQuery(document).ready(function () {
|
print 'jQuery(document).ready(function () {
|
||||||
jQuery(".bankswitchclass").'.($bankdirect||$bankviainvoice?'show()':'hide()').';
|
jQuery(".bankswitchclass").'.($bankdirect||$bankviainvoice?'show()':'hide()').';
|
||||||
jQuery("#none").click(function() {
|
jQuery("#none").click(function() {
|
||||||
@ -394,7 +394,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
|
|||||||
jQuery(".bankswitchclass").show();
|
jQuery(".bankswitchclass").show();
|
||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>';
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form name="cotisation" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="cotisation" method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|||||||
@ -665,6 +665,20 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectpays_id").change(function() {
|
||||||
|
document.formsoc.action.value="create";
|
||||||
|
document.formsoc.submit();
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@ -733,7 +747,7 @@ if ($action == 'create')
|
|||||||
// Country
|
// Country
|
||||||
$adh->pays_id=$adh->pays_id?$adh->pays_id:$mysoc->pays_id;
|
$adh->pays_id=$adh->pays_id?$adh->pays_id:$mysoc->pays_id;
|
||||||
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
||||||
$html->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$adh->pays_id,'pays_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_create()"':'');
|
$html->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$adh->pays_id,'pays_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -850,6 +864,18 @@ if ($action == 'edit')
|
|||||||
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectpays").change(function() {
|
||||||
|
document.formsoc.action.value="edit";
|
||||||
|
document.formsoc.submit();
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
$rowspan=17;
|
$rowspan=17;
|
||||||
$rowspan+=sizeof($adho->attribute_label);
|
$rowspan+=sizeof($adho->attribute_label);
|
||||||
if ($conf->societe->enabled) $rowspan++;
|
if ($conf->societe->enabled) $rowspan++;
|
||||||
@ -929,7 +955,7 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
||||||
$html->select_pays(isset($_POST["pays"])?$_POST["pays"]:$adh->pays_id,'pays',$conf->use_javascript_ajax?' onChange="company_save_refresh_edit()"':'');
|
$html->select_pays(isset($_POST["pays"])?$_POST["pays"]:$adh->pays_id,'pays');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -267,6 +267,14 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
/**
|
/**
|
||||||
* Edition des parametres
|
* Edition des parametres
|
||||||
*/
|
*/
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectpays_id").change(function() {
|
||||||
|
document.form_index.action.value="updateedit";
|
||||||
|
document.form_index.submit();
|
||||||
|
});
|
||||||
|
});';
|
||||||
|
print '</script>'."\n";
|
||||||
|
|
||||||
print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -292,11 +300,12 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyTown").'</td><td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyTown").'</td><td>';
|
||||||
print '<input name="ville" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_VILLE?$conf->global->MAIN_INFO_SOCIETE_VILLE:$_POST["ville"]) . '"></td></tr>'."\n";
|
print '<input name="ville" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_VILLE?$conf->global->MAIN_INFO_SOCIETE_VILLE:$_POST["ville"]) . '"></td></tr>'."\n";
|
||||||
|
|
||||||
|
// Country
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>';
|
||||||
$pays_selected=$pays_id;
|
$pays_selected=$pays_id;
|
||||||
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
||||||
$form->select_pays($pays_selected,'pays_id',($conf->use_javascript_ajax?' onChange="company_save_refresh()"':''));
|
$form->select_pays($pays_selected,'pays_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
@ -362,8 +371,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Note
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>';
|
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>';
|
||||||
print '<textarea class="flat" name="note" cols="80" rows="'.ROWS_5.'">'.$conf->global->MAIN_INFO_SOCIETE_NOTE.'</textarea></td></tr>';
|
print '<textarea class="flat" name="note" cols="80" rows="'.ROWS_5.'">'.$conf->global->MAIN_INFO_SOCIETE_NOTE.'</textarea></td></tr>';
|
||||||
|
|||||||
@ -181,6 +181,18 @@ if ($_REQUEST["action"] == 'create')
|
|||||||
|
|
||||||
if ($message) { print "$message<br>\n"; }
|
if ($message) { print "$message<br>\n"; }
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectaccount_country_id").change(function() {
|
||||||
|
document.formsoc.action.value="create";
|
||||||
|
document.formsoc.submit();
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" name="formsoc" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" name="formsoc" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@ -238,7 +250,7 @@ if ($_REQUEST["action"] == 'create')
|
|||||||
$selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$account->pays_code;
|
$selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$account->pays_code;
|
||||||
}
|
}
|
||||||
else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
|
else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
|
||||||
$form->select_pays($selectedcode,'account_country_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_create()"':'');
|
$form->select_pays($selectedcode,'account_country_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -448,6 +460,18 @@ else
|
|||||||
|
|
||||||
if ($message) { print "$message<br>\n"; }
|
if ($message) { print "$message<br>\n"; }
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectaccount_country_id").change(function() {
|
||||||
|
document.formsoc.action.value="edit";
|
||||||
|
document.formsoc.submit();
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post" name="formsoc">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$account->id.'" method="post" name="formsoc">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
@ -494,7 +518,7 @@ else
|
|||||||
$selectedcode=$account->pays_code;
|
$selectedcode=$account->pays_code;
|
||||||
if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"];
|
if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"];
|
||||||
else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
|
else if (empty($selectedcode)) $selectedcode=$mysoc->pays_code;
|
||||||
$form->select_pays($selectedcode,'account_country_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_edit()"':'');
|
$form->select_pays($selectedcode,'account_country_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -300,6 +300,18 @@ if ($user->rights->societe->contact->creer)
|
|||||||
// Affiche les erreurs
|
// Affiche les erreurs
|
||||||
dol_htmloutput_errors($mesg,$errors);
|
dol_htmloutput_errors($mesg,$errors);
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectpays_id").change(function() {
|
||||||
|
document.formsoc.action.value="create";
|
||||||
|
document.formsoc.submit();
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<form method="post" name="formsoc" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" name="formsoc" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@ -346,7 +358,7 @@ if ($user->rights->societe->contact->creer)
|
|||||||
// Country
|
// Country
|
||||||
if (dol_strlen(trim($contact->fk_pays)) == 0) $contact->fk_pays = $objsoc->pays_id; // Predefined with third party
|
if (dol_strlen(trim($contact->fk_pays)) == 0) $contact->fk_pays = $objsoc->pays_id; // Predefined with third party
|
||||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||||
$form->select_pays((isset($_POST["pays_id"])?$_POST["pays_id"]:$contact->fk_pays),'pays_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_create()"':'');
|
$form->select_pays((isset($_POST["pays_id"])?$_POST["pays_id"]:$contact->fk_pays),'pays_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -418,6 +430,18 @@ if ($user->rights->societe->contact->creer)
|
|||||||
// Affiche les erreurs
|
// Affiche les erreurs
|
||||||
dol_htmloutput_errors($mesg,$errors);
|
dol_htmloutput_errors($mesg,$errors);
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#selectpays_id").change(function() {
|
||||||
|
document.formsoc.action.value="edit";
|
||||||
|
document.formsoc.submit();
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
print '</script>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$_REQUEST["id"].'" name="formsoc">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$_REQUEST["id"].'" name="formsoc">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">';
|
print '<input type="hidden" name="id" value="'.$_REQUEST["id"].'">';
|
||||||
@ -459,7 +483,7 @@ if ($user->rights->societe->contact->creer)
|
|||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||||
$form->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$contact->fk_pays,'pays_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_edit()"':'');
|
$form->select_pays(isset($_POST["pays_id"])?$_POST["pays_id"]:$contact->fk_pays,'pays_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -274,7 +274,7 @@ class Form
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<select class="flat" name="'.$htmlname.'" '.$htmloption.'>';
|
print '<select id="select'.$htmlname.'" class="flat selectpays" name="'.$htmlname.'" '.$htmloption.'>';
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num)
|
if ($num)
|
||||||
@ -1569,7 +1569,7 @@ class Form
|
|||||||
|
|
||||||
$this->load_cache_types_paiements();
|
$this->load_cache_types_paiements();
|
||||||
|
|
||||||
print '<select id="selectpaymenttypes" class="flat" name="'.$htmlname.'">';
|
print '<select id="select'.$htmlname.'" class="flat selectpaymenttypes" name="'.$htmlname.'">';
|
||||||
if ($empty) print '<option value=""> </option>';
|
if ($empty) print '<option value=""> </option>';
|
||||||
foreach($this->cache_types_paiements as $id => $arraytypes)
|
foreach($this->cache_types_paiements as $id => $arraytypes)
|
||||||
{
|
{
|
||||||
@ -1710,7 +1710,7 @@ class Form
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print '<select id="selectbankaccount" class="flat" name="'.$htmlname.'">';
|
print '<select id="select'.$htmlname.'" class="flat selectbankaccount" name="'.$htmlname.'">';
|
||||||
if ($useempty)
|
if ($useempty)
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'"> </option>';
|
print '<option value="'.$obj->rowid.'"> </option>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr>
|
/* Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,17 +20,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/core/class/html.form.class.php
|
\file htdocs/includes/barcode/html.formbarcode.class.php
|
||||||
\brief Fichier de la classe des fonctions pr<EFBFBD>d<EFBFBD>finie de composants html
|
\brief Fichier de la classe des fonctions predefinie de composants html
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class Form
|
\class Form
|
||||||
\brief Classe permettant la g<EFBFBD>n<EFBFBD>ration de composants html
|
\brief Classe permettant la generation de composants html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class FormBarCode
|
class FormBarCode
|
||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
@ -63,6 +62,20 @@ class FormBarCode
|
|||||||
|
|
||||||
$disable = '';
|
$disable = '';
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
|
print 'jQuery(document).ready(function () {
|
||||||
|
jQuery("#select'.$idForm.'").change(function() {
|
||||||
|
var formName = document.getElementById("form'.$idForm.'");
|
||||||
|
formName.action.value="setcoder";
|
||||||
|
formName.submit();
|
||||||
|
});
|
||||||
|
});';
|
||||||
|
print '</script>'."\n";
|
||||||
|
//onChange="barcode_coder_save(\''.$idForm.'\')
|
||||||
|
}
|
||||||
|
|
||||||
// We check if barcode is already selected by default
|
// We check if barcode is already selected by default
|
||||||
if ((($conf->product->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) ||
|
if ((($conf->product->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) ||
|
||||||
($conf->societe->enabled && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id))
|
($conf->societe->enabled && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id))
|
||||||
@ -70,11 +83,11 @@ class FormBarCode
|
|||||||
$disable = 'disabled="disabled"';
|
$disable = 'disabled="disabled"';
|
||||||
}
|
}
|
||||||
|
|
||||||
$select_encoder = '<form action="barcode.php" method="post" id="'.$idForm.'">';
|
$select_encoder = '<form action="'.DOL_URL_ROOT.'/includes/modules/barcode/admin/barcode.php" method="post" id="form'.$idForm.'">';
|
||||||
$select_encoder.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$select_encoder.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
$select_encoder.= '<input type="hidden" name="action" value="update">';
|
$select_encoder.= '<input type="hidden" name="action" value="update">';
|
||||||
$select_encoder.= '<input type="hidden" name="code_id" value="'.$code_id.'">';
|
$select_encoder.= '<input type="hidden" name="code_id" value="'.$code_id.'">';
|
||||||
$select_encoder.= '<select class="flat" name="coder" onChange="barcode_coder_save(\''.$idForm.'\')">';
|
$select_encoder.= '<select id="select'.$idForm.'" class="flat" name="coder">';
|
||||||
$select_encoder.= '<option value="0"'.($selected==0?' selected="true"':'').' '.$disable.'>'.$langs->trans('Disable').'</option>';
|
$select_encoder.= '<option value="0"'.($selected==0?' selected="true"':'').' '.$disable.'>'.$langs->trans('Disable').'</option>';
|
||||||
$select_encoder.= '<option value="-1" disabled="disabled">--------------------</option>';
|
$select_encoder.= '<option value="-1" disabled="disabled">--------------------</option>';
|
||||||
foreach($barcodelist as $key => $value)
|
foreach($barcodelist as $key => $value)
|
||||||
@ -100,7 +113,7 @@ class FormBarCode
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||||
$sql.= " WHERE coder <> '0'";
|
$sql.= " WHERE coder <> '0'";
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
$sql.= " ORDER BY rowid";
|
$sql.= " ORDER BY code";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -140,6 +140,7 @@ print "</tr>\n";
|
|||||||
$sql = "SELECT rowid, code as encoding, libelle, coder, example";
|
$sql = "SELECT rowid, code as encoding, libelle, coder, example";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
|
$sql.= " ORDER BY code";
|
||||||
|
|
||||||
dol_syslog("admin/barcode.php sql=".$sql);
|
dol_syslog("admin/barcode.php sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|||||||
@ -11,20 +11,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
/*=================================================================
|
|
||||||
Purpose: Resubmit page when barcode choice is changed (admin page)
|
|
||||||
Input: formNameID
|
|
||||||
Author: Laurent Destailleur
|
|
||||||
Licence: GPL
|
|
||||||
==================================================================*/
|
|
||||||
function barcode_coder_save(formNameID)
|
|
||||||
{
|
|
||||||
var formName = document.getElementById(formNameID);
|
|
||||||
formName.action.value='setcoder';
|
|
||||||
formName.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*=================================================================
|
/*=================================================================
|
||||||
Purpose: Pour la fonction de saisie auto des villes
|
Purpose: Pour la fonction de saisie auto des villes
|
||||||
Input: postalcode,objecttown,objectcountry,objectstate
|
Input: postalcode,objecttown,objectcountry,objectstate
|
||||||
@ -43,32 +29,6 @@ function autofilltownfromzip_PopupPostalCode(url_root, postalcode,objecttown,obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*=================================================================
|
|
||||||
Purpose: To resubmit pages when country is changed
|
|
||||||
Input: postalcode,objecttown,objectcountry,objectstate
|
|
||||||
Author: Eric Seigne
|
|
||||||
Licence: GPL
|
|
||||||
==================================================================*/
|
|
||||||
function company_save_refresh_edit()
|
|
||||||
{
|
|
||||||
document.formsoc.action.value="edit";
|
|
||||||
document.formsoc.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
function company_save_refresh_create()
|
|
||||||
{
|
|
||||||
document.formsoc.action.value="create";
|
|
||||||
document.formsoc.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
function company_save_refresh()
|
|
||||||
{
|
|
||||||
document.form_index.action.value="updateedit";
|
|
||||||
document.form_index.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*=================================================================
|
/*=================================================================
|
||||||
Purpose: Pour la saisie des dates par calendrier
|
Purpose: Pour la saisie des dates par calendrier
|
||||||
Input: base "/theme/eldy"
|
Input: base "/theme/eldy"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user