New: Can select thirdparties into emailing targets, even if module

category is not enabled.
This commit is contained in:
Laurent Destailleur 2012-08-27 20:21:53 +02:00
parent 80d9fb7134
commit 857a11f508
3 changed files with 14 additions and 14 deletions

View File

@ -39,6 +39,7 @@ For users:
- New: [ task #326 ]: Add a numbering module to suggest automatically a product ref
- New: Add conditional substitution IF/ELSEIF/ENDIF for ODT templates
- New: Add unit foot2, inch2, foot3 and inch3 for surface and volumes.
- New: Can select thirdparties into emailing targets, even if module category is not enabled.
- Fix: [ bug #499 ]: Supplier order input method not translated
- Fix: No images into product description lines as PDF generation does
not work with this.

View File

@ -19,20 +19,15 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
/**
* \class mailing_thirdparties
* \brief Class to manage a list of personalised recipients for mailing feature
* Class to manage a list of personalised recipients for mailing feature
*/
class mailing_thirdparties extends MailingTargets
{
// CHANGE THIS: Put here a name not already used
var $name='ContactsCategories';
// 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
var $desc="Third parties (by categories)";
// CHANGE THIS: Set to 1 if selector is available for admin users only
var $require_admin=0;
var $require_module=array("categorie","societe");
var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
var $picto='company';
var $db;
@ -44,6 +39,8 @@ class mailing_thirdparties extends MailingTargets
*/
function __construct($db)
{
global $conf;
$this->db=$db;
}
@ -151,11 +148,12 @@ class mailing_thirdparties extends MailingTargets
}
/*
* \brief 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
/**
* 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 Nb of recipients
*/
function getNbOfRecipients()
{
@ -200,6 +198,8 @@ class mailing_thirdparties extends MailingTargets
{
$num = $this->db->num_rows($resql);
if (empty($conf->categorie->enabled)) $num=0; // Force empty list if category module is not enabled
if ($num) $s.='<option value="0">&nbsp;</option>';
else $s.='<option value="0">'.$langs->trans("ContactsAllShort").'</option>';

View File

@ -18,8 +18,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
/**
* \class mailing_thirdparties_services_expired
* \brief Class to offer a selector of emailing targets with Rule 'services expired'.
* Class to offer a selector of emailing targets with Rule 'services expired'.
*/
class mailing_thirdparties_services_expired extends MailingTargets
{