From 7de0438299a4aa47bf3a47a0d679ff2b4d90ef13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Feb 2014 16:26:41 +0100 Subject: [PATCH 01/16] Fix: Link on supplier in document invoice must go to supplier card. --- htdocs/fourn/facture/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 1cd4d982466..6c47f66ec7d 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -120,7 +120,7 @@ if ($object->id > 0) print "\n"; // Thirdparty - print ''.$langs->trans('Supplier').''.$object->thirdparty->getNomUrl(1).''; + print ''.$langs->trans('Supplier').''.$object->thirdparty->getNomUrl(1,'supplier').''; // Type print ''.$langs->trans('Type').''; From 2d15e2c759482bf4d5b711fe1baad081c11073a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Feb 2014 16:31:23 +0100 Subject: [PATCH 02/16] Fix: Link on supplier in document invoice must go to supplier card. --- htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/fiche.php | 2 +- htdocs/fourn/facture/note.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index c5205c47815..9010abbb50f 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref)) // Third party print "".$langs->trans("Supplier").""; - print ''.$object->client->getNomUrl(1,'compta').''; + print ''.$object->thirdparty->getNomUrl(1,'supplier').''; print ""; print ''; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 06c8d9d590d..cf47afcf10c 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1520,7 +1520,7 @@ else print ''; // Third party - print ''.$langs->trans('Supplier').''.$societe->getNomUrl(1); + print ''.$langs->trans('Supplier').''.$societe->getNomUrl(1,'supplier'); print '   ('.$langs->trans('OtherBills').')'; print ''; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index b4bb99dcefc..7947b9be020 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -101,7 +101,7 @@ if ($object->id > 0) print "\n"; // Company - print ''.$langs->trans('Supplier').''.$object->thirdparty->getNomUrl(1).''; + print ''.$langs->trans('Supplier').''.$object->thirdparty->getNomUrl(1,'supplier').''; // Type print ''.$langs->trans('Type').''; From 18f8c80b98e2ef31a0c9ab697031b00941662b4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Feb 2014 13:59:38 +0100 Subject: [PATCH 03/16] Fix: lintian warning in date --- build/debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index af2141bf6db..899d08100d9 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -3,7 +3,7 @@ dolibarr (3.5.0-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. - -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Fri, 31 Jan 2013 12:00:00 +0100 dolibarr (3.4.2-3) unstable; urgency=low @@ -17,7 +17,7 @@ dolibarr (3.4.1-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. - -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Mon, 27 Apr 2013 12:00:00 +0100 dolibarr (3.4.0-3) unstable; urgency=low From 4c60873d0648ec2b3996218ded0f2e58f0dc98ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Feb 2014 14:57:55 +0100 Subject: [PATCH 04/16] Fix: not dependencies by default to be compatible with all distrib. --- build/debian/control | 15 +++++++------ build/debian/install.forced.php.install | 30 ++++++++++++------------- build/debian/rules | 28 +++++++++++------------ 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/build/debian/control b/build/debian/control index ac65f0b9070..fe5bdb8b162 100755 --- a/build/debian/control +++ b/build/debian/control @@ -11,13 +11,14 @@ Comments: This package need at least debian 7 or ubuntu 13.04 or any distributio Package: dolibarr Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, php5-mysql | php5-mysqli, - php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip, - libphp-adodb, - libnusoap-php, - libphp-pclzip, - libfpdi-php, libfpdf-tpl-php, php-fpdf, - libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor, - ttf-dejavu-core, + php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, +# php5-geoip, +# libphp-adodb, +# libnusoap-php, +# libphp-pclzip, +# libfpdi-php, libfpdf-tpl-php, php-fpdf, +# libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor, +# ttf-dejavu-core, xdg-utils, mysql-server, ${misc:Depends}, diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index f5b663b3f4c..370cb5353de 100755 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -27,20 +27,20 @@ $force_install_lockinstall='444'; // Value to overwrite path to use shared libraries/fonts instead of embedded one. // If we enable/disable libraries declaration during install, we must also check they are -// not removed from package (see in rules file), -// declared into dependencies (see in control file) -$force_dolibarr_lib_TCPDF_PATH=''; -$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf'; -$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; -$force_dolibarr_lib_GEOIP_PATH=''; -$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; -$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; -$force_dolibarr_lib_PHPEXCEL_PATH=''; -$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; -$force_dolibarr_js_JQUERY='/javascript/jquery'; -$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; -$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; -$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; +// - not removed from package (see rm in rules file), +// - declared into dependencies (see Depends in control file) +//$force_dolibarr_lib_TCPDF_PATH=''; +//$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf'; +//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; +//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; +//$force_dolibarr_lib_GEOIP_PATH=''; +//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; +//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; +//$force_dolibarr_lib_PHPEXCEL_PATH=''; +//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; +//$force_dolibarr_js_JQUERY='/javascript/jquery'; +//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; +//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot'; +//$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; ?> \ No newline at end of file diff --git a/build/debian/rules b/build/debian/rules index 2ab8af290c1..528924e64d8 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -90,27 +90,27 @@ clean: rm -fr build/rpm rm -fr build/zip - # clean from all embedded libraries (we use package dependencies instead) - rm -fr htdocs/includes/adodbtime - rm -fr htdocs/includes/ckeditor + # clean from all PHP embedded libraries (we use package dependencies instead) +# rm -fr htdocs/includes/adodbtime # rm -fr htdocs/includes/fpdfi - rm -fr htdocs/includes/fonts - rm -fr htdocs/includes/geoip - rm -fr htdocs/includes/nusoap - rm -fr htdocs/includes/odtphp/zip/pclzip - rm -fr htdocs/includes/phpmailer - rm -fr htdocs/includes/jquery/css - rm -fr htdocs/includes/jquery/js - rm -fr htdocs/includes/jquery/plugins/flot - rm -fr htdocs/includes/jquery/plugins/jstree - rm -fr htdocs/includes/jquery/plugins/lightbox +# rm -fr htdocs/includes/geoip +# rm -fr htdocs/includes/nusoap +# rm -fr htdocs/includes/odtphp/zip/pclzip + # clean from all JS-CSS embedded libraries (we use package dependencies instead) +# rm -fr htdocs/includes/ckeditor +# rm -fr htdocs/includes/jquery/js +# rm -fr htdocs/includes/jquery/css +# rm -fr htdocs/includes/jquery/plugins/flot + # clean from all embedded fonts (we use package dependencies instead) +# rm -fr htdocs/includes/fonts + + # clean from useless files rm -fr htdocs/includes/jquery/plugins/multiselect rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33 rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 rm -fr htdocs/includes/tcpdf/fonts/utils - # clean from files to avoid warning of missing dependencies rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py From 8768ece9f7300743927124a19fc271a09f942d4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Feb 2014 15:46:22 +0100 Subject: [PATCH 05/16] Fix for ubuntu compatibility --- build/debian/control | 32 +++++++++++++++++++------------- build/debian/dolibarr.postinst | 33 +++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/build/debian/control b/build/debian/control index fe5bdb8b162..a293319d453 100755 --- a/build/debian/control +++ b/build/debian/control @@ -1,41 +1,47 @@ Source: dolibarr -Maintainer: Laurent Destailleur (eldy) -Uploaders: Laurent Destailleur (eldy) -Standards-Version: 3.9.2 Section: web Priority: optional +Maintainer: Laurent Destailleur (eldy) +Uploaders: Laurent Destailleur (eldy) +Standards-Version: 3.9.4 Homepage: http://www.dolibarr.org -Build-Depends: debhelper (>= 7), po-debconf, dpatch +Build-Depends: debhelper (>= 9), po-debconf, dpatch Comments: This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version Package: dolibarr +Architecture: all Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, - php5-mysql | php5-mysqli, - php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, -# php5-geoip, + php5-cli, +# Required PHP extensions + php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap, php5-geoip, +# Required PHP libraries + php-pear, php-mail-mime, +# libfpdi-php, libfpdf-tpl-php, php-fpdf, # libphp-adodb, # libnusoap-php, # libphp-pclzip, -# libfpdi-php, libfpdf-tpl-php, php-fpdf, +# Required javascript libraries # libjs-jquery, libjs-jquery-ui, libjs-flot, ckeditor, -# ttf-dejavu-core, +# Misc dependencies +# fonts-dejavu-core | ttf-dejavu-core, xdg-utils, mysql-server, ${misc:Depends}, ${perl:Depends} -Recommends: apache2 | lighttpd | httpd, mysql-client +Recommends: mysql-client, apache2 | lighttpd | httpd Suggests: www-browser -Architecture: all Description: Web based software to manage a small company or foundation Dolibarr ERP & CRM is an easy to use open source/free software for small and medium companies, foundations or freelances. It includes different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. + . It's a web software you can install as a standalone program or on any web hosting provider to use it from anywhere with any web browser. . - Dolibarr was designed to be easy to use. Only features you need are - visible, depending on which module were activated. + Dolibarr was designed to be easy to use. Only the features that you need are + visible, depending on which modules were activated. + . Most common used modules are: . Customers, Suppliers or Prospects directory, diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 40fb4142c40..00b1601ce00 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -13,6 +13,11 @@ set -e # # for details, see /usr/share/doc/packaging-manual/ +if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + # Needs to be run outside of functions to have access to parameters + . /usr/share/apache2/apache2-maintscript-helper +fi + setup_empty_conf() { echo Create empty file $config mkdir -p /etc/dolibarr @@ -36,21 +41,29 @@ enable_install_upgrade_wizard() { } apache_install() { + # Apache 2 setup + if which a2enmod >/dev/null 2>&1 ;then + a2enmod alias + fi + webserver=$1 - if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then - echo "Add link for Apache config file" - ln -s /etc/$webserver/conf-available/dolibarr.conf /etc/$webserver/conf.d/dolibarr.conf + if which a2enconf >/dev/null 2>&1 ;then + # a2enconf exists for ubuntu only + a2enconf dolibarr + else + if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then + echo "Add link for Apache config file" + ln -s /etc/$webserver/conf-available/dolibarr.conf /etc/$webserver/conf.d/dolibarr.conf + fi fi } lighttpd_install() { - if [ ! -f /etc/lighttpd/conf-available/50-dolibarr.conf ] ; then - if which lighty-enable-mod >/dev/null 2>&1 ; then - echo "Enable lighttpd link for dolibarr config file" - lighty-enable-mod dolibarr fastcgi-php - else - echo "Lighttpd not installed, skipping" - fi + if which lighty-enable-mod >/dev/null 2>&1 ; then + echo "Enable lighttpd link for dolibarr config file" + lighty-enable-mod dolibarr fastcgi-php + else + echo "Lighttpd not installed, skipping" fi } From ad0e78a56ad95798c581d2675feaecc120cf98d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Feb 2014 16:29:56 +0100 Subject: [PATCH 06/16] Fix: debian and ubuntu package --- build/debian/changelog | 4 ++-- build/debian/dolibarr.install | 2 +- build/debian/rules | 5 +++-- build/makepack-dolibarr.pl | 28 ++++++++++++++++++---------- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 899d08100d9..b53a9bb741f 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -3,7 +3,7 @@ dolibarr (3.5.0-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. - -- Laurent Destailleur (eldy) Fri, 31 Jan 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Fri, 31 Jan 2014 12:00:00 +0100 dolibarr (3.4.2-3) unstable; urgency=low @@ -24,4 +24,4 @@ dolibarr (3.4.0-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. - -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 + -- Laurent Destailleur (eldy) Mon, 22 Apr 2013 12:00:00 +0100 \ No newline at end of file diff --git a/build/debian/dolibarr.install b/build/debian/dolibarr.install index 106a3b7dcf8..72dff46ed15 100755 --- a/build/debian/dolibarr.install +++ b/build/debian/dolibarr.install @@ -6,7 +6,7 @@ debian/lighttpd/50-dolibarr.conf etc/lighttpd/conf-available/ debian/install.forced.php.install etc/dolibarr/ htdocs usr/share/dolibarr/ scripts usr/share/dolibarr/ -ChangeLog usr/share/doc/dolibarr/ +changelog usr/share/doc/dolibarr/ README usr/share/doc/dolibarr/ doc/install usr/share/doc/dolibarr/ doc/user usr/share/doc/dolibarr/ diff --git a/build/debian/rules b/build/debian/rules index 528924e64d8..b1b7ca09aff 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -114,8 +114,9 @@ clean: # clean from files to avoid warning of missing dependencies rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py - # Licence files are included into copyright file. - rm -fr htdocs/includes/phpexcel/license.txt + # Licence files are already included into copyright file. + rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt + rm -f htdocs/includes/phpexcel/license.txt rm -f htdocs/includes/tcpdf/LICENSE.TXT dh $@ diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 4751b9a43c9..964b5b58d98 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -46,7 +46,7 @@ $FILENAMETGZ="$PROJECT-$MAJOR.$MINOR.$BUILD"; $FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD"; $FILENAMEXZ="$PROJECT-$MAJOR.$MINOR.$BUILD"; $FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION"; -$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${BUILD}"; +$FILENAMEDEB="see later"; $FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app"; $FILENAMEEXEDOLIWAMP="DoliWamp-$MAJOR.$MINOR.$BUILD"; if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat @@ -365,6 +365,8 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # Keep this removal in case we embed libraries + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; @@ -613,15 +615,17 @@ if ($nboftargetok) { $newbuild =~ s/(dev|alpha)/1/gi; # dev $newbuild =~ s/beta/2/gi; # beta $newbuild =~ s/rc./3/gi; # rc - if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale - # now newbuild is 0-1 or 0-4 for example + if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc + # now newbuild is 0-1 or 0-3 for example print "Version is $MAJOR.$MINOR.$newbuild\n"; $build = $newbuild; $build =~ s/-.*$//g; # now build is 0 for example # $build .= '+nmu1'; # now build is 0+nmu1 for example - + + $FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}"; + print "Remove target ${FILENAMEDEB}_all.deb...\n"; unlink("$NEWDESTI/${FILENAMEDEB}_all.deb"); print "Remove target ${FILENAMEDEB}.dsc...\n"; @@ -676,12 +680,14 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; # We remove embedded libraries or fonts (this is also inside rules file, target clean) - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`, - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`; - + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`; + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`, + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`; + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`; + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`; + # Rename upstream changelog to match debian rules + $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; + # Prepare source package (init debian dir) print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; @@ -753,6 +759,8 @@ if ($nboftargetok) { chdir("$olddir"); + print "You can check package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n"; + # Move to final dir print "Move *_all.deb to $NEWDESTI\n"; $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; From 77b3c9d2eb4e5c7aeb367881b35ac721b68cf4d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Feb 2014 19:00:56 +0100 Subject: [PATCH 07/16] Fix: Bad constant --- htdocs/admin/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index e577f90b625..47a05684223 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -88,7 +88,7 @@ print '
'; // Show info setup module print img_picto('','puce').' '.$langs->trans("SetupDescription4",DOL_URL_ROOT.'/admin/modules.php?mainmenu=home'); -if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->global->MAIN_MINNB_MODULE)) // If only user module enabled +if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled { $langs->load("errors"); $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); @@ -97,6 +97,7 @@ if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->g print '
'; print '
'; print '
'; +print '
'; // Add hook to add information $reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks From 70c262a99f8c0fade72005081f081bc2ae4eba2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Feb 2014 19:19:41 +0100 Subject: [PATCH 08/16] Avoid duplicate a2en. No pass into log. --- build/debian/dolibarr.postinst | 11 ++++++----- build/debian/dolibarr.postrm | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 00b1601ce00..f45ab7680c4 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -41,11 +41,6 @@ enable_install_upgrade_wizard() { } apache_install() { - # Apache 2 setup - if which a2enmod >/dev/null 2>&1 ;then - a2enmod alias - fi - webserver=$1 if which a2enconf >/dev/null 2>&1 ;then # a2enconf exists for ubuntu only @@ -92,6 +87,12 @@ case "$1" in else echo This is not a first install fi + + # Apache 2 setup + if which a2enmod >/dev/null 2>&1 ;then + a2enmod alias + fi + apache_install lighttpd_install diff --git a/build/debian/dolibarr.postrm b/build/debian/dolibarr.postrm index 38ebf8399c2..fa16ed582f0 100644 --- a/build/debian/dolibarr.postrm +++ b/build/debian/dolibarr.postrm @@ -177,18 +177,19 @@ case "$1" in passopt="--password='"`echo "$dbadmpass" | sed -e "s/'/'"'"'"'"'"'"'/g"`"'" fi mysqlcmd="mysql $hostopt $passopt -u $dbadmin" - + mysqlcmdnopass="mysql $hostopt -u $dbadmin" + # Now run the drop user if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then echo postrm Database login $dbuser@localhost removed else - error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\"" + error="Unable to run $mysqlcmdnopass -f -e \"DROP USER '$dbuser'@'localhost';\"" echo postrm $error fi if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'%';\"" ; then echo postrm Database login $dbuser@% removed else - error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'%';\"" + error="Unable to run $mysqlcmdnopass -f -e \"DROP USER '$dbuser'@'%';\"" echo postrm $error fi From 2b2d764180ae9a552b70abf898f7ee0eabb66a74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2014 17:30:35 +0100 Subject: [PATCH 09/16] Fix: ref and date of supplier invoice. Fix: Check on bank account --- htdocs/fourn/facture/paiement.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 8f3f2909832..352c3150c52 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -96,7 +96,7 @@ if ($action == 'add_paiement') { // Si module bank actif, un compte est obligatoire lors de la saisie // d'un paiement - if (! $_POST['accountid']) + if ($_POST['accountid'] <= 0) { setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors'); $error++; @@ -298,13 +298,16 @@ if ($action == 'create' || $action == 'add_paiement') $objp = $db->fetch_object($resql); $var=!$var; print ''; - print ''.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref; - print ''; + print ''; + $invoicesupplierstatic->ref=$objp->ref; + $invoicesupplierstatic->id=$objp->facid; + print $invoicesupplierstatic->getNomUrl(1); + print ''; print ''.$objp->ref_supplier.''; if ($objp->df > 0 ) { print ''; - print dol_print_date($db->jdate($objp->df)).''; + print dol_print_date($db->jdate($objp->df), 'day').''; } else { From 408a02832034339a1ff1349baee8fc3505197468 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Feb 2014 20:07:25 +0100 Subject: [PATCH 10/16] Fix: Must return a string --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8b572bc5635..7aa09f556b9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -705,7 +705,7 @@ class Form } else {*/ - print $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit); + return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit); //} } From 1ae87887fb26fd6ccf3a934016a5f6d1ea515d68 Mon Sep 17 00:00:00 2001 From: jfefe Date: Tue, 4 Feb 2014 17:53:41 +0100 Subject: [PATCH 11/16] Fix into user webservices : better error management and country detection - Avoid errors when creating an user with thirdparty - Add country detection in webservices when country_code is filled --- htdocs/webservices/server_user.php | 53 +++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 3a7d0a89283..c33bfaf07ea 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -181,7 +181,8 @@ $thirdpartywithuser_fields = array( 'tva_intra' => array('name'=>'tva_intra','type'=>'xsd:string'), // For user 'login' => array('name'=>'login','type'=>'xsd:string'), - 'password' => array('name'=>'password','type'=>'xsd:string') + 'password' => array('name'=>'password','type'=>'xsd:string'), + 'group_id' => array('name'=>'group_id','type'=>'xsd:string') ); //Retreive all extrafield for contact @@ -523,6 +524,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) } else { + $db->begin(); /* * Company creation */ @@ -533,6 +535,25 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) $thirdparty->town=$thirdpartywithuser['town']; $thirdparty->country_id=$thirdpartywithuser['country_id']; $thirdparty->country_code=$thirdpartywithuser['country_code']; + + // find the country id by code + $langs->load("dict"); + + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; + $sql.= " WHERE active = 1"; + $sql.= " AND code='".$thirdparty->country_code."'"; + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + if ($num) + { + $obj = $db->fetch_object($resql); + $thirdparty->country_id = $obj->rowid; + } + } $thirdparty->phone=$thirdpartywithuser['phone']; $thirdparty->fax=$thirdpartywithuser['fax']; $thirdparty->email=$thirdpartywithuser['email']; @@ -570,6 +591,9 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) $contact->phone_pro = $thirdparty->phone; $contact->phone_mobile = $thirdpartywithuser['phone_mobile']; $contact->fax = $thirdparty->fax; + $contact->statut = 1; + $contact->country_id = $thirdparty->country_id; + $contact->country_code = $thirdparty->country_code; //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels @@ -591,33 +615,29 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) * */ $edituser = new User($db); - $db->begin(); $id = $edituser->create_from_contact($contact,$thirdpartywithuser["login"]); if ($id > 0) { - $edituser->setPassword($user,trim($thirdpartywithuser['password'])); + $edituser->setPassword($fuser,trim($thirdpartywithuser['password'])); + + if($thirdpartywithuser['group_id'] > 0 ) + $edituser->SetInGroup($thirdpartywithuser['group_id'],$conf->entity); } else { $error++; - $errorcode='NOT_CREATE'; $errorlabel='Object not create : no contact found or create'; - } - - - if (! $error && $id > 0) - { - $db->commit(); - } - else - { - $db->rollback(); - $error++; - $errorcode='NOT_CREATE'; $errorlabel='Contact not create'; + $errorcode='NOT_CREATE'; $errorlabel='Object not create : '.$edituser->error; } } + else + { + $error++; + $errorcode='NOT_CREATE'; $errorlabel='Object not create : '.$contact->error; + } if(!$error) { + $db->commit(); $objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>'SUCCESS'),'id'=>$socid_return); $error=0; } @@ -645,6 +665,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) if ($error) { + $db->rollback(); $objectresp = array( 'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel) ); From 0da1a64335e995738f0336e72b52a08951eb56b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2014 20:41:23 +0100 Subject: [PATCH 12/16] Fix: Missing vars and bar id. --- htdocs/core/tpl/contacts.tpl.php | 3 +++ htdocs/projet/tasks/contact.php | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index c2c2ef9a452..875b81cd05e 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -34,6 +34,9 @@ elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; } elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } elseif ($module == 'project') { $permission=$user->rights->projet->creer; } +elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } +elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } +elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page $formcompany= new FormCompany($db); diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 80ddc0cd178..27559938626 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -283,7 +283,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - print ''; + if ($withproject) print ''; // Ligne ajout pour contact interne print ""; @@ -299,7 +299,7 @@ if ($id > 0 || ! empty($ref)) print ''; // On recupere les id des users deja selectionnes $contactsofproject=$projectstatic->getListContactId('internal'); - $form->select_users($user->id,'contactid',0,'',0,'',$contactsofproject); + $form->select_users($user->id,'userid',0,'',0,'',$contactsofproject); print ''; print ''; $formcompany->selectTypeContact($object, '', 'type','internal','rowid'); @@ -317,6 +317,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; + if ($withproject) print ''; $var=!$var; print ""; From a6a26ec31358414352ebd39e692d6d679d5f3784 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Feb 2014 17:25:02 +0100 Subject: [PATCH 13/16] Fixed: Write note into field "note_private" in llx_facture ("note" deprecated) --- htdocs/cashdesk/validation_verif.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index d2b55deccde..ffaa01b7a94 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -207,7 +207,7 @@ switch ($action) $invoice->total_ht=$obj_facturation->prixTotalHt(); $invoice->total_tva=$obj_facturation->montantTva(); $invoice->total_ttc=$obj_facturation->prixTotalTtc(); - $invoice->note=$note; + $invoice->note_private=$note; $invoice->cond_reglement_id=$cond_reglement_id; $invoice->mode_reglement_id=$mode_reglement_id; //print "c=".$invoice->cond_reglement_id." m=".$invoice->mode_reglement_id; exit; From e3ac9db9ec92b32ecf0286fcf92dc67692c57caf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2014 12:11:39 +0100 Subject: [PATCH 14/16] Fix: Data was encode twice making bad translation for language with special chars. --- htdocs/core/boxes/box_graph_product_distribution.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 521dd33f0e2..725ef300125 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -115,9 +115,9 @@ class box_graph_product_distribution extends ModeleBoxes if ($showpropalnb) $nbofgraph++; if ($showordernb) $nbofgraph++; - $paramtitle=$langs->trans("Products").'/'.$langs->trans("Services"); - if (empty($conf->produit->enabled)) $paramtitle=$langs->trans("Services"); - if (empty($conf->service->enabled)) $paramtitle=$langs->trans("Products"); + $paramtitle=$langs->transnoentitiesnoconv("Products").'/'.$langs->transnoentitiesnoconv("Services"); + if (empty($conf->produit->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Services"); + if (empty($conf->service->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Products"); $socid=empty($user->societe_id)?0:$user->societe_id; $userid=0; // No filter on user creation From db006dcdf833357076f71a9d96770750aa506c9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2014 12:52:00 +0100 Subject: [PATCH 15/16] Fix: Missing lang->load --- htdocs/compta/sociales/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index e96c5389529..a8432c38d52 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -27,12 +27,13 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; +$langs->load("compta"); + // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); From 255a1f649791bca731c38b6ca203f53226074a02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2014 20:57:43 +0100 Subject: [PATCH 16/16] Fix: String translated twice --- htdocs/core/ajax/ziptown.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 294458d2352..47cb887c0cc 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Laurent Destailleur +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2011-204 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 @@ -73,7 +73,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; $sql.= " ORDER BY z.zip, z.town"; - $sql.= $db->plimit(50); // Avoid pb with bad criteria + $sql.= $db->plimit(100); // Avoid pb with bad criteria } else // Use table of third parties { @@ -87,7 +87,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; $sql.= " ORDER BY s.fk_pays, s.zip, s.town"; - $sql.= $db->plimit(50); // Avoid pb with bad criteria + $sql.= $db->plimit(100); // Avoid pb with bad criteria } //print $sql; @@ -97,8 +97,8 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) { while ($row = $db->fetch_array($resql)) { - $country = $row['fk_country']?($langs->trans('Country'.$row['country_code'])!='Country'.$row['country_code']?$langs->trans('Country'.$row['country_code']):$row['country']):''; - $county = $row['fk_county']?($langs->trans($row['county_code'])!=$row['county_code']?$langs->trans($row['county_code']):($row['county']!='-'?$row['county']:'')):''; + $country = $row['fk_country']?($langs->transnoentitiesnoconv('Country'.$row['country_code'])!='Country'.$row['country_code']?$langs->transnoentitiesnoconv('Country'.$row['country_code']):$row['country']):''; + $county = $row['fk_county']?($langs->transnoentitiesnoconv($row['county_code'])!=$row['county_code']?$langs->transnoentitiesnoconv($row['county_code']):($row['county']!='-'?$row['county']:'')):''; $row_array['label'] = $row['zip'].' '.$row['town']; $row_array['label'] .= ($county || $country)?' (':'';