This commit is contained in:
philippe grand 2015-10-03 12:43:38 +02:00
commit d19a9f66b3
5 changed files with 21 additions and 10 deletions

View File

@ -39,6 +39,8 @@ $showpass=GETPOST('showpass');
*/ */
$label=$db::LABEL; $label=$db::LABEL;
$type=$db->type;
$help_url='EN:Restores|FR:Restaurations|ES:Restauraciones'; $help_url='EN:Restores|FR:Restaurations|ES:Restauraciones';
llxHeader('','',$help_url); llxHeader('','',$help_url);
@ -91,7 +93,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
<fieldset id="exportoptions"> <fieldset id="exportoptions">
<legend><?php echo $langs->trans("ImportMethod"); ?></legend> <legend><?php echo $langs->trans("ImportMethod"); ?></legend>
<?php <?php
if ($label == 'MySQL') if (in_array($type, array('mysql', 'mysqli')))
{ {
?> ?>
<div class="formelementrow"> <div class="formelementrow">
@ -100,7 +102,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
</div> </div>
<?php <?php
} }
else if ($label == 'PostgreSQL') else if (in_array($type, array('pgsql')))
{ {
?> ?>
<div class="formelementrow"> <div class="formelementrow">
@ -123,7 +125,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
<div id="div_container_sub_exportoptions"> <div id="div_container_sub_exportoptions">
<?php <?php
if ($label == 'MySQL') if (in_array($type, array('mysql', 'mysqli')))
{ {
?> ?>
<fieldset id="mysql_options"> <fieldset id="mysql_options">
@ -157,7 +159,7 @@ if ($label == 'MySQL')
</fieldset> </fieldset>
<?php <?php
} }
else if ($label == 'PostgreSQL') else if (in_array($type, array('pgsql')))
{ {
?> ?>
<fieldset id="postgresql_options"> <fieldset id="postgresql_options">

View File

@ -298,6 +298,7 @@ if (empty($reshook))
$object->zip = GETPOST("zipcode"); $object->zip = GETPOST("zipcode");
$object->town = GETPOST("town"); $object->town = GETPOST("town");
$object->state_id = GETPOST("state_id",'int'); $object->state_id = GETPOST("state_id",'int');
$object->fk_departement = GETPOST("state_id",'int'); // For backward compatibility
$object->country_id = GETPOST("country_id",'int'); $object->country_id = GETPOST("country_id",'int');
$object->email = GETPOST("email",'alpha'); $object->email = GETPOST("email",'alpha');

View File

@ -537,7 +537,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
else else
{ {
$var = false; $var = false;
print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("None").'</td></tr>'; print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
} }
$db->free($result); $db->free($result);
} }

View File

@ -1375,7 +1375,6 @@ class Societe extends CommonObject
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople";
$sql.= " WHERE fk_soc = " . $id; $sql.= " WHERE fk_soc = " . $id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
$error++; $error++;
@ -1388,7 +1387,6 @@ class Societe extends CommonObject
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
$error++; $error++;
@ -1402,7 +1400,18 @@ class Societe extends CommonObject
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib";
$sql.= " WHERE fk_soc = " . $id; $sql.= " WHERE fk_soc = " . $id;
dol_syslog(get_class($this)."::Delete", LOG_DEBUG); if (! $this->db->query($sql))
{
$error++;
$this->error = $this->db->lasterror();
}
}
// Remove societe_remise_except
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except";
$sql.= " WHERE fk_soc = " . $id;
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
$error++; $error++;
@ -1415,7 +1424,6 @@ class Societe extends CommonObject
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux";
$sql.= " WHERE fk_soc = " . $id; $sql.= " WHERE fk_soc = " . $id;
dol_syslog(get_class($this)."::Delete", LOG_DEBUG);
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
$error++; $error++;

View File

@ -49,7 +49,7 @@ $langs->load("commercial");
$langs->load("bills"); $langs->load("bills");
$langs->load("banks"); $langs->load("banks");
$langs->load("users"); $langs->load("users");
if (! empty($conf->categories->enabled)) $langs->load("categories"); if (! empty($conf->categorie->enabled)) $langs->load("categories");
if (! empty($conf->incoterm->enabled)) $langs->load("incoterm"); if (! empty($conf->incoterm->enabled)) $langs->load("incoterm");
if (! empty($conf->notification->enabled)) $langs->load("mails"); if (! empty($conf->notification->enabled)) $langs->load("mails");