Fix: choice of country in list of juridal status
This commit is contained in:
parent
5dc5b85269
commit
ce08087a41
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@ -521,7 +521,8 @@ if ($_GET["id"])
|
|||||||
{
|
{
|
||||||
// Ligne de titre
|
// Ligne de titre
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($fieldlist as $field => $value) {
|
foreach ($fieldlist as $field => $value)
|
||||||
|
{
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
// dans les dictionnaires de données
|
// dans les dictionnaires de données
|
||||||
$showfield=1; // Par defaut
|
$showfield=1; // Par defaut
|
||||||
@ -680,19 +681,20 @@ llxFooter('$Date$ - $Revision$');
|
|||||||
function fieldList($fieldlist,$obj='')
|
function fieldList($fieldlist,$obj='')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $region_id,$pays_id;
|
global $region_id;
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
if ($fieldlist[$field] == 'pays') {
|
if ($fieldlist[$field] == 'pays') {
|
||||||
|
//var_dump($obj);
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$html->select_pays($pays_id,'pays');
|
$html->select_pays($obj->pays,'pays');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'pays_id') {
|
elseif ($fieldlist[$field] == 'pays_id') {
|
||||||
$pays_id = $obj->$fieldlist[$field]?$obj->$fieldlist[$field]:0;
|
$pays_id = (! empty($obj->$fieldlist[$field])) ? $obj->$fieldlist[$field] : 0;
|
||||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$pays_id.'">';
|
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$pays_id.'">';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'region') {
|
elseif ($fieldlist[$field] == 'region') {
|
||||||
|
|||||||
@ -23,13 +23,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/html.form.class.php
|
\file htdocs/html.form.class.php
|
||||||
\brief Fichier de la classe des fonctions prédéfinie de composants html
|
\brief Fichier de la classe des fonctions prédéfinie de composants html
|
||||||
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -370,7 +369,7 @@ class Form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne la liste déroulante des pays actifs, dans la langue de l'utilisateur
|
* \brief Retourne la liste déroulante des pays actifs, dans la langue de l'utilisateur
|
||||||
* \param selected Id ou code pays pré-sélectionné
|
* \param selected Id ou Code pays ou Libelle pays pré-sélectionné
|
||||||
* \param htmlname Nom de la liste deroulante
|
* \param htmlname Nom de la liste deroulante
|
||||||
* \param htmloption Options html sur le select
|
* \param htmloption Options html sur le select
|
||||||
* \todo trier liste sur noms après traduction plutot que avant
|
* \todo trier liste sur noms après traduction plutot que avant
|
||||||
@ -448,7 +447,8 @@ class Form
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
if ($selected && $selected != '-1' && ($selected == $obj->rowid || $selected == $obj->code))
|
if ($selected && $selected != '-1' &&
|
||||||
|
($selected == $obj->rowid || $selected == $obj->code || $selected == $obj->libelle) )
|
||||||
{
|
{
|
||||||
$foundselected=true;
|
$foundselected=true;
|
||||||
print '<option value="'.$obj->rowid.'" selected="true">';
|
print '<option value="'.$obj->rowid.'" selected="true">';
|
||||||
|
|||||||
@ -215,6 +215,8 @@ function dolibarr_del_const($db, $name)
|
|||||||
|
|
||||||
$sql = "DELETE FROM llx_const";
|
$sql = "DELETE FROM llx_const";
|
||||||
$sql.=" WHERE name='".addslashes($name)."' or rowid='".addslashes($name)."'";
|
$sql.=" WHERE name='".addslashes($name)."' or rowid='".addslashes($name)."'";
|
||||||
|
|
||||||
|
dolibarr_syslog("admin.lib::dolibarr_del_const sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -241,6 +243,8 @@ function dolibarr_get_const($db, $name)
|
|||||||
$sql ="SELECT value";
|
$sql ="SELECT value";
|
||||||
$sql.=" FROM llx_const";
|
$sql.=" FROM llx_const";
|
||||||
$sql.=" WHERE name = '".addslashes($name)."'";
|
$sql.=" WHERE name = '".addslashes($name)."'";
|
||||||
|
|
||||||
|
dolibarr_syslog("admin.lib::dolibarr_get_const sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -266,7 +270,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (! $name)
|
if (empty($name))
|
||||||
{
|
{
|
||||||
dolibarr_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
|
dolibarr_print_error("Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR);
|
||||||
exit;
|
exit;
|
||||||
@ -276,12 +280,15 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
|
|||||||
|
|
||||||
//dolibarr_syslog("dolibarr_set_const name=$name, value=$value");
|
//dolibarr_syslog("dolibarr_set_const name=$name, value=$value");
|
||||||
$sql = "DELETE FROM llx_const WHERE name = '".addslashes($name)."';";
|
$sql = "DELETE FROM llx_const WHERE name = '".addslashes($name)."';";
|
||||||
|
dolibarr_syslog("admin.lib::dolibarr_set_const sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|
||||||
if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0
|
if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO llx_const(name,value,type,visible,note)";
|
$sql = "INSERT INTO llx_const(name,value,type,visible,note)";
|
||||||
$sql.= " VALUES ('".$name."','".addslashes($value)."','".$type."',".$visible.",'".addslashes($note)."')";
|
$sql.= " VALUES ('".$name."','".addslashes($value)."','".$type."',".$visible.",'".addslashes($note)."')";
|
||||||
|
|
||||||
|
dolibarr_syslog("admin.lib::dolibarr_set_const sql=".$sql);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,6 +305,4 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -188,4 +188,6 @@ create table llx_events
|
|||||||
|
|
||||||
ALTER TABLE llx_events ADD INDEX idx_events_dateevent (dateevent);
|
ALTER TABLE llx_events ADD INDEX idx_events_dateevent (dateevent);
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_forme_juridique ADD isvatexempted tinyint DEFAULT 0 NOT NULL after libelle;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ create table llx_c_forme_juridique
|
|||||||
code varchar(12) UNIQUE NOT NULL,
|
code varchar(12) UNIQUE NOT NULL,
|
||||||
fk_pays integer NOT NULL,
|
fk_pays integer NOT NULL,
|
||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
|
isvatexempted tinyint DEFAULT 0 NOT NULL,
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
|
||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user