From 3354b35e758d79db718a5eba2fcc5cea2d9b288e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2012 10:05:28 +0200 Subject: [PATCH 1/8] Fix: Avoid warning if param is empty --- htdocs/core/lib/json.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 0704f035848..2a85bc12063 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -230,7 +230,8 @@ function dol_json_decode($json, $assoc=false) $out=_unval($out); // Return an array - eval('$array = '.$out.';'); + if ($out != '') eval('$array = '.$out.';'); + else $array=array(); // Return an object if (! $assoc) From cfa8ca5c52317bb7091b464aaf065d1875ab339c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Jun 2012 17:44:38 +0200 Subject: [PATCH 2/8] Fix: Removed warning --- htdocs/imports/class/import.class.php | 5 +++-- htdocs/imports/emptyexample.php | 11 ++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index f981847a466..3f8ea381385 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -173,9 +173,10 @@ class Import * @param string $model Name of import engine ('csv', ...) * @param string $headerlinefields Array of values for first line of example file * @param string $contentlinevalues Array of values for content line of example file + * @param string $datatoimport Dataset to import * @return string <0 if KO, >0 if OK */ - function build_example_file($model, $headerlinefields, $contentlinevalues) + function build_example_file($model, $headerlinefields, $contentlinevalues,$datatoimport) { global $conf,$langs; @@ -188,7 +189,7 @@ class Import $file = "import_".$model.".modules.php"; $classname = "Import".$model; require_once($dir.$file); - $objmodel = new $classname($this->db); + $objmodel = new $classname($this->db,$datatoimport); $outputlangs=$langs; // Lang for output $s=''; diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index c65791568da..21ae9d9a80c 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -21,12 +21,6 @@ * \brief Show example of import file */ -// This is to make Dolibarr working with Plesk -set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); - -$datatoimport=isset($_GET["datatoimport"])? $_GET["datatoimport"] : (isset($_POST["datatoimport"])?$_POST["datatoimport"]:''); -$format=isset($_GET["format"])? $_GET["format"] : (isset($_POST["format"])?$_POST["format"]:''); - // This file is a wrapper, so empty header function llxHeader() { print 'Build an import example file'; } // This file is a wrapper, so empty footer @@ -37,6 +31,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/imports/class/import.class.php"); require_once(DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'); +$datatoimport=GETPOST('datatoimport'); +$format=GETPOST('format'); + $langs->load("exports"); // Check exportkey @@ -86,6 +83,6 @@ foreach($fieldstarget as $code=>$label) //var_dump($headerlinefields); //var_dump($contentlinevalues); -print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues); +print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues,$datatoimport); ?> From cb6f9f40b81f65e8467a6afb094ae0bbb4d8f9e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Jun 2012 19:22:44 +0200 Subject: [PATCH 3/8] Prepare release --- build/debian/changelog | 2 +- build/exe/doliwamp/doliwamp.iss | 6 +++--- build/makepack-dolibarr.pl | 2 +- build/makepack-howto.txt | 4 ++-- build/pad/pad_dolibarr.xml | 4 ++-- build/pad/pad_doliwamp.xml | 4 ++-- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 3b1aeb0907f..3d2b04c129c 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -4,6 +4,6 @@ dolibarr (3.2.0+nmu1) unstable; urgency=low * New upstream release. closes: bug#634783 - -- Dolibarr team Mon, 10 Aug 2011 12:00:00 +0100 + -- Dolibarr team Mon, 18 Jun 2012 12:00:00 +0100 # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 4e77d880df0..0baa034e545 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta -AppVerName=DoliWamp-3.2.0-beta +AppVerName=DoliWamp-3.2.0 ; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta -OutputBaseFilename=DoliWamp-3.2.0-beta +OutputBaseFilename=DoliWamp-3.2.0 ; Define full path from wich all relative path are defined ; You must modify this to put here your dolibarr root directory ;SourceDir=C:\Documents and Settings\ldestail\git\dolibarrold @@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com AppSupportURL=http://www.dolibarr.org AppUpdatesURL=http://www.dolibarr.org AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares. -AppCopyright=Copyright (C) 2008-2011 Laurent Destailleur, NLTechno +AppCopyright=Copyright (C) 2008-2012 Laurent Destailleur, NLTechno DefaultDirName=c:\dolibarr DefaultGroupName=Dolibarr ;LicenseFile=COPYING diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index e14ebd9304e..68b8866d524 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -10,7 +10,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="2"; -$BUILD="0-beta"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="0-rc"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 44d96f3c109..b7c8899e2a9 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -8,7 +8,7 @@ This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step. - Check all files are commited. -- Update version/info in / directory (README*.txt, ChangeLog...) +- Update version/info in /ChangeLog - Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile - Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl - Update version number with x.x.x-y in build/makepack-dolibarr.pl @@ -34,7 +34,7 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - Check all files are commited. -- Update version/info in / directory (README*.txt, ChangeLog...) +- Update version/info in /ChangeLog - Update version number with x.x.x-y in build/makepack-dolibarr.pl - Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss - Update version number with x.x.x-y in htdocs/filefunc.inc.php diff --git a/build/pad/pad_dolibarr.xml b/build/pad/pad_dolibarr.xml index 1d609838f97..8b85e501dd7 100644 --- a/build/pad/pad_dolibarr.xml +++ b/build/pad/pad_dolibarr.xml @@ -35,8 +35,8 @@ Dolibarr 3.2.0 - 05 - 10 + 06 + 18 2012 diff --git a/build/pad/pad_doliwamp.xml b/build/pad/pad_doliwamp.xml index deae060cbc8..31a30d2d24e 100644 --- a/build/pad/pad_doliwamp.xml +++ b/build/pad/pad_doliwamp.xml @@ -35,8 +35,8 @@ DoliWamp 3.2.0 - 10 - 05 + 06 + 18 2012 diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 93b290510e8..a306112108e 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -312,5 +312,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 40df91e4008..88991dcebbb 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -368,5 +368,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index eda35d0ed74..86a570cdd91 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -301,5 +301,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 9e37eb4ec29..512f7a021a7 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -306,5 +306,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) From a00439b375190d6da42b3b3e0f788ac1d1e5eb29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Jun 2012 22:30:01 +0200 Subject: [PATCH 4/8] Prepare release --- build/debian/changelog | 2 +- build/exe/doliwamp/doliwamp.iss | 10 +++++----- build/makepack-dolibarr.pl | 2 +- build/makepack-howto.txt | 4 ++-- build/pad/pad_dolibarr.xml | 4 ++-- build/pad/pad_doliwamp.xml | 4 ++-- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- htdocs/filefunc.inc.php | 2 +- htdocs/install/inc.php | 2 +- htdocs/support/inc.php | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 3b1aeb0907f..3d2b04c129c 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -4,6 +4,6 @@ dolibarr (3.2.0+nmu1) unstable; urgency=low * New upstream release. closes: bug#634783 - -- Dolibarr team Mon, 10 Aug 2011 12:00:00 +0100 + -- Dolibarr team Mon, 18 Jun 2012 12:00:00 +0100 # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 4e77d880df0..e7ca6063c38 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -16,10 +16,10 @@ [Setup] ; ----- Change this ----- AppName=DoliWamp -; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta -AppVerName=DoliWamp-3.2.0-beta -; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta -OutputBaseFilename=DoliWamp-3.2.0-beta +; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x +AppVerName=DoliWamp-3.2.0-rc +; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x +OutputBaseFilename=DoliWamp-3.2.0-rc ; Define full path from wich all relative path are defined ; You must modify this to put here your dolibarr root directory ;SourceDir=C:\Documents and Settings\ldestail\git\dolibarrold @@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com AppSupportURL=http://www.dolibarr.org AppUpdatesURL=http://www.dolibarr.org AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares. -AppCopyright=Copyright (C) 2008-2011 Laurent Destailleur, NLTechno +AppCopyright=Copyright (C) 2008-2012 Laurent Destailleur, NLTechno DefaultDirName=c:\dolibarr DefaultGroupName=Dolibarr ;LicenseFile=COPYING diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index e14ebd9304e..68b8866d524 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -10,7 +10,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="2"; -$BUILD="0-beta"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="0-rc"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 44d96f3c109..2cbb9d44383 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -8,7 +8,7 @@ This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step. - Check all files are commited. -- Update version/info in / directory (README*.txt, ChangeLog...) +- Update version/info in /ChangeLog and /filefunc.inc.php - Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile - Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl - Update version number with x.x.x-y in build/makepack-dolibarr.pl @@ -34,7 +34,7 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - Check all files are commited. -- Update version/info in / directory (README*.txt, ChangeLog...) +- Update version/info in /ChangeLog and /filefunc.inc.php - Update version number with x.x.x-y in build/makepack-dolibarr.pl - Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss - Update version number with x.x.x-y in htdocs/filefunc.inc.php diff --git a/build/pad/pad_dolibarr.xml b/build/pad/pad_dolibarr.xml index 1d609838f97..8b85e501dd7 100644 --- a/build/pad/pad_dolibarr.xml +++ b/build/pad/pad_dolibarr.xml @@ -35,8 +35,8 @@ Dolibarr 3.2.0 - 05 - 10 + 06 + 18 2012 diff --git a/build/pad/pad_doliwamp.xml b/build/pad/pad_doliwamp.xml index deae060cbc8..31a30d2d24e 100644 --- a/build/pad/pad_doliwamp.xml +++ b/build/pad/pad_doliwamp.xml @@ -35,8 +35,8 @@ DoliWamp 3.2.0 - 10 - 05 + 06 + 18 2012 diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 93b290510e8..a306112108e 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -312,5 +312,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 40df91e4008..88991dcebbb 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -368,5 +368,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index eda35d0ed74..86a570cdd91 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -301,5 +301,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 9e37eb4ec29..512f7a021a7 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -306,5 +306,5 @@ fi %changelog -* Wed Mar 4 2012 Laurent Destailleur 3.2.0-0.2.beta1 +* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3 - Initial version (#723326) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index a80de78f44f..72685068e0b 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z) +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.0'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z) if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index d231ccb3fd6..f3e62d6342f 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -24,7 +24,7 @@ * \brief File that define environment for support pages */ -define('DOL_VERSION','3.2.0-beta'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z) +define('DOL_VERSION','3.2.0'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z) // Define DOL_DOCUMENT_ROOT an ADODB_PATH used for install/upgrade process if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..'); diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 1938c854e38..718d8dc067b 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -24,7 +24,7 @@ * \brief File that define environment for support pages */ -define('DOL_VERSION','3.2.0-beta'); // Also defined in htdocs/master.inc.php +define('DOL_VERSION','3.2.0'); // Also defined in htdocs/master.inc.php // Define DOL_DOCUMENT_ROOT an ADODB_PATH used for install/upgrade process if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..'); From 6bd438fc7fbf6b21ffb746302818480754720a1b Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 18 Jun 2012 10:24:52 +0200 Subject: [PATCH 5/8] Doc: Update ChangeLog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index f8a517f8cc9..88b6ad958ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -68,6 +68,8 @@ For users: - Fix: Sanitize input parameters. - Fix: [ bug #368 ] Product list - Fix: [ bug #370 ] Filter in accountancy -> suppliers_bills +- Fix: [ bug #399 ] Bad calculation of local taxes in update line products +- Fix: [ bug #427 ] Bad links to wiki help in certains menus For developers: - New: Can add a left menu into an existing top menu or left menu. From 8c030f4f81155af75d6c69986304f5336de322b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Jun 2012 21:33:36 +0200 Subject: [PATCH 6/8] Fix: rebuild_merge_pdf does not regenerate files already existing by default. --- scripts/invoices/rebuild_merge_pdf.php | 30 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 45f112e071b..c44ed149c03 100644 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -39,8 +39,9 @@ require_once($path."../../htdocs/master.inc.php"); 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/pdf.lib.php'); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); +require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); +require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); // Load main language strings @@ -66,6 +67,7 @@ $diroutputpdf=$conf->facture->dir_output . '/temp'; $newmodel=''; // To force a new model $newlangid='en_EN'; // To force a new lang id $filter=array(); +$regenerate=''; $option=''; foreach ($argv as $key => $value) @@ -81,6 +83,16 @@ foreach ($argv as $key => $value) print 'Use language '.$newlangid.".\n"; } + if (preg_match('/^regenerate=(.*)/i',$value,$reg)) + { + if (! in_array($reg[1],array('','0','no'))) + { + $found=true; + $regenerate=$reg[1]; + print 'Regeneration of PDF is requested with template '.$regenerate."\n"; + } + } + if ($value == 'filter=all') { $found=true; @@ -269,11 +281,18 @@ if ( $resql=$db->query($sql) ) $outputlangs->setDefaultLang($newlangid); } } - print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n"; - $result=facture_pdf_create($db, $fac, $newmodel?$newmodel:$fac->modelpdf, $outputlangs); + $filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf'; + if ($regenerate || ! dol_is_file($filename)) + { + print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n"; + $result=facture_pdf_create($db, $fac, $newmodel?$newmodel:$fac->modelpdf, $outputlangs); + } + else { + print "PDF for invoice ".$obj->facnumber." already exists\n"; + } // Add file into files array - $files[] = $conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf'; + $files[] = $filename; } if ($result <= 0) @@ -393,8 +412,9 @@ function usage() print "To exclude credit notes, use filter=nocreditnote\n"; print "To exclude replacement invoices, use filter=noreplacement\n"; print "To exclude deposit invoices, use filter=nodeposit\n"; + print "To regenerate existing PDF, use regenerate=crabe\n"; print "\n"; - print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR\n"; + print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR regenerate=yes\n"; print "Example: ".$script_file." filter=all lang=it_IT\n"; print "\n"; print "Note that some filters can be cumulated.\n"; From cb044443012cb3d1fb367542cd7153ea19b81487 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Jun 2012 21:54:36 +0200 Subject: [PATCH 7/8] Fix: If option to not manage a login is on, login is not output into info message. Fix: Bad error management --- htdocs/adherents/class/adherent.class.php | 9 ++++++--- htdocs/adherents/fiche.php | 13 ++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index de6a320e2b9..bfc17e21f81 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -184,7 +184,7 @@ class Adherent extends CommonObject */ function makeSubstitution($text) { - global $langs; + global $conf,$langs; $birthday = dol_print_date($this->naiss,'day'); @@ -202,8 +202,11 @@ class Adherent extends CommonObject $infos.= $langs->transnoentities("Town").": ".$this->town."\n"; $infos.= $langs->transnoentities("Country").": ".$this->country."\n"; $infos.= $langs->transnoentities("EMail").": ".$this->email."\n"; - $infos.= $langs->transnoentities("Login").": ".$this->login."\n"; - $infos.= $langs->transnoentities("Password").": ".$this->pass."\n"; + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + $infos.= $langs->transnoentities("Login").": ".$this->login."\n"; + $infos.= $langs->transnoentities("Password").": ".$this->pass."\n"; + } $infos.= $langs->transnoentities("Birthday").": ".$birthday."\n"; $infos.= $langs->transnoentities("Photo").": ".$this->photo."\n"; $infos.= $langs->transnoentities("Public").": ".yn($this->public); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 3b3f1305484..2efa36f6eaf 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -200,8 +200,13 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes') { if ($object->email) { - $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); - $mesg=$langs->trans("CardSent"); + $from=$conf->email_from; + if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; + + $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); + + $langs->load("mails"); + $mesg=$langs->trans("MailSuccessfulySent", $from, $object->email); } } @@ -1046,7 +1051,9 @@ if ($action == 'edit') if ($rowid && $action != 'edit') { - /* ************************************************************************** */ + dol_htmloutput_mesg($mesg); + + /* ************************************************************************** */ /* */ /* Mode affichage */ /* */ From 9fed7fba30b601db647fc003e4d5bf42fd4e15ed Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Jun 2012 22:23:43 +0200 Subject: [PATCH 8/8] Fix: missing not empty test --- htdocs/master.inc.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 591a4aabccf..b481d1028af 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -1,4 +1,4 @@ - * Copyright (C) 2003 Xavier Dutoit * Copyright (C) 2004-2012 Laurent Destailleur @@ -206,20 +206,24 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC')) $mysoc->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; // We define pays_id, pays_code and country - $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS); - $country_id=$tmp[0]; - if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label" + if (! empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) { - $country_code=$tmp[1]; - $country_label=$tmp[2]; - } - else // For backward compatibility - { - dol_syslog("Your country setup use an old syntax. Reedit it in setup area.", LOG_WARNING); - include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'); - $country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature - $country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature + $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS); + $country_id=$tmp[0]; + if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label" + { + $country_code=$tmp[1]; + $country_label=$tmp[2]; + } + else // For backward compatibility + { + dol_syslog("Your country setup use an old syntax. Reedit it in setup area.", LOG_WARNING); + include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'); + $country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature + $country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature + } } + $mysoc->pays_id=$country_id; // TODO deprecated $mysoc->country_id=$country_id; $mysoc->pays_code=$country_code; // TODO deprecated