FIX module for emailing target selection must use a condition on module
This commit is contained in:
parent
2c9c55bc75
commit
f6ad688ddd
@ -365,17 +365,19 @@ if ($object->fetch($id) >= 0) {
|
|||||||
|
|
||||||
$obj = new $classname($db);
|
$obj = new $classname($db);
|
||||||
|
|
||||||
|
// Check if qualified
|
||||||
|
$qualified = (is_null($obj->enabled) ? 1 : dol_eval($obj->enabled, 1));
|
||||||
|
|
||||||
// Check dependencies
|
// Check dependencies
|
||||||
$qualified = (isset($obj->enabled) ? $obj->enabled : 1);
|
|
||||||
foreach ($obj->require_module as $key) {
|
foreach ($obj->require_module as $key) {
|
||||||
if (!$conf->$key->enabled || (!$user->admin && $obj->require_admin)) {
|
if (empty($conf->$key->enabled) || (empty($user->admin) && $obj->require_admin)) {
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
//print "Les prerequis d'activation du module mailing ne sont pas respectes. Il ne sera pas actif";
|
//print "Les prerequis d'activation du module mailing ne sont pas respectes. Il ne sera pas actif";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si le module mailing est qualifie
|
// If module is qualified
|
||||||
if ($qualified) {
|
if ($qualified) {
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,8 @@ class mailing_advthirdparties extends MailingTargets
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
public $enabled = '$conf->societe->enabled';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -38,6 +38,8 @@ class mailing_contacts1 extends MailingTargets
|
|||||||
public $require_module = array("societe"); // Module mailing actif si modules require_module actifs
|
public $require_module = array("societe"); // Module mailing actif si modules require_module actifs
|
||||||
public $require_admin = 0; // Module mailing actif pour user admin ou non
|
public $require_admin = 0; // Module mailing actif pour user admin ou non
|
||||||
|
|
||||||
|
public $enabled = '$conf->societe->enabled';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -41,6 +41,8 @@ class mailing_fraise extends MailingTargets
|
|||||||
|
|
||||||
public $require_module = array('adherent');
|
public $require_module = array('adherent');
|
||||||
|
|
||||||
|
public $enabled = '$conf->adherent->enabled';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -36,6 +36,11 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Condition to be enabled
|
||||||
|
*/
|
||||||
|
public $enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -41,6 +41,8 @@ class mailing_partnership extends MailingTargets
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
public $enabled = '$conf->partnership->enabled';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -31,6 +31,8 @@ class mailing_thirdparties extends MailingTargets
|
|||||||
|
|
||||||
public $require_module = array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
|
public $require_module = array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
|
||||||
|
|
||||||
|
public $enabled = '$conf->societe->enabled';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -29,6 +29,8 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
|
|
||||||
public $require_module = array('contrat');
|
public $require_module = array('contrat');
|
||||||
|
|
||||||
|
public $enabled = '$conf->societe->enabled';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -24,7 +24,8 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
|||||||
// 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
|
||||||
public $require_admin = 0;
|
public $require_admin = 0;
|
||||||
|
|
||||||
public $enabled = 0;
|
public $enabled = '$conf->mymodule->enabled';
|
||||||
|
|
||||||
public $require_module = array();
|
public $require_module = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user