Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
This commit is contained in:
Laurent Destailleur 2013-04-11 07:39:16 +02:00
commit 792341a4b8
21 changed files with 177 additions and 171 deletions

View File

@ -240,7 +240,9 @@ if ($socid)
}
// Address
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">'.nl2br($soc->address).'</td></tr>';
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">';
print dol_print_address($soc->address,'gmap','thirdparty',$object->id);
print '</td></tr>';
// Zip / Town
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->zip."</td>";

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -307,7 +307,7 @@ if ($object->fetch($id) >= 0)
print $modulename;
print "</td>";
*/
$nbofrecipient=$obj->getNbOfRecipients();
$nbofrecipient=$obj->getNbOfRecipients('');
print '<td align="center">';
if ($nbofrecipient >= 0)
{
@ -346,21 +346,8 @@ if ($object->fetch($id) >= 0)
print '</table>';
print '<br>';
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%">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="right"><input type="submit" class="button" value="'.$langs->trans("TargetsReset").'"></td>';
print '</tr>';
print '</table>';
print '</form>';
print '<br>';
}
// List of selected targets
print "\n<!-- Liste destinataires selectionnes -->\n";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -383,21 +370,23 @@ if ($object->fetch($id) >= 0)
{
$num = $db->num_rows($resql);
$parm = "&amp;id=".$object->id;
if ($search_lastname) $parm.= "&amp;search_lastname=".urlencode($search_lastname);
if ($search_firstname) $parm.= "&amp;search_firstname=".urlencode($search_firstname);
if ($search_email) $parm.= "&amp;search_email=".urlencode($search_email);
$param = "&amp;id=".$object->id;
if ($search_lastname) $param.= "&amp;search_lastname=".urlencode($search_lastname);
if ($search_firstname) $param.= "&amp;search_firstname=".urlencode($search_firstname);
if ($search_email) $param.= "&amp;search_email=".urlencode($search_email);
print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$parm,$sortfield,$sortorder,"",$num,$object->nbemail,'');
$cleartext='<br></div><div>'.$langs->trans("ToClearAllRecipientsClickHere").': '.'<input type="submit" class="button" value="'.$langs->trans("TargetsReset").'">';
if ($page) $parm.= "&amp;page=".$page;
print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,'');
if ($page) $param.= "&amp;page=".$page;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.lastname",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$parm,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$param,"",'align="center"',$sortfield,$sortorder);
// Date sendinf
if ($object->statut < 2)
@ -406,11 +395,11 @@ if ($object->fetch($id) >= 0)
}
else
{
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$parm,'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder);
}
// Statut
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$parm,'','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder);
print '</tr>';
@ -496,7 +485,7 @@ if ($object->fetch($id) >= 0)
print '<td align="center">&nbsp;</td>';
print '<td align="right" nowrap="nowrap">'.$langs->trans("MailingStatusNotSent");
if ($user->rights->mailing->creer) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$parm.'">'.img_delete($langs->trans("RemoveRecipient"));
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient"));
}
print '</td>';
}

View File

@ -541,6 +541,7 @@ class Contact extends CommonObject
$this->mail = $obj->email;
$this->birthday = $this->db->jdate($obj->birthday);
$this->note = $obj->note_private; // deprecated
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->default_lang = $obj->default_lang;

View File

@ -66,6 +66,13 @@ if ($action == 'add')
$mesg[]=$langs->trans("ErrorNoValueForSelectType");
$action = 'create';
}
if (GETPOST('type')=='sellist' && !GETPOST('param'))
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorNoValueForSelectListType");
$action = 'create';
}
if (GETPOST('type')=='checkbox' && !GETPOST('param'))
{
$error++;
@ -82,30 +89,30 @@ if ($action == 'add')
}
if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox') || (GETPOST('type')=='radio')) && GETPOST('param'))
{
// Construct array for parameter (value of select list)
$parameters = GETPOST('param');
$parameters_array = explode("\r\n",$parameters);
foreach($parameters_array as $param_ligne)
{
if (!empty($param_ligne)) {
if (preg_match_all('/,/',$param_ligne,$matches))
{
if (count($matches[0])>1) {
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorBadFormatValueList",$param_ligne);
$action = 'create';
}
}
else
{
// Construct array for parameter (value of select list)
$parameters = GETPOST('param');
$parameters_array = explode("\r\n",$parameters);
foreach($parameters_array as $param_ligne)
{
if (!empty($param_ligne)) {
if (preg_match_all('/,/',$param_ligne,$matches))
{
if (count($matches[0])>1) {
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorBadFormatValueList",$param_ligne);
$action = 'create';
}
}
}
}
else
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorBadFormatValueList",$param_ligne);
$action = 'create';
}
}
}
}
if (! $error)
@ -114,6 +121,7 @@ if ($action == 'add')
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
{
// Construct array for parameter (value of select list)
$default_value = GETPOST('default_value');
$parameters = GETPOST('param');
$parameters_array = explode("\r\n",$parameters);
foreach($parameters_array as $param_ligne)
@ -186,6 +194,13 @@ if ($action == 'update')
$mesg[]=$langs->trans("ErrorNoValueForSelectType");
$action = 'edit';
}
if (GETPOST('type')=='sellist' && !GETPOST('param'))
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorNoValueForSelectListType");
$action = 'edit';
}
if (GETPOST('type')=='checkbox' && !GETPOST('param'))
{
$error++;
@ -291,4 +306,4 @@ if ($action == 'delete')
}
}
?>
?>

View File

@ -252,18 +252,20 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
// Ajout trace sur requete (eventuellement a commenter si beaucoup de requetes)
if (! $silent) print '<tr><td valign="top">'.$langs->trans("Request").' '.($i+1)." sql='".dol_htmlentities($newsql,ENT_NOQUOTES)."'</td></tr>\n";
dol_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
$sqlmodified=0;
// Replace for encrypt data
if (preg_match_all('/__ENCRYPT\(\'([A-Za-z0-9_\"\[\]]+)\'\)__/i',$newsql,$reg))
if (preg_match_all('/__ENCRYPT\(\'([^\']+)\'\)__/i',$newsql,$reg))
{
$num=count($reg[0]);
for($i=0;$i<$num;$i++)
for($j=0;$j<$num;$j++)
{
$from = $reg[0][$i];
$to = $db->encrypt($reg[1][$i],1);
$from = $reg[0][$j];
$to = $db->encrypt($reg[1][$j],1);
$newsql = str_replace($from,$to,$newsql);
}
$sqlmodified++;
}
// Replace for decrypt data
@ -271,12 +273,13 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
{
$num=count($reg[0]);
for($i=0;$i<$num;$i++)
for($j=0;$j<$num;$j++)
{
$from = $reg[0][$i];
$to = $db->decrypt($reg[1][$i]);
$from = $reg[0][$j];
$to = $db->decrypt($reg[1][$j]);
$newsql = str_replace($from,$to,$newsql);
}
$sqlmodified++;
}
// Replace __x__ with rowid of insert nb x
@ -294,9 +297,11 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
$from='__'.$cursor.'__';
$to=$listofinsertedrowid[$cursor];
$newsql=str_replace($from,$to,$newsql);
dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.') sql='.$newsql, LOG_DEBUG);
$sqlmodified++;
}
if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
$result=$db->query($newsql,$usesavepoint);
if ($result)
{

View File

@ -1,7 +1,6 @@
#!/usr/bin/php
<?php
/*
* Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,22 +28,23 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
/**
* Function to build a compiled PDF
*
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
*
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @param string $diroutputpdf Dir to output file
* @param string $newlangid Lang id
* @param array $filter Array with filters
* @param date $dateafterdate Invoice after date
* @param date $dateafterdate Invoice after date
* @param date $datebeforedate Invoice before date
* @param date $paymentdateafter Payment after date
* @param date $paymentdatebefore Payment before date
* @param int $usestdout Add information onto standard output
* @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template,
* @return int Error code
* @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template
* @param string $option Suffix to add into file name of generated PDF
* @return int Error code
*/
function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0)
function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $option='')
{
$sql = "SELECT DISTINCT f.rowid, f.facnumber";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
@ -104,19 +104,19 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
}
if ($sqlwhere) $sql.=$sqlwhere;
if ($sqlorder) $sql.=$sqlorder;
//print $sql; exit;
dol_syslog("scripts/invoices/rebuild_merge.php: sql=".$sql);
if ($usestdout) print '--- start'."\n";
// Start of transaction
//$db->begin();
$error = 0;
$result = 0;
$files = array() ; // liste les fichiers
dol_syslog("scripts/invoices/rebuild_merge.php sql=".$sql);
if ( $resql=$db->query($sql) )
{
@ -125,16 +125,16 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
$oldemail = '';
$message = '';
$total = '';
if ($num)
{
// First loop on each resultset to build PDF
// -----------------------------------------
while ($cpt < $num)
{
$obj = $db->fetch_object($resql);
$fac = new Facture($db);
$result=$fac->fetch($obj->rowid);
if ($result > 0)
@ -157,35 +157,35 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
else {
if ($usestdout) print "PDF for invoice ".$obj->facnumber." already exists\n";
}
// Add file into files array
$files[] = $filename;
}
if ($result <= 0)
{
$error++;
if ($usestdout) print "Error: Failed to build PDF for invoice ".$fac->ref."\n";
else dol_syslog("Failed to build PDF for invoice ".$fac->ref, LOG_ERR);
if ($usestdout) print "Error: Failed to build PDF for invoice ".($fac->ref?$fac->ref:' id '.$obj->rowid)."\n";
else dol_syslog("Failed to build PDF for invoice ".($fac->ref?$fac->ref:' id '.$obj->rowid), LOG_ERR);
}
$cpt++;
}
// Define format of output PDF
// Define format of output PDF
$formatarray=pdf_getFormat();
$page_largeur = $formatarray['width'];
$page_hauteur = $formatarray['height'];
$format = array($page_largeur,$page_hauteur);
if ($usestdout) print "Using output PDF format ".join('x',$format)."\n";
else dol_syslog("Using output PDF format ".join('x',$format), LOG_ERR);
// Now, build a merged files with all files in $files array
//---------------------------------------------------------
// Create empty PDF
$pdf=pdf_getInstance($format);
if (class_exists('TCPDF'))
@ -193,12 +193,12 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
$pdf->SetFont(pdf_getPDFFont($langs));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
//$pdf->SetCompression(false);
//$pdf->Open();
//$pdf->AddPage();
//$title=$langs->trans("BillsCustomersUnpaid");
@ -224,21 +224,26 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
// Create output dir if not exists
dol_mkdir($diroutputpdf);
// Save merged file
$filename='mergedpdf';
if (! empty($option)) $filename.='_'.$option;
if ($pagecount)
$file=$diroutputpdf.'/'.$filename.'.pdf';
if (! $error && $pagecount)
{
$file=$diroutputpdf.'/'.$filename.'.pdf';
$pdf->Output($file,'F');
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
}
if ($usestdout) print "Merged PDF has been built in ".$file."\n";
if ($usestdout)
{
if (! $error) print "Merged PDF has been built in ".$file."\n";
else print "Can't build PDF ".$file."\n";
}
$result = 1;
}
else
@ -254,7 +259,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
dol_syslog("scripts/invoices/rebuild_merge.php: Error");
$error++;
}
if ($error) return -1;
else return $result;
}

View File

@ -71,11 +71,8 @@ class mailing_contacts1 extends MailingTargets
$statssql=array();
$statssql[0] = "SELECT '".$langs->trans("NbOfCompaniesContacts")."' as label,";
$statssql[0].= " count(distinct(c.email)) as nb";
$statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$statssql[0].= " ".MAIN_DB_PREFIX."societe as s";
$statssql[0].= " WHERE s.rowid = c.fk_soc";
$statssql[0].= " AND c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND s.client IN (1, 3)";
$statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$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";
@ -96,12 +93,11 @@ class mailing_contacts1 extends MailingTargets
global $conf;
$sql = "SELECT count(distinct(c.email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
$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.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql.= " WHERE 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
@ -203,10 +199,9 @@ class mailing_contacts1 extends MailingTargets
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
$sql.= " c.lastname, c.firstname, c.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND c.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''";
$sql.= " AND c.no_email = 0";
foreach($filtersarray as $key)

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011 François Cerbelle <francois@cerbelle.net>
/* Copyright (C) 2011 François Cerbelle <francois@cerbelle.net>
* Copyright (C) 2013 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -80,14 +81,13 @@ class mailing_contacts2 extends MailingTargets
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= " sp.lastname, sp.firstname as firstname, sp.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$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.poste != ''";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$filtersarray[0]."'";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.lastname, sp.firstname";
$resql = $this->db->query($sql);
if ($resql)
@ -162,10 +162,9 @@ class mailing_contacts2 extends MailingTargets
// Number with a filter are show in the combo list for each filter.
// If we want a filter "a position is defined", we must add it into formFilter
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$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.poste != ''";
@ -187,10 +186,8 @@ class mailing_contacts2 extends MailingTargets
$langs->load("companies");
$sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$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.poste IS NOT NULL AND sp.poste != '')";

View File

@ -79,12 +79,11 @@ class mailing_contacts3 extends MailingTargets
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= " sp.lastname, sp.firstname, sp.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c,";
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.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c";
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
$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.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
@ -168,10 +167,9 @@ class mailing_contacts3 extends MailingTargets
// Number with a filter are show in the combo list for each filter.
// If we want a filter "is inside at least one category", we must add it into formFilter
$sql = "SELECT count(distinct(c.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND c.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
/*
@ -205,11 +203,9 @@ class mailing_contacts3 extends MailingTargets
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."categorie as c,";
$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.= " WHERE 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";

View File

@ -82,7 +82,7 @@ class mailing_pomme extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @param string $sql SQL request to use to count
* @return int Number of recipients
*/
function getNbOfRecipients($sql='')

View File

@ -175,7 +175,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Request
* @param string $sql SQL request to use to count
* @return int Number of recipients
*/
function getNbOfRecipients($sql='')

View File

@ -26,18 +26,18 @@ create table llx_adherent_type_extrafields
) ENGINE=innodb;
ALTER TABLE llx_adherent_type_extrafields ADD INDEX idx_adherent_type_extrafields (fk_object);
UPDATE llx_const set value='eldy_menu.php' where value='eldy_backoffice.php';
UPDATE llx_const set value='eldy_menu.php' where value='eldy_frontoffice.php';
UPDATE llx_const set value='auguria_menu.php' where value='auguria_backoffice.php';
UPDATE llx_const set value='auguria_menu.php' where value='auguria_frontoffice.php';
UPDATE llx_const set value='smartphone_menu.php' where value='smartphone_backoffice.php';
UPDATE llx_const set value='smartphone_menu.php' where value='smartphone_frontoffice.php';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_ADDRESS' where name='MAIN_INFO_SOCIETE_ADRESSE';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_TOWN' where name='MAIN_INFO_SOCIETE_VILLE';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_ZIP' where name='MAIN_INFO_SOCIETE_CP';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_COUNTRY' where name='MAIN_INFO_SOCIETE_PAYS';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_STATE' where name='MAIN_INFO_SOCIETE_DEPARTEMENT';
UPDATE llx_const set name='LIVRAISON_ADDON_NUMBER' where name='LIVRAISON_ADDON';
UPDATE llx_const set value = __ENCRYPT('eldy_menu.php')__ where __DECRYPT('value')__ = 'eldy_backoffice.php';
UPDATE llx_const set value = __ENCRYPT('eldy_menu.php')__ where __DECRYPT('value')__ = 'eldy_frontoffice.php';
UPDATE llx_const set value = __ENCRYPT('auguria_menu.php')__ where __DECRYPT('value')__ = 'auguria_backoffice.php';
UPDATE llx_const set value = __ENCRYPT('auguria_menu.php')__ where __DECRYPT('value')__ = 'auguria_frontoffice.php';
UPDATE llx_const set value = __ENCRYPT('smartphone_menu.php')__ where __DECRYPT('value')__ = 'smartphone_backoffice.php';
UPDATE llx_const set value = __ENCRYPT('smartphone_menu.php')__ where __DECRYPT('value')__ = 'smartphone_frontoffice.php';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_ADDRESS')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_ADRESSE';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_TOWN')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_VILLE';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_ZIP')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_CP';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_COUNTRY')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_PAYS';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_STATE')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_DEPARTEMENT';
UPDATE llx_const set name = __ENCRYPT('LIVRAISON_ADDON_NUMBER')__ where __DECRYPT('name')__ = 'LIVRAISON_ADDON';
ALTER TABLE llx_user add COLUMN fk_user integer;

View File

@ -82,16 +82,16 @@ ActivateCheckReadKey=Key use to encrypt URL use for "Read Receipt" and "Unsubcri
EMailSentToNRecipients=EMail sent to %s recipients.
# Libelle des modules de liste de destinataires mailing
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
MailingModuleDescContactCompanies=Contacts/addresses of all third parties (customer, prospect, supplier, ...)
MailingModuleDescDolibarrUsers=Dolibarr users
MailingModuleDescFundationMembers=Foundation members with emails
MailingModuleDescEmailsFromFile=EMails from a text file (email;lastname;firstname;other)
MailingModuleDescEmailsFromUser=EMails from user input (email;lastname;firstname;other)
MailingModuleDescContactsCategories=Third parties (by category)
MailingModuleDescDolibarrContractsLinesExpired=Third parties with expired contract's lines
MailingModuleDescContactsByCompanyCategory=Contacts of third parties (by third parties category)
MailingModuleDescContactsByCompanyCategory=Contacts/addresses of third parties (by third parties category)
MailingModuleDescMembersCategories=Foundation members (by categories)
MailingModuleDescContactsByFunction=Contacts of third parties (by position/function)
MailingModuleDescContactsByFunction=Contacts/addresses of third parties (by position/function)
LineInFile=Line %s in file
@ -100,7 +100,7 @@ MailSelectedRecipients=Selected recipients
MailingArea=EMailings area
LastMailings=Last %s emailings
TargetsStatistics=Targets statistics
NbOfCompaniesContacts=Unique contacts of companies
NbOfCompaniesContacts=Unique contacts/addresses
MailNoChangePossible=Recipients for validated emailing can't be changed
SearchAMailing=Search mailing
SendMailing=Send emailing

View File

@ -99,7 +99,7 @@ MailSelectedRecipients=Destinataires sélectionnés
MailingArea=Espace emailings
LastMailings=Les %s derniers emailings
TargetsStatistics=Statistiques destinataires
NbOfCompaniesContacts=Contacts uniques des sociétés
NbOfCompaniesContacts=Contacts/adresses uniques
MailNoChangePossible=Destinataires d'un mailing validé non modifiables
SearchAMailing=Rechercher un mailing
SendMailing=Envoi emailing

View File

@ -106,7 +106,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans('ThirdPartyName').'</td>';
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';

View File

@ -133,7 +133,7 @@ if ($object->id)
print '<table class="border"width="100%">';
// Ref
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td>';
print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';

View File

@ -92,7 +92,7 @@ if ($id > 0)
print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
@ -121,11 +121,12 @@ if ($id > 0)
}
print "</table>";
print '<br>';
$colwidth='25';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end();
}

View File

@ -141,7 +141,7 @@ if ($result > 0)
print '<table class="border"width="100%">';
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
@ -169,7 +169,7 @@ if ($result > 0)
print '</td></tr>';
}
print '<tr><td width="30%">'.$langs->trans("NbOfActiveNotifications").'</td>';
print '<tr><td>'.$langs->trans("NbOfActiveNotifications").'</td>';
print '<td colspan="3">';
$sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";

View File

@ -1465,7 +1465,7 @@ else
*/
// Name
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
print '</td>';

View File

@ -174,6 +174,7 @@ select.flat {
border-top:solid 1px rgba(0,0,0,.4);
border-bottom:solid 1px rgba(0,0,0,.2);
box-shadow:1px 1px 2px rgba(0,0,0,.2) inset;
background: #FDFDFD;
}
form {

View File

@ -36,7 +36,6 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
// After this $db is an opened handler to database. We close it at end of file.
require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
@ -179,7 +178,7 @@ if (in_array('payments',$filter) && in_array('nopayment',$filter))
// Define SQL and SQL request to select invoices
// Use $filter, $dateafterdate, datebeforedate, $paymentdateafter, $paymentdatebefore
$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate);
$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate, $option);