diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 1e0e78db868..8cd5d031b41 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++; @@ -544,7 +543,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 b4336936181..aa7d532025e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -622,7 +622,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/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 8dd693624ac..07a5ff606bc 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -48,7 +48,7 @@ class PropaleStats extends Stats * Constructor * * @param DoliDB $db Database handler - * @param int $socid Id third party for filter + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. * @param int $userid Id user for filter (creation user) */ function __construct($db, $socid=0, $userid=0) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 312e958a38e..1ab418a9daa 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -48,7 +48,7 @@ class CommandeStats extends Stats * Constructor * * @param DoliDB $db Database handler - * @param int $socid Id third party for filter + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 5d8d22cfa9d..b2fd603a394 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -45,7 +45,7 @@ class FactureStats extends Stats * Constructor * * @param DoliDB $db Database handler - * @param int $socid Id third party for filter + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ @@ -168,7 +168,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; $sql.= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql.= " AND ".$this->where; $sql.= " GROUP BY dm"; @@ -188,7 +188,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg"; $sql.= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; $sql.= " GROUP BY year"; $sql.= $this->db->order('year','DESC'); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 558b83ed53f..99de75c6d26 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 b1e22110f5e..08e92af45e8 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 0c1ccc86d61..61d992b32aa 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_soc = sp.fk_soc"; diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php index 56134d38932..631f06ec8f2 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/install/upgrade2.php b/htdocs/install/upgrade2.php index f42e55cb697..a5d43a0d95e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3830,7 +3830,6 @@ 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 Service module"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; if ($res) { $mod=new modService($db); @@ -3841,7 +3840,6 @@ 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 Commande module"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; if ($res) { $mod=new modCommande($db); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0b4b399e31f..fce013be146 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1226,6 +1226,7 @@ ContractsNumberingModules=Contracts numbering modules TemplatePDFContracts=Contracts documents models FreeLegalTextOnContracts=Free text on contracts WatermarkOnDraftContractCards=Watermark on draft contracts (none if empty) +ContractsAndServices=List of contracts and services ##### Members ##### MembersSetup=Members module setup MemberMainOptions=Main options