[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: modFournisseur.class.php,v 1.29 2005/10/22 13:45:24 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/includes/modules/modFournisseur.class.php,v $ 21 * 22 */ 23 24 /** \defgroup fournisseur Module fournisseur 25 \brief Module pour gérer des sociétés et contacts de type fournisseurs 26 */ 27 28 /** 29 \file htdocs/includes/modules/modFournisseur.class.php 30 \ingroup fournisseur 31 \brief Fichier de description et activation du module Fournisseur 32 */ 33 34 35 include_once "DolibarrModules.class.php"; 36 37 /** \class modFournisseur 38 \brief Classe de description et activation du module Fournisseur 39 */ 40 41 class modFournisseur extends DolibarrModules 42 { 43 44 /** 45 * \brief Constructeur. Definit les noms, constantes et boites 46 * \param DB handler d'accès base 47 */ 48 function modFournisseur($DB) 49 { 50 $this->db = $DB ; 51 $this->numero = 40 ; 52 53 $this->family = "products"; 54 $this->name = "Fournisseur"; 55 $this->description = "Gestion des fournisseurs"; 56 57 $this->revision = explode(' ','$Revision: 1.29 $'); 58 $this->version = $this->revision[1]; 59 60 $this->const_name = 'MAIN_MODULE_FOURNISSEUR'; 61 $this->special = 0; 62 $this->picto='company'; 63 64 // Dir 65 $this->dirs = array(); 66 67 // Dépendances 68 $this->depends = array("modSociete"); 69 $this->requiredby = array(); 70 71 // Constantes 72 $this->const = array(); 73 74 // Boxes 75 $this->boxes = array(); 76 $this->boxes[0][0] = "Derniers founisseurs"; 77 $this->boxes[0][1] = "box_fournisseurs.php"; 78 79 // Permissions 80 $this->rights = array(); 81 $this->rights_class = 'fournisseur'; 82 83 $this->rights[2][0] = 181; 84 $this->rights[2][1] = 'Lire les commandes fournisseur'; 85 $this->rights[2][2] = 'r'; 86 $this->rights[2][3] = 1; 87 $this->rights[2][4] = 'commande'; 88 $this->rights[2][5] = 'lire'; 89 90 $this->rights[3][0] = 182; 91 $this->rights[3][1] = 'Créer une commande fournisseur'; 92 $this->rights[3][2] = 'w'; 93 $this->rights[3][3] = 0; 94 $this->rights[3][4] = 'commande'; 95 $this->rights[3][5] = 'creer'; 96 97 $this->rights[4][0] = 183; 98 $this->rights[4][1] = 'Valider une commande fournisseur'; 99 $this->rights[4][2] = 'w'; 100 $this->rights[4][3] = 0; 101 $this->rights[4][4] = 'commande'; 102 $this->rights[4][5] = 'valider'; 103 104 $this->rights[5][0] = 184; 105 $this->rights[5][1] = 'Approuver les commandes fournisseur'; 106 $this->rights[5][2] = 'w'; 107 $this->rights[5][3] = 0; 108 $this->rights[5][4] = 'commande'; 109 $this->rights[5][5] = 'approuver'; 110 111 $this->rights[6][0] = 185; 112 $this->rights[6][1] = 'Commander une commande fournisseur'; 113 $this->rights[6][2] = 'w'; 114 $this->rights[6][3] = 0; 115 $this->rights[6][4] = 'commande'; 116 $this->rights[6][5] = 'commander'; 117 118 $this->rights[7][0] = 186; 119 $this->rights[7][1] = 'Réceptionner les commandes fournisseur'; 120 $this->rights[7][2] = 'd'; 121 $this->rights[7][3] = 0; 122 $this->rights[7][4] = 'commande'; 123 $this->rights[7][5] = 'receptionner'; 124 125 $this->rights[8][0] = 187; 126 $this->rights[8][1] = 'Clotûrer les commandes fournisseur'; 127 $this->rights[8][2] = 'd'; 128 $this->rights[8][3] = 0; 129 $this->rights[8][4] = 'commande'; 130 $this->rights[8][5] = 'cloturer'; 131 132 $this->rights[9][0] = 188; 133 $this->rights[9][1] = 'Annuler les commandes fournisseur'; 134 $this->rights[9][2] = 'd'; 135 $this->rights[9][3] = 0; 136 $this->rights[9][4] = 'commande'; 137 $this->rights[9][5] = 'annuler'; 138 139 140 $this->rights[10][0] = 231; 141 $this->rights[10][1] = 'Lire les factures fournisseur'; 142 $this->rights[10][2] = 'r'; 143 $this->rights[10][3] = 1; 144 $this->rights[10][4] = 'facture'; 145 $this->rights[10][5] = 'lire'; 146 147 $this->rights[11][0] = 232; 148 $this->rights[11][1] = 'Créer une facture fournisseur'; 149 $this->rights[11][2] = 'w'; 150 $this->rights[11][3] = 0; 151 $this->rights[11][4] = 'facture'; 152 $this->rights[11][5] = 'creer'; 153 154 $this->rights[12][0] = 233; 155 $this->rights[12][1] = 'Valider une facture fournisseur'; 156 $this->rights[12][2] = 'w'; 157 $this->rights[12][3] = 0; 158 $this->rights[12][4] = 'facture'; 159 $this->rights[12][5] = 'valider'; 160 161 } 162 163 164 /** 165 * \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module. 166 * Définit également les répertoires de données à créer pour ce module. 167 */ 168 function init() 169 { 170 $this->remove(); 171 172 $sql = array(); 173 174 $this->load_datas(); 175 176 return $this->_init($sql); 177 } 178 179 /** 180 * \brief Fonction appelée lors de la désactivation d'un module. 181 * Supprime de la base les constantes, boites et permissions du module. 182 */ 183 function remove() 184 { 185 $sql = array(); 186 187 return $this->_remove($sql); 188 } 189 190 /** 191 * \brief Fonction appelé par l'init (donc lors de l'activation d'un module) 192 * 193 */ 194 function load_datas() 195 { 196 $sql = "SELECT count(rowid) FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; 197 198 if ($this->db->query($sql)) 199 { 200 $row = $this->db->fetch_row(); 201 202 if ($row[0] == 0) 203 { 204 $this->db->free(); 205 206 $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; 207 $sql .= " (code,libelle) VALUES ('OrderByMail','Courrier')"; 208 209 $this->db->query($sql); 210 211 $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; 212 $sql .= " (code,libelle) VALUES ('OrderByFax','Fax')"; 213 214 $this->db->query($sql); 215 216 $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; 217 $sql .= " (code,libelle) VALUES ('OrderByEMail','EMail')"; 218 219 $this->db->query($sql); 220 221 $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; 222 $sql .= " (code,libelle) VALUES ('OrderByPhone','Téléphone')"; 223 224 $this->db->query($sql); 225 226 $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; 227 $sql .= " (code,libelle) VALUES ('OrderByWWW','En ligne')"; 228 229 $this->db->query($sql); 230 } 231 } 232 } 233 } 234 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |