From a6dd46e271e67bf82b8be7e74b463f27c675efc2 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 4 Jan 2017 17:46:11 +0000 Subject: [PATCH] #1067 --- .../DAO/class.common.dao.entreprise.php | 18 +++++++++++------- inc/postconfig.inc.php | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/inc/commons/DAO/class.common.dao.entreprise.php b/inc/commons/DAO/class.common.dao.entreprise.php index 1ef04742d..8305e47a0 100644 --- a/inc/commons/DAO/class.common.dao.entreprise.php +++ b/inc/commons/DAO/class.common.dao.entreprise.php @@ -159,13 +159,17 @@ class commonDAOEntreprise extends commonDAO { $c->ws_signatures = implode(',', $signatures); } - if ($data['entreprise_id'] == 'new' || $data['entreprise_id'] == '') { - $c->date_creation = TIME; - $entreprise_id = $c->entreprise_id = $this->getNextId(); - $c->insert(); - } else { - $entreprise_id = $data['entreprise_id']; - $c->update('WHERE entreprise_id=\'' . $this->con->escape($data['entreprise_id']) . '\''); + try { + if ($data['entreprise_id'] == 'new' || $data['entreprise_id'] == '') { + $c->date_creation = TIME; + $entreprise_id = $c->entreprise_id = $this->getNextId(); + $c->insert(); + } else { + $entreprise_id = $data['entreprise_id']; + $c->update('WHERE entreprise_id=\'' . $this->con->escape($data['entreprise_id']) . '\''); + } + } catch (Exception $e) { + } $entreprise = $this->selectById($entreprise_id); diff --git a/inc/postconfig.inc.php b/inc/postconfig.inc.php index 306c51f40..e9f669ccc 100644 --- a/inc/postconfig.inc.php +++ b/inc/postconfig.inc.php @@ -17,7 +17,8 @@ define('DEV', $dev); // Définition des variables dans l'environnement de production //define('DB_HOST', ':/var/run/mysqld/mysqld.sock'); -define('DB_HOST', '127.0.0.1'); +//define('DB_HOST', '127.0.0.1'); +define('DB_HOST', 'amarcord.cubedesigners.com'); define('SERVER', 'avanger'); define('DB_NAME', 'extranet'); -- 2.39.5