diff --git a/INSTALL b/INSTALL
index 56866a05d4e..584c3f04713 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,6 @@
INSTALL
-------
-English: See README file.
+English: See README.md file.
-French: Voir fichier README-FR.
+French: Voir fichier README-FR.md.
diff --git a/README-FR.md b/README-FR.md
index aa8c3c1f5da..8d3d7f36aa9 100644
--- a/README-FR.md
+++ b/README-FR.md
@@ -1,21 +1,16 @@
# DOLIBARR ERP & CRM
-## INTRODUCTION
-
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).

---------------------------------
-Documentation démarrage rapide
---------------------------------
-1) Installer Dolibarr
-2) Mettre à jour Dolibarr depuis une ancienne version
-3) Ce qui est nouveau dans cette version
-4) Ce que peux faire Dolibarr
-5) Ce que ne peux pas faire Dolibarr (pas encore)
+
+## LICENCE
+
+Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
+
## INSTALLER DOLIBARR
diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php
index 8fd0795c262..2954047e310 100644
--- a/htdocs/accountancy/admin/export.php
+++ b/htdocs/accountancy/admin/export.php
@@ -42,7 +42,7 @@ if (!$user->admin)
$action = GETPOST('action', 'alpha');
-// Other parameters ACCOUNTING_*
+// Other parameters ACCOUNTING_EXPORT_*
$list = array (
'ACCOUNTING_EXPORT_SEPARATORCSV',
'ACCOUNTING_EXPORT_DATE',
@@ -114,20 +114,24 @@ print '';
$var = ! $var;
print '
";
+
+ // End of page
+ llxFooter();
}
-// End of page
-llxFooter();
-
$db->close();
\ No newline at end of file
diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php
index 0831571ace1..721692145a1 100644
--- a/htdocs/admin/tools/export.php
+++ b/htdocs/admin/tools/export.php
@@ -480,10 +480,10 @@ function backup_tables($outputfile, $tables='*')
if ($row[$j] == null and !is_string($row[$j])) {
// IMPORTANT: if the field is NULL we set it NULL
$row[$j] = 'NULL';
- } elseif(is_string($row[$j]) and $row[$j] == '') {
+ } elseif(is_string($row[$j]) && $row[$j] == '') {
// if it's an empty string, we set it as an empty string
$row[$j] = "''";
- } elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
+ } elseif(is_numeric($row[$j]) && !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
// if it's a number, we return it as-is
// $row[$j] = $row[$j];
} else { // else for all other cases we escape the value and put quotes around
diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php
index 5a156b1eda7..349b32d5104 100644
--- a/htdocs/core/class/rssparser.class.php
+++ b/htdocs/core/class/rssparser.class.php
@@ -550,7 +550,7 @@ class RssParser
//
elseif ($this->_format == 'atom' and $el == 'link' )
{
- if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
+ if ( isset($attrs['rel']) && $attrs['rel'] == 'alternate' )
{
$link_el = 'link';
}
diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php
index 03264601624..c8ffd4bef7d 100644
--- a/htdocs/core/datepicker.php
+++ b/htdocs/core/datepicker.php
@@ -26,13 +26,13 @@
* \brief File to manage popup date selector
*/
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
+if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // disabled
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
-if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
+if (! defined('NOLOGIN')) define('NOLOGIN',1); // disabled
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
@@ -188,26 +188,13 @@ function displayBox($selectedDate,$month,$year)
load("orders");
$outputlangs->load("deliveries");
+ $nblignes = count($object->lines);
+
if ($conf->commande->dir_output)
{
$object->fetch_thirdparty();
@@ -195,8 +197,6 @@ class pdf_einstein extends ModelePDFCommandes
global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
- $nblignes = count($object->lines);
-
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
@@ -328,6 +328,7 @@ class pdf_einstein extends ModelePDFCommandes
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc);
+ $pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
@@ -511,11 +512,6 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->Output($file,'F');
// Add pdfgeneration hook
- if (! is_object($hookmanager))
- {
- include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
- $hookmanager=new HookManager($this->db);
- }
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
@@ -797,7 +793,7 @@ class pdf_einstein extends ModelePDFCommandes
//{
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{
- if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
+ if (in_array((string) $localtax_type, array('1','3','5'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey!=0) // On affiche pas taux 0
@@ -828,7 +824,7 @@ class pdf_einstein extends ModelePDFCommandes
//{
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{
- if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
+ if (in_array((string) $localtax_type, array('1','3','5'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey!=0) // On affiche pas taux 0
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index bd6ec1b60e9..9f2bf42c98d 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -96,7 +96,7 @@ class pdf_soleil extends ModelePDFFicheinter
/**
* Function to build pdf onto disk
*
- * @param CommonObject $object Id of object to generate
+ * @param Object $object Object to generate
* @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
@@ -106,7 +106,7 @@ class pdf_soleil extends ModelePDFFicheinter
*/
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{
- global $user,$langs,$conf,$mysoc;
+ global $user,$langs,$conf,$mysoc,$db,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@@ -121,16 +121,24 @@ class pdf_soleil extends ModelePDFFicheinter
{
$object->fetch_thirdparty();
- $objectref = dol_sanitizeFileName($object->ref);
- $dir = $conf->ficheinter->dir_output;
- if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
- $file = $dir . "/" . $objectref . ".pdf";
-
+ // Definition of $dir and $file
+ if ($object->specimen)
+ {
+ $dir = $conf->ficheinter->dir_output;
+ $file = $dir . "/SPECIMEN.pdf";
+ }
+ else
+ {
+ $objectref = dol_sanitizeFileName($object->ref);
+ $dir = $conf->ficheinter->dir_output . "/" . $objectref;
+ $file = $dir . "/" . $objectref . ".pdf";
+ }
+
if (! file_exists($dir))
{
if (dol_mkdir($dir) < 0)
{
- $this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
+ $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
return 0;
}
}
@@ -149,6 +157,9 @@ class pdf_soleil extends ModelePDFFicheinter
global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+ $nblignes = count($object->lines);
+
+ // Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
@@ -196,12 +207,13 @@ class pdf_soleil extends ModelePDFFicheinter
$tab_height_newpage = 150;
// Affiche notes
- if (! empty($object->note_public))
+ $notetoshow=empty($object->note_public)?'':$object->note_public;
+ if ($notetoshow)
{
$tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1);
- $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
+ $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
@@ -252,15 +264,17 @@ class pdf_soleil extends ModelePDFFicheinter
$valide = empty($objectligne->id) ? 0 : $objectligne->fetch($objectligne->id);
if ($valide > 0 || $object->specimen)
{
- $curX = $this->posxdesc-1;
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
$pdf->setTopMargin($tab_top_newpage);
- $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext/*+$heightforinfotot*/); // The only function to edit the bottom margin of current page to set it.
+ $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage();
+ // Description of product line
+ $curX = $this->posxdesc-1;
+
// Description of product line
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
if ($objectligne->duration > 0)
@@ -288,6 +302,8 @@ class pdf_soleil extends ModelePDFFicheinter
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('','',true);
+ if (! empty($tplidx)) $pdf->useTemplate($tplidx);
+ if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1);
}
}
@@ -316,33 +332,34 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->setPage($pagenb);
if ($pagenb == 1)
{
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
- $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1);
+ $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++;
$pdf->setPage($pagenb);
- $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
+ if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1);
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
}
else
{
- $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1);
+ $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
// New page
$pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++;
+ if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
}
}
}
@@ -350,13 +367,13 @@ class pdf_soleil extends ModelePDFFicheinter
// Show square
if ($pagenb == 1)
{
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfreetext - $heightforfooter - 50, 0, $outputlangs, 0, 0);
- $bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
+ $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
else
{
- $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfreetext - $heightforfooter - 50, 0, $outputlangs, 1, 0);
- $bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
+ $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
+ $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
$this->_pagefoot($pdf,$object,$outputlangs);
@@ -364,6 +381,13 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->Close();
$pdf->Output($file,'F');
+
+ // Add pdfgeneration hook
+ $hookmanager->initHooks(array('pdfgeneration'));
+ $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
+ global $action;
+ $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php
index cef4155c607..9268a10f3c4 100644
--- a/htdocs/core/modules/member/doc/pdf_standard.class.php
+++ b/htdocs/core/modules/member/doc/pdf_standard.class.php
@@ -137,7 +137,7 @@ class pdf_standard
$imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker)
// We are in a new page, then we must add a page
- if (($this->_COUNTX ==0) and ($this->_COUNTY==0) and (!$this->_First==1)) {
+ if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) {
$pdf->AddPage();
}
$this->_First=0;
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index d683d4bb271..70a52dc90e1 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -129,7 +129,7 @@ class modAccounting extends DolibarrModules
$this->const[9] = array(
"ACCOUNTING_EXPORT_MODELCSV",
"chaine",
- "0"
+ "1"
);
$this->const[10] = array(
"ACCOUNTING_LENGTH_GACCOUNT",
diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
index 8ae45bdc681..193de960bb8 100644
--- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
+++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
@@ -135,7 +135,7 @@ class pdf_standardlabel
$imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker)
// We are in a new page, then we must add a page
- if (($this->_COUNTX ==0) and ($this->_COUNTY==0) and (!$this->_First==1)) {
+ if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) {
$pdf->AddPage();
}
$this->_First=0;
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index f4a270cca00..d9539f17eb4 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -882,7 +882,7 @@ if ($action == 'create')
if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0;
}
- if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[$warehouse_id])))
+ if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() && is_object($product->stock_warehouse[$warehouse_id])))
{
// Quantity to send
print '
';
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 1209debde92..9748f9a4fc8 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -960,7 +960,7 @@ class Fichinter extends CommonObject
$this->note_private='Private note';
$this->note_public='SPECIMEN';
$this->duree = 0;
- $nbp = 20;
+ $nbp = 25;
$xnbp = 0;
while ($xnbp < $nbp)
{
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index e1713acd57c..b09dab7f764 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -13,7 +13,9 @@ ConfigAccountingExpert=Configuration of the module accounting expert
Journaux=Journals
JournalFinancial=Financial journals
Exports=Exports
+Export=Export
Modelcsv=Model of export
+OptionsDeactivatedForThisExportModel=For this export model, options are deactivated
Selectmodelcsv=Select a model of export
Modelcsv_normal=Classic export
Modelcsv_CEGID=Export towards CEGID Expert
@@ -66,7 +68,7 @@ Lineofinvoice=Line of invoice
VentilatedinAccount=Ventilated successfully in the accounting account
NotVentilatedinAccount=Not ventilated in the accounting account
-ACCOUNTING_SEPARATORCSV=Separator CSV
+ACCOUNTING_SEPARATORCSV=Column separator in export file
ACCOUNTING_LIMIT_LIST_VENTILATION=Number of elements to be breakdown shown by page (maximum recommended : 50)
ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the breakdown pages "Has to breakdown" by the most recent elements