From 3486c00baf37cfb1b88361d852f238d13ee22502 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 22 Sep 2004 10:16:34 +0000 Subject: [PATCH] Nouveau fichier --- .../includes/modules/modPrelevement.class.php | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 htdocs/includes/modules/modPrelevement.class.php diff --git a/htdocs/includes/modules/modPrelevement.class.php b/htdocs/includes/modules/modPrelevement.class.php new file mode 100644 index 00000000000..998ac2dcd28 --- /dev/null +++ b/htdocs/includes/modules/modPrelevement.class.php @@ -0,0 +1,130 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ + +/*! \defgroup prelevement Module prelevement + \brief Module de gestion des prélèvements bancaires +*/ + +/*! + \file htdocs/includes/modules/modPrelevement.class.php + \ingroup prelevement + \brief Fichier de description et activation du module Prelevement +*/ + +include_once "DolibarrModules.class.php"; + +/*! \class modPrelevement + \brief Classe de description et activation du module Prelevement +*/ + +class modPrelevement extends DolibarrModules +{ + + /** Initialisation de l'objet + * + * + */ + + function modPrelevement($DB) + { + $this->db = $DB ; + $this->numero = 57 ; + + $this->family = "technic"; + $this->name = "Prelevement"; + $this->description = "Gestion des Prélèvements (experimental)"; + $this->const_name = "MAIN_MODULE_PRELEVEMENT"; + $this->const_config = MAIN_MODULE_PRELEVEMENT; + + // Dépendances + $this->depends = array(); + $this->requiredby = array(); + + $this->const = array(); + $this->boxes = array(); + } + /** initialisation du module + * + * + * + */ + + function init() + { + /* + * Permissions + */ + $this->remove(); + $sql = array( + "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (150,'Tous les droits sur les prélèvements','prelevement','a',0);", + "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (151,'Consulter les prelevement','prélèvements','r',0);", + "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (152,'Configurer les prelevement','prélèvements','w',0);"); + + /* + * Documents + * + */ + if (defined("DOL_DATA_ROOT")) + { + $dir[0] = DOL_DATA_ROOT . "/prelevement/" ; + $dir[1] = DOL_DATA_ROOT . "/prelevement/bon" ; + + for ($i = 0 ; $i < sizeof($dir) ; $i++) + { + if (is_dir($dir[$i])) + { + dolibarr_syslog ("Le dossier '".$dir[$i]."' existe"); + } + else + { + if (! @mkdir($dir[$i], 0755)) + { + print "Impossible de créer : ".$dir[$i]."Erreur"; + dolibarr_syslog ("Impossible de créer '".$dir[$i]); + $error++; + } + else + { + dolibarr_syslog ("Le dossier '".$dir[$i]."' a ete créé"); + } + } + } + } + + + return $this->_init($sql); + + + + } + /** suppression du module + * + * + */ + function remove() + { + $sql = array("DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'prelevement';"); + + return $this->_remove($sql); + } +} +?>