dolibarr/htdocs/includes/modules/modPropale.class.php

172 lines
5.9 KiB
PHP
Raw Normal View History

<?php
2004-11-27 17:27:09 +01:00
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
2003-06-24 17:19:11 +02:00
*
* 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 propale Module propale
\brief Module pour g<EFBFBD>rer la tenue de propositions commerciales
*/
/**
\file htdocs/includes/modules/modPropale.class.php
\ingroup propale
\brief Fichier de description et activation du module Propale
*/
2003-11-13 16:09:12 +01:00
include_once "DolibarrModules.class.php";
2003-09-10 18:03:44 +02:00
/** \class modPropale
\brief Classe de description et activation du module Propale
*/
2003-11-13 16:09:12 +01:00
class modPropale extends DolibarrModules
2003-06-24 17:19:11 +02:00
{
2004-11-23 21:04:19 +01:00
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'acc<EFBFBD>s base
*/
function modPropale($DB)
2003-06-24 17:19:11 +02:00
{
$this->db = $DB ;
2003-11-13 16:09:12 +01:00
$this->numero = 20 ;
$this->family = "crm";
2003-11-13 16:09:12 +01:00
$this->name = "Propositions commerciales";
2004-05-08 22:42:44 +02:00
$this->description = "Gestion des propositions commerciales";
2005-04-15 14:36:08 +02:00
$this->revision = explode(' ','$Revision$');
2005-04-15 14:36:08 +02:00
$this->version = $this->revision[1];
2003-11-13 16:09:12 +01:00
$this->const_name = "MAIN_MODULE_PROPALE";
$this->const_config = MAIN_MODULE_PROPALE;
2004-11-23 21:04:19 +01:00
$this->special = 0;
2005-03-06 01:15:34 +01:00
$this->picto='propal';
2004-11-23 21:04:19 +01:00
// Dir
$this->dirs = array();
2003-11-13 16:09:12 +01:00
// D<>pendances
2003-11-13 16:09:12 +01:00
$this->depends = array("modSociete","modCommercial");
2003-11-07 18:46:37 +01:00
$this->config_page_url = "propale.php";
2003-11-13 16:09:12 +01:00
2004-11-23 21:04:19 +01:00
// Constantes
2003-09-10 18:31:37 +02:00
$this->const = array();
2003-09-10 18:31:37 +02:00
$this->const[0][0] = "PROPALE_ADDON_PDF";
$this->const[0][1] = "chaine";
$this->const[0][2] = "rouge";
$this->const[0][3] = 'Nom du gestionnaire de g<>n<EFBFBD>ration des propales en PDF';
$this->const[0][4] = 0;
2003-09-10 18:31:37 +02:00
$this->const[1][0] = "PROPALE_ADDON";
$this->const[1][1] = "chaine";
$this->const[1][2] = "mod_propale_ivoire";
$this->const[1][3] = 'Nom du gestionnaire de num<75>rotation des propales';
$this->const[1][4] = 0;
2004-11-23 21:04:19 +01:00
// Boxes
$this->boxes = array();
2003-09-11 17:19:56 +02:00
$this->boxes[0][0] = "Proposition commerciales";
$this->boxes[0][1] = "box_propales.php";
// Permissions
$this->rights = array();
$this->rights_class = 'propale';
2004-11-27 17:27:09 +01:00
$this->rights[1][0] = 21; // id de la permission
$this->rights[1][1] = 'Lire les propositions commerciales'; // libelle de la permission
$this->rights[1][2] = 'r'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
$this->rights[1][3] = 1; // La permission est-elle une permission par d<>faut
$this->rights[1][4] = 'lire';
2004-11-27 17:27:09 +01:00
$this->rights[2][0] = 22; // id de la permission
2005-04-02 14:19:59 +02:00
$this->rights[2][1] = 'Cr<43>er/modifier les propositions commerciales'; // libelle de la permission
2004-11-27 17:27:09 +01:00
$this->rights[2][2] = 'w'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
$this->rights[2][3] = 0; // La permission est-elle une permission par d<>faut
$this->rights[2][4] = 'creer';
2004-11-27 17:27:09 +01:00
$this->rights[3][0] = 24; // id de la permission
$this->rights[3][1] = 'Valider les propositions commerciales'; // libelle de la permission
$this->rights[3][2] = 'd'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
$this->rights[3][3] = 0; // La permission est-elle une permission par d<>faut
$this->rights[3][4] = 'valider';
2004-11-27 17:27:09 +01:00
$this->rights[4][0] = 25; // id de la permission
$this->rights[4][1] = 'Envoyer les propositions commerciales aux clients'; // libelle de la permission
$this->rights[4][2] = 'd'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
$this->rights[4][3] = 0; // La permission est-elle une permission par d<>faut
$this->rights[4][4] = 'envoyer';
2004-11-27 17:27:09 +01:00
$this->rights[5][0] = 26; // id de la permission
$this->rights[5][1] = 'Cl<43>turer les propositions commerciales'; // libelle de la permission
$this->rights[5][2] = 'd'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
$this->rights[5][3] = 0; // La permission est-elle une permission par d<>faut
$this->rights[5][4] = 'cloturer';
2004-11-27 17:27:09 +01:00
$this->rights[6][0] = 27; // id de la permission
$this->rights[6][1] = 'Supprimer les propositions commerciales'; // libelle de la permission
$this->rights[6][2] = 'd'; // type de la permission (d<>pr<70>ci<63> <20> ce jour)
$this->rights[6][3] = 0; // La permission est-elle une permission par d<>faut
$this->rights[6][4] = 'supprimer';
}
/**
* \brief Fonction appel<EFBFBD>e lors de l'activation du module. Ins<EFBFBD>re en base les constantes, boites, permissions du module.
* D<EFBFBD>finit <EFBFBD>galement les r<EFBFBD>pertoires de donn<EFBFBD>es <EFBFBD> cr<EFBFBD>er pour ce module.
*/
function init()
{
global $conf;
// Permissions et valeurs par d<>faut
$this->remove();
2005-04-15 14:33:59 +02:00
// R<>pertoires
2005-04-15 14:36:08 +02:00
$this->dirs[0] = $conf->propal->dir_output;
2005-04-15 14:59:19 +02:00
$this->dirs[1] = $conf->propal->dir_images;
2004-11-30 10:32:07 +01:00
2003-08-11 20:35:29 +02:00
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom = '".$this->const[0][2]."'",
"INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES('".$this->const[0][2]."');",
2003-08-11 20:35:29 +02:00
);
2003-09-10 18:03:44 +02:00
2003-09-11 17:19:56 +02:00
return $this->_init($sql);
2003-08-11 20:35:29 +02:00
2003-06-24 17:19:11 +02:00
}
2004-11-23 21:04:19 +01:00
/**
* \brief Fonction appel<EFBFBD>e lors de la d<EFBFBD>sactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
2003-07-23 15:58:58 +02:00
*/
function remove()
2003-07-23 15:58:58 +02:00
{
$sql = array();
2003-09-10 18:03:44 +02:00
return $this->_remove($sql);
2003-07-23 15:58:58 +02:00
}
2003-06-24 17:19:11 +02:00
}
?>