31 |
$this->description = "ERREUR DANS LA DEFINITION DU MODULE."; |
$this->description = "ERREUR DANS LA DEFINITION DU MODULE."; |
32 |
} |
} |
33 |
|
|
34 |
|
Function Active() |
35 |
|
{ |
36 |
|
// Mise a jour du statut |
37 |
|
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition_methode set statut= 1 "; |
38 |
|
$sql.= " WHERE rowid = ".$this->id; |
39 |
|
|
40 |
|
$resql = $this->db->query($sql); |
41 |
|
|
42 |
|
if ($resql) |
43 |
|
{ |
44 |
|
$af = $this->db->affected_rows($resql); |
45 |
|
|
46 |
|
if ($af == 0) |
47 |
|
{ |
48 |
|
// On créé la méthode dans la base |
49 |
|
|
50 |
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expedition_methode"; |
51 |
|
$sql .= " (rowid, statut, code, libelle, description)"; |
52 |
|
$sql .= " VALUES (".$this->id.",1,'$this->code','$this->name','$this->description')"; |
53 |
|
|
54 |
|
$resql = $this->db->query($sql); |
55 |
|
|
56 |
|
if (! $resql) |
57 |
|
{ |
58 |
|
dolibarr_syslog("methode_expedition::Active Erreur 2"); |
59 |
|
} |
60 |
|
} |
61 |
|
} |
62 |
|
else |
63 |
|
{ |
64 |
|
dolibarr_syslog("methode_expedition::Active Erreur 1"); |
65 |
|
} |
66 |
|
} |
67 |
|
|
68 |
Function write_pdf_file($id) |
Function write_pdf_file($id) |
69 |
{ |
{ |
70 |
global $user; |
global $user; |