commit
4d1555f4ca
@ -347,7 +347,7 @@ if ($object->fetch($id) >= 0)
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?action=clear&rowid='.$object->id.'" method="POST">';
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?action=clear&id='.$object->id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print_titre($langs->trans("ToClearAllRecipientsClickHere"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -72,6 +72,7 @@ class Contact extends CommonObject
|
||||
var $birthday;
|
||||
var $default_lang;
|
||||
var $note; // Private note
|
||||
var $no_email; // 1=Don't send e-mail to this contact, 0=do
|
||||
|
||||
var $ref_facturation; // Nb de reference facture pour lequel il est contact
|
||||
var $ref_contrat; // Nb de reference contrat pour lequel il est contact
|
||||
@ -250,6 +251,7 @@ class Contact extends CommonObject
|
||||
$sql .= ", priv = '".$this->priv."'";
|
||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
|
||||
$sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null");
|
||||
$sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"null");
|
||||
$sql .= " WHERE rowid=".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::update sql=".$sql,LOG_DEBUG);
|
||||
@ -468,7 +470,7 @@ class Contact extends CommonObject
|
||||
$sql.= " c.fk_departement,";
|
||||
$sql.= " c.birthday,";
|
||||
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,";
|
||||
$sql.= " c.priv, c.note, c.default_lang, c.canvas,";
|
||||
$sql.= " c.priv, c.note, c.default_lang, c.no_email, c.canvas,";
|
||||
$sql.= " c.import_key,";
|
||||
$sql.= " p.libelle as country, p.code as country_code,";
|
||||
$sql.= " d.nom as state, d.code_departement as state_code,";
|
||||
@ -536,6 +538,7 @@ class Contact extends CommonObject
|
||||
$this->birthday = $this->db->jdate($obj->birthday);
|
||||
$this->note = $obj->note;
|
||||
$this->default_lang = $obj->default_lang;
|
||||
$this->no_email = $obj->no_email;
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
$this->canvas = $obj->canvas;
|
||||
|
||||
@ -146,6 +146,7 @@ if (empty($reshook))
|
||||
$object->phone_mobile = $_POST["phone_mobile"];
|
||||
$object->fax = $_POST["fax"];
|
||||
$object->jabberid = $_POST["jabberid"];
|
||||
$object->no_email = $_POST["no_email"];
|
||||
$object->priv = $_POST["priv"];
|
||||
$object->note = $_POST["note"];
|
||||
|
||||
@ -237,6 +238,7 @@ if (empty($reshook))
|
||||
$object->phone_mobile = $_POST["phone_mobile"];
|
||||
$object->fax = $_POST["fax"];
|
||||
$object->jabberid = $_POST["jabberid"];
|
||||
$object->no_email = $_POST["no_email"];
|
||||
$object->priv = $_POST["priv"];
|
||||
$object->note = $_POST["note"];
|
||||
|
||||
@ -448,8 +450,9 @@ else
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party
|
||||
print '<tr><td>'.$langs->trans("Email").'</td><td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td></tr>';
|
||||
|
||||
// Instant message
|
||||
print '<tr><td>'.$langs->trans("IM").'</td><td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
||||
// Instant message and no email
|
||||
print '<tr><td>'.$langs->trans("IM").'</td><td><input name="jabberid" type="text" size="50" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
|
||||
print '<td>'.$langs->trans("No_Email").'</td><td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
||||
@ -623,7 +626,8 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Jabberid
|
||||
print '<tr><td>Jabberid</td><td colspan="3"><input name="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td></tr>';
|
||||
print '<tr><td>Jabberid</td><td><input name="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
|
||||
print '<td>'.$langs->trans("No_Email").'</td><td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
||||
@ -815,8 +819,9 @@ else
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Instant message
|
||||
print '<tr><td>'.$langs->trans("IM").'</td><td colspan="3">'.$object->jabberid.'</td></tr>';
|
||||
// Instant message and no email
|
||||
print '<tr><td>'.$langs->trans("IM").'</td><td>'.$object->jabberid.'</td>';
|
||||
print '<td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
|
||||
print $object->LibPubPriv($object->priv);
|
||||
|
||||
@ -77,6 +77,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$statssql[0].= " AND c.entity IN (".getEntity('societe', 1).")";
|
||||
$statssql[0].= " AND s.client IN (1, 3)";
|
||||
$statssql[0].= " AND c.email != ''"; // Note that null != '' is false
|
||||
$statssql[0].= " AND c.no_email = 0";
|
||||
|
||||
return $statssql;
|
||||
}
|
||||
@ -99,6 +100,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " WHERE s.rowid = c.fk_soc";
|
||||
$sql .= " AND c.entity IN (".getEntity('societe', 1).")";
|
||||
$sql .= " AND c.email != ''"; // Note that null != '' is false
|
||||
$sql .= " AND c.no_email = 0";
|
||||
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
@ -205,6 +207,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql.= " WHERE s.rowid = c.fk_soc";
|
||||
$sql.= " AND c.entity IN (".getEntity('societe', 1).")";
|
||||
$sql.= " AND c.email != ''";
|
||||
$sql.= " AND c.no_email = 0";
|
||||
foreach($filtersarray as $key)
|
||||
{
|
||||
if ($key == 'prospects') $sql.= " AND s.client=2";
|
||||
|
||||
@ -84,6 +84,7 @@ class mailing_contacts2 extends MailingTargets
|
||||
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE s.rowid = sp.fk_soc";
|
||||
$sql.= " AND sp.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND sp.no_email = 0";
|
||||
//$sql.= " AND sp.poste != ''";
|
||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$filtersarray[0]."'";
|
||||
@ -165,6 +166,7 @@ class mailing_contacts2 extends MailingTargets
|
||||
$sql.= " WHERE s.rowid = sp.fk_soc";
|
||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||
$sql.= " AND sp.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND sp.no_email = 0";
|
||||
//$sql.= " AND sp.poste != ''";
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
@ -189,6 +191,7 @@ class mailing_contacts2 extends MailingTargets
|
||||
$sql.= " WHERE s.rowid = sp.fk_soc";
|
||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||
$sql.= " AND sp.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND sp.no_email = 0";
|
||||
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
|
||||
$sql.= " GROUP BY sp.poste";
|
||||
$sql.= " ORDER BY sp.poste";
|
||||
|
||||
@ -85,6 +85,7 @@ class mailing_contacts3 extends MailingTargets
|
||||
if ($filtersarray[0] <> 'all') $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
|
||||
$sql.= " WHERE s.rowid = sp.fk_soc";
|
||||
$sql.= " AND sp.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND sp.no_email = 0";
|
||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
|
||||
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_societe = sp.fk_soc";
|
||||
@ -171,6 +172,7 @@ class mailing_contacts3 extends MailingTargets
|
||||
$sql.= " WHERE s.rowid = c.fk_soc";
|
||||
$sql.= " AND c.entity IN (".getEntity('societe', 1).")";
|
||||
$sql.= " AND c.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND c.no_email = 0";
|
||||
/*
|
||||
$sql = "SELECT count(distinct(sp.email)) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@ -207,6 +209,7 @@ class mailing_contacts3 extends MailingTargets
|
||||
$sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
|
||||
$sql.= " WHERE s.rowid = sp.fk_soc";
|
||||
$sql.= " AND sp.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND sp.no_email = 0";
|
||||
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
|
||||
$sql.= " AND cs.fk_categorie = c.rowid";
|
||||
$sql.= " AND cs.fk_societe = sp.fk_soc";
|
||||
|
||||
@ -71,3 +71,5 @@ ALTER TABLE llx_commande_fournisseur CHANGE fk_methode_commande fk_input_method
|
||||
INSERT INTO llx_const (name, value, type, note, visible) values ('PRODUCT_CODEPRODUCT_ADDON','mod_codeproduct_leopard','yesno','Module to control product codes',0);
|
||||
|
||||
ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity);
|
||||
|
||||
ALTER TABLE llx_socpeople ADD column no_email SMALLINT NOT NULL DEFAULT 0 AFTER priv;
|
||||
|
||||
@ -41,6 +41,7 @@ create table llx_socpeople
|
||||
fax varchar(30),
|
||||
email varchar(255),
|
||||
jabberid varchar(255),
|
||||
no_email smallint NOT NULL DEFAULT 0,
|
||||
priv smallint NOT NULL DEFAULT 0,
|
||||
fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement
|
||||
fk_user_modif integer,
|
||||
|
||||
@ -68,6 +68,7 @@ Phone=Phone
|
||||
PhonePro=Prof. phone
|
||||
PhonePerso=Pers. phone
|
||||
PhoneMobile=Mobile
|
||||
No_Email=Don't send e-mail
|
||||
Fax=Fax
|
||||
Zip=Zip Code
|
||||
Town=City
|
||||
|
||||
@ -70,6 +70,7 @@ Phone=Téléphone
|
||||
PhonePro=Tél pro.
|
||||
PhonePerso=Tél perso.
|
||||
PhoneMobile=Tél portable
|
||||
No_Email=Ne pas envoyer d'e-mail
|
||||
Fax=Fax
|
||||
Zip=Code postal
|
||||
Town=Ville
|
||||
|
||||
Loading…
Reference in New Issue
Block a user