diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index b1532f5d7d7..ddc7079c786 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -240,7 +240,9 @@ if ($socid) } // Address - print ''.$langs->trans('Address').''.nl2br($soc->address).''; + print ''.$langs->trans('Address').''; + print dol_print_address($soc->address,'gmap','thirdparty',$object->id); + print ''; // Zip / Town print ''.$langs->trans('Zip').''.$soc->zip.""; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 95bb905348f..22c7de7c5f2 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2010 Laurent Destailleur + * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -307,7 +307,7 @@ if ($object->fetch($id) >= 0) print $modulename; print ""; */ - $nbofrecipient=$obj->getNbOfRecipients(); + $nbofrecipient=$obj->getNbOfRecipients(''); print ''; if ($nbofrecipient >= 0) { @@ -346,21 +346,8 @@ if ($object->fetch($id) >= 0) print ''; print '
'; - - print '
'; - print ''; - print_titre($langs->trans("ToClearAllRecipientsClickHere")); - print ''; - print ''; - print ''; - print ''; - print '
'; - print '
'; - print '
'; } - - // List of selected targets print "\n\n"; print '
'; @@ -383,21 +370,23 @@ if ($object->fetch($id) >= 0) { $num = $db->num_rows($resql); - $parm = "&id=".$object->id; - if ($search_lastname) $parm.= "&search_lastname=".urlencode($search_lastname); - if ($search_firstname) $parm.= "&search_firstname=".urlencode($search_firstname); - if ($search_email) $parm.= "&search_email=".urlencode($search_email); + $param = "&id=".$object->id; + if ($search_lastname) $param.= "&search_lastname=".urlencode($search_lastname); + if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname); + if ($search_email) $param.= "&search_email=".urlencode($search_email); - print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$parm,$sortfield,$sortorder,"",$num,$object->nbemail,''); + $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; - if ($page) $parm.= "&page=".$page; + print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,''); + + if ($page) $param.= "&page=".$page; print ''; print ''; - 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 ''; @@ -496,7 +485,7 @@ if ($object->fetch($id) >= 0) print ''; print ''; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 65c0407cb97..a41aaf6b366 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -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; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php index 02eab4db893..0b608a1e736 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/admin_extrafields.inc.php @@ -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') } } -?> \ No newline at end of file +?> diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 978f0896f65..0d4bbcf6d7a 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -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 '\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) { diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index a73855accb4..057dffd7d13 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -1,7 +1,6 @@ -#!/usr/bin/php + * Copyright (C) 2009-2013 Laurent Destailleur * * 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; } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 3c44c5e15ce..f45969ea564 100755 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -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) diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php index 955a126912b..5a25a11e590 100755 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ b/htdocs/core/modules/mailings/contacts2.modules.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2011 François Cerbelle + * Copyright (C) 2013 Regis Houssin * * 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 != '')"; diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php index b1955aa981e..600a855c975 100755 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ b/htdocs/core/modules/mailings/contacts3.modules.php @@ -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"; diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 6e645b3581c..30c7c63da60 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -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='') diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index b9d8feccd5c..450773a2566 100755 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -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='') diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 42cd9a10f08..bd1bd8693ce 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -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; diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index f143a7fa167..f52dea49651 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -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 diff --git a/htdocs/langs/fr_FR/mails.lang b/htdocs/langs/fr_FR/mails.lang index be08ccad7e8..a94aa8ff149 100644 --- a/htdocs/langs/fr_FR/mails.lang +++ b/htdocs/langs/fr_FR/mails.lang @@ -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 diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index f3538c6e266..7c0a4c0332f 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -106,7 +106,7 @@ print ''; print ''; print '
 '.$langs->trans("MailingStatusNotSent"); if ($user->rights->mailing->creer) { - print ''.img_delete($langs->trans("RemoveRecipient")); + print ''.img_delete($langs->trans("RemoveRecipient")); } print '
'.$langs->trans("Request").' '.($i+1)." sql='".dol_htmlentities($newsql,ENT_NOQUOTES)."'
'; -print ''; +print ''; print ''; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index ca5582b4dee..f9703044257 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -133,7 +133,7 @@ if ($object->id) print '
'.$langs->trans('ThirdPartyName').'
'.$langs->trans('ThirdPartyName').''; print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); print '
'; // Ref - print ''; + print ''; print ''; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index e24fa8a8cdc..8fbd6c6187f 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -92,7 +92,7 @@ if ($id > 0) print '
'.$langs->trans("ThirdPartyName").'
'.$langs->trans("ThirdPartyName").''; print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); print '
'; - print ''; + print ''; print ''; @@ -121,11 +121,12 @@ if ($id > 0) } print "
'.$langs->trans('ThirdPartyName').'
'.$langs->trans('ThirdPartyName').''; print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); print '
"; - + print '
'; - + + $colwidth='25'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - + dol_fiche_end(); } diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index 2499ae30a5b..a0ab078e315 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -141,7 +141,7 @@ if ($result > 0) print ''; - print ''; @@ -169,7 +169,7 @@ if ($result > 0) print ''; } - print ''; + print ''; print ''; + print ''; print ''; diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 41f96d10d20..e1501152c2d 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -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 { diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index f4984331a51..6360735ab67 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -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);
'.$langs->trans("ThirdPartyName").''; + print '
'.$langs->trans("ThirdPartyName").''; print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); print '
'.$langs->trans("NbOfActiveNotifications").'
'.$langs->trans("NbOfActiveNotifications").''; $sql = "SELECT COUNT(n.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index ceef3ec324e..0ee8d7d0f8c 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1465,7 +1465,7 @@ else */ // Name - print '
'.$langs->trans('ThirdPartyName').'
'.$langs->trans('ThirdPartyName').''; print $form->showrefnav($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); print '