2004-10-20 00:24:10 +02:00
|
|
|
|
<?php
|
2004-11-27 17:27:09 +01:00
|
|
|
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2006-06-02 22:47:27 +02:00
|
|
|
|
* Copyright (C) 2004-2006 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$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2005-01-14 19:46:23 +01:00
|
|
|
|
/** \defgroup propale Module propale
|
2004-08-14 14:21:24 +02:00
|
|
|
|
\brief Module pour g<EFBFBD>rer la tenue de propositions commerciales
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2005-01-14 19:46:23 +01:00
|
|
|
|
/**
|
2004-08-14 14:21:24 +02:00
|
|
|
|
\file htdocs/includes/modules/modPropale.class.php
|
2004-08-15 14:40:18 +02:00
|
|
|
|
\ingroup propale
|
2004-08-14 14:21:24 +02:00
|
|
|
|
\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
|
|
|
|
|
2005-01-14 19:46:23 +01:00
|
|
|
|
/** \class modPropale
|
2004-10-20 00:24:10 +02:00
|
|
|
|
\brief Classe de description et activation du module Propale
|
2004-08-15 14:40:18 +02:00
|
|
|
|
*/
|
|
|
|
|
|
|
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
|
|
|
|
|
|
*/
|
2004-08-07 19:14:42 +02:00
|
|
|
|
function modPropale($DB)
|
2003-06-24 17:19:11 +02:00
|
|
|
|
{
|
|
|
|
|
|
$this->db = $DB ;
|
2006-01-22 19:31:56 +01:00
|
|
|
|
$this->id = 'propale'; // Same value xxx than in file modXxx.class.php file
|
2003-11-13 16:09:12 +01:00
|
|
|
|
$this->numero = 20 ;
|
2004-06-26 19:15:28 +02:00
|
|
|
|
|
|
|
|
|
|
$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
|
|
|
|
|
2005-08-11 21:18:11 +02:00
|
|
|
|
$this->revision = explode(' ','$Revision$');
|
2005-04-15 14:36:08 +02:00
|
|
|
|
$this->version = $this->revision[1];
|
|
|
|
|
|
|
2005-10-22 15:45:24 +02:00
|
|
|
|
$this->const_name = '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
|
|
|
|
|
2004-06-26 19:15:28 +02: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();
|
2004-06-09 03:30:26 +02:00
|
|
|
|
|
2003-09-10 18:31:37 +02:00
|
|
|
|
$this->const[0][0] = "PROPALE_ADDON_PDF";
|
|
|
|
|
|
$this->const[0][1] = "chaine";
|
2006-06-02 22:47:27 +02:00
|
|
|
|
$this->const[0][2] = "azur";
|
2004-06-09 03:30:26 +02:00
|
|
|
|
$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";
|
2006-06-02 22:47:27 +02:00
|
|
|
|
$this->const[1][2] = "mod_propale_marbre";
|
2004-06-09 03:30:26 +02:00
|
|
|
|
$this->const[1][3] = 'Nom du gestionnaire de num<75>rotation des propales';
|
|
|
|
|
|
$this->const[1][4] = 0;
|
2006-01-05 11:41:34 +01:00
|
|
|
|
|
2006-05-22 00:34:15 +02:00
|
|
|
|
$this->const[2][0] = "PROPALE_ADD_PROD_DESC";
|
2006-01-05 11:41:34 +01:00
|
|
|
|
$this->const[2][1] = "chaine";
|
|
|
|
|
|
$this->const[2][2] = "0";
|
2006-02-11 17:24:55 +01:00
|
|
|
|
$this->const[2][3] = "Mettre <20> 1 pour voir la description d\'un produit dans une propale";
|
2006-01-05 11:49:12 +01:00
|
|
|
|
$this->const[2][4] = 1;
|
2004-06-09 03:30:26 +02:00
|
|
|
|
|
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";
|
2004-11-27 13:54:08 +01:00
|
|
|
|
|
|
|
|
|
|
// 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
|
2005-02-16 22:27:45 +01:00
|
|
|
|
$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
|
2005-02-16 22:27:45 +01:00
|
|
|
|
$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
|
2005-02-16 22:27:45 +01:00
|
|
|
|
$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
|
2005-02-16 22:27:45 +01:00
|
|
|
|
$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
|
2005-02-16 22:27:45 +01:00
|
|
|
|
$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
|
2005-02-16 22:27:45 +01:00
|
|
|
|
$this->rights[6][4] = 'supprimer';
|
2004-11-27 13:54:08 +01:00
|
|
|
|
|
2005-05-14 16:22:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* \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(
|
2006-04-29 00:54:02 +02:00
|
|
|
|
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."'",
|
|
|
|
|
|
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES('".$this->const[0][2]."','propal')",
|
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
|
|
|
|
*/
|
2004-08-07 19:14:42 +02:00
|
|
|
|
function remove()
|
2003-07-23 15:58:58 +02:00
|
|
|
|
{
|
2005-01-14 19:46:23 +01:00
|
|
|
|
$sql = array();
|
2003-07-24 13:21:18 +02:00
|
|
|
|
|
2003-09-10 18:03:44 +02:00
|
|
|
|
return $this->_remove($sql);
|
2003-07-24 13:21:18 +02:00
|
|
|
|
|
2003-07-23 15:58:58 +02:00
|
|
|
|
}
|
2003-06-24 17:19:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
?>
|