New: parametre de config des repertoires dans les proprietes de la classe du module

avec un répertoire parent en fonction de l'entité
This commit is contained in:
Regis Houssin 2009-04-28 20:35:01 +00:00
parent 2356abb5c4
commit 13e9ff24a7
30 changed files with 304 additions and 206 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ llxHeader();
$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec"; $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat as datec";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql.= " WHERE 1=1"; $sql.= " WHERE m.entity = ".$conf->entity;
if ($sref) $sql.= " AND m.rowid = '".$sref."'"; if ($sref) $sql.= " AND m.rowid = '".$sref."'";
if ($sall) $sql.= " AND (m.titre like '%".$sall."%' OR m.sujet like '%".$sall."%' OR m.body like '%".$sall."%')"; if ($sall) $sql.= " AND (m.titre like '%".$sall."%' OR m.sujet like '%".$sall."%' OR m.body like '%".$sall."%')";
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -81,7 +82,7 @@ class Mailing extends CommonObject
*/ */
function create($user) function create($user)
{ {
global $langs; global $conf, $langs;
$this->db->begin(); $this->db->begin();
@ -95,8 +96,8 @@ class Mailing extends CommonObject
} }
$sql = "INSERT INTO ".$this->db_table; $sql = "INSERT INTO ".$this->db_table;
$sql .= " (date_creat, fk_user_creat)"; $sql .= " (date_creat, fk_user_creat, entity)";
$sql .= " VALUES (".$this->db->idate(mktime()).", ".$user->id.")"; $sql .= " VALUES (".$this->db->idate(mktime()).", ".$user->id.", ".$conf->entity.")";
if (! $this->titre) if (! $this->titre)
{ {
@ -368,8 +369,8 @@ class Mailing extends CommonObject
/** /**
* \brief Retourne le libell<EFBFBD> du statut d'un mailing (brouillon, valid<EFBFBD>e, ... * \brief Retourne le libelle du statut d'un mailing (brouillon, validee, ...
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* \return string Libelle * \return string Libelle
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
@ -378,10 +379,10 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Renvoi le libell<EFBFBD> d'un statut donn<EFBFBD> * \brief Renvoi le libelle d'un statut donn<EFBFBD>
* \param statut Id statut * \param statut Id statut
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long, 5=Libell<EFBFBD> court + Picto * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* \return string Libell<EFBFBD> du statut * \return string Libelle du statut
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {

View File

@ -155,9 +155,6 @@ class Conf
$this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0; $this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
$this->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0; $this->propal->enabled=defined("MAIN_MODULE_PROPALE")?MAIN_MODULE_PROPALE:0;
// Module externalrss
$this->externalrss->dir_temp=DOL_DATA_ROOT."/rss/temp";
// Sous module bons d'expedition // Sous module bons d'expedition
$this->expedition_bon->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0; $this->expedition_bon->enabled=defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0;
@ -172,9 +169,8 @@ class Conf
$this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp"; $this->tax->dir_temp =DOL_DATA_ROOT."/taxes/temp";
// Module ficheinter // Module ficheinter
$this->fichinter->dir_output=DOL_DATA_ROOT."/ficheinter"; if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->ficheinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
$this->fichinter->dir_temp =DOL_DATA_ROOT."/ficheinter/temp";
if (defined('FICHEINTER_OUTPUTDIR') && FICHEINTER_OUTPUTDIR) { $this->fichinter->dir_output=FICHEINTER_OUTPUTDIR; } # Pour passer outre le rep par defaut
// Module produit // Module produit
$this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0; $this->produit->MultiPricesEnabled=defined("PRODUIT_MULTIPRICES")?PRODUIT_MULTIPRICES:0;
@ -224,18 +220,7 @@ class Conf
// Module actions // Module actions
$this->actions->dir_output=DOL_DATA_ROOT."/action"; $this->actions->dir_output=DOL_DATA_ROOT."/action";
$this->actions->dir_temp =DOL_DATA_ROOT."/action/temp"; $this->actions->dir_temp =DOL_DATA_ROOT."/action/temp";
// Module export
$this->export->dir_output=DOL_DATA_ROOT."/export";
$this->export->dir_temp =DOL_DATA_ROOT."/export/temp";
// Module import
$this->import->dir_output=DOL_DATA_ROOT."/import";
$this->import->dir_temp =DOL_DATA_ROOT."/import/temp";
// Module ldap
$this->ldap->dir_temp=DOL_DATA_ROOT."/ldap/temp";
// Module FCKeditor
$this->fckeditor->dir_output=DOL_DATA_ROOT."/fckeditor";
// Module emailing
$this->mailings->dir_temp=DOL_DATA_ROOT."/mailings/temp";
// Module oscommerce 1 // Module oscommerce 1
$this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0; $this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0;
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0; $this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;

View File

@ -132,7 +132,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fichinter->dir_output.'/'.$original_file; $original_file=$conf->ficheinter->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'"; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='$refname'";
} }

View File

@ -110,7 +110,7 @@ if ($_GET["id"] > 0) {
* Documents * Documents
*/ */
$fichinterref = sanitizeFileName($fichinter->ref); $fichinterref = sanitizeFileName($fichinter->ref);
$dir_output = $conf->fichinter->dir_output . "/"; $dir_output = $conf->ficheinter->dir_output . "/";
$filepath = $dir_output . $fichinterref . "/"; $filepath = $dir_output . $fichinterref . "/";
$file = $filepath . $fichinterref . ".pdf"; $file = $filepath . $fichinterref . ".pdf";
$filedetail = $filepath . $fichinterref . "-detail.pdf"; $filedetail = $filepath . $fichinterref . "-detail.pdf";

View File

@ -64,7 +64,7 @@ $pagenext = $page + 1;
$object = new Fichinter($db); $object = new Fichinter($db);
$object->fetch($_GET["id"]); $object->fetch($_GET["id"]);
$upload_dir = $conf->fichinter->dir_output.'/'.sanitizeFileName($object->ref); $upload_dir = $conf->ficheinter->dir_output.'/'.sanitizeFileName($object->ref);
$modulepart='fichinter'; $modulepart='fichinter';

View File

@ -903,7 +903,7 @@ elseif ($_GET["id"] > 0)
* Built documents * Built documents
*/ */
$filename=sanitizeFileName($fichinter->ref); $filename=sanitizeFileName($fichinter->ref);
$filedir=$conf->fichinter->dir_output . "/".$fichinter->ref; $filedir=$conf->ficheinter->dir_output . "/".$fichinter->ref;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$fichinter->id;
$genallowed=$user->rights->ficheinter->creer; $genallowed=$user->rights->ficheinter->creer;
$delallowed=$user->rights->ficheinter->supprimer; $delallowed=$user->rights->ficheinter->supprimer;

View File

@ -480,10 +480,10 @@ class Fichinter extends CommonObject
// Remove directory with files // Remove directory with files
$fichinterref = sanitizeFileName($this->ref); $fichinterref = sanitizeFileName($this->ref);
if ($conf->fichinter->dir_output) if ($conf->ficheinter->dir_output)
{ {
$dir = $conf->fichinter->dir_output . "/" . $fichinterref ; $dir = $conf->ficheinter->dir_output . "/" . $fichinterref ;
$file = $conf->fichinter->dir_output . "/" . $fichinterref . "/" . $fichinterref . ".pdf"; $file = $conf->ficheinter->dir_output . "/" . $fichinterref . "/" . $fichinterref . ".pdf";
if (file_exists($file)) if (file_exists($file))
{ {
fichinter_delete_preview($this->db, $this->id, $this->ref); fichinter_delete_preview($this->db, $this->id, $this->ref);

View File

@ -238,10 +238,10 @@ function fichinter_delete_preview($db, $fichinterid, $fichinterref='')
$fichinterref = $fichinter->ref; $fichinterref = $fichinter->ref;
} }
if ($conf->fichinter->dir_output) if ($conf->ficheinter->dir_output)
{ {
$fichinterref = sanitizeFileName($fichinterref); $fichinterref = sanitizeFileName($fichinterref);
$dir = $conf->fichinter->dir_output . "/" . $fichinterref ; $dir = $conf->ficheinter->dir_output . "/" . $fichinterref ;
$file = $dir . "/" . $fichinterref . ".pdf.png"; $file = $dir . "/" . $fichinterref . ".pdf.png";
$multiple = $file . "."; $multiple = $file . ".";

View File

@ -94,7 +94,7 @@ class pdf_soleil extends ModelePDFFicheinter
$outputlangs->setPhpLang(); $outputlangs->setPhpLang();
if ($conf->fichinter->dir_output) if ($conf->ficheinter->dir_output)
{ {
// If $fichinter is id instead of object // If $fichinter is id instead of object
if (! is_object($fichinter)) if (! is_object($fichinter))
@ -109,7 +109,7 @@ class pdf_soleil extends ModelePDFFicheinter
} }
$fichref = sanitizeFileName($fichinter->ref); $fichref = sanitizeFileName($fichinter->ref);
$dir = $conf->fichinter->dir_output; $dir = $conf->ficheinter->dir_output;
if (! eregi('specimen',$fichref)) $dir.= "/" . $fichref; if (! eregi('specimen',$fichref)) $dir.= "/" . $fichref;
$file = $dir . "/" . $fichref . ".pdf"; $file = $dir . "/" . $fichref . ".pdf";

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This file is an example to follow to add your own email selector inside * This file is an example to follow to add your own email selector inside
* the Dolibarr email tool. * the Dolibarr email tool.
@ -24,40 +25,40 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
*/ */
class mailing_kiwi extends MailingTargets class mailing_kiwi extends MailingTargets
{ {
// CHANGE THIS: Put here a name not already used // CHANGE THIS: Put here a name not already used
var $name='ContactsCategories'; var $name='ContactsCategories';
// CHANGE THIS: Put here a description of your selector module. // CHANGE THIS: Put here a description of your selector module.
// This label is used if no translation found for key MailingModuleDescXXX where XXX=name is found // This label is used if no translation found for key MailingModuleDescXXX where XXX=name is found
var $desc="Third parties (by categories)"; var $desc="Third parties (by categories)";
// CHANGE THIS: Set to 1 if selector is available for admin users only // CHANGE THIS: Set to 1 if selector is available for admin users only
var $require_admin=0; var $require_admin=0;
var $require_module=array("categorie"); var $require_module=array("categorie");
var $picto='company'; var $picto='company';
var $db; var $db;
// CHANGE THIS: Constructor name must be called mailing_xxx with xxx=name of your selector // CHANGE THIS: Constructor name must be called mailing_xxx with xxx=name of your selector
function mailing_categories($DB) function mailing_categories($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
/** /**
* \brief This is the main function that returns the array of emails * \brief This is the main function that returns the array of emails
* \param mailing_id Id of mailing. No need to use it. * \param mailing_id Id of mailing. No need to use it.
* \param filterarray If you used the formFilter function. Empty otherwise. * \param filterarray If you used the formFilter function. Empty otherwise.
* \return int <0 if error, number of emails added if ok * \return int <0 if error, number of emails added if ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
global $langs; global $conf, $langs;
$cibles = array(); $cibles = array();
// CHANGE THIS // CHANGE THIS
// Select the contacts from category // Select the contacts from category
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,"; $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,";
if ($_POST['filter']) $sql.= " llx_categorie.label as label"; if ($_POST['filter']) $sql.= " llx_categorie.label as label";
else $sql.=" null as label"; else $sql.=" null as label";
@ -65,26 +66,27 @@ class mailing_kiwi extends MailingTargets
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid"; if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid";
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie"; if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie";
$sql.= " WHERE s.email != ''"; $sql.= " WHERE s.email != ''";
$sql.= " AND s.entity = ".$conf->entity;
if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'"; if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'";
$sql.= " ORDER BY s.email"; $sql.= " ORDER BY s.email";
// Stocke destinataires dans cibles // Stocke destinataires dans cibles
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{
$num = $this->db->num_rows($result);
$i = 0;
$j = 0;
dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
$old = '';
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
if ($old <> $obj->email)
{ {
$num = $this->db->num_rows($result); $cibles[$j] = array(
$i = 0;
$j = 0;
dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
$old = '';
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
if ($old <> $obj->email)
{
$cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'name' => $obj->name,
@ -92,23 +94,22 @@ class mailing_kiwi extends MailingTargets
'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''), 'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''),
'url' => $this->url($obj->id) 'url' => $this->url($obj->id)
); );
$old = $obj->email; $old = $obj->email;
$j++; $j++;
}
$i++;
}
}
else
{
dol_syslog($this->db->error());
$this->error=$this->db->error();
return -1;
} }
$i++;
return parent::add_to_target($mailing_id, $cibles); }
} }
else
{
dol_syslog($this->db->error());
$this->error=$this->db->error();
return -1;
}
return parent::add_to_target($mailing_id, $cibles);
}
/** /**
@ -136,9 +137,10 @@ class mailing_kiwi extends MailingTargets
*/ */
function getNbOfRecipients() function getNbOfRecipients()
{ {
$sql = "SELECT count(distinct(s.email)) as nb"; $sql = "SELECT count(distinct(s.email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.email != ''"; $sql.= " WHERE s.email != ''";
$sql.= " AND s.entity = ".$conf->entity;
// La requete doit retourner un champ "nb" pour etre comprise // La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients // par parent::getNbOfRecipients
@ -152,7 +154,7 @@ class mailing_kiwi extends MailingTargets
*/ */
function formFilter() function formFilter()
{ {
global $langs; global $conf, $langs;
$s=''; $s='';
$s.='<select name="filter" class="flat">'; $s.='<select name="filter" class="flat">';
@ -162,6 +164,7 @@ class mailing_kiwi extends MailingTargets
$sql = "SELECT rowid, label, type"; $sql = "SELECT rowid, label, type";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE visible > 0 AND type > 0"; $sql.= " WHERE visible > 0 AND type > 0";
$sql.= " AND entity = ".$conf->entity;
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/includes/modules/mailings/peche.modules.php * \file htdocs/includes/modules/mailings/peche.modules.php
* \ingroup mailing * \ingroup mailing
* \brief Fichier de la classe permettant de g<EFBFBD>n<EFBFBD>rer la liste de destinataires Peche * \brief Fichier de la classe permettant de generer la liste de destinataires Peche
* \version $Id$ * \version $Id$
*/ */
@ -30,13 +30,13 @@ require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
/** /**
* \class mailing_pomme * \class mailing_pomme
* \brief Classe permettant de g<EFBFBD>n<EFBFBD>rer la liste des destinataires Pomme * \brief Classe permettant de generer la liste des destinataires Peche
*/ */
class mailing_peche extends MailingTargets class mailing_peche extends MailingTargets
{ {
var $name='EmailsFromFile'; // Identifiant du module mailing var $name='EmailsFromFile'; // Identifiant du module mailing
var $desc='EMails issus d\'un fichier'; // Libell<EFBFBD> utilis<69> si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e var $desc='EMails issus d\'un fichier'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
var $require_module=array(); // Module mailing actif si modules require_module actifs var $require_module=array(); // Module mailing actif si modules require_module actifs
var $require_admin=1; // Module mailing actif pour user admin ou non var $require_admin=1; // Module mailing actif pour user admin ou non
var $picto='generic'; var $picto='generic';
@ -100,7 +100,7 @@ class mailing_peche extends MailingTargets
/** /**
* \brief Ajoute destinataires dans table des cibles * \brief Ajoute destinataires dans table des cibles
* \param mailing_id Id du mailing concern<EFBFBD> * \param mailing_id Id du mailing concerne
* \param filterarray Requete sql de selection des destinataires * \param filterarray Requete sql de selection des destinataires
* \return int < 0 si erreur, nb ajout si ok * \return int < 0 si erreur, nb ajout si ok
*/ */
@ -110,7 +110,7 @@ class mailing_peche extends MailingTargets
$cibles = array(); $cibles = array();
$upload_dir=$conf->mailings->dir_temp; $upload_dir=$conf->mailing->dir_temp;
// Save file // Save file
if (! is_dir($upload_dir)) create_exdir($upload_dir); if (! is_dir($upload_dir)) create_exdir($upload_dir);

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -35,28 +36,37 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
class mailing_poire extends MailingTargets class mailing_poire extends MailingTargets
{ {
var $name='ContactCompanies'; // Identifiant du module mailing var $name='ContactCompanies'; // Identifiant du module mailing
var $desc='Contacts des tiers (prospects, clients, fournisseurs...)'; // Libellé utilisé si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée var $desc='Contacts des tiers (prospects, clients, fournisseurs...)'; // Libellé utilisé si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée
var $require_module=array("commercial"); // Module mailing actif si modules require_module actifs var $require_module=array("commercial"); // Module mailing actif si modules require_module actifs
var $require_admin=0; // Module mailing actif pour user admin ou non var $require_admin=0; // Module mailing actif pour user admin ou non
var $picto='contact'; var $picto='contact';
var $db; var $db;
function mailing_poire($DB) function mailing_poire($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
function getSqlArrayForStats() function getSqlArrayForStats()
{ {
global $langs; global $conf, $langs;
$langs->load("commercial");
$statssql=array(); $langs->load("commercial");
$statssql[0]="SELECT '".$langs->trans("NbOfCompaniesContacts")."' as label, count(distinct(c.email)) as nb FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."societe as s WHERE s.rowid = c.fk_soc AND s.client = 1 AND c.email != ''";
$statssql=array();
$statssql[0] = "SELECT '".$langs->trans("NbOfCompaniesContacts")."' as label";
$statssql[0].= ", count(distinct(c.email)) as nb";
$statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$statssql[0].= ", ".MAIN_DB_PREFIX."societe as s";
$statssql[0].= " WHERE s.rowid = c.fk_soc";
$statssql[0].= " AND s.entity = ".$conf->entity;
$statssql[0].= " AND c.entity = ".$conf->entity;
$statssql[0].= " AND s.client = 1";
$statssql[0].= " AND c.email != ''";
return $statssql; return $statssql;
} }
@ -70,15 +80,19 @@ class mailing_poire extends MailingTargets
*/ */
function getNbOfRecipients() function getNbOfRecipients()
{ {
$sql = "SELECT count(distinct(c.email)) as nb"; global $conf;
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.rowid = c.fk_soc";
$sql .= " AND c.email != ''";
// La requete doit retourner un champ "nb" pour etre comprise $sql = "SELECT count(distinct(c.email)) as nb";
// par parent::getNbOfRecipients $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
return parent::getNbOfRecipients($sql); $sql .= ", ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.rowid = c.fk_soc";
$sql .= " AND c.entity = ".$conf->entity;
$sql .= " AND s.entity = ".$conf->entity;
$sql .= " AND c.email != ''";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
return parent::getNbOfRecipients($sql);
} }
@ -143,7 +157,7 @@ class mailing_poire extends MailingTargets
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
global $langs; global $conf, $langs;
$cibles = array(); $cibles = array();
@ -174,6 +188,8 @@ class mailing_poire extends MailingTargets
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = c.fk_soc"; $sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND c.email != ''"; $sql.= " AND c.email != ''";
foreach($filtersarray as $key) foreach($filtersarray as $key)
{ {

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -34,30 +35,34 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
class mailing_pomme extends MailingTargets class mailing_pomme extends MailingTargets
{ {
var $name='DolibarrUsers'; // Identifiant du module mailing var $name='DolibarrUsers'; // Identifiant du module mailing
var $desc='Utilisateurs de Dolibarr avec emails'; // Libellé utilisé si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée var $desc='Utilisateurs de Dolibarr avec emails'; // Libellé utilisé si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée
var $require_module=array(); // Module mailing actif si modules require_module actifs var $require_module=array(); // Module mailing actif si modules require_module actifs
var $require_admin=1; // Module mailing actif pour user admin ou non var $require_admin=1; // Module mailing actif pour user admin ou non
var $picto='user'; var $picto='user';
var $db; var $db;
function mailing_pomme($DB) function mailing_pomme($DB)
{ {
$this->db=$DB; $this->db=$DB;
} }
function getSqlArrayForStats() function getSqlArrayForStats()
{ {
global $langs; global $conf, $langs;
$langs->load("users");
$statssql=array(); $langs->load("users");
$sql = "SELECT '".$langs->trans("DolibarrUsers")."' as label, count(distinct(email)) as nb FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test $statssql=array();
$statssql[0]=$sql; $sql = "SELECT '".$langs->trans("DolibarrUsers")."' as label";
$sql.= ", count(distinct(u.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$statssql[0]=$sql;
return $statssql; return $statssql;
} }
@ -71,13 +76,16 @@ class mailing_pomme extends MailingTargets
*/ */
function getNbOfRecipients() function getNbOfRecipients()
{ {
$sql = "SELECT count(distinct(u.email)) as nb"; global $conf;
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test
// La requete doit retourner un champ "nb" pour etre comprise $sql = "SELECT count(distinct(u.email)) as nb";
// par parent::getNbOfRecipients $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
return parent::getNbOfRecipients($sql); $sql.= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test
$sql.= " AND u.entity IN (0,".$conf->entity.")";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
return parent::getNbOfRecipients($sql);
} }
@ -89,6 +97,7 @@ class mailing_pomme extends MailingTargets
function formFilter() function formFilter()
{ {
global $langs; global $langs;
$langs->load("users"); $langs->load("users");
$s=''; $s='';
@ -118,7 +127,7 @@ class mailing_pomme extends MailingTargets
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
global $langs; global $conf, $langs;
$cibles = array(); $cibles = array();
@ -127,6 +136,7 @@ class mailing_pomme extends MailingTargets
$sql.= " u.name as name, u.firstname as firstname, u.login, u.office_phone"; $sql.= " u.name as name, u.firstname as firstname, u.login, u.office_phone";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test $sql.= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test
$sql.= " AND u.entity IN (0,".$conf->entity.")";
foreach($filtersarray as $key) foreach($filtersarray as $key)
{ {
if ($key == '1') $sql.= " AND u.statut=1"; if ($key == '1') $sql.= " AND u.statut=1";

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -67,13 +68,13 @@ class modExpedition extends DolibarrModules
$r++; $r++;
$this->dirs[$r][0] = "temp"; $this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/expedition/temp"; $this->dirs[$r][1] = "/expedition/temp";
$r++ $r++;
$this->dirs[$r][0] = "bon_expedition"; $this->dirs[$r][0] = "bon_expedition";
$this->dirs[$r][1] = "/expedition/sending"; $this->dirs[$r][1] = "/expedition/sending";
$r++; $r++;
$this->dirs[$r][0] = "bon_expedition_temp"; $this->dirs[$r][0] = "bon_expedition_temp";
$this->dirs[$r][1] = "/expedition/sending/temp"; $this->dirs[$r][1] = "/expedition/sending/temp";
$r++ $r++;
$this->dirs[$r][0] = "bon_livraison"; $this->dirs[$r][0] = "bon_livraison";
$this->dirs[$r][1] = "/expedition/receipt"; $this->dirs[$r][1] = "/expedition/receipt";
$r++; $r++;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,7 +18,7 @@
*/ */
/** \defgroup export Module export /** \defgroup export Module export
* \brief Module g<EFBFBD>n<EFBFBD>rique pour r<EFBFBD>aliser des exports de donn<EFBFBD>es en base * \brief Module generique pour realiser des exports de donnees en base
* \version $Id$ * \version $Id$
*/ */
@ -55,13 +56,21 @@ class modExport extends DolibarrModules
$this->special = 0; $this->special = 0;
$this->picto=''; $this->picto='';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/export";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/export/temp";
// Config pages // Config pages
$this->config_page_url = array(); $this->config_page_url = array();
// D<>pendances // Dependances
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
$this->phpmin = array(4,2,0); $this->phpmin = array(4,2,0);

View File

@ -53,14 +53,22 @@ class modExternalRss extends DolibarrModules
$this->family = "technic"; $this->family = "technic";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = eregi_replace('^mod','',get_class($this)); $this->name = eregi_replace('^mod','',get_class($this));
$this->description = "Ajout de files d'informations RSS dans les <EFBFBD>crans Dolibarr"; $this->description = "Ajout de files d'informations RSS dans les ecrans Dolibarr";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1; $this->special = 1;
$this->picto='rss'; $this->picto='rss';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/rss";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/rss/temp";
// Config pages // Config pages
$this->config_page_url = array("external_rss.php"); $this->config_page_url = array("external_rss.php");
@ -74,10 +82,6 @@ class modExternalRss extends DolibarrModules
// Constantes // Constantes
$this->const = array(); $this->const = array();
// Repertoires
$this->dirs = array();
$this->dirs[0] = $conf->externalrss->dir_temp;
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
// Les boites sont ajoutees lors de la configuration des flux // Les boites sont ajoutees lors de la configuration des flux
@ -93,12 +97,15 @@ class modExternalRss extends DolibarrModules
*/ */
function init() function init()
{ {
global $conf;
$sql = array(); $sql = array();
// Recherche configuration de boites // Recherche configuration de boites
$this->boxes=array(); $this->boxes=array();
$sql="select name, value from ".MAIN_DB_PREFIX."const"; $sql="select name, value from ".MAIN_DB_PREFIX."const";
$sql.= " WHERE name like 'EXTERNAL_RSS_TITLE_%'"; $sql.= " WHERE name like 'EXTERNAL_RSS_TITLE_%'";
$sql.= " AND entity = ".$conf->entity;
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{ {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -56,13 +56,25 @@ class modFckeditor extends DolibarrModules
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 2; $this->special = 2;
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/fckeditor";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/fckeditor/temp";
$r++;
$this->dirs[$r][0] = "images";
$this->dirs[$r][1] = "/fckeditor/images";
// Config pages // Config pages
$this->config_page_url = array("fckeditor.php"); $this->config_page_url = array("fckeditor.php");
// D<>pendances // Dependances
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
@ -85,9 +97,6 @@ class modFckeditor extends DolibarrModules
{ {
global $conf; global $conf;
// Dir
$this->dirs[0] = $conf->fckeditor->dir_images;
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql);

View File

@ -65,8 +65,16 @@ class modFicheinter extends DolibarrModules
$this->special = 0; $this->special = 0;
$this->picto = "intervention"; $this->picto = "intervention";
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/ficheinter";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/ficheinter/temp";
// Dependencies // Dependencies
$this->depends = array("modSociete","modCommercial"); $this->depends = array("modSociete","modCommercial");
@ -158,9 +166,6 @@ class modFicheinter extends DolibarrModules
// Permissions // Permissions
$this->remove(); $this->remove();
// Dir
$this->dirs[0] = $conf->facture->dir_output;
$sql = array( $sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','ficheinter',".$conf->entity.")", "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','ficheinter',".$conf->entity.")",

View File

@ -71,7 +71,7 @@ class modFournisseur extends DolibarrModules
$this->dirs[$r][0] = "temp"; $this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/fournisseur/temp"; $this->dirs[$r][1] = "/fournisseur/temp";
$r++ $r++;
$this->dirs[$r][0] = "commande"; $this->dirs[$r][0] = "commande";
$this->dirs[$r][1] = "/fournisseur/commande"; $this->dirs[$r][1] = "/fournisseur/commande";
@ -79,7 +79,7 @@ class modFournisseur extends DolibarrModules
$this->dirs[$r][0] = "commande_temp"; $this->dirs[$r][0] = "commande_temp";
$this->dirs[$r][1] = "/fournisseur/commande/temp"; $this->dirs[$r][1] = "/fournisseur/commande/temp";
$r++ $r++;
$this->dirs[$r][0] = "facture"; $this->dirs[$r][0] = "facture";
$this->dirs[$r][1] = "/fournisseur/facture"; $this->dirs[$r][1] = "/fournisseur/facture";

View File

@ -56,8 +56,16 @@ class modImport extends DolibarrModules
$this->special = 0; $this->special = 0;
$this->picto=''; $this->picto='';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/import";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/import/temp";
// Config pages // Config pages
$this->config_page_url = array(); $this->config_page_url = array();

View File

@ -58,8 +58,16 @@ class modLabel extends DolibarrModules
$this->special = 2; $this->special = 2;
$this->picto='label'; $this->picto='label';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/label";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/label/temp";
// Dependancies // Dependancies
$this->depends = array(); $this->depends = array();

View File

@ -56,8 +56,16 @@ class modLdap extends DolibarrModules
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 1; $this->special = 1;
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
$this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/ldap";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/ldap/temp";
// Config pages // Config pages
$this->config_page_url = array("ldap.php"); $this->config_page_url = array("ldap.php");

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -57,10 +58,18 @@ class modMailing extends DolibarrModules
$this->special = 0; $this->special = 0;
$this->picto='email'; $this->picto='email';
// Dir // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
$r=0;
// D<>pendances $this->dirs[$r][0] = "output";
$this->dirs[$r][1] = "/mailings";
$r++;
$this->dirs[$r][0] = "temp";
$this->dirs[$r][1] = "/mailings/temp";
// Dependances
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
$this->langfiles = array("mails"); $this->langfiles = array("mails");

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -132,7 +132,7 @@ if ($modulepart)
{ {
$accessallowed=1; $accessallowed=1;
} }
$original_file=$conf->fichinter->dir_output.'/'.$original_file; $original_file=$conf->ficheinter->dir_output.'/'.$original_file;
} }
// Wrapping pour les images des stats propales // Wrapping pour les images des stats propales

View File

@ -21,6 +21,8 @@ ALTER TABLE llx_bank_account ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER
ALTER TABLE llx_document_model ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER nom; ALTER TABLE llx_document_model ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER nom;
ALTER TABLE llx_menu ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER menu_handler; ALTER TABLE llx_menu ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER menu_handler;
ALTER TABLE llx_ecm_directories ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label; ALTER TABLE llx_ecm_directories ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_mailing ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER titre;
ALTER TABLE llx_categorie ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_rights_def DROP PRIMARY KEY; ALTER TABLE llx_rights_def DROP PRIMARY KEY;
ALTER TABLE llx_user_param DROP INDEX fk_user; ALTER TABLE llx_user_param DROP INDEX fk_user;
@ -31,6 +33,7 @@ ALTER TABLE llx_entrepot DROP INDEX label;
ALTER TABLE llx_bank_account DROP INDEX uk_bank_account_label; ALTER TABLE llx_bank_account DROP INDEX uk_bank_account_label;
ALTER TABLE llx_document_model DROP INDEX uk_document_model; ALTER TABLE llx_document_model DROP INDEX uk_document_model;
ALTER TABLE llx_menu DROP INDEX idx_menu_uk_menu; ALTER TABLE llx_menu DROP INDEX idx_menu_uk_menu;
ALTER TABLE llx_categorie DROP INDEX uk_categorie_ref;
ALTER TABLE llx_rights_def ADD PRIMARY KEY (id, entity); ALTER TABLE llx_rights_def ADD PRIMARY KEY (id, entity);
ALTER TABLE llx_user_param ADD UNIQUE INDEX uk_user_param (fk_user,param,entity); ALTER TABLE llx_user_param ADD UNIQUE INDEX uk_user_param (fk_user,param,entity);
@ -41,3 +44,4 @@ ALTER TABLE llx_entrepot ADD UNIQUE INDEX uk_entrepot_label (label, entity);
ALTER TABLE llx_bank_account ADD UNIQUE INDEX uk_bank_account_label (label, entity); ALTER TABLE llx_bank_account ADD UNIQUE INDEX uk_bank_account_label (label, entity);
ALTER TABLE llx_document_model ADD UNIQUE INDEX uk_document_model (nom, type, entity); ALTER TABLE llx_document_model ADD UNIQUE INDEX uk_document_model (nom, type, entity);
ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, url, entity); ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, url, entity);
ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label, type, entity);

View File

@ -1,5 +1,6 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -18,6 +19,6 @@
-- $Id$ -- $Id$
-- ============================================================================ -- ============================================================================
ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label,type); ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label,type,entity);
ALTER TABLE llx_categorie ADD INDEX idx_categorie_type (type); ALTER TABLE llx_categorie ADD INDEX idx_categorie_type (type);

View File

@ -1,7 +1,7 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr> -- Copyright (C) 2005 Brice Davoleau <e1davole@iu-vannes.fr>
-- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> -- Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
-- Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> -- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -23,11 +23,12 @@
create table llx_categorie create table llx_categorie
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
label VARCHAR(255), -- category name label varchar(255), -- category name
type tinyint DEFAULT 1 NOT NULL, -- category type (product, supplier, customer)
entity integer DEFAULT 1 NOT NULL, -- multi company id
description text, -- description of the category description text, -- description of the category
fk_soc integer DEFAULT NULL, -- attribution of the category has a company (for product only) fk_soc integer DEFAULT NULL, -- attribution of the category has a company (for product only)
visible tinyint DEFAULT 1 NOT NULL, -- determine if the products are visible or not visible tinyint DEFAULT 1 NOT NULL -- determine if the products are visible or not
type tinyint DEFAULT 1 NOT NULL -- category type (product, supplier, customer)
)type=innodb; )type=innodb;
-- --
@ -37,3 +38,11 @@ create table llx_categorie
-- 1 : supplier -- 1 : supplier
-- 2 : customer -- 2 : customer
-- --
--
-- List of codes for the field entity
--
-- 1 : first company category type
-- 2 : second company category type
-- 3 : etc...
--

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -27,28 +28,30 @@
create table llx_mailing create table llx_mailing
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
statut smallint DEFAULT 0, -- statut smallint DEFAULT 0, --
titre varchar(60), -- Ref of mailing
titre varchar(60), -- company name entity integer DEFAULT 1 NOT NULL, -- multi company id
sujet varchar(60), -- company name sujet varchar(60), -- Sujet of mailing
body text, body text,
cible varchar(60), cible varchar(60),
nbemail integer, nbemail integer,
email_from varchar(160), -- Email address of sender
email_from varchar(160), -- company name email_replyto varchar(160), -- Email address for reply
email_replyto varchar(160), -- company name email_errorsto varchar(160), -- Email addresse for errors
email_errorsto varchar(160), -- company name
date_creat datetime, -- creation date date_creat datetime, -- creation date
date_valid datetime, -- date_valid datetime, --
date_appro datetime, -- date_appro datetime, --
date_envoi datetime, -- date d'envoi date_envoi datetime, -- date d'envoi
fk_user_creat integer, -- utilisateur qui a créé l'info fk_user_creat integer, -- utilisateur qui a créé l'info
fk_user_valid integer, -- utilisateur qui a créé l'info fk_user_valid integer, -- utilisateur qui a créé l'info
fk_user_appro integer -- utilisateur qui a créé l'info fk_user_appro integer -- utilisateur qui a créé l'info
)type=innodb; )type=innodb;
--
-- List of codes for the field entity
--
-- 1 : first company mailing
-- 2 : second company mailing
-- 3 : etc...
--