diff --git a/COPYRIGHT b/COPYRIGHT index ed8a667acc8..7457542f060 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -52,6 +52,9 @@ http://www.fsf.org/licensing/licenses/index_html Copyright --------- +Copyright (C) 2015 +- Marcos García + Copyright (C) 2014 - Laurent Destailleur - Raphaël Doursenaud diff --git a/ChangeLog b/ChangeLog index 079219e6c7f..2643b444876 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,10 +2,44 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.6.3 compared to 3.6.2 ***** +- Fix: ref_ext was not saved when recording a customer order from web service +- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid. +- Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php +- Fix: withdrawal create error if in the same month are deleted previus withdrawals. +- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules +- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database +- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects +- Fix: [ bug #1804 ] SQL error when sending email without addresee +- Fix: [ bug #1803 ] AJAX company contact input is not aligned +- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook +- Fix: [ bug #1796 ] Unable to use numeration modules from an external module +- Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON +- Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount +- Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme + +***** ChangeLog for 3.6.2 compared to 3.6.1 ***** +- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. +- Fix: bug 1588 : relative discount. +- Fix: label of input method not tranlated. +- Fix: box of customer and propsects were not correctly disabled. +- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode +- Fix: Civility & birthdate wasn't save into adherent module. +- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref +- Fix: Chars - is no more allowed into value for code for extra fields. +- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache +- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state +- Fix: Show sender Country on PDF docs when sender Country <> receiver Country +- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS +- Fix: [ bug #1749 ] Undefined $mailchimp +- Fix: [ bug #1649 ] Cancel button of several thirdparty actions, does the same thing as modify +- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks +- Fix: [ bug #1731 ] Can't use quick navigation on project tasks secondary tabs + ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: - Fix: Can upload files on services. -- Fix: sql errors on updat fichinter. +- Fix: sql errors on update fichinter. - Fix: debian script syntax error. - Fix: error "menu param is not inside list" into pos module. - Fix: Salary payments are not reflected on the reporting sheets. @@ -20,7 +54,13 @@ For users: - Fix: Extrafield feature select from table should try to translate multiple column when not needed - Fix: cents for indian ruppes are calle paisa and paise. - Fix: Invoices payments may be older than invoices. +- Fix: Withdrawal total amount is double - Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line +- Fix: Web service categorie WDSL declaration is correct +- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined +- Fix: Category creation failed and no message output +- Fix: Lanf for Payment Type +- Fix: PHPCheckstyle 1.5.5 ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: @@ -130,6 +170,25 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f - Remove add_photo_web() that is ot used anymore by core code. +***** ChangeLog for 3.5.7 compared to 3.5.6 ***** +Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers +Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H +Fix: [ bug #1757 ] Sorting breaks product/service statistics +Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date +Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled + +***** ChangeLog for 3.5.6 compared to 3.5.5 ***** +Fix: Avoid missing class error for fetch_thirdparty method #1973 +Fix: Can't update phone_pro from web service +Fix: Some security holes. +Fix: copy extrafields when creating order from proposal. +Fix: report on action was not filtering by environment. +Fix: Avoid missing class error. +Fix: Add function dolEscapeXML. +Fix: Bad days and month reported by function. +Fix: Bad margin calculation. + ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. diff --git a/build/debian/changelog b/build/debian/changelog index 06d0d2212d5..4a711c9868c 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,69 +1,20 @@ +dolibarr (3.6.2-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Sat, 27 dec 2014 12:00:00 +0100 + +dolibarr (3.6.1-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 23 Sep 2014 12:00:00 +0100 + dolibarr (3.6.0-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Tue, 15 July 2014 12:00:00 +0100 - -dolibarr (3.5.5-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Tue, 8 July 2014 12:00:00 +0100 - -dolibarr (3.5.4-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Tue, 1 July 2014 12:00:00 +0100 - -dolibarr (3.5.3-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 2 May 2014 12:00:00 +0100 - -dolibarr (3.5.2-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 14 March 2014 12:00:00 +0100 - -dolibarr (3.5.1-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 7 Feb 2014 12:00:00 +0100 - -dolibarr (3.5.0-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * New upstream release. - - -- Laurent Destailleur (eldy) Fri, 31 Jan 2014 12:00:00 +0100 - -dolibarr (3.4.2-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * Maintenance release. - - -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 - -dolibarr (3.4.1-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * Maintenance release. - - -- Laurent Destailleur (eldy) Mon, 27 Apr 2013 12:00:00 +0100 - -dolibarr (3.4.0-3) unstable; urgency=low - - [ Laurent Destailleur (eldy) ] - * Maintenance release. - - -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 diff --git a/build/debian/control b/build/debian/control index fc0cee30319..164b919e066 100755 --- a/build/debian/control +++ b/build/debian/control @@ -3,7 +3,7 @@ Section: web Priority: optional Maintainer: Laurent Destailleur (eldy) # Uploaders: Laurent Destailleur (eldy) # Only if differs from Maintainer -Standards-Version: 3.9.4 +Standards-Version: 3.9.6 Homepage: http://www.dolibarr.org Build-Depends: debhelper (>= 9), po-debconf # This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version @@ -16,7 +16,8 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap, php5-geoip, # Required PHP libraries php-pear, php-mail-mime, -# php-tcpdf, libfpdi-php, libfpdf-tpl-php, php-fpdf, +# php-tcpdf, libfpdi-php, +# libfpdf-tpl-php, php-fpdf, # libphp-adodb, # libnusoap-php, # libphp-pclzip, @@ -26,9 +27,10 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | # fonts-dejavu-core | ttf-dejavu-core, xdg-utils, mysql-server, + mysql-client, ${misc:Depends}, ${perl:Depends} -Recommends: mysql-client, apache2 | lighttpd | httpd +Recommends: apache2 | lighttpd | httpd Suggests: www-browser Description: Web based software to manage a company or foundation Dolibarr ERP & CRM is an easy to use open source/free software for small diff --git a/build/debian/copyright b/build/debian/copyright index 73109152034..080965c31a3 100644 --- a/build/debian/copyright +++ b/build/debian/copyright @@ -1,7 +1,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Dolibarr Upstream-Contact: Laurent Destailleur -Source: http://sourceforge.net/projects/dolibarr/files/ +Source: http://www.dolibarr.org/files/stable/standard/ Files: * Copyright: 2002-2009, Rodolphe Quiedeville diff --git a/build/exe/doliwamp/.gitignore b/build/exe/doliwamp/.gitignore new file mode 100644 index 00000000000..ce74d54f78e --- /dev/null +++ b/build/exe/doliwamp/.gitignore @@ -0,0 +1 @@ +/doliwamp.tmp.iss diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index da727786896..6183bcac85c 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-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.6.0 -; 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.6.0 +; Replace key with 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=__FILENAMEEXEDOLIWAMP__ +; Replace key with 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=__FILENAMEEXEDOLIWAMP__ ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 77f19c1500a..8467d4140f3 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) -# \author (c)2004-2013 Laurent Destailleur +# \author (c)2004-2014 Laurent Destailleur # # This is list of constant you can set to have generated packages moved into a specific dir: #DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild' @@ -442,6 +442,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; @@ -460,8 +461,8 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`; @@ -610,9 +611,6 @@ if ($nboftargetok) { print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; - #print "Create directory $RPMDIR\n"; - #$ret=`mkdir -p "$RPMDIR"`; - print "Remove target ".$FILENAMERPM."...\n"; unlink("$NEWDESTI/".$FILENAMERPM); print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n"; @@ -620,13 +618,13 @@ if ($nboftargetok) { print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; - # Set owners - #print "Set owners on files/dir\n"; - #$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`; + # Removed files we don't need + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; print "Set permissions on files/dir\n"; $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; @@ -747,10 +745,18 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; # Removed duplicate license files + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/scayt/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/wsc/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/freefont-20120503/COPYING`; + # Removed files we don't need + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source`; + # Rename upstream changelog to match debian rules $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; @@ -905,8 +911,6 @@ if ($nboftargetok) { close SPECFROM; close SPECTO; print "Version set to $MAJOR.$MINOR.$newbuild\n"; - #$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure\""; - #$ret=`$cmd`; $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\""; $ret=`$cmd`; $cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\""; @@ -945,8 +949,12 @@ if ($nboftargetok) { $SOURCEBACK=$SOURCE; $SOURCEBACK =~ s/\//\\/g; - print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; - $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\""; + + print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; + $ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; + + print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"\n"; + $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\""; print "$cmd\n"; $ret= `$cmd`; #print "$ret\n"; @@ -956,6 +964,9 @@ if ($nboftargetok) { rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; $ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`; + + $ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`; + next; } } diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 24e5f809185..40b0e5180bc 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -36,14 +36,13 @@ complete release of Dolibarr, step by step. - Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z in build/rpm/*.spec - Commit all changes. -- Add a Tag (x.y.z) - Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl - Check content of built packages. - Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files/stable). - Run makepack-dolibarr.pl again with option to publish files on - sourceforge. + sourceforge. This will also add official tag. - Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx" on server to point to new files (used by some web sites). diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index d676e59255e..0904797b5a4 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -333,23 +333,11 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3 +- Upstream release + +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release - -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index ef94435a62a..44a5ea1d842 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -569,23 +569,12 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3 +- Upstream release + +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index dfa148570f0..a06162bcf1a 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -338,23 +338,12 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3 +- Upstream release + +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index b3b304312f5..1c939abae87 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -349,23 +349,12 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3 +- Upstream release + +* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 +- Upstream release + * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 - Upstream release -* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3 -- Upstream release - -* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3 -- Upstream release - -* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3 -- Upstream release - -* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 -- Upstream release - -* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 -- Upstream release - -* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 -- Initial version (#723326) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 38ea1310d22..9cff30f457d 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -6,17 +6,34 @@ */conf.php */includes/* */documents/* + */dev/vagrant/* */custom/* */nltechno* - - + + 0 - + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + 0 @@ -105,7 +122,7 @@ - + @@ -162,7 +179,75 @@ 0 - + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + '."\n"; - print ''; - print ''; - print ''; - print '
'; if ($obj->rowid == 0) { print ''; @@ -621,9 +619,6 @@ class FormCompany print ''; } print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength); - print '
'; print "\n"; return $socid; } diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index bce8d9f041e..4de88a7bfc9 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -4,7 +4,7 @@ * * 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 - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,6 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * or see http://www.gnu.org/ */ /** diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index fe1cd8ddb6b..05d7a36b6f9 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -462,7 +462,7 @@ class FormOther /** * Write lines of a project (all lines of a project if parent = 0) * - * @param int &$inc Cursor counter + * @param int $inc Cursor counter * @param int $parent Id of parent task we want to see * @param array $lines Array of task lines * @param int $level Level @@ -1033,6 +1033,7 @@ class FormOther if ($nbboxactivated) { $langs->load("boxes"); + $langs->load("projects"); $emptybox=new ModeleBoxes($db); diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 30eeca5a486..88abc140104 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -370,7 +370,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ @@ -423,7 +423,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param string $user Objet user that modify * @return int <0 if KO, >0 if OK */ @@ -475,7 +475,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that update * @param string $olddn Old DN entry key (before update) * @return int <0 if KO, >0 if OK @@ -563,7 +563,7 @@ class Ldap * Build a LDAP message * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @return string Content of file */ function dump_content($dn, $info) @@ -605,7 +605,7 @@ class Ldap * Dump a LDAP message to ldapinput.in file * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @return int <0 if KO, >0 if OK */ function dump($dn, $info) @@ -642,7 +642,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ @@ -694,7 +694,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ @@ -746,7 +746,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string[] $info Attributes array + * @param array $info Attributes array * @param User $user Objet user that create * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 08d520d519e..02924d86668 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -234,7 +234,7 @@ class Link extends CommonObject /** * Loads all links from database * - * @param array &$links array of Link objects to fill + * @param array $links array of Link objects to fill * @param string $objecttype type of the associated object in dolibarr * @param int $objectid id of the associated object in dolibarr * @param string $sortfield field used to sort diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 966b9ac7f77..2f4049ee460 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -152,7 +152,7 @@ class Menubase $sql.= " '".$this->fk_menu."',"; $sql.= " ".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").","; $sql.= " ".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").","; - $sql.= " '".$this->position."',"; + $sql.= " '".(int) $this->position."',"; $sql.= " '".$this->db->escape($this->url)."',"; $sql.= " '".$this->db->escape($this->target)."',"; $sql.= " '".$this->db->escape($this->titre)."',"; @@ -380,7 +380,7 @@ class Menubase * @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @return array Return array with menu entries for top menu */ function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) @@ -408,7 +408,7 @@ class Menubase * @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) - * @param array &$tabMenu Array with menu entries already loaded + * @param array $tabMenu Array with menu entries already loaded * @return Menu Menu array for particular mainmenu value or full tabArray */ function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) @@ -493,7 +493,7 @@ class Menubase * @param string $myleftmenu Value for left that defined leftmenu * @param int $type_user Looks for menu entry for 0=Internal users, 1=External users * @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...) - * @param array &$tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) + * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) * @return int >0 if OK, <0 if KO */ function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 80ca1b155b7..d9a7d8348d6 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -258,7 +258,7 @@ class RssParser if (!is_resource($xmlparser)) { $this->error="ErrorFailedToCreateParser"; return -1; } - + xml_set_object($xmlparser, $this); xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); xml_set_character_data_handler($xmlparser, 'feed_cdata'); @@ -268,7 +268,7 @@ class RssParser //var_dump($rss->_format);exit; } } - + // If $rss loaded if ($rss) { @@ -452,7 +452,7 @@ class RssParser * * @param string $p Start * @param string $element Tag - * @param array &$attrs Attributes of tags + * @param array $attrs Attributes of tags * @return void */ function feed_start_element($p, $element, &$attrs) @@ -644,7 +644,7 @@ class RssParser /** * To concat 2 string with no warning if an operand is not defined * - * @param string &$str1 Str1 + * @param string $str1 Str1 * @param string $str2 Str2 * @return string String cancatenated */ diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 7e0333bc5aa..67af3c7e083 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -39,6 +39,7 @@ require_once '../main.inc.php'; if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php $langs->load("main"); +$langs->load("agenda"); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); @@ -57,7 +58,7 @@ if (GETPOST('mode') && GETPOST('mode') == 'test') } else { - print 'Calendar'; + print ''.$langs->trans("Calendar").''; } // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index aa0792c5970..65b136a7a9c 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/core/db/dolidb.class.php - * \brief Class file to manage Dolibarr database access + * \file htdocs/core/db/DoliDB.class.php + * \brief Class file to manage Dolibarr database access */ require_once DOL_DOCUMENT_ROOT .'/core/db/Database.interface.php'; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 7a964d07afc..f768a1115bd 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -351,7 +351,6 @@ class DoliDBMysqli extends DoliDB * @return int Nombre de lignes * @see num_rows */ - function affected_rows($resultset) { // If resultset not provided, we take the last used by connexion diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 0b0bc8c8a5c..6f494cb6f48 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -387,7 +387,7 @@ class DoliDBPgsql extends DoliDB if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) { $con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty - $this->db = pg_connect($con_string); + $this->db = @pg_connect($con_string); } // if local connection failed or not requested, use TCP/IP @@ -397,7 +397,7 @@ class DoliDBPgsql extends DoliDB if (! $port) $port = 5432; $con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'"; - $this->db = pg_connect($con_string); + $this->db = @pg_connect($con_string); } // now we test if at least one connect method was a success @@ -832,7 +832,7 @@ class DoliDBPgsql extends DoliDB // Test charset match LC_TYPE (pgsql error otherwise) //print $charset.' '.setlocale(LC_CTYPE,'0'); exit; - $sql='CREATE DATABASE '.$database.' OWNER '.$owner.' ENCODING \''.$charset.'\''; + $sql='CREATE DATABASE "'.$database.'" OWNER "'.$owner.'" ENCODING \''.$charset.'\''; dol_syslog($sql,LOG_DEBUG); $ret=$this->query($sql); return $ret; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index c389f442830..155415f59c3 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -853,17 +853,17 @@ function unActivateModule($value, $requiredby=1) /** * Add external modules to list of dictionaries * - * @param array &$taborder Taborder - * @param array &$tabname Tabname - * @param array &$tablib Tablib - * @param array &$tabsql Tabsql - * @param array &$tabsqlsort Tabsqlsort - * @param array &$tabfield Tabfield - * @param array &$tabfieldvalue Tabfieldvalue - * @param array &$tabfieldinsert Tabfieldinsert - * @param array &$tabrowid Tabrowid - * @param array &$tabcond Tabcond - * @param array &$tabhelp Tabhelp + * @param array $taborder Taborder + * @param array $tabname Tabname + * @param array $tablib Tablib + * @param array $tabsql Tabsql + * @param array $tabsqlsort Tabsqlsort + * @param array $tabfield Tabfield + * @param array $tabfieldvalue Tabfieldvalue + * @param array $tabfieldinsert Tabfieldinsert + * @param array $tabrowid Tabrowid + * @param array $tabcond Tabcond + * @param array $tabhelp Tabhelp * @return int 1 */ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 1d447430dfe..924d3da2259 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -482,7 +482,7 @@ function dol_get_last_day($year,$month=12,$gm=false) * @param int $month Month * @param int $year Year * @param int $gm False or 0 or 'server' = Return date to compare with server TZ, True or 1 to compare with GM date. - * @return array year,month, week,first_day,prev_year,prev_month,prev_day + * @return array year,month,week,first_day,prev_year,prev_month,prev_day */ function dol_get_first_day_week($day,$month,$year,$gm=false) { @@ -524,7 +524,7 @@ function dol_get_first_day_week($day,$month,$year,$gm=false) } $tmpmonth = $prev_month; $tmpyear = $prev_year; - + //Get first day of next week $tmptime=dol_mktime(12,0,0,$month,$tmpday,$year,1,0); $tmptime-=24*60*60*7; @@ -532,7 +532,7 @@ function dol_get_first_day_week($day,$month,$year,$gm=false) $prev_day = $tmparray['mday']; //Check prev day of week is in same month than first day or not - if ($prev_day>$tmpday) + if ($prev_day > $tmpday) { $prev_month = $month-1; $prev_year = $year; @@ -544,7 +544,7 @@ function dol_get_first_day_week($day,$month,$year,$gm=false) } } - $week = date("W",dol_mktime(0,0,0,$month,$tmpday,$year,$gm)); + $week = date("W",dol_mktime(0,0,0,$tmpmonth,$tmpday,$tmpyear,$gm)); return array('year' => $year, 'month' => $month, 'week' => $week, 'first_day' => $tmpday, 'first_month' => $tmpmonth, 'first_year' => $tmpyear, 'prev_year' => $prev_year, 'prev_month' => $prev_month, 'prev_day' => $prev_day); } @@ -563,9 +563,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $nbFerie = 0; // Check to ensure we use correct parameters - if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hour and be GMT dates'; + if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; - while ($timestampStart < $timestampEnd) // Loop end when equals + $i=0; + while ($timestampStart < $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop) { $ferie=false; $countryfound=0; @@ -573,7 +574,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); - if ($countrycode == 'FR') { $countryfound=1; @@ -676,8 +676,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') if ($ferie) $nbFerie++; // Increase number of days (on go up into loop) - $jour++; - $timestampStart=dol_mktime(0,0,0,$mois,$jour,$annee,1); // Generate GMT date for next day + $timestampStart=dol_time_plus_duree($timestampStart, 1, 'd'); + //var_dump($jour.' '.$mois.' '.$annee.' '.$timestampStart); + + $i++; } return $nbFerie; @@ -718,13 +720,16 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0) * @param int $inhour 0: return number of days, 1: return number of hours * @param int $lastday We include last day, 0: no, 1:yes * @param int $halfday Tag to define half day when holiday start and end + * @param string $country_code Country code (company country code if not defined) * @return int Number of days or hours */ -function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0) +function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='') { - global $langs; + global $langs,$mysoc; - dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday); + if (empty($country_code)) $country_code=$mysoc->country_code; + + dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday.' country_code='.$country_code); // Check parameters if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day'; @@ -733,7 +738,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha //print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday; if ($timestampStart < $timestampEnd) { - $nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $lastday); + $numdays = num_between_day($timestampStart, $timestampEnd, $lastday); + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code); + $nbOpenDay = $numdays - $numholidays; $nbOpenDay.= " " . $langs->trans("Days"); if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c90e58f556c..bcc6c165472 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -43,7 +43,7 @@ function dol_basename($pathfile) * @param string $types Can be "directories", "files", or "all" * @param int $recursive Determines whether subdirectories are searched * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function - * @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')) + * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')) * @param string $sortcriteria Sort criteria ("","fullname","name","date","size") * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only @@ -1289,7 +1289,7 @@ function dol_uncompress($inputfile,$outputdir) * * @param string $dir Directory to scan * @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function - * @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function + * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function * @param int $nohook Disable all hooks * @return string Full path to most recent file */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1450e2f100f..f6f09dd1567 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -719,11 +719,12 @@ function dol_bc($var,$moreclass='') * @param Object $object A company or contact object * @param int $withcountry 1=Add country into address string * @param string $sep Separator to use to build string + * @param Tranlsate $outputlangs Object lang that contains language for text translation. * @return string Formated string */ -function dol_format_address($object,$withcountry=0,$sep="\n") +function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') { - global $conf; + global $conf,$langs; $ret=''; $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); @@ -768,8 +769,8 @@ function dol_format_address($object,$withcountry=0,$sep="\n") $ret.=", ".$object->state; } } - - if ($withcountry) $ret.=($object->country?$sep.$object->country:''); + if (! is_object($outputlangs)) $outputlangs=$langs; + if ($withcountry) $ret.=($object->country_code?$sep.$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)):''); return $ret; } @@ -1053,7 +1054,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) $default_timezone=@date_default_timezone_get(); } } - else $localtz = new DateTimeZone('UTC'); + + if (empty($localtz)) { + $localtz = new DateTimeZone('UTC'); + } + $dt = new DateTime(null,$localtz); $dt->setDate($year,$month,$day); $dt->setTime((int) $hour, (int) $minute, (int) $second); @@ -3770,7 +3775,7 @@ function make_substitutions($chaine,$substitutionarray) /** * Complete the $substitutionarray with more entries * - * @param array &$substitutionarray Array substitution old value => new value value + * @param array $substitutionarray Array substitution old value => new value value * @param Translate $outputlangs If we want substitution from special constants, we provide a language * @param Object $object If we want substitution from special constants, we provide data in a source object * @param Mixed $parameters Add more parameters (useful to pass product lines) @@ -4109,7 +4114,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0) * or descending output and uses optionally natural case insensitive sorting (which * can be optionally case sensitive as well). * - * @param array &$array Array to sort (array of array('key','otherkey1','otherkey2'...)) + * @param array $array Array to sort (array of array('key','otherkey1','otherkey2'...)) * @param string $index Key in array to use for sorting criteria * @param int $order Sort order * @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort) @@ -4330,8 +4335,8 @@ function picto_from_langcode($codelang) * @param Conf $conf Object conf * @param Translate $langs Object langs * @param Object $object Object object - * @param array &$head Object head - * @param int &$h New position to fill + * @param array $head Object head + * @param int $h New position to fill * @param string $type Value for object where objectvalue can be * 'thirdparty' to add a tab in third party view * 'intervention' to add a tab in intervention view diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 1c3953906a2..4c2dd6e5189 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -738,7 +738,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql = "SELECT MAX(".$sqlstring.") as val"; $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; - $sql.= " AND ".$field." NOT LIKE '%PROV%'"; + $sql.= " AND ".$field." NOT LIKE '(PROV%)'"; $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -1107,7 +1107,7 @@ function numero_semaine($time) * Convertit une masse d'une unite vers une autre unite * * @param float $weight Masse a convertir - * @param int &$from_unit Unite originale en puissance de 10 + * @param int $from_unit Unite originale en puissance de 10 * @param int $to_unit Nouvelle unite en puissance de 10 * @return float Masse convertie */ @@ -1142,7 +1142,7 @@ function weight_convert($weight,&$from_unit,$to_unit) * * @param DoliDB $db Handler database * @param Conf $conf Object conf - * @param User &$user Object user + * @param User $user Object user * @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder * @return int <0 if KO, >0 if OK * diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index dd299ab5c2c..6b4877b14b2 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -50,4 +50,3 @@ function holiday_prepare_head($object) return $head; } -?> diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 9309d083187..fb9d8f90f70 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -2,19 +2,20 @@ /* * 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*/ + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ /** * \file htdocs/core/lib/invoice2.lib.php diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index bcb1008b622..8b0091a6f6d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -309,7 +309,10 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($mode == 'source') { - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany))."\n"; + $withCountry = 0; + if (!empty($sourcecompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) $withCountry = 1; + + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany, $withCountry, "\n", $outputlangs))."\n"; if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS)) { @@ -420,7 +423,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target /** * Show header of page for PDF generation * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $page_height Height of page * @return void @@ -441,7 +444,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height) /** * Add a draft watermark on PDF files * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang * @param int $h Height of PDF * @param int $w Width of PDF @@ -481,7 +484,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) /** * Show bank informations for PDF generation * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang * @param int $curx X * @param int $cury Y @@ -643,7 +646,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default /** * Show footer of page for PDF generation * - * @param PDF &$pdf The PDF factory + * @param PDF $pdf The PDF factory * @param Translate $outputlangs Object lang for output * @param string $paramfreetext Constant name of free text * @param Societe $fromcompany Object company @@ -852,7 +855,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass /** * Show linked objects for PDF generation * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param object $object Object * @param Translate $outputlangs Object lang * @param int $posx X @@ -890,7 +893,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al /** * Output line description into PDF * - * @param PDF &$pdf PDF object + * @param PDF $pdf PDF object * @param Object $object Object * @param int $i Current line number * @param Translate $outputlangs Object lang for output @@ -1587,13 +1590,13 @@ function pdf_getLinkedObjects($object,$outputlangs) { $outputlangs->load('orders'); $outputlangs->load('sendings'); - + $num=count($objects); for ($i=0;$i<$num;$i++) { $objects[$i]->fetchObjectLinked(); $order = $objects[$i]->linkedObjects['commande'][0]; - + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : ''); $linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($objects[$i]->ref); diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index e8c86b37db9..a252b361dcf 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -357,5 +357,3 @@ function measuring_units_string($unit,$measuring_style='') return $measuring_units[$unit]; } - -?> diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index bfe782c40f9..a564a312ac2 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -206,13 +206,13 @@ function project_admin_prepare_head() /** * Show task lines with a particular parent * - * @param string &$inc Counter that count number of lines legitimate to show (for return) + * @param string $inc Counter that count number of lines legitimate to show (for return) * @param int $parent Id of parent task to start - * @param array &$lines Array of all tasks - * @param int &$level Level of task + * @param array $lines Array of all tasks + * @param int $level Level of task * @param string $var Color * @param int $showproject Show project columns - * @param int &$taskrole Array of roles of user for each tasks + * @param int $taskrole Array of roles of user for each tasks * @param int $projectsListId List of id of project allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @return void @@ -443,12 +443,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t /** * Output a task line * - * @param string &$inc ? + * @param string $inc ? * @param string $parent ? * @param Object $lines ? - * @param int &$level ? - * @param string &$projectsrole ? - * @param string &$tasksrole ? + * @param int $level ? + * @param string $projectsrole ? + * @param string $tasksrole ? * @param string $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @return $inc @@ -589,10 +589,10 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr /** * Search in task lines with a particular parent if there is a task for a particular user (in taskrole) * - * @param string &$inc Counter that count number of lines legitimate to show (for return) + * @param string $inc Counter that count number of lines legitimate to show (for return) * @param int $parent Id of parent task to start - * @param array &$lines Array of all tasks - * @param string &$taskrole Array of task filtered on a particular user + * @param array $lines Array of all tasks + * @param string $taskrole Array of task filtered on a particular user * @return int 1 if there is */ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 31e900f8e7e..7416d564a1a 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -174,11 +174,17 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature } else if (! empty($feature2)) // This should be used for future changes { + $tmpreadok=1; foreach($feature2 as $subfeature) { - if (! empty($subfeature) && empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) { $readok=0; $nbko++; } - else if (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $readok=0; $nbko++; } - else { $readok=1; break; } // Break is to bypass second test if the first is ok + if (! empty($subfeature) && empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) { $tmpreadok=0; } + else if (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $tmpreadok=0; } + else { $tmpreadok=1; break; } // Break is to bypass second test if the first is ok + } + if (! $tmpreadok) // We found a test on feature that is ko + { + $readok=0; // All tests are ko (we manage here the and, the or will be managed later using $nbko). + $nbko++; } } else if (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 1bbf2e55e27..470da211f2e 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -28,7 +28,7 @@ /** * Show indent and picto of a tree line. Return array with information of line. * - * @param array &$fulltree Array of entries in correct order + * @param array $fulltree Array of entries in correct order * @param string $key Key of entry into fulltree to show picto * @param int $silent Do not output indent and picto, returns only value * @return array array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub) diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php index 60794497554..7d58e9e01b1 100644 --- a/htdocs/core/lib/trip.lib.php +++ b/htdocs/core/lib/trip.lib.php @@ -54,10 +54,8 @@ function trip_prepare_head($object) $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; - + complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove'); return $head; } - -?> \ No newline at end of file diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index d6097b6f5a1..75a78627f52 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -342,4 +342,3 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; } -?> diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php index 1e7f4b4e522..533a13e1fb6 100644 --- a/htdocs/core/lib/ws.lib.php +++ b/htdocs/core/lib/ws.lib.php @@ -27,9 +27,9 @@ * Check authentication array and set error, errorcode, errorlabel * * @param array $authentication Array with authentication informations ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) - * @param int &$error Number of errors - * @param string &$errorcode Error string code - * @param string &$errorlabel Error string label + * @param int $error Number of errors + * @param string $errorcode Error string code + * @param string $errorlabel Error string label * @return User Return user object identified by login/pass/entity into authentication array */ function check_authentication($authentication,&$error,&$errorcode,&$errorlabel) diff --git a/htdocs/core/login/functions_empty.php b/htdocs/core/login/functions_empty.php index c96a5023d4d..e4379ee2c3a 100644 --- a/htdocs/core/login/functions_empty.php +++ b/htdocs/core/login/functions_empty.php @@ -39,5 +39,3 @@ function check_user_password_empty($usertotest,$passwordtotest,$entitytotest) return $login; } - -?> \ No newline at end of file diff --git a/htdocs/core/login/functions_forceuser.php b/htdocs/core/login/functions_forceuser.php index e74a253550a..94201c74ad0 100644 --- a/htdocs/core/login/functions_forceuser.php +++ b/htdocs/core/login/functions_forceuser.php @@ -46,6 +46,3 @@ function check_user_password_forceuser($usertotest,$passwordtotest,$entitytotest return $login; } - - -?> \ No newline at end of file diff --git a/htdocs/core/login/functions_http.php b/htdocs/core/login/functions_http.php index b224b27f15b..285ebebbabf 100644 --- a/htdocs/core/login/functions_http.php +++ b/htdocs/core/login/functions_http.php @@ -43,6 +43,3 @@ function check_user_password_http($usertotest,$passwordtotest,$entitytotest) return $login; } - - -?> \ No newline at end of file diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 403530ac80b..88a5f55de19 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -227,5 +227,3 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) return $login; } - -?> diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php index e183bc40795..2470567d596 100644 --- a/htdocs/core/login/functions_openid.php +++ b/htdocs/core/login/functions_openid.php @@ -112,5 +112,3 @@ function check_user_password_openid($usertotest,$passwordtotest,$entitytotest) return $login; } - -?> \ No newline at end of file diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 837403828ee..e8d71496820 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param DoliDB $db Database handler * @param string $atarget Target * @param int $type_user 0=Menu for backoffice, 1=Menu for front office - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param array &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @return int 0 */ @@ -203,8 +203,8 @@ function print_end_menu_array_auguria() * @param DoliDB $db Database handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler * @param array $menu_array_after Table of menu entries to show after entries of menu handler - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param Menu &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) @@ -402,8 +402,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM * Function to test if an entry is enabled or not * * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu - * @param array &$menuentry Array for menu entry - * @param array &$listofmodulesforexternal Array with list of modules allowed to external users + * @param array $menuentry Array for menu entry + * @param array $listofmodulesforexternal Array with list of modules allowed to external users * @return int 0=Hide, 1=Show, 2=Show gray */ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) @@ -430,5 +430,3 @@ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexterna if (! $menuentry['perms']) return 2; // No permissions and user is external return 1; } - -?> diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ed255b5785f..b42fc258c6d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param DoliDB $db Database handler * @param string $atarget Target (Example: '' or '_top') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param array &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @return int 0 */ @@ -428,8 +428,8 @@ function print_end_menu_array() * @param DoliDB $db Database handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) * @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param Menu &$menu Object Menu to return back list of menu entries + * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param Menu $menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) @@ -1364,8 +1364,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu * Function to test if an entry is enabled or not * * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu - * @param array &$menuentry Array for menu entry - * @param array &$listofmodulesforexternal Array with list of modules allowed to external users + * @param array $menuentry Array for menu entry + * @param array $listofmodulesforexternal Array with list of modules allowed to external users * @return int 0=Hide, 1=Show, 2=Show gray */ function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index e25f4d0c715..8b636fd247f 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -748,6 +748,8 @@ abstract class DolibarrModules $err=0; + if (empty($this->const)) return 0; + foreach ($this->const as $key => $value) { $name = $this->const[$key][0]; @@ -816,6 +818,8 @@ abstract class DolibarrModules $err=0; + if (empty($this->const)) return 0; + foreach ($this->const as $key => $value) { $name = $this->const[$key][0]; diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b864205f2c9..59f8fbfb129 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -159,7 +159,7 @@ class CommActionRapport /** * Write content of pages * - * @param PDF &$pdf Object pdf + * @param PDF $pdf Object pdf * @param Translate $outputlangs Object langs * @return int 1 */ @@ -184,6 +184,7 @@ class CommActionRapport $sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid"; $sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'"; $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; + $sql.= " AND a.entity = ".$conf->entity; $sql.= " ORDER BY a.datep DESC"; dol_syslog(get_class($this)."::_page sql=".$sql); @@ -255,7 +256,7 @@ class CommActionRapport /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Translate $outputlangs Object lang for output * @param int $pagenb Page nb * @return void diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index e03bdc6d2e9..28fa03ee4f3 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/core/modules/product/mod_barcode_product_standard.php + * \file htdocs/core/modules/barcode/mod_barcode_product_standard.php * \ingroup barcode * \brief File of class to manage barcode numbering with standard rule */ @@ -162,7 +162,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $thirdparty_type 0 = customer/prospect , 1 = supplier * @param string $type type of barcode (EAN, ISBN, ...) @@ -177,7 +177,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode global $conf; //var_dump($code.' '.$product->ref.' '.$thirdparty_type);exit; - + require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; $result=0; @@ -282,7 +282,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { $newcodefortest=substr($newcodefortest,0,12); } - + $result=check_value($mask,$newcodefortest); return $result; diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index 96214f08d66..04ba6a57174 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -177,7 +177,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Generate Header * - * @param PDF &$pdf Pdf object + * @param PDF $pdf Pdf object * @param int $page Current page number * @param int $pages Total number of pages * @param Translate $outputlangs Object language for output @@ -283,7 +283,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Output array * - * @param PDF &$pdf PDF object + * @param PDF $pdf PDF object * @param int $pagenb Page nb * @param int $pages Pages * @param Translate $outputlangs Object lang @@ -341,7 +341,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 68266f2cef9..2f569f1e47f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -533,7 +533,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -548,7 +548,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -732,7 +732,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -989,7 +989,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1084,7 +1084,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1177,7 +1177,7 @@ class pdf_einstein extends ModelePDFCommandes if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -1263,7 +1263,7 @@ class pdf_einstein extends ModelePDFCommandes /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index eb599c2a214..cf5a562e2ef 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -532,7 +532,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -547,7 +547,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -689,7 +689,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -946,7 +946,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1041,7 +1041,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1134,7 +1134,7 @@ class pdf_proforma extends ModelePDFCommandes if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -1220,7 +1220,7 @@ class pdf_proforma extends ModelePDFCommandes /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 5fc0eb6dd2a..88645973f6c 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -357,7 +357,7 @@ class pdf_strato extends ModelePDFContract /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -423,7 +423,7 @@ class pdf_strato extends ModelePDFContract /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -520,7 +520,7 @@ class pdf_strato extends ModelePDFContract $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -602,7 +602,7 @@ class pdf_strato extends ModelePDFContract /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 5385d7ad0e6..cc9d884a831 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -73,7 +73,7 @@ class pdf_merou extends ModelePdfExpedition /** * Function to build pdf onto disk * - * @param Object &$object Object expedition to generate (or id if old method) + * @param Object $object Object expedition to generate (or id if old method) * @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 @@ -353,7 +353,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -394,7 +394,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -423,7 +423,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -516,7 +516,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetTextColor(0,0,0); // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); $pdf->SetFont('','', $default_font_size - 3); $pdf->SetXY($blSocX,$blSocY+4); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 6d0e44817a7..eedc4b91827 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -76,7 +76,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Function to build pdf onto disk * - * @param Object &$object Object expedition to generate (or id if old method) + * @param Object $object Object expedition to generate (or id if old method) * @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 @@ -354,7 +354,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -409,7 +409,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -564,7 +564,7 @@ class pdf_rouget extends ModelePdfExpedition $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posx=$this->marge_gauche; @@ -649,7 +649,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9186e51b954..e8ea460fb9b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -535,7 +535,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -673,7 +673,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -829,7 +829,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1124,7 +1124,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1218,7 +1218,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1363,7 +1363,7 @@ class pdf_crabe extends ModelePDFFactures if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -1449,7 +1449,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index f2055e8d643..a8595eb68db 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -253,7 +253,32 @@ class pdf_soleil extends ModelePDFFicheinter $txt=''.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).''; $desc=dol_htmlentitiesbr($objectligne->desc,1); + $pdf->startTransaction(); $pdf->writeHTMLCell(0, 0, $curX, $curY + 1, dol_concatdesc($txt,$desc), 0, 1, 0); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'
'.$desc, LR, 1, 0); + $pageposafter=$pdf->getPage(); + $posyafter=$pdf->GetY(); + //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + $pdf->setPage($pageposafter+1); + } + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); @@ -345,7 +370,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -408,7 +433,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -505,7 +530,7 @@ class pdf_soleil extends ModelePDFFicheinter $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -587,7 +612,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index b13177f9127..ba58279c8ec 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -540,7 +540,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -567,7 +567,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -626,7 +626,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -749,7 +749,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -842,7 +842,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 043a2e89f5c..cef4155c607 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -99,7 +99,7 @@ class pdf_standard * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $pt point * @return void */ @@ -118,7 +118,7 @@ class pdf_standard * - %LOGO% is replace with company logo * - %PHOTO% is replace with photo provided as parameter * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $textleft Text left * @param string $header Header * @param string $footer Footer @@ -300,7 +300,7 @@ class pdf_standard /** * Print dot line * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -341,7 +341,7 @@ class pdf_standard /** * Fonction realisant une croix aux 4 coins des cartes * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -412,7 +412,7 @@ class pdf_standard /** * Set format * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $format Format * @return void */ diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index f8a99b99aab..5ecadcc9792 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -22,7 +22,7 @@ */ /** - * \defgroup tax Module salaries + * \defgroup salaries Module salaries * \brief Module to include salaries management * \file htdocs/core/modules/modSalaries.class.php * \ingroup salaries diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index b6e35f95f8e..8ae45bdc681 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -99,7 +99,7 @@ class pdf_standardlabel * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $pt point * @return void */ @@ -117,7 +117,7 @@ class pdf_standardlabel * - %LOGO% is replace with company logo * - %PHOTO% is replace with photo provided as parameter * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $textleft Text left * @param string $header Header * @param string $footer Footer @@ -292,7 +292,7 @@ class pdf_standardlabel /** * Print dot line * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -333,7 +333,7 @@ class pdf_standardlabel /** * Fonction realisant une croix aux 4 coins des cartes * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param int $x1 X1 * @param int $y1 Y1 * @param int $x2 X2 @@ -404,7 +404,7 @@ class pdf_standardlabel /** * Set format * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param string $format Format * @return void */ diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 3ab5fdb9e09..37383474c2d 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -220,7 +220,7 @@ class mod_codeproduct_elephant extends ModeleProductCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index df71792ee86..a3df52f682f 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -91,7 +91,7 @@ class mod_codeproduct_leopard extends ModeleProductCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Product $product Object product * @param int $type 0 = product , 1 = service * @return int 0 if OK diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index c8cc0b65fbc..d8f2d744e78 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -315,7 +315,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -348,7 +348,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -434,7 +434,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index fe952fb9903..d7d4b3150cf 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -589,7 +589,7 @@ class pdf_azur extends ModelePDFPropales /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object proposal * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -604,7 +604,7 @@ class pdf_azur extends ModelePDFPropales /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -779,7 +779,7 @@ class pdf_azur extends ModelePDFPropales /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1050,7 +1050,7 @@ class pdf_azur extends ModelePDFPropales /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1154,7 +1154,7 @@ class pdf_azur extends ModelePDFPropales /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1269,7 +1269,7 @@ class pdf_azur extends ModelePDFPropales $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -1354,7 +1354,7 @@ class pdf_azur extends ModelePDFPropales /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 289862c8523..8e45f3b86f2 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -253,4 +253,3 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, } } -?> diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index d0defd260dd..3bfb6f6b60c 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -95,7 +95,7 @@ class pdf_paiement $socid=0; if ($user->societe_id) $socid=$user->societe_id; - + 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 if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; @@ -141,7 +141,7 @@ class pdf_paiement $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."facture as f,"; $sql.= " ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement_facture as pf,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; - if (! $user->rights->societe->client->voir && ! $socid) + if (! $user->rights->societe->client->voir && ! $socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -149,7 +149,7 @@ class pdf_paiement $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND p.fk_paiement = c.id "; $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; - if (! $user->rights->societe->client->voir && ! $socid) + if (! $user->rights->societe->client->voir && ! $socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } @@ -237,7 +237,7 @@ class pdf_paiement /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param int $page Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -296,7 +296,7 @@ class pdf_paiement /** * Output body * - * @param PDF &$pdf PDF object + * @param PDF $pdf PDF object * @param string $page Page * @param array $lines Array of lines * @param Translate $outputlangs Object langs diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 94dd1b814e7..88b6e65bf01 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -239,7 +239,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Societe $soc Object third party * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 313a14ad246..27155847bf0 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -90,7 +90,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Societe $soc Object third party * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 8b31e581e26..2933a09de8e 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -139,7 +139,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $date = dol_now(); $yymm = strftime("%y%m",$date); - + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s",$max+1); @@ -152,7 +152,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode * Check validity of code according to its rules * * @param DoliDB $db Database handler - * @param string &$code Code to check/correct + * @param string $code Code to check/correct * @param Societe $soc Object third party * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if OK diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index eca0da0f9a5..15bef66bf8f 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -125,7 +125,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices return 0; } - $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->datef); + //Supplier invoices take invoice date instead of creation date for the mask + $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date); return $numFinal; } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index ead49d7de98..4124d4745f6 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -494,7 +494,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -689,7 +689,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -785,7 +785,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -870,7 +870,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -961,7 +961,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -1045,7 +1045,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index f15cab9cb6b..83d1aac952b 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -521,7 +521,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show payments table * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -536,7 +536,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -599,7 +599,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show total to pay * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -802,7 +802,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show table for lines * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -897,7 +897,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show top header of page. * - * @param PDF &$pdf Object PDF + * @param PDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1005,7 +1005,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; @@ -1089,7 +1089,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF + * @param PDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 82748a69b05..f508a595d23 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -203,7 +203,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file -
+
"> - remise_client); ?>" name="remise_percent">% + remise_percent); ?>" name="remise_percent">% rights->cron->ex } else { - if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); - else setEventMessage($langs->trans("JobFinished"),'mesgs'); - $action=''; + $res = $object->reprogram_jobs($user->login); + if ($res > 0) + { + if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); + else setEventMessage($langs->trans("JobFinished"),'mesgs'); + $action=''; + } + else + { + setEventMessage($object->error,'errors'); + $action=''; + } } } @@ -345,7 +354,7 @@ if (($action=="create") || ($action=="edit")) print $langs->trans('CronEvery').""; print "'; print ''; - + //$var=true; //print ''; //print ''.$langs->trans("OtherParameter").''; @@ -181,7 +181,7 @@ if ($mode == 'test' && $user->admin) print 'Media'; print 'Supported'; print "\n"; - + $list = $printer->getlist_available_printers(); $var = true; foreach ($list as $value) @@ -203,13 +203,13 @@ if ($mode == 'test' && $user->admin) print "\n"; } print ''; - + if (count($list) == 0) print $langs->trans("NoPrinterFound"); } dol_fiche_end(); + llxFooter(); $db->close(); -?> diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index ddbd3c015ff..44c28f383b5 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -67,7 +67,7 @@ class ActionsCardProduct /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index cee958be50f..cbb9e10750c 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -66,7 +66,7 @@ class ActionsCardService /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e0bd0c23c48..2987d0de8fd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4,16 +4,10 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger -<<<<<<< HEAD * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013-2014 Cedric GROSS - * Copyright (C) 2013 Marcos García - * Copyright (C) 2011-2014 Alexandre Spangaro -======= - * Copyright (C) 2010-2011 Juanjo Menent - * Copyright (C) 2013 Cedric GROSS * Copyright (C) 2013-2014 Marcos García ->>>>>>> refs/remotes/origin/3.5 + * Copyright (C) 2011-2014 Alexandre Spangaro * * 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 @@ -1413,6 +1407,7 @@ class Product extends CommonObject $sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,"; $sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,"; $sql.= " datec, tms, import_key, entity, desiredstock, tobatch"; + $sql.= " ,ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; if ($id) $sql.= " WHERE rowid = ".$this->db->escape($id); else @@ -1487,6 +1482,8 @@ class Product extends CommonObject $this->date_modification = $obj->tms; $this->import_key = $obj->import_key; $this->entity = $obj->entity; + + $this->ref_ext = $obj->ref_ext; $this->db->free($resql); diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 26761a2d56b..bf89798e79f 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("bills"); $langs->load("products"); +$langs->load("main"); $id=GETPOST('id','int'); $ref=GETPOST('ref','alpha'); @@ -292,13 +293,17 @@ if ($id > 0 || ! empty($ref)) { // Price print ''.$langs->trans("SellingPrice").''; + if ($object->price_base_type == 'TTC') { print price($object->price_ttc).' '.$langs->trans($object->price_base_type); } else { - print price($object->price).' '.$langs->trans($object->price_base_type); + print price($object->price); + if (!empty($object->price_base_type)) { + print ' '.$langs->trans($object->price_base_type); + } } print ''; @@ -310,7 +315,10 @@ if ($id > 0 || ! empty($ref)) } else { - print price($object->price_min).' '.$langs->trans($object->price_base_type); + print price($object->price_min); + if (!empty($object->price_base_type)) { + print ' '.$langs->trans($object->price_base_type); + } } print ''; } diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 1e8c7b7cd9a..24c8122a3a0 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -76,13 +76,13 @@ $modulepart='produit'; $parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if (empty($reshook)) { + /* + * Action envoie fichier + */ -/* - * Action envoie fichier - */ - -include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; - + include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php'; +} /* * View diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index a73d5817b3a..5498233e5b8 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -124,7 +124,7 @@ if (empty($reshook)) // Barcode value if ($action == 'setbarcode' && $createbarcode) { - $result=$object->check_barcode(GETPOST('barcode'),GETPOT('barcode_type_code')); + $result=$object->check_barcode(GETPOST('barcode'),GETPOST('barcode_type_code')); if ($result >= 0) { @@ -422,10 +422,10 @@ if (empty($reshook)) $_error++; $action = ""; - $mesg='
'.$langs->trans("ErrorProductAlreadyExists",$object->ref); + $mesg=$langs->trans("ErrorProductAlreadyExists",$object->ref); $mesg.=' '.$langs->trans("ShowCardHere").'.'; - $mesg.='
'; setEventMessage($mesg, 'errors'); + $object->fetch($id); //dol_print_error($object->db); } else diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 527615cc7c4..5396bd2e564 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -64,10 +64,6 @@ $hookmanager->initHooks(array('pricesuppliercard')); $product = new ProductFournisseur($db); $product->fetch($id,$ref); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=$hookmanager->errors; - - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -81,127 +77,130 @@ if (! $sortorder) $sortorder="ASC"; $parameters=array('socid'=>$socid, 'id_prod'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks -$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); -if ($action == 'remove_pf') -{ - $product = new ProductFournisseur($db); - if ($product->fetch($id) > 0) - { - if ($rowid) - { - $result=$product->remove_product_fournisseur_price($rowid); - $action = ''; - $mesg = '
'.$langs->trans("PriceRemoved").'.
'; - } - } +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) -{ - $id_fourn=GETPOST("id_fourn"); - if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn"); - $ref_fourn=GETPOST("ref_fourn"); - if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn"); - $quantity=GETPOST("qty"); - $remise_percent=price2num(GETPOST('remise_percent','alpha')); - $npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ; - $tva_tx = str_replace('*','', GETPOST('tva_tx','alpha')); - $tva_tx = price2num($tva_tx); - - if ($tva_tx == '') - { - $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'
'; - } - if (empty($quantity)) +if (empty($reshook)) { + if ($action == 'remove_pf') { - $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'
'; - } - if (empty($ref_fourn)) - { - $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'
'; - } - if ($id_fourn <= 0) - { - $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'
'; - } - if ($_POST["price"] < 0 || $_POST["price"] == '') - { - $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'
'; - } - - $product = new ProductFournisseur($db); - $result=$product->fetch($id); - if ($result <= 0) - { - $error++; - $mesg=$product->error; - } - - if (! $error) - { - $db->begin(); - - if (! $error) + $product = new ProductFournisseur($db); + if ($product->fetch($id) > 0) { - $ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice - if ($ret == -3) + if ($rowid) { - $error++; - - $product->fetch($product->product_id_already_linked); - $productLink = $product->getNomUrl(1,'supplier'); - - $mesg='
'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'
'; - } - else if ($ret < 0) - { - $error++; - $mesg='
'.$product->error.'
'; + $result=$product->remove_product_fournisseur_price($rowid); + $action = ''; + $mesg = '
'.$langs->trans("PriceRemoved").'.
'; } } + } + + if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) + { + $id_fourn=GETPOST("id_fourn"); + if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn"); + $ref_fourn=GETPOST("ref_fourn"); + if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn"); + $quantity=GETPOST("qty"); + $remise_percent=price2num(GETPOST('remise_percent','alpha')); + $npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ; + $tva_tx = str_replace('*','', GETPOST('tva_tx','alpha')); + $tva_tx = price2num($tva_tx); + + if ($tva_tx == '') + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'
'; + } + if (empty($quantity)) + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'
'; + } + if (empty($ref_fourn)) + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'
'; + } + if ($id_fourn <= 0) + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'
'; + } + if ($_POST["price"] < 0 || $_POST["price"] == '') + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'
'; + } + + $product = new ProductFournisseur($db); + $result=$product->fetch($id); + if ($result <= 0) + { + $error++; + $mesg=$product->error; + } if (! $error) - { - $supplier=new Fournisseur($db); - $result=$supplier->fetch($id_fourn); - if (isset($_POST['ref_fourn_price_id'])) - $product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); + { + $db->begin(); - $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, $npr); - if ($ret < 0) + if (! $error) { - $error++; - $mesg='
'.$product->error.'
'; + $ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice + if ($ret == -3) + { + $error++; + + $product->fetch($product->product_id_already_linked); + $productLink = $product->getNomUrl(1,'supplier'); + + $mesg='
'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'
'; + } + else if ($ret < 0) + { + $error++; + $mesg='
'.$product->error.'
'; + } } - } - if (! $error) - { - $db->commit(); - $action=''; - } - else - { - $db->rollback(); - } - } + if (! $error) + { + $supplier=new Fournisseur($db); + $result=$supplier->fetch($id_fourn); + if (isset($_POST['ref_fourn_price_id'])) + $product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); + + $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, $npr); + if ($ret < 0) + { + $error++; + $mesg='
'.$product->error.'
'; + } + } + + if (! $error) + { + $db->commit(); + $action=''; + } + else + { + $db->rollback(); + } + } + } + + if (GETPOST('cancel') == $langs->trans("Cancel")) + { + $action = ''; + header("Location: fournisseurs.php?id=".$_GET["id"]); + exit; + } } -if (GETPOST('cancel') == $langs->trans("Cancel")) -{ - $action = ''; - header("Location: fournisseurs.php?id=".$_GET["id"]); - exit; -} - - - /* * view */ diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 33025dd1551..a8502498e41 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -167,7 +167,7 @@ print $total; print ''; print ''; -if (! empty($conf->categorie->enabled)) +if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 40e99a2d2ee..44a6a69da2e 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -324,12 +324,16 @@ else print ''; print ''; print ''; + + // Barcode if (! empty($conf->barcode->enabled)) { print ''; print ''; print ''; } + + // Date modification print ''; print ' '; print ''; @@ -363,16 +367,7 @@ else print ''; print ' '; print ''; - //desiredstock - print ''; - print ' '; - print ''; - } - else - { - print ''; - print ' '; - print ''; + // Desired stock print ''; print ' '; print ''; @@ -467,7 +462,7 @@ else } // Better buy price - if ($user->rights->produit->creer) + if ($user->rights->fournisseur->lire) { print ''; if ($objp->minsellprice != '') @@ -501,15 +496,6 @@ else print $product_static->stock_reel; print ''; } - else - { - print ''; - print ' '; - print ''; - print ''; - print ' '; - print ''; - } } // Status (to buy) diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 7d1f4da5682..fe619531f48 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Marcos García * * 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 @@ -71,7 +72,9 @@ llxHeader('','',$helpurl); $sql = "SELECT count(*) as c"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= ' WHERE entity IN ('.getEntity('product', 1).')'; -if (isset($type)) $sql.= " AND fk_product_type = ".$type; +if ($type !== '') { + $sql.= " AND fk_product_type = ".$type; +} $result=$db->query($sql); if ($result) @@ -82,11 +85,14 @@ if ($result) $param = ''; $title = $langs->trans("ListProductServiceByPopularity"); -if (isset($type)) -{ +if ($type !== '') { $param = '&type='.$type; - $title = $langs->trans("ListProductByPopularity"); - if ($type == 1) $title = $langs->trans("ListServiceByPopularity"); + + if ($type == 1) { + $title = $langs->trans("ListServiceByPopularity"); + } else { + $title = $langs->trans("ListProductByPopularity"); + } } print_barre_liste($title, $page, "popuprop.php",$param,"","","",$num); @@ -106,7 +112,9 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; $sql.= " AND p.rowid = pd.fk_product"; -if (isset($type)) $sql.= " AND fk_product_type = ".$type; +if ($type !== '') { + $sql.= " AND fk_product_type = ".$type; +} $sql.= " GROUP BY (p.rowid)"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit, $offset); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b208cba1c7e..856a68face6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -365,10 +365,14 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) { // Prix mini print '' . $langs->trans("MinPrice") . ' ' . $i . ''; - if ($object->multiprices_base_type ["$i"] == 'TTC') { - print price($object->multiprices_min_ttc ["$i"]) . ' ' . $langs->trans($object->multiprices_base_type ["$i"]); - } else { - print price($object->multiprices_min ["$i"]) . ' ' . $langs->trans($object->multiprices_base_type ["$i"]); + if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT"; + if ($object->multiprices_base_type["$i"] == 'TTC') + { + print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]); + } + else + { + print price($object->multiprices_min["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]); } print ''; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index dc65764defd..001b528d431 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -153,7 +154,7 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$product->id,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$product->id,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$product->id,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&id=".$product->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","","&id=".$product->id,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$product->id,'align="right"',$sortfield,$sortorder); print "\n"; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ea0cce9e121..678660b7e6f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -41,7 +41,7 @@ class Task extends CommonObject var $fk_task_parent; var $label; var $description; - var $duration_effective; + var $duration_effective; // total of time spent on this task var $planned_workload; var $date_c; var $date_start; @@ -287,8 +287,8 @@ class Task extends CommonObject $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; $sql.= " duration_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").","; $sql.= " planned_workload=".(isset($this->planned_workload)?$this->planned_workload:"0").","; - $sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').","; - $sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').","; + $sql.= " dateo=".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null').","; + $sql.= " datee=".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null').","; $sql.= " progress=".$this->progress.","; $sql.= " rang=".((!empty($this->rang))?$this->rang:"0"); $sql.= " WHERE rowid=".$this->id; @@ -769,7 +769,7 @@ class Task extends CommonObject if ($this->db->query($sql) ) { $tasktime_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_time"); - $ret = $tasktme_id; + $ret = $tasktime_id; if (! $notrigger) { @@ -801,10 +801,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::addTimeSpent error -2 ".$this->error, LOG_ERR); $ret = -2; } - } - - if ($ret >= 0) - { + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")"; $sql.= " WHERE rowid = ".$tasktime_id; @@ -1025,7 +1022,8 @@ class Task extends CommonObject $error=0; - $now=dol_now(); + //Use 00:00 of today if time is use on task. + $now=dol_mktime(0,0,0,dol_print_date(dol_now(),'%m'),dol_print_date(dol_now(),'%d'),dol_print_date(dol_now(),'%Y')); $datec = $now; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 53559c74333..f0e5efa7254 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -130,12 +130,12 @@ print ''.$langs->trans("Status").''.$project->getLibStatut(4).' // Date start print ''.$langs->trans("DateStart").''; -print dol_print_date($object->date_start,'day'); +print dol_print_date($project->date_start,'day'); print ''; // Date end print ''.$langs->trans("DateEnd").''; -print dol_print_date($object->date_end,'day'); +print dol_print_date($project->date_end,'day'); print ''; print ''; @@ -212,7 +212,7 @@ if ($action=="addelement") $elementselectid = GETPOST("elementselect"); $result=$project->update_element($tablename, $elementselectid); if ($result<0) { - setEventMessage($mailchimp->error,'errors'); + setEventMessage($project->error,'errors'); } } @@ -373,8 +373,10 @@ foreach ($listofreferent as $key => $value) } } +$langs->load('margins'); + // Margin display of the project -print_titre("Margin"); +print_titre($langs->trans("Margins")); print ''; print ''; print ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index f0bdce25fca..8a6ebb0a3d4 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -57,7 +57,7 @@ $projectstatic = new Project($db); // Add new contact if ($action == 'addcontact' && $user->rights->projet->creer) { - $result = $object->fetch($id); + $result = $object->fetch($id, $ref); if ($result > 0 && $id > 0) { @@ -87,7 +87,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) // bascule du statut d'un contact if ($action == 'swapstatut' && $user->rights->projet->creer) { - if ($object->fetch($id)) + if ($object->fetch($id, $ref)) { $result=$object->swapContactStatus(GETPOST('ligne')); } @@ -100,7 +100,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) // Efface un contact if ($action == 'deleteline' && $user->rights->projet->creer) { - $object->fetch($id); + $object->fetch($id, $ref); $result = $object->delete_contact($_GET["lineid"]); if ($result >= 0) @@ -152,7 +152,7 @@ $userstatic = new User($db); if ($id > 0 || ! empty($ref)) { - if ($object->fetch($id) > 0) + if ($object->fetch($id, $ref) > 0) { $result=$projectstatic->fetch($object->fk_project); if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); @@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref)) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 50763f839f7..03ca7bae452 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -209,7 +209,7 @@ if ($object->id > 0) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; print ''; diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index ec23afb1902..94711b4d92e 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -97,7 +97,7 @@ print '
'.$langs->trans("Element").'
'; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index a6f8846ce0e..04e92c7c7f2 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -181,7 +181,7 @@ if ($object->id > 0) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index dd83cf57d8f..908a9513162 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -348,7 +348,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Progress - print ''; @@ -436,14 +436,15 @@ if ($id > 0 || ! empty($ref)) print convertSecondToTime($object->planned_workload,'allhourmin'); print ''; - // Progress + // Declared progress print ''; - // Progress + // Calculated progress print ''; // Description diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index cb8a4dd193a..8f72510adba 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -50,7 +50,7 @@ $projectstatic = new Project($db); /* * Actions -*/ + */ if ($action == 'addtimespent' && $user->rights->projet->creer) { @@ -72,7 +72,7 @@ if ($action == 'addtimespent' && $user->rights->projet->creer) if (! $error) { - $object->fetch($id); + $object->fetch($id, $ref); $object->timespent_note = $_POST["timespent_note"]; $object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds @@ -109,7 +109,7 @@ if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->cree if (! $error) { - $object->fetch($id); + $object->fetch($id, $ref); $object->timespent_id = $_POST["lineid"]; $object->timespent_note = $_POST["timespent_note_line"]; @@ -171,7 +171,7 @@ if (! empty($project_ref) && ! empty($withproject)) /* * View -*/ + */ llxHeader("",$langs->trans("Task")); @@ -183,7 +183,7 @@ if ($id > 0 || ! empty($ref)) /* * Fiche projet en mode visu */ - if ($object->fetch($id) >= 0) + if ($object->fetch($id, $ref) >= 0) { $result=$projectstatic->fetch($object->fk_project); if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); @@ -277,15 +277,12 @@ if ($id > 0 || ! empty($ref)) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label print ''; - // Planned workload - print ''; - // Project if (empty($withproject)) { @@ -300,6 +297,30 @@ if ($id > 0 || ! empty($ref)) print ''; } + // Date start + print ''; + + // Date end + print ''; + + // Planned workload + print ''; + + // Declared progress + print ''; + + // Calculated progress + print ''; + print '
'.$langs->trans("Project").''.$langs->trans("Status").''.$langs->trans("ProjectStatus").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("DateStart").'
'.$langs->trans("Progress").''; + print '
'.$langs->trans("ProgressDeclared").''; print $formother->select_percent($object->progress,'progress'); print '
'.$langs->trans("ProgressDeclared").''; print $object->progress.' %'; print '
'.$langs->trans("ProgressCalculated").''; - print $object->progress.' %'; + if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %'; + else print ''; print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("PlannedWorkload").''.convertSecondToTime($object->planned_workload,'allhourmin').'
'.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'dayhour'); + print '
'.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'dayhour'); + print '
'.$langs->trans("PlannedWorkload").''.convertSecondToTime($object->planned_workload,'allhourmin').'
'.$langs->trans("ProgressDeclared").''; + print $object->progress.' %'; + print '
'.$langs->trans("ProgressCalculated").''; + if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %'; + else print ''; + print '
'; dol_fiche_end(); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 38562557e3a..0dbf21ce881 100755 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -61,58 +61,59 @@ $hookmanager->initHooks(array('resource_card')); $parameters=array('resource_id'=>$id); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if (empty($reshook)) { -/******************************************************************* -* ACTIONS -* -* Put here all code to do according to value of "action" parameter -********************************************************************/ + /******************************************************************* + * ACTIONS + * + * Put here all code to do according to value of "action" parameter + ********************************************************************/ -if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write ) -{ - $error=0; - - if (empty($ref)) + if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write ) { - $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'
'; - } + $error=0; - if (! $error) - { - $res = $object->fetch($id); - if ( $res > 0 ) + if (empty($ref)) { - $object->ref = $ref; - $object->description = $description; - $object->fk_code_type_resource = $fk_code_type_resource; - - $result=$object->update($user); - if ($result > 0) + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'
'; + } + + if (! $error) + { + $res = $object->fetch($id); + if ( $res > 0 ) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; + $object->ref = $ref; + $object->description = $description; + $object->fk_code_type_resource = $fk_code_type_resource; + + $result=$object->update($user); + if ($result > 0) + { + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + setEventMessage('
'.$object->error.'
'); + $action='edit'; + } + } else { - setEventMessage('
'.$object->error.'
'); + setEventMessage($object->error,'errors'); $action='edit'; } - } - else + else { - setEventMessage($object->error,'errors'); $action='edit'; } } - else - { - $action='edit'; - } } - /*************************************************** * VIEW * diff --git a/htdocs/resource/class/actions_resource.class.php b/htdocs/resource/class/actions_resource.class.php index afcf9eb19b8..f8f0b5412f9 100644 --- a/htdocs/resource/class/actions_resource.class.php +++ b/htdocs/resource/class/actions_resource.class.php @@ -46,8 +46,8 @@ class ActionsResource * doActions for resource module * * @param array $parameters parameters - * @param Object &$object object - * @param string &$action action + * @param Object $object object + * @param string $action action * @return void */ /* Why a hook action ? TODO Remove this class and replace a method into commonobject diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index f618581aecd..d0f8be573f5 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -1,19 +1,20 @@ -* -* 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 -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*/ + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ /** * \file place/class/html.place.class.php diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 9cf6a83ef1d..d9ad13f83b1 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -23,8 +23,8 @@ */ // Put here all includes required by your class file -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); - +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; /** * DAO Resource object @@ -330,12 +330,12 @@ class Resource extends CommonObject function delete($rowid, $notrigger=0) { global $user,$langs,$conf; - + $error=0; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."resource"; $sql.= " WHERE rowid =".$rowid; - + dol_syslog(get_class($this)."::delete sql=".$sql); if ($this->db->query($sql)) { @@ -355,7 +355,7 @@ class Resource extends CommonObject } // End call triggers } - + return 1; } else { @@ -371,7 +371,7 @@ class Resource extends CommonObject return -1; } } - + /** * Load resource objects into $this->lines * @@ -507,9 +507,9 @@ class Resource extends CommonObject $line->fk_user_create = $obj->fk_user_create; if($obj->resource_id && $obj->resource_type) - $line->objresource = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type); + $line->objresource = fetchObjectByElement($obj->resource_id,$obj->resource_type); if($obj->element_id && $obj->element_type) - $line->objelement = $this->fetchObjectByElement($obj->element_id,$obj->element_type); + $line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type); $this->lines[$i] = $line; $i++; @@ -591,7 +591,7 @@ class Resource extends CommonObject $line->mandatory = $obj->mandatory; $line->fk_user_create = $obj->fk_user_create; - $this->lines[$i] = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type); + $this->lines[$i] = fetchObjectByElement($obj->resource_id,$obj->resource_type); $i++; } @@ -814,7 +814,7 @@ class Resource extends CommonObject $i=0; foreach($resources as $nb => $resource) { - $this->lines[$i] = $this->fetchObjectByElement($resource['resource_id'],$resource['resource_type']); + $this->lines[$i] = fetchObjectByElement($resource['resource_id'],$resource['resource_type']); $i++; } return $i; diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 32fbe2e2c00..de116453cf2 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -110,5 +110,3 @@ else { echo json_encode(array('nom'=>'ErrorBadParameter','label'=>'ErrorBadParameter','key'=>'ErrorBadParameter','value'=>'ErrorBadParameter')); } - -?> \ No newline at end of file diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 1ee163038bb..39f0dc761f8 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -89,7 +89,7 @@ abstract class ActionsCardCommon /** * Load data control * - * @param int &$action Action code + * @param int $action Action code * @return void */ function doActions(&$action) @@ -354,7 +354,7 @@ abstract class ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void @@ -706,4 +706,3 @@ abstract class ActionsCardCommon } -?> diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index a47b6321792..d54af2b8bba 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -75,7 +75,7 @@ class ActionsCardCompany extends ActionsCardCommon /** * Execute actions * - * @param string &$action Type of action + * @param string $action Type of action * @param int $id Id of object * @return int <0 if KO, >0 if OK */ @@ -91,7 +91,7 @@ class ActionsCardCompany extends ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index b8cb94a820b..2f00cd4bc27 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -75,7 +75,7 @@ class ActionsCardIndividual extends ActionsCardCommon /** * Execute actions * - * @param string &$action Action + * @param string $action Action * @param int $id Id of object (may be empty for creation) * @return int <0 if KO, >0 if OK */ @@ -91,7 +91,7 @@ class ActionsCardIndividual extends ActionsCardCommon /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param string &$action Type of action + * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5893fbab021..2cb3e634841 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -133,17 +133,17 @@ class Societe extends CommonObject var $barcode_type; /** * code (loaded by fetch_barcode) - * @var + * @var string */ var $barcode_type_code; /** * label (loaded by fetch_barcode) - * @var + * @var string */ var $barcode_type_label; /** * coder (loaded by fetch_barcode) - * @var + * @var string */ var $barcode_type_coder; @@ -2848,10 +2848,10 @@ class Societe extends CommonObject } /** - * Check if thirdparty may using localtax or not + * Check if we must use localtax feature or not according to country (country of $mysocin most cases). * * @param int $localTaxNum To get info for only localtax1 or localtax2 - * @return array array(0=>boolean, 1=>boolean) + * @return boolean true or false */ function useLocalTax($localTaxNum=0) { @@ -2873,9 +2873,9 @@ class Societe extends CommonObject } /** - * Check if thirdparty is from a country using revenue stamps + * Check if we must use revenue stamps feature or not according to country (country of $mysocin most cases). * - * @return boolean Yes or no + * @return boolean true or false */ function useRevenueStamp() { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 3cf38a58b90..84fc4326fe4 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -159,7 +159,7 @@ print $total; print ''; print ''; -if (! empty($conf->categorie->enabled)) +if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index df36812cce8..afb53bb5a5e 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2118,7 +2118,7 @@ class User extends CommonObject /** * Update user using data from the LDAP * - * @param ldapuser &$ldapuser Ladp User + * @param ldapuser $ldapuser Ladp User * * @return int <0 if KO, >0 if OK */ @@ -2220,8 +2220,6 @@ class User extends CommonObject * Reconstruit l'arborescence hierarchique des users sous la forme d'un tableau * Renvoi un tableau de tableau('id','id_parent',...) trie selon arbre et avec: * id = id du user - * id_parent = id du user parent - * id_children = tableau des id enfant * name = nom du user * fullname = nom avec chemin complet du user * fullpath = chemin complet compose des id @@ -2237,7 +2235,7 @@ class User extends CommonObject // Init this->parentof that is array(id_son=>id_parent, ...) $this->load_parentof(); - + // Init $this->users array $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -2306,6 +2304,29 @@ class User extends CommonObject return $this->users; } + /** + * Return list of all childs users in herarchy. + * + * @return array Array of user id lower than user. This overwrite this->users. + */ + function getAllChildIds() + { + // Init this->users + $this->get_full_tree(); + + $idtoscan=$this->id; + $childids=array(); + + dol_syslog("Build childid for id = ".$idtoscan); + foreach($this->users as $id => $val) + { + //var_dump($val['fullpath']); + if (preg_match('/_'.$idtoscan.'_/', $val['fullpath'])) $childids[$val['id']]=$val['id']; + } + + return $childids; + } + /** * For user id_user and its childs available in this->users, define property fullpath and fullname * diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index a0523bcbc28..9b1845d6bff 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1208,7 +1208,11 @@ else // Signature print ''.$langs->trans('Signature').''; - print dol_htmlentitiesbr($object->signature); + if (empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)) { + print dol_htmlentitiesbr($object->signature); + } else { + print $object->signature; + } print "\n"; // Hierarchy diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index cde5e764af5..978b1929b98 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -64,6 +64,10 @@ if ($action == 'dolibarr2ldap') $result=$ldap->connect_bind(); $info=$fgroup->_load_ldap_info(); + // Get a gid number for objectclass PosixGroup + if(in_array('posixGroup',$info['objectclass'])) + $info['gidNumber'] = $ldap->getNextGroupGid(); + $dn=$fgroup->_load_ldap_dn($info); $olddn=$dn; // We can say that old dn = dn as we force synchro diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 1b85c677175..45a8fb76a78 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -106,56 +106,41 @@ $server->wsdl->addComplexType( 'tns:categorie' ); -/* - * Tableau des catégories - -$server->wsdl->addComplexType( - 'categories', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - array('id'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:categorie[]') - ), - 'tns:categories' -); + /* + * Image of product */ - -/* - * Les photos de la catégorie (un tableau indéxé qui contient les images avec leur vignette) + $server->wsdl->addComplexType( + 'PhotosArray', + 'complexType', + 'array', + 'sequence', + '', + array( + 'image' => array( + 'name' => 'image', + 'type' => 'tns:image', + 'minOccurs' => '0', + 'maxOccurs' => 'unbounded' + ) + ) + ); + + /* + * An image */ -$server->wsdl->addComplexType( - 'PhotosArray', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:image[]') - ), - '' -); - -/* - * Une photo ( nom image / nom_vignette ) - */ -$server->wsdl->addComplexType( - 'image', - 'complexType', - 'array', - '', - 'SOAP-ENC:Array', - array(), - array( - 'photo' => array('name'=>'photo','type'=>'xsd:string'), - 'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'), - 'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'), - 'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string') - ) -); + $server->wsdl->addComplexType( + 'image', + 'complexType', + 'struct', + 'all', + '', + array( + 'photo' => array('name'=>'photo','type'=>'xsd:string'), + 'photo_vignette' => array('name'=>'photo_vignette','type'=>'xsd:string'), + 'imgWidth' => array('name'=>'imgWidth','type'=>'xsd:string'), + 'imgHeight' => array('name'=>'imgHeight','type'=>'xsd:string') + ) + ); /* * Retour diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 570777b0972..eb05665ea04 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -655,6 +655,7 @@ function updateContact($authentication,$contact) $object->province_id=$contact['province_id']; + $object->phone_pro=$contact['phone_pro']; $object->phone_perso=$contact['phone_perso']; $object->phone_mobile=$contact['phone_mobile']; $object->fax=$contact['fax']; diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index c5ac0c8c686..4a295cd3bfa 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -460,7 +460,7 @@ function createThirdParty($authentication,$thirdparty) $result=$newobject->create($fuser); if ($newobject->particulier && $result > 0) { $newobject->firstname = $thirdparty['firstname']; - $newobject->name_bis = $thirdparty['ref']; + $newobject->name_bis = $thirdparty['lastname']; $result = $newobject->create_individual($fuser); } if ($result <= 0) diff --git a/scripts/odt2pdf/odt2pdf.sh b/scripts/odt2pdf/odt2pdf.sh index 0599e4291c5..9d9bf18a8c7 100755 --- a/scripts/odt2pdf/odt2pdf.sh +++ b/scripts/odt2pdf/odt2pdf.sh @@ -22,7 +22,7 @@ if [ -f "$1.odt" ] nbprocess=$(pgrep -c soffice) if [ $nbprocess -ne 1 ] then - soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless& + soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless & retcode=$? if [ $retcode -ne 0 ] then diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 2c83b4fdfc3..90c0d10e3fb 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -338,4 +338,3 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 451e886a761..8a2e3f57120 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -265,4 +265,3 @@ class CommandeTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index cbdde31e14d..a22146dfc2a 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -183,4 +183,3 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase return $result; } } -?> \ No newline at end of file diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 24d6ad03d80..693282e62c4 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -233,4 +233,4 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index efd5f54008f..53788d71dab 100755 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -257,4 +257,3 @@ class EntrepotTest extends PHPUnit_Framework_TestCase return; } } -?> \ No newline at end of file diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index d5938fc4691..641fe3b7f9e 100755 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -265,4 +265,4 @@ class ExportTest extends PHPUnit_Framework_TestCase return true; } } -?> + diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 4adace8ef9a..4d4783240fa 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -131,7 +131,7 @@ class FactureRecTest extends PHPUnit_Framework_TestCase $localobjectinv=new Facture($this->savdb); $localobjectinv->initAsSpecimen(); $localobjectinv->create($user); - + $localobject=new FactureRec($this->savdb); $localobject->initAsSpecimen(); $result=$localobject->create($user, $localobjectinv->id); @@ -141,15 +141,15 @@ class FactureRecTest extends PHPUnit_Framework_TestCase return $result; } - - - - - + + + + + /** * Edit an object to test updates * - * @param mixed &$localobject Object Facture + * @param mixed $localobject Object Facture * @return void */ public function changeProperties(&$localobject) @@ -196,4 +196,3 @@ class FactureRecTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> \ No newline at end of file diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 9551c6ce02e..2227559ffd3 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -282,7 +282,7 @@ class FactureTest extends PHPUnit_Framework_TestCase /** * Edit an object to test updates * - * @param mixed &$localobject Object Facture + * @param mixed $localobject Object Facture * @return void */ public function changeProperties(&$localobject) @@ -329,4 +329,4 @@ class FactureTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> + diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index dbb3f6d8b8d..78c2278ba69 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -799,4 +799,4 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 3cac847a01f..089b279f75c 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -265,4 +265,4 @@ class PropalTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 162248f2e98..97aa0f0a954 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -456,4 +456,4 @@ class SocieteTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index d161b3ce395..e0eaa03acec 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -272,7 +272,7 @@ class UserTest extends PHPUnit_Framework_TestCase /** * Edit an object to test updates * - * @param mixed &$localobject Object Facture + * @param mixed $localobject Object Facture * @return void */ public function changeProperties(&$localobject) @@ -318,4 +318,3 @@ class UserTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> \ No newline at end of file diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 12c01eeba70..85c2398c568 100755 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -181,4 +181,4 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase } } -?> + diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 8ef0c383955..bf7cdc357c0 100755 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -181,4 +181,4 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase } } -?> +