diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index dad5f484a4d..392779e7d41 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -203,7 +203,6 @@ else if ($action == 'set_FICHINTER_FREE_TEXT') else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') { $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -538,7 +537,7 @@ print ''; print ''; print "\n"; - +print ''; // print products on fichinter $var=! $var; print '
'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 341924ffa13..28c54db1f9e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -542,7 +542,19 @@ class ActionComm extends CommonObject $this->error=$this->db->lasterror(); $error++; } - + + if (! $error) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources"; + $sql.= " WHERE fk_actioncomm=".$this->id; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $res=$this->db->query($sql); + if ($res < 0) { + $this->error=$this->db->lasterror(); + $error++; + } + } + // Removed extrafields if (! $error) { $result=$this->deleteExtraFields(); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 3f8df87cd7a..f898442fae7 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -75,6 +75,7 @@ class mailing_contacts1 extends MailingTargets $statssql[0].= " WHERE c.entity IN (".getEntity('societe', 1).")"; $statssql[0].= " AND c.email != ''"; // Note that null != '' is false $statssql[0].= " AND c.no_email = 0"; + $statssql[0].= " AND c.statut = 1"; return $statssql; } @@ -98,6 +99,7 @@ class mailing_contacts1 extends MailingTargets $sql.= " WHERE c.entity IN (".getEntity('societe', 1).")"; $sql.= " AND c.email != ''"; // Note that null != '' is false $sql.= " AND c.no_email = 0"; + $sql.= " AND c.statut = 1"; // La requete doit retourner un champ "nb" pour etre comprise // par parent::getNbOfRecipients @@ -204,6 +206,7 @@ class mailing_contacts1 extends MailingTargets $sql.= " WHERE c.entity IN (".getEntity('societe', 1).")"; $sql.= " AND c.email <> ''"; $sql.= " AND c.no_email = 0"; + $sql.= " AND c.statut = 1"; $sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; foreach($filtersarray as $key) { diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index fe49ce56b35..b0a82e5136e 100644 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -86,6 +86,7 @@ class mailing_contacts2 extends MailingTargets $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email <> ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; //$sql.= " AND sp.poste != ''"; $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'"; @@ -168,6 +169,7 @@ class mailing_contacts2 extends MailingTargets $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; //$sql.= " AND sp.poste != ''"; // La requete doit retourner un champ "nb" pour etre comprise // par parent::getNbOfRecipients @@ -191,6 +193,7 @@ class mailing_contacts2 extends MailingTargets $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; $sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; $sql.= " GROUP BY sp.poste"; $sql.= " ORDER BY sp.poste"; diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php index 92640291088..3333549e6da 100644 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ b/htdocs/core/modules/mailings/contacts3.modules.php @@ -85,6 +85,7 @@ class mailing_contacts3 extends MailingTargets if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " WHERE sp.email <> ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid"; @@ -173,6 +174,7 @@ class mailing_contacts3 extends MailingTargets $sql.= " WHERE c.entity IN (".getEntity('societe', 1).")"; $sql.= " AND c.email != ''"; // Note that null != '' is false $sql.= " AND c.no_email = 0"; + $sql.= " AND c.statut = 1"; /* $sql = "SELECT count(distinct(sp.email)) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -208,6 +210,7 @@ class mailing_contacts3 extends MailingTargets $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " WHERE sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; $sql.= " AND cs.fk_categorie = c.rowid"; $sql.= " AND cs.fk_societe = sp.fk_soc"; diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php index 59355b372fe..747370bac07 100644 --- a/htdocs/core/modules/mailings/contacts4.modules.php +++ b/htdocs/core/modules/mailings/contacts4.modules.php @@ -85,6 +85,7 @@ class mailing_contacts4 extends MailingTargets $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; $sql.= " WHERE sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; $sql.= " ORDER BY sp.lastname, sp.firstname"; @@ -173,6 +174,7 @@ class mailing_contacts4 extends MailingTargets $sql.= " WHERE c.entity IN (".getEntity('societe', 1).")"; $sql.= " AND c.email != ''"; // Note that null != '' is false $sql.= " AND c.no_email = 0"; + $sql.= " AND c.statut = 1"; /* $sql = "SELECT count(distinct(sp.email)) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -208,6 +210,7 @@ class mailing_contacts4 extends MailingTargets $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; $sql.= " WHERE sp.email != ''"; // Note that null != '' is false $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; $sql.= " AND sp.entity IN (".getEntity('societe', 1).")"; $sql.= " GROUP BY c.label"; $sql.= " ORDER BY c.label"; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 69ec8984cf6..56287721180 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -867,6 +867,7 @@ else if ($action == 'update_extras') if ($result < 0) { $error++; + setEventMessage($object->error,'errors'); } } else if ($reshook < 0) $error++; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 0c96c3c6d5c..1fb081b5c3f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3818,8 +3818,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; $mod=new modService($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3828,8 +3828,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; $mod=new modCommande($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3838,8 +3838,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; $mod=new modFacture($db); //$mod->remove('noboxes'); $mod->init('newboxdefonly'); @@ -3878,8 +3878,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1 { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; $mod=new modECM($db); $mod->remove('noboxes'); // We need to remove because a permission id has been removed $mod->init('newboxdefonly');