From 1e9ea31b4635f02541fe7b6d60957db94621771c Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 31 Jul 2005 08:57:35 +0000 Subject: [PATCH] Ajout Methode Active --- .../mods/methode_expedition.modules.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/expedition/mods/methode_expedition.modules.php b/htdocs/expedition/mods/methode_expedition.modules.php index 29bfe2e3c78..02d23afa5f8 100644 --- a/htdocs/expedition/mods/methode_expedition.modules.php +++ b/htdocs/expedition/mods/methode_expedition.modules.php @@ -31,6 +31,40 @@ Class methode_expedition $this->description = "ERREUR DANS LA DEFINITION DU MODULE."; } + Function Active() + { + // Mise a jour du statut + $sql = "UPDATE ".MAIN_DB_PREFIX."expedition_methode set statut= 1 "; + $sql.= " WHERE rowid = ".$this->id; + + $resql = $this->db->query($sql); + + if ($resql) + { + $af = $this->db->affected_rows($resql); + + if ($af == 0) + { + // On créé la méthode dans la base + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."expedition_methode"; + $sql .= " (rowid, statut, code, libelle, description)"; + $sql .= " VALUES (".$this->id.",1,'$this->code','$this->name','$this->description')"; + + $resql = $this->db->query($sql); + + if (! $resql) + { + dolibarr_syslog("methode_expedition::Active Erreur 2"); + } + } + } + else + { + dolibarr_syslog("methode_expedition::Active Erreur 1"); + } + } + Function write_pdf_file($id) { global $user;