New: Add a selection module for emailing to enter a recipient from
gui.
This commit is contained in:
parent
655a288f8b
commit
856c829c99
@ -42,6 +42,7 @@ For users:
|
|||||||
- New: Can select thirdparties into emailing targets, even if module category is not enabled.
|
- New: Can select thirdparties into emailing targets, even if module category is not enabled.
|
||||||
- New: [ task #498 ] Improvement of the block to add products/services lines.
|
- New: [ task #498 ] Improvement of the block to add products/services lines.
|
||||||
- New: ECM autodir works also for files joined to products and services.
|
- New: ECM autodir works also for files joined to products and services.
|
||||||
|
- New: Add a selection module for emailing to enter a recipient from gui.
|
||||||
New experimental modules:
|
New experimental modules:
|
||||||
- New: Add margin and commissions management module.
|
- New: Add margin and commissions management module.
|
||||||
- New: Add holiday module.
|
- New: Add holiday module.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* 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,24 +17,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/mailings/peche.modules.php
|
* \file htdocs/core/modules/mailings/xinputfile.modules.php
|
||||||
* \ingroup mailing
|
* \ingroup mailing
|
||||||
* \brief File of class to offer a selector of emailing targets with Rule 'Peche'.
|
* \brief File of class to offer a selector of emailing targets with Rule 'xinputfile'.
|
||||||
*/
|
*/
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class mailing_peche
|
* Class to offer a selector of emailing targets with Rule 'xinputfile'.
|
||||||
* \brief Class to offer a selector of emailing targets with Rule 'Peche'.
|
|
||||||
*/
|
*/
|
||||||
class mailing_peche extends MailingTargets
|
class mailing_xinputfile extends MailingTargets
|
||||||
{
|
{
|
||||||
var $name='EmailsFromFile'; // Identifiant du module mailing
|
var $name='EmailsFromFile'; // Identifiant du module mailing
|
||||||
var $desc='EMails issus d\'un fichier'; // Libelle utilise 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=0; // Module mailing actif pour user admin ou non
|
||||||
var $picto='generic';
|
var $picto='generic';
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
@ -69,11 +68,12 @@ class mailing_peche extends MailingTargets
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Return here number of distinct emails returned by your selector.
|
* Return here number of distinct emails returned by your selector.
|
||||||
* For example if this selector is used to extract 500 different
|
* For example if this selector is used to extract 500 different
|
||||||
* emails from a text file, this function must return 500.
|
* emails from a text file, this function must return 500.
|
||||||
* \return int '' means NA
|
*
|
||||||
|
* @return int '' means NA
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients()
|
function getNbOfRecipients()
|
||||||
{
|
{
|
||||||
164
htdocs/core/modules/mailings/xinputuser.modules.php
Normal file
164
htdocs/core/modules/mailings/xinputuser.modules.php
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* 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, see <http://www.gnu.org/licenses/>.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/modules/mailings/xinputuser.modules.php
|
||||||
|
* \ingroup mailing
|
||||||
|
* \brief File of class to offer a selector of emailing targets with Rule 'xinputuser'.
|
||||||
|
*/
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to offer a selector of emailing targets with Rule 'xinputuser'.
|
||||||
|
*/
|
||||||
|
class mailing_xinputuser extends MailingTargets
|
||||||
|
{
|
||||||
|
var $name='EmailsFromUser'; // Identifiant du module mailing
|
||||||
|
var $desc='EMails input by user'; // 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_admin=0; // Module mailing actif pour user admin ou non
|
||||||
|
var $picto='generic';
|
||||||
|
|
||||||
|
var $db;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
function __construct($db)
|
||||||
|
{
|
||||||
|
$this->db=$db;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On the main mailing area, there is a box with statistics.
|
||||||
|
* If you want to add a line in this report you must provide an
|
||||||
|
* array of SQL request that returns two field:
|
||||||
|
* One called "label", One called "nb".
|
||||||
|
*
|
||||||
|
* @return array Array with SQL requests
|
||||||
|
*/
|
||||||
|
function getSqlArrayForStats()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$langs->load("users");
|
||||||
|
|
||||||
|
$statssql=array();
|
||||||
|
return $statssql;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return here number of distinct emails returned by your selector.
|
||||||
|
* For example if this selector is used to extract 500 different
|
||||||
|
* emails from a text file, this function must return 500.
|
||||||
|
*
|
||||||
|
* @return int '' means NA
|
||||||
|
*/
|
||||||
|
function getNbOfRecipients()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie url lien vers fiche de la source du destinataire du mailing
|
||||||
|
*
|
||||||
|
* @param int $id ID
|
||||||
|
* @return string Url lien
|
||||||
|
*/
|
||||||
|
function url($id)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
|
||||||
|
*
|
||||||
|
* @return string Retourne zone select
|
||||||
|
*/
|
||||||
|
function formFilter()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$s='';
|
||||||
|
$s.='<input type="text" name="xinputuser" class="flat" size="40">';
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ajoute destinataires dans table des cibles
|
||||||
|
*
|
||||||
|
* @param int $mailing_id Id of emailing
|
||||||
|
* @param array $filtersarray Requete sql de selection des destinataires
|
||||||
|
* @return int < 0 si erreur, nb ajout si ok
|
||||||
|
*/
|
||||||
|
function add_to_target($mailing_id,$filtersarray=array())
|
||||||
|
{
|
||||||
|
global $conf,$langs,$_FILES;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
|
$tmparray=explode(';',GETPOST('xinputuser'));
|
||||||
|
$email=$tmparray[0];
|
||||||
|
$lastname=$tmparray[1];
|
||||||
|
$firstname=$tmparray[2];
|
||||||
|
$other=$tmparray[3];
|
||||||
|
|
||||||
|
$cibles=array();
|
||||||
|
if (! empty($email))
|
||||||
|
{
|
||||||
|
if (isValidEMail($email))
|
||||||
|
{
|
||||||
|
$cibles[] = array(
|
||||||
|
'email' => $email,
|
||||||
|
'name' => $name,
|
||||||
|
'firstname' => $firstname,
|
||||||
|
'other' => $other,
|
||||||
|
'source_url' => '',
|
||||||
|
'source_id' => '',
|
||||||
|
'source_type' => 'file'
|
||||||
|
);
|
||||||
|
|
||||||
|
return parent::add_to_target($mailing_id, $cibles);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans("ErrorBadEMail",$email);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
$this->error = $langs->trans("ErrorBadEmail",$email);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@ -3407,6 +3407,7 @@ function migrate_delete_old_files($db,$langs,$conf)
|
|||||||
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_backoffice.php',
|
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_backoffice.php',
|
||||||
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_frontoffice.php',
|
DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_frontoffice.php',
|
||||||
DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php',
|
DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php',
|
||||||
|
DOL_DOCUMENT_ROOT.'/core/modules/mailings/peche.modules.php',
|
||||||
DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php',
|
DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php',
|
||||||
DOL_DOCUMENT_ROOT.'/core/modules/mailings/kiwi.modules.php',
|
DOL_DOCUMENT_ROOT.'/core/modules/mailings/kiwi.modules.php',
|
||||||
DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_crabe.modules.php',
|
DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_crabe.modules.php',
|
||||||
|
|||||||
@ -85,6 +85,7 @@ MailingModuleDescContactCompanies=Contacts of all third parties (customer, prosp
|
|||||||
MailingModuleDescDolibarrUsers=Dolibarr users
|
MailingModuleDescDolibarrUsers=Dolibarr users
|
||||||
MailingModuleDescFundationMembers=Foundation members with emails
|
MailingModuleDescFundationMembers=Foundation members with emails
|
||||||
MailingModuleDescEmailsFromFile=EMails from a text file (email;lastname;firstname;other)
|
MailingModuleDescEmailsFromFile=EMails from a text file (email;lastname;firstname;other)
|
||||||
|
MailingModuleDescEmailsFromUser=EMails from user input (email;lastname;firstname;other)
|
||||||
MailingModuleDescContactsCategories=Third parties (by category)
|
MailingModuleDescContactsCategories=Third parties (by category)
|
||||||
MailingModuleDescDolibarrContractsLinesExpired=Third parties with expired contract's lines
|
MailingModuleDescDolibarrContractsLinesExpired=Third parties with expired contract's lines
|
||||||
MailingModuleDescContactsByCompanyCategory=Contacts of third parties (by third parties category)
|
MailingModuleDescContactsByCompanyCategory=Contacts of third parties (by third parties category)
|
||||||
|
|||||||
@ -85,6 +85,7 @@ MailingModuleDescContactCompanies=Contacts de tiers (prospects, clients, fournis
|
|||||||
MailingModuleDescDolibarrUsers=Utilisateurs de Dolibarr
|
MailingModuleDescDolibarrUsers=Utilisateurs de Dolibarr
|
||||||
MailingModuleDescFundationMembers=Adhérents
|
MailingModuleDescFundationMembers=Adhérents
|
||||||
MailingModuleDescEmailsFromFile=EMails issus d'un fichier texte (email;nom;prenom;autre)
|
MailingModuleDescEmailsFromFile=EMails issus d'un fichier texte (email;nom;prenom;autre)
|
||||||
|
MailingModuleDescEmailsFromUser=EMails saisi manuellement (email;nom;prenom;autre)
|
||||||
MailingModuleDescContactsCategories=Tiers (par catégorie)
|
MailingModuleDescContactsCategories=Tiers (par catégorie)
|
||||||
MailingModuleDescDolibarrContractsLinesExpired=Tiers avec lignes de contrats de services expirées
|
MailingModuleDescDolibarrContractsLinesExpired=Tiers avec lignes de contrats de services expirées
|
||||||
MailingModuleDescContactsByCompanyCategory=Contacts de tiers (par catégorie de tiers)
|
MailingModuleDescContactsByCompanyCategory=Contacts de tiers (par catégorie de tiers)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user