From caa530707917e252e68694e144725b8bd95fa713 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 21:52:07 +0000 Subject: [PATCH 001/252] Fix: Parent class must be declared. From 97f4606007abbe72f8b494ae999b61c739ef7255 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 23:35:05 +0000 Subject: [PATCH 002/252] Test with phpunit --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 79a4cba739b..4b573b22b3e 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a timeout before end, try this: +If there is a fu... timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -10 du process php +puis renice -11 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php +> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs From 5b1a35b5e5360339dc9e6fdae459bdad05923910 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:11:55 +0000 Subject: [PATCH 003/252] Test with phpcs --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 4b573b22b3e..79a4cba739b 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a fu... timeout before end, try this: +If there is a timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -11 du process php +puis renice -10 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs +> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php From 692c9279e35e97d293d49f2d8d2b6aa730b63f7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:15:16 +0000 Subject: [PATCH 004/252] Qual: Removed errors and warnings reported by codesniffer From 292b51e724d30ad0466e1dfb2be2897116c353c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 01:39:07 +0000 Subject: [PATCH 005/252] Removed useless files to avoid warning in packages From 1a2ba7bb513ae8a6ddc3cc306d2ec2595b9a03b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 02:41:36 +0000 Subject: [PATCH 006/252] Prepare packaging for debian --- build/deb/config | 11 +++++++++++ build/deb/control | 27 ++++++++++----------------- build/deb/copyright | 3 --- build/deb/templates | 15 +++------------ build/makepack-dolibarr.pl | 38 ++++++++++++++++---------------------- 5 files changed, 40 insertions(+), 54 deletions(-) diff --git a/build/deb/config b/build/deb/config index 1965ef73cc5..e006ebda186 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,6 +1,17 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # +# lintian package To test a package +# +# dpkg -l list all packages +# dpkg -b is to build package +# dpkg -c package.deb list content of package +# dpkg -I package.deb give informations on package +# dpkg -i package.deb install a package +# +# dpkg -L packagename list content of installed package +# dpkg --purge remove interactive saved answers +# set -e diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..19eb51664e7 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,39 +3,35 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 61200 +Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: firefox +Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: Easy to use ERP & CRM software to manage your activity. +Description: An ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. + Management (CRM) but also other features for different activities. . - Only features you need are visible, depending on which module were activated. - Most common used modules are: + Dolibarr features are activated by modules. Most common modules are: . + * Products and services catalog + * Stock management + * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management - * Products and services catalog - * Stock management - * Foundations members management - * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management + * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -43,7 +39,4 @@ Description: Easy to use ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of more modules... - . - You can also add third parties external modules or develop yours. - \ No newline at end of file + * And a lot of other modules diff --git a/build/deb/copyright b/build/deb/copyright index 00aafd563b1..74752ea4864 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1,4 +1 @@ -Copyright 2011 Laurent Destailleur - -This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/templates b/build/deb/templates index 1d1c133f99a..82fcaa1ba48 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running ? +Description: Which Web Server are you running? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,15 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Delete the Dolibarr MySQL database and all its datas (datas related - to this quetion are the Dolibarr DBMS account and all + Do I have to delete also the Dolibarr MySQL database and all its datas + (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? - -Template: dolibarr/postrmfile -Type: boolean -Default: true -Description: Delete attached files ? - Delete also all uploaded and generated files (datas related - to this quetion are all files found into /usr/share/dolibarr/documents, - uploaded or generated when using Dolibarr) ? - \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8e0e3a0b1d1..799a17c5ff4 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; # Use - before number of choice to avoid copy +my $copyalreadydone=0; my $batch=0; for (0..@ARGV-1) { @@ -262,7 +262,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; @@ -458,6 +457,7 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; + print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,11 +498,13 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -514,28 +516,20 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Set owners on files/dir\n"; + print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; + + print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; - $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From c07ac7b81ba46ed6176d183d72d651e99ad0b24d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 05:28:41 +0000 Subject: [PATCH 007/252] Fix: remove deprecated constant --- htdocs/admin/mails.php | 22 ++++------------------ htdocs/langs/ca_ES/admin.lang | 1 - htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/es_ES/admin.lang | 1 - htdocs/langs/fr_FR/admin.lang | 1 - 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c9d5ac88812..ab12d1419b6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ + * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ */ require("../main.inc.php"); @@ -63,7 +63,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -80,7 +79,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +126,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -469,12 +468,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''; - // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -575,13 +568,6 @@ else if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - // Errors To - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; - if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -737,5 +723,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); +llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); ?> diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index b79ba3f2c77..848deab542a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f43c1c9e82..9f153916ea5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,7 +229,6 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index de8ec9133ef..5645bd6ff6f 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3cb19e89ba8..2729073a3b8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) -MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From 88abdaf18541cc196c0137a26a9fcd77f41c4199 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 06:10:04 +0000 Subject: [PATCH 008/252] Fix: add possibility to force mail errors-to to all mails sent --- htdocs/admin/mails.php | 18 ++++++++++-- htdocs/core/class/html.formmail.class.php | 36 ++++++++--------------- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ab12d1419b6..05b12ff10b8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ + * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ */ require("../main.inc.php"); @@ -63,6 +63,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -467,6 +468,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; + + // From + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''; // Autocopy to $var=!$var; @@ -567,6 +574,13 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; + + // Errors To + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); + print ''; // Autocopy to $var=!$var; @@ -723,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); +llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3164f86d8e1..25c96d54498 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,6 +1,5 @@ - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -22,7 +21,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +123,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param string $path Full absolute path on filesystem of file, including file name - * @param string $file Only filename - * @param string $type Mime type + * @param $path + * @param $file + * @param $type */ function add_attached_files($path,$file,$type) { @@ -505,27 +504,14 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out.= ''."\n"; - $out.= ''."\n"; + //print '
'; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { - $out.= '
'; - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) - { - $out.= ' '; - //$out.= ' '.img_delete($langs->trans("Delete").''; - } - $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else @@ -534,9 +520,11 @@ class FormMail } if ($this->withfile == 2) // Can add other files { + //print '
'; $out.= ''; $out.= ' '; $out.= ''; + //print '
'; } $out.= "\n"; } @@ -556,7 +544,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f153916ea5..0f43c1c9e82 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,6 +229,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) +MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2729073a3b8..3cb19e89ba8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) +MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From de99f829947b72f3c38feec1d82696f6157365ce Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 08:05:08 +0000 Subject: [PATCH 009/252] New: add jquery method for random generation From 65d9ca6837e107eb307a88e4a775f29b1a70b2dd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 10:26:19 +0000 Subject: [PATCH 010/252] Fix: add div for jquery --- htdocs/core/class/html.formmail.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 25c96d54498..0de9a763c66 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -21,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -509,9 +510,10 @@ class FormMail { foreach($listofpaths as $key => $val) { - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; - $out.= '
'; + $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else From 5b1d9198f35f145d9016c81c6331d3adfcbd54cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 11:24:32 +0000 Subject: [PATCH 011/252] Fix: Set x bit required to directories From b536da4234836df137a010615c6648448ec65d1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 14:11:40 +0000 Subject: [PATCH 012/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 24 +++++++----------------- build/deb/changelog | 2 +- build/deb/control | 2 +- build/deb/copyright | 3 +++ build/deb/install.forced.php.install | 7 +++---- build/deb/postinst | 22 +++++++++++++--------- build/deb/templates | 4 ++-- 7 files changed, 30 insertions(+), 34 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index fa29149ee59..d37b433fb98 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com @@ -13,10 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # -# Directory for web pages - - Order deny,allow - Allow from all + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -56,23 +53,16 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - + -# Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + -# Directory for data files - + AllowOverride All Order deny,allow Allow from all - - - AllowOverride All - Order deny,allow - Allow from all - + diff --git a/build/deb/changelog b/build/deb/changelog index d75fd100a60..182110624de 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ -dolibarr 3.1.0 unstable; urgency=low + dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 19eb51664e7..3f564f5608f 100644 --- a/build/deb/control +++ b/build/deb/control @@ -9,7 +9,7 @@ Section: web Priority: optional Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: An ERP & CRM software to manage your activity. +Description: ERP & CRM software to manage your activity. 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 diff --git a/build/deb/copyright b/build/deb/copyright index 74752ea4864..00aafd563b1 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1 +1,4 @@ +Copyright 2011 Laurent Destailleur + +This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 1166abe41ae..198565d3211 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,13 +4,12 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ +// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ // - $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -$force_install_main_data_root='/usr/share/dolibarr/documents'; -#$force_install_main_data_root='/var/lib/dolibarr'; +#$force_install_main_data_root='/usr/share/dolibarr/documents'; +$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index be9fb7521b7..4d065f58ca0 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,21 +49,19 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create document directory - #docdir='/var/lib/dolibarr/documents' - docdir='/usr/share/dolibarr/documents' - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir + # Create /var/lib/dolibarr/documents + mkdir -p /var/lib/dolibarr/documents + chown -R www-data:www-data /var/lib/dolibarr/documents; + chmod -R 775 /var/lib/dolibarr/documents; + chmod -R g+s /var/lib/dolibarr/documents; # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; fi #db_reset "dolibarr/webserver" @@ -108,6 +106,12 @@ case "$1" in done + # Copy icon file + #echo "Copy icon file" + #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" + #target="/usr/share/pixmaps/" + #cp -f $fileorig $target + #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/deb/templates b/build/deb/templates index 82fcaa1ba48..3b370ee68f2 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -91,6 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Do I have to delete also the Dolibarr MySQL database and all its datas - (datas subjected to this quetion are the Dolibarr DBMS account and all + Answer yes if you want to delete also the Dolibarr MySQL database and all + its datas (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? From 26603248f1035ed581d92a76b198e194051a1f03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 15:48:19 +0000 Subject: [PATCH 013/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 8 ++++++ build/deb/changelog | 2 +- build/deb/control | 20 ++++++++------- build/deb/install.forced.php.install | 7 +++--- build/deb/postinst | 16 ++++++------ build/deb/templates | 15 ++++++++--- build/makepack-dolibarr.pl | 37 ++++++++++++++++------------ 7 files changed, 66 insertions(+), 39 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index d37b433fb98..568dd605dca 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -13,6 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # +# Directory for web pages DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -55,12 +56,19 @@ Alias /dolibarr /usr/share/dolibarr/htdocs +# Directory for public pages AllowOverride All Order deny,allow Allow from all +# Directory for data files + + AllowOverride All + Order deny,allow + Allow from all + AllowOverride All Order deny,allow diff --git a/build/deb/changelog b/build/deb/changelog index 182110624de..d75fd100a60 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ - dolibarr 3.1.0 unstable; urgency=low +dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 3f564f5608f..07a08b7d045 100644 --- a/build/deb/control +++ b/build/deb/control @@ -7,31 +7,32 @@ Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: mozilla | netscape +Recommends: firefox Homepage: http://www.dolibarr.org -Description: ERP & CRM software to manage your activity. +Description: Easy to use ERP & CRM software to manage your activity. 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 other features for different activities. + Management (CRM) but also for different other activities. . - Dolibarr features are activated by modules. Most common modules are: + Only features you need are visible, depending on which module were activated. + Most common used modules are: . - * Products and services catalog - * Stock management - * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management + * Products and services catalog + * Stock management + * Foundations members management + * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management - * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -39,4 +40,5 @@ Description: ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of other modules + * And a lot of more modules... +You can also add third parties external modules or develop yours. \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 198565d3211..1166abe41ae 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,12 +4,13 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ +// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ // + $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -#$force_install_main_data_root='/usr/share/dolibarr/documents'; -$force_install_main_data_root='/var/lib/dolibarr'; +$force_install_main_data_root='/usr/share/dolibarr/documents'; +#$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index 4d065f58ca0..12e3fdbd07a 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,19 +49,21 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create /var/lib/dolibarr/documents - mkdir -p /var/lib/dolibarr/documents - chown -R www-data:www-data /var/lib/dolibarr/documents; - chmod -R 775 /var/lib/dolibarr/documents; - chmod -R g+s /var/lib/dolibarr/documents; + # Create document directory + #docdir='/var/lib/dolibarr/documents' + docdir='/usr/share/dolibarr/documents' + mkdir -p $docdir + chown -R www-data:www-data $docdir + chmod -R 775 $docdir + chmod -R g+s $docdir # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php fi #db_reset "dolibarr/webserver" diff --git a/build/deb/templates b/build/deb/templates index 3b370ee68f2..1d1c133f99a 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running? +Description: Which Web Server are you running ? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,6 +91,15 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Answer yes if you want to delete also the Dolibarr MySQL database and all - its datas (datas subjected to this quetion are the Dolibarr DBMS account and all + Delete the Dolibarr MySQL database and all its datas (datas related + to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? + +Template: dolibarr/postrmfile +Type: boolean +Default: true +Description: Delete attached files ? + Delete also all uploaded and generated files (datas related + to this quetion are all files found into /usr/share/dolibarr/documents, + uploaded or generated when using Dolibarr) ? + \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 799a17c5ff4..2cc4b0b880e 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; +my $copyalreadydone=0; # Use - before number of choice to avoid copy my $batch=0; for (0..@ARGV-1) { @@ -457,7 +457,6 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; - print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,13 +497,11 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -516,20 +513,28 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; - - print "Set permissions/owners on files/dir\n"; + print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; + + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; + $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From c286ece71378d89fcedc1f025a3919910578a86b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH 014/252] Work on packaging RPM & DEB --- build/deb/config | 11 --- build/deb/control | 7 +- build/deb/postinst | 6 -- build/rpm/README | 13 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 149 ++++++++----------------------------- 6 files changed, 41 insertions(+), 150 deletions(-) diff --git a/build/deb/config b/build/deb/config index e006ebda186..1965ef73cc5 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,17 +1,6 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # -# lintian package To test a package -# -# dpkg -l list all packages -# dpkg -b is to build package -# dpkg -c package.deb list content of package -# dpkg -I package.deb give informations on package -# dpkg -i package.deb install a package -# -# dpkg -L packagename list content of installed package -# dpkg --purge remove interactive saved answers -# set -e diff --git a/build/deb/control b/build/deb/control index 07a08b7d045..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,7 +3,7 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 31200 +Installed-Size: 61200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional @@ -14,6 +14,7 @@ Description: Easy to use ERP & CRM software to manage your activity. 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. + Dolibarr was designed to provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. Most common used modules are: @@ -41,4 +42,6 @@ Description: Easy to use ERP & CRM software to manage your activity. * LDAP connectivity * PDF exports * And a lot of more modules... -You can also add third parties external modules or develop yours. \ No newline at end of file + . + You can also add third parties external modules or develop yours. + \ No newline at end of file diff --git a/build/deb/postinst b/build/deb/postinst index 12e3fdbd07a..be9fb7521b7 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -108,12 +108,6 @@ case "$1" in done - # Copy icon file - #echo "Copy icon file" - #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" - #target="/usr/share/pixmaps/" - #cp -f $fileorig $target - #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/rpm/README b/build/rpm/README index d868ed411b8..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,15 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# rpm -i --test dolibarr-...rpm To list dependencies of RPM -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 11090951bdd..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,32 +19,20 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org +#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandriva-Mageia +# For Mandrake Group: Networking/WWW # For all other distrib Group: Applications/Internet -# Requires can use lua to be defined dynamically (but still at build time) -# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } - -# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Requires for OpenSuse -#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mandriva-Mageia -#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl - -#Requires(pre): -#Requires(postun): - -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -55,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -100,19 +69,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -178,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -245,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -264,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' +export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -311,17 +234,11 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi -# Removed dirs after apache restart -echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install -rmdir $targetdir/doc >/dev/null 2>&1 -rmdir $targetdir/htdocs >/dev/null 2>&1 + %changelog From 0c691059514ae0b5ca59e3f01dea52a26b2e30ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 18:29:46 +0000 Subject: [PATCH 015/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2cc4b0b880e..532bf16a2da 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -529,8 +529,8 @@ if ($nboftargetok) { $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + #$ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; From f4a6b08cfd32e5f94a1fa7063d3f077438c23021 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:18:50 +0000 Subject: [PATCH 016/252] Prepare release 3.1 From e092d3eb316e97e941e3dac0573ec9caf86f52fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:26:53 +0000 Subject: [PATCH 017/252] Work on packaging RPM & DEB --- build/deb/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/deb/control b/build/deb/control index 3d8878f4569..2d356fc7b2b 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,6 +14,8 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. From 8f8526652c2c8d389999aabbc412f579230ad235 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:33:27 +0000 Subject: [PATCH 018/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.desktop | 5 ++++- build/rpm/dolibarr.spec | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index e3be821080c..ab2a758867f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,9 +5,12 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM +Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations +Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs +Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti +Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b1def13ae37..4bfbcfaae65 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -43,12 +43,34 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. +%description -l es +Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones +que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores +ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource +que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier +lugar disponiendo de una conexión a Internet. +Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, +pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: +Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). +Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). +Simple de desarrollar (sin frameworks pesados). + %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. +%description -l it +Dolibarr è un programma gestionale open source e gratuito per piccole e medie +imprese, fondazioni e liberi professionisti. Include varie funzionalità per +Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori +attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno +ed essere facile da usare. +Dolibar è completamente web-based, progettato per poter fornire solo ciò di +cui hai bisogno ed essere facile da usare. + + #---- prep %prep From 288698fcd79727167efbf0d018a61238ee2bc46d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:33:53 +0000 Subject: [PATCH 019/252] Use global option if local not defined From 60782f1c7cc25d3f235a97907afbec12e984f6cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:39:34 +0000 Subject: [PATCH 020/252] Add comment From 98e5530501708838ed14f23dfd70d5891040c9a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:48:25 +0000 Subject: [PATCH 021/252] Fix: Param of constructor must be only database handler From 312d1e4b86f8e9bb2107d790b1128fac817b3765 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 16:50:40 +0000 Subject: [PATCH 022/252] Fix: Missing fields and missing encoding of special chars --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e97abed808..4863b52689e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ + * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 12a892e0e64522b4a99bcbab4d113d28945fe413 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 17:28:09 +0000 Subject: [PATCH 023/252] Fix: missing htmlname in ajax response --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4863b52689e..7e97abed808 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ + * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From c92c6fe220b8fd9052a2e5fdcffe2ae20a640e87 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 18:24:18 +0000 Subject: [PATCH 024/252] Fix: possibility to change status of another input element From 1065c3483b2229666774a4440a3508f5771f3eca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 20:03:38 +0000 Subject: [PATCH 025/252] Fix: file add and delte in email forms was broken with firefox 5 --- htdocs/admin/mails.php | 12 +++++----- htdocs/core/class/html.formmail.class.php | 28 +++++++++++++++-------- htdocs/lib/files.lib.php | 5 ++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 05b12ff10b8..c9d5ac88812 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ + * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ */ require("../main.inc.php"); @@ -80,7 +80,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +127,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -468,7 +468,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; - + // From $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -574,7 +574,7 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - + // Errors To $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -737,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); +llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0de9a763c66..3164f86d8e1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +124,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param $path - * @param $file - * @param $type + * @param string $path Full absolute path on filesystem of file, including file name + * @param string $file Only filename + * @param string $type Mime type */ function add_attached_files($path,$file,$type) { @@ -505,14 +505,26 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - //print '
'; + // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript + $out.= ''."\n"; + $out.= ''."\n"; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { $out.= '
'; $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; + if (! $this->withfilereadonly) + { + $out.= ' '; + //$out.= ' '.img_delete($langs->trans("Delete").''; + } $out.= '
'; } } @@ -522,11 +534,9 @@ class FormMail } if ($this->withfile == 2) // Can add other files { - //print '
'; $out.= ''; $out.= ' '; $out.= ''; - //print '
'; } $out.= "\n"; } @@ -546,7 +556,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 3dbbef2c6b2..8b6ea639ec8 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ + * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ */ /** @@ -561,8 +561,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger && is_object($object)) + if (! $notrigger) { + if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 67a3f7f049e92a327eb599e5598f5c8d0f3ca78f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 21:17:14 +0000 Subject: [PATCH 026/252] Fix: Missing name on form From 53741330a59b1b075d824dd43678933bc07e65e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 22:45:44 +0000 Subject: [PATCH 027/252] Work on packaging RPM & DEB --- build/rpm/README | 12 +++++-- build/rpm/dolibarr.spec | 70 +++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index 1b2d4745dc4..f2077ceac36 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,6 +10,14 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# yum install dolibarr To remove package -# yum erase dolibarr To remove package +# On Fedora +# yum install dolibarr-...rpm To install package and dependencies +# yum erase dolibarr To remove package # +# On OpenSuse +# yast --install dolibarr-...rpm To install package and dependencies +# yast --remove dolibarr To remove package +# +# On Mageia +# urpmi dolibarr-...rpm To install package and dependencies +# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 4bfbcfaae65..a9003afcac3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -44,16 +44,13 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones -que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores -ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource -que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier -lugar disponiendo de una conexión a Internet. -Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, -pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: -Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). -Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). -Simple de desarrollar (sin frameworks pesados). +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y +medianas empresas, asociaciones o autónomos. Incluye diferentes +funcionalidades para la Planificación de Recursos Empresariales (ERP) y +Gestión de la Relación con los Clientes (CRM) así como para para otras +diferentes actividades. Dolibarr ha sido diseñado para suministrarle +solamente las funcionalidades que necesita y haciendo hincapié en su +facilidad de uso. %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, @@ -182,19 +179,35 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi -# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf -if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then - echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf - ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf + +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + apacheuser='apache'; + apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + apacheuser='wwwrun'; + apachegroup='wwwrun'; +fi + +# Create a config link dolibarr.conf for Fedora or Redhat +if [ ! -f $conffile ]; then + echo Create dolibarr web server config link $conffile + ln -fs /etc/dolibarr/apache.conf $conffile fi # Set permissions -echo Set permission on $targetdir -chown -R apache.apache $targetdir +echo Set permission to $apacheuser:$apachegroup on $targetdir +chown -R $apacheuser:$apachegroup $targetdir chmod -R a-w $targetdir -echo Set permission on $docdir -chown -R apache.apache $docdir +echo Set permission to $apacheuser:$apachegroup on $docdir +chown -R $apacheuser:$apachegroup $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer @@ -205,7 +218,7 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -220,6 +233,9 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi +if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart +fi # Show result echo @@ -236,12 +252,23 @@ echo %postun %clean_menus +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +fi + + # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' -export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -256,6 +283,9 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi fi rm -rf /etc/dolibarr From 9e320e086d42875c1eb1661286dfa8534fd9ea3d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Jul 2011 06:23:22 +0000 Subject: [PATCH 028/252] Fix: need complete object --- htdocs/lib/files.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 8b6ea639ec8..3dbbef2c6b2 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ */ /** @@ -561,9 +561,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger) + if (! $notrigger && is_object($object)) { - if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 0d1ca685d777c93ea6048b087045a0f21862af37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 07:50:22 +0000 Subject: [PATCH 029/252] RPM works alos on ubuntu and debian --- build/rpm/dolibarr.spec | 57 +++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index a9003afcac3..46c0b734ca3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,7 +32,8 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -AutoReqProv: yes +# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) +AutoReqProv: no %description @@ -103,17 +104,6 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr -# menu -#%{__install} -d $RPM_BUILD_ROOT%{_menudir} -#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} -#?package(%{name}):\ -#command="Dolibarr" \ -#section="Office" \ -#title="Dolibarr" \ -#icon="dolibarr_48x48.png" \ -#longtitle="Dolibarr ERP & CRM" -#EOF - #---- clean %clean @@ -181,19 +171,26 @@ fi # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - apacheuser='apache'; - apachegroup='apache'; + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - apacheuser='wwwrun'; - apachegroup='wwwrun'; + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $conffile ]; then @@ -214,11 +211,11 @@ chmod -R o-w $docdir if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown apache.apache $targetdir/htdocs/conf/conf.php + chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -253,16 +250,26 @@ echo %clean_menus # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi - +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' From 07a6334e3bf566107a4bfe277f1dbcb8e62e3501 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 07:51:31 +0000 Subject: [PATCH 030/252] Trad: add possibility to force mail errors-to to all mails sent --- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 848deab542a..b79ba3f2c77 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 5645bd6ff6f..de8ec9133ef 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails From 672efb1b5a961a1ad89977e614e3e660939624a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:36:11 +0000 Subject: [PATCH 031/252] Work on packaging RPM & DEB --- build/rpm/README | 2 +- build/rpm/dolibarr.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index f2077ceac36..c072a212632 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -18,6 +18,6 @@ with format RPM (for Redhat, Mandriva, ...). # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package # -# On Mageia +# On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies # urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 46c0b734ca3..b3aaca1d494 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -171,20 +171,26 @@ fi # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; @@ -250,20 +256,26 @@ echo %clean_menus # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; From 552f255f06e3d4f9db730f33397a9ef3ea8159d6 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 08:38:02 +0000 Subject: [PATCH 032/252] Fix: Missing translation From 7b353f682b272248443678ba3106fa345def06ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:54:57 +0000 Subject: [PATCH 033/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 18 ++++++++++-------- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index 568dd605dca..cfedcbc4dbb 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -14,7 +14,9 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # # Directory for web pages - + + Order deny,allow + Allow from all DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -54,23 +56,23 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - + # Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + # Directory for data files - + AllowOverride All Order deny,allow Allow from all - - + + AllowOverride All Order deny,allow Allow from all - + diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 4a395f235a2..e1fcb3f77e5 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From 424322cc18e5bcc9da597a1316c9ddb956865424 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:55:53 +0000 Subject: [PATCH 034/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 2 +- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index cfedcbc4dbb..fa29149ee59 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index e1fcb3f77e5..4a395f235a2 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From c08995543a0b2d46fe9a023877d63164c6773287 Mon Sep 17 00:00:00 2001 From: cdelambert Date: Mon, 11 Jul 2011 09:32:35 +0000 Subject: [PATCH 035/252] Correction paiement Ajax From b00c45b7238eb82ad9b4735f383864b7e1c1f0b0 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 10:41:29 +0000 Subject: [PATCH 036/252] Trad: add translation From 73e22dc96862906703b941c0065396b367437f23 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 10:53:37 +0000 Subject: [PATCH 037/252] Fix: Removed install warning From 5a06f579bbda087c63cfa6dd3197074a1aaa33b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 11:09:02 +0000 Subject: [PATCH 038/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 532bf16a2da..8e0e3a0b1d1 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -262,6 +262,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; From 148da706817493312986325162bafe679fceabbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 12:31:38 +0000 Subject: [PATCH 039/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b3aaca1d494..44051435047 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -31,7 +31,13 @@ Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql +# Requires for OpenSuse +#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl +# Requires for Mageia +#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -182,7 +188,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -267,7 +273,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -307,9 +313,12 @@ then fi fi +# Removed dirs after apache restart +echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install - +rmdir $targetdir/doc >/dev/null 2>&1 +rmdir $targetdir/htdocs >/dev/null 2>&1 %changelog From 42ae3a2b0c0c429c08deca0feb6a84e4851de7aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 21:16:25 +0000 Subject: [PATCH 040/252] Work on packaging RPM & DEB --- build/rpm/README | 1 + build/rpm/dolibarr.spec | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index c072a212632..d868ed411b8 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -11,6 +11,7 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # # On Fedora +# rpm -i --test dolibarr-...rpm To list dependencies of RPM # yum install dolibarr-...rpm To install package and dependencies # yum erase dolibarr To remove package # diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 44051435047..11090951bdd 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,25 +19,30 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org -#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandrake +# For Mandriva-Mageia Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires can use lua to be defined dynamically (but still at build time) +# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } + # Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql # Requires for OpenSuse #Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mageia +# Requires for Mandriva-Mageia #Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl +#Requires(pre): +#Requires(postun): + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -95,19 +100,17 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr From 22b56043d8f0e794d79017c7e1f882e31b65bd85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 07:17:11 +0000 Subject: [PATCH 041/252] Fix: Uniformise code From 3609df40220e96e4bf4c7f7acaf5d1001a4d0052 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Jul 2011 08:07:59 +0000 Subject: [PATCH 042/252] Fix: update jstree plugin From b9e24f86bb55e2c878f6112b9241d27f65c03d96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:16:03 +0000 Subject: [PATCH 043/252] Fix: Upgrade detection fails From 97a24ad45eab665098cfc5c5aa3b183a57b07e35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:48:08 +0000 Subject: [PATCH 044/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 9de8cdf662d..0f6034488dd 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ + * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From 00e9ebb7f37923211c7bc972207d295073eb572d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:52:41 +0000 Subject: [PATCH 045/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0f6034488dd..9de8cdf662d 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ + * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From 9e8c24786db6999fbcc37e9fcce0175097f45f21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 21:07:24 +0000 Subject: [PATCH 046/252] Fix: Type of amount From eb935593e8ae82ae08f139897d70d0384687c16f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:03:44 +0000 Subject: [PATCH 047/252] Fix: Add civility for all peopal tables From b6c071b418ed7d5201350cf1afb71fa6365d82b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:12:12 +0000 Subject: [PATCH 048/252] Fix: Add civility for all peopal tables From b3d1a291683ec188ffe3cf8307df3da0dca64d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:19:02 +0000 Subject: [PATCH 049/252] Fix: Attachment fails if content was empty From 230d224176a7eaf8a3f819f55dde6a2b737d8ade Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 21:52:07 +0000 Subject: [PATCH 050/252] Fix: Parent class must be declared. From b8c7c088d0006767cb12abea052e1cce353d16a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 23:35:05 +0000 Subject: [PATCH 051/252] Test with phpunit --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 79a4cba739b..4b573b22b3e 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a timeout before end, try this: +If there is a fu... timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -10 du process php +puis renice -11 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php +> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs From 38042df46085e872c843335acb726664c2978c70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:11:55 +0000 Subject: [PATCH 052/252] Test with phpcs --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 4b573b22b3e..79a4cba739b 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a fu... timeout before end, try this: +If there is a timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -11 du process php +puis renice -10 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs +> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php From 855fdeb6eca601f207620cb9e6410a3829d876bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:15:16 +0000 Subject: [PATCH 053/252] Qual: Removed errors and warnings reported by codesniffer From 68c7c39be1cac278af80466a26e50b9b56185f1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 01:39:07 +0000 Subject: [PATCH 054/252] Removed useless files to avoid warning in packages From 56a5cc4ff00e2bbd96f3d1a150f8b7b65f61b7c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 02:41:36 +0000 Subject: [PATCH 055/252] Prepare packaging for debian --- build/deb/config | 11 +++++++++++ build/deb/control | 27 ++++++++++----------------- build/deb/copyright | 3 --- build/deb/templates | 15 +++------------ build/makepack-dolibarr.pl | 38 ++++++++++++++++---------------------- 5 files changed, 40 insertions(+), 54 deletions(-) diff --git a/build/deb/config b/build/deb/config index 1965ef73cc5..e006ebda186 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,6 +1,17 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # +# lintian package To test a package +# +# dpkg -l list all packages +# dpkg -b is to build package +# dpkg -c package.deb list content of package +# dpkg -I package.deb give informations on package +# dpkg -i package.deb install a package +# +# dpkg -L packagename list content of installed package +# dpkg --purge remove interactive saved answers +# set -e diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..19eb51664e7 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,39 +3,35 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 61200 +Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: firefox +Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: Easy to use ERP & CRM software to manage your activity. +Description: An ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. + Management (CRM) but also other features for different activities. . - Only features you need are visible, depending on which module were activated. - Most common used modules are: + Dolibarr features are activated by modules. Most common modules are: . + * Products and services catalog + * Stock management + * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management - * Products and services catalog - * Stock management - * Foundations members management - * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management + * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -43,7 +39,4 @@ Description: Easy to use ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of more modules... - . - You can also add third parties external modules or develop yours. - \ No newline at end of file + * And a lot of other modules diff --git a/build/deb/copyright b/build/deb/copyright index 00aafd563b1..74752ea4864 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1,4 +1 @@ -Copyright 2011 Laurent Destailleur - -This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/templates b/build/deb/templates index 1d1c133f99a..82fcaa1ba48 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running ? +Description: Which Web Server are you running? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,15 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Delete the Dolibarr MySQL database and all its datas (datas related - to this quetion are the Dolibarr DBMS account and all + Do I have to delete also the Dolibarr MySQL database and all its datas + (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? - -Template: dolibarr/postrmfile -Type: boolean -Default: true -Description: Delete attached files ? - Delete also all uploaded and generated files (datas related - to this quetion are all files found into /usr/share/dolibarr/documents, - uploaded or generated when using Dolibarr) ? - \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8e0e3a0b1d1..799a17c5ff4 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; # Use - before number of choice to avoid copy +my $copyalreadydone=0; my $batch=0; for (0..@ARGV-1) { @@ -262,7 +262,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; @@ -458,6 +457,7 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; + print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,11 +498,13 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -514,28 +516,20 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Set owners on files/dir\n"; + print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; + + print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; - $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From 09fa95d7011f04e3d86054251ff553d4c44b5bc0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 05:28:41 +0000 Subject: [PATCH 056/252] Fix: remove deprecated constant --- htdocs/admin/mails.php | 22 ++++------------------ htdocs/langs/ca_ES/admin.lang | 1 - htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/es_ES/admin.lang | 1 - htdocs/langs/fr_FR/admin.lang | 1 - 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c9d5ac88812..ab12d1419b6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ + * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ */ require("../main.inc.php"); @@ -63,7 +63,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -80,7 +79,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +126,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -469,12 +468,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''; - // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -575,13 +568,6 @@ else if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - // Errors To - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; - if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -737,5 +723,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); +llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); ?> diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index b79ba3f2c77..848deab542a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f43c1c9e82..9f153916ea5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,7 +229,6 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index de8ec9133ef..5645bd6ff6f 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3cb19e89ba8..2729073a3b8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) -MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From d87cbae6dc7d281fc862e71fce4317a4d2ff1949 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 06:10:04 +0000 Subject: [PATCH 057/252] Fix: add possibility to force mail errors-to to all mails sent --- htdocs/admin/mails.php | 18 ++++++++++-- htdocs/core/class/html.formmail.class.php | 36 ++++++++--------------- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ab12d1419b6..05b12ff10b8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ + * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ */ require("../main.inc.php"); @@ -63,6 +63,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -467,6 +468,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; + + // From + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''; // Autocopy to $var=!$var; @@ -567,6 +574,13 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; + + // Errors To + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); + print ''; // Autocopy to $var=!$var; @@ -723,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); +llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3164f86d8e1..25c96d54498 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,6 +1,5 @@ - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -22,7 +21,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +123,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param string $path Full absolute path on filesystem of file, including file name - * @param string $file Only filename - * @param string $type Mime type + * @param $path + * @param $file + * @param $type */ function add_attached_files($path,$file,$type) { @@ -505,27 +504,14 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out.= ''."\n"; - $out.= ''."\n"; + //print '
'; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { - $out.= '
'; - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) - { - $out.= ' '; - //$out.= ' '.img_delete($langs->trans("Delete").''; - } - $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else @@ -534,9 +520,11 @@ class FormMail } if ($this->withfile == 2) // Can add other files { + //print '
'; $out.= ''; $out.= ' '; $out.= ''; + //print '
'; } $out.= "\n"; } @@ -556,7 +544,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f153916ea5..0f43c1c9e82 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,6 +229,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) +MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2729073a3b8..3cb19e89ba8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) +MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From 11fce7a48fd6e1239a24e6f87d9de23c640385c4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 08:05:08 +0000 Subject: [PATCH 058/252] New: add jquery method for random generation From 19533f0044cf0d35b3b4a369eb6530563327b640 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 10:26:19 +0000 Subject: [PATCH 059/252] Fix: add div for jquery --- htdocs/core/class/html.formmail.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 25c96d54498..0de9a763c66 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -21,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -509,9 +510,10 @@ class FormMail { foreach($listofpaths as $key => $val) { - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; - $out.= '
'; + $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else From a691485a244cb3afc3ed65d4703f45f8a3df8c24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 11:24:32 +0000 Subject: [PATCH 060/252] Fix: Set x bit required to directories From fa90ba7231d3296786e04e09a8d3ce7a7178914a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 14:11:40 +0000 Subject: [PATCH 061/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 24 +++++++----------------- build/deb/changelog | 2 +- build/deb/control | 2 +- build/deb/copyright | 3 +++ build/deb/install.forced.php.install | 7 +++---- build/deb/postinst | 22 +++++++++++++--------- build/deb/templates | 4 ++-- 7 files changed, 30 insertions(+), 34 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index fa29149ee59..d37b433fb98 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com @@ -13,10 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # -# Directory for web pages - - Order deny,allow - Allow from all + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -56,23 +53,16 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - +
-# Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + -# Directory for data files - + AllowOverride All Order deny,allow Allow from all - - - AllowOverride All - Order deny,allow - Allow from all - + diff --git a/build/deb/changelog b/build/deb/changelog index d75fd100a60..182110624de 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ -dolibarr 3.1.0 unstable; urgency=low + dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 19eb51664e7..3f564f5608f 100644 --- a/build/deb/control +++ b/build/deb/control @@ -9,7 +9,7 @@ Section: web Priority: optional Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: An ERP & CRM software to manage your activity. +Description: ERP & CRM software to manage your activity. 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 diff --git a/build/deb/copyright b/build/deb/copyright index 74752ea4864..00aafd563b1 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1 +1,4 @@ +Copyright 2011 Laurent Destailleur + +This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 1166abe41ae..198565d3211 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,13 +4,12 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ +// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ // - $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -$force_install_main_data_root='/usr/share/dolibarr/documents'; -#$force_install_main_data_root='/var/lib/dolibarr'; +#$force_install_main_data_root='/usr/share/dolibarr/documents'; +$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index be9fb7521b7..4d065f58ca0 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,21 +49,19 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create document directory - #docdir='/var/lib/dolibarr/documents' - docdir='/usr/share/dolibarr/documents' - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir + # Create /var/lib/dolibarr/documents + mkdir -p /var/lib/dolibarr/documents + chown -R www-data:www-data /var/lib/dolibarr/documents; + chmod -R 775 /var/lib/dolibarr/documents; + chmod -R g+s /var/lib/dolibarr/documents; # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; fi #db_reset "dolibarr/webserver" @@ -108,6 +106,12 @@ case "$1" in done + # Copy icon file + #echo "Copy icon file" + #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" + #target="/usr/share/pixmaps/" + #cp -f $fileorig $target + #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/deb/templates b/build/deb/templates index 82fcaa1ba48..3b370ee68f2 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -91,6 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Do I have to delete also the Dolibarr MySQL database and all its datas - (datas subjected to this quetion are the Dolibarr DBMS account and all + Answer yes if you want to delete also the Dolibarr MySQL database and all + its datas (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? From 2fbb277c9694c0556bd6437c6f542403bbecd377 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 15:48:19 +0000 Subject: [PATCH 062/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 8 ++++++ build/deb/changelog | 2 +- build/deb/control | 20 ++++++++------- build/deb/install.forced.php.install | 7 +++--- build/deb/postinst | 16 ++++++------ build/deb/templates | 15 ++++++++--- build/makepack-dolibarr.pl | 37 ++++++++++++++++------------ 7 files changed, 66 insertions(+), 39 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index d37b433fb98..568dd605dca 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -13,6 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # +# Directory for web pages DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -55,12 +56,19 @@ Alias /dolibarr /usr/share/dolibarr/htdocs +# Directory for public pages AllowOverride All Order deny,allow Allow from all +# Directory for data files + + AllowOverride All + Order deny,allow + Allow from all + AllowOverride All Order deny,allow diff --git a/build/deb/changelog b/build/deb/changelog index 182110624de..d75fd100a60 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ - dolibarr 3.1.0 unstable; urgency=low +dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 3f564f5608f..07a08b7d045 100644 --- a/build/deb/control +++ b/build/deb/control @@ -7,31 +7,32 @@ Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: mozilla | netscape +Recommends: firefox Homepage: http://www.dolibarr.org -Description: ERP & CRM software to manage your activity. +Description: Easy to use ERP & CRM software to manage your activity. 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 other features for different activities. + Management (CRM) but also for different other activities. . - Dolibarr features are activated by modules. Most common modules are: + Only features you need are visible, depending on which module were activated. + Most common used modules are: . - * Products and services catalog - * Stock management - * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management + * Products and services catalog + * Stock management + * Foundations members management + * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management - * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -39,4 +40,5 @@ Description: ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of other modules + * And a lot of more modules... +You can also add third parties external modules or develop yours. \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 198565d3211..1166abe41ae 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,12 +4,13 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ +// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ // + $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -#$force_install_main_data_root='/usr/share/dolibarr/documents'; -$force_install_main_data_root='/var/lib/dolibarr'; +$force_install_main_data_root='/usr/share/dolibarr/documents'; +#$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index 4d065f58ca0..12e3fdbd07a 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,19 +49,21 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create /var/lib/dolibarr/documents - mkdir -p /var/lib/dolibarr/documents - chown -R www-data:www-data /var/lib/dolibarr/documents; - chmod -R 775 /var/lib/dolibarr/documents; - chmod -R g+s /var/lib/dolibarr/documents; + # Create document directory + #docdir='/var/lib/dolibarr/documents' + docdir='/usr/share/dolibarr/documents' + mkdir -p $docdir + chown -R www-data:www-data $docdir + chmod -R 775 $docdir + chmod -R g+s $docdir # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php fi #db_reset "dolibarr/webserver" diff --git a/build/deb/templates b/build/deb/templates index 3b370ee68f2..1d1c133f99a 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running? +Description: Which Web Server are you running ? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,6 +91,15 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Answer yes if you want to delete also the Dolibarr MySQL database and all - its datas (datas subjected to this quetion are the Dolibarr DBMS account and all + Delete the Dolibarr MySQL database and all its datas (datas related + to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? + +Template: dolibarr/postrmfile +Type: boolean +Default: true +Description: Delete attached files ? + Delete also all uploaded and generated files (datas related + to this quetion are all files found into /usr/share/dolibarr/documents, + uploaded or generated when using Dolibarr) ? + \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 799a17c5ff4..2cc4b0b880e 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; +my $copyalreadydone=0; # Use - before number of choice to avoid copy my $batch=0; for (0..@ARGV-1) { @@ -457,7 +457,6 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; - print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,13 +497,11 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -516,20 +513,28 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; - - print "Set permissions/owners on files/dir\n"; + print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; + + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; + $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From 24d8f1d1c75731213554d56a4b60581c1b0705ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH 063/252] Work on packaging RPM & DEB --- build/deb/config | 11 --- build/deb/control | 7 +- build/deb/postinst | 6 -- build/rpm/README | 13 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 149 ++++++++----------------------------- 6 files changed, 41 insertions(+), 150 deletions(-) diff --git a/build/deb/config b/build/deb/config index e006ebda186..1965ef73cc5 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,17 +1,6 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # -# lintian package To test a package -# -# dpkg -l list all packages -# dpkg -b is to build package -# dpkg -c package.deb list content of package -# dpkg -I package.deb give informations on package -# dpkg -i package.deb install a package -# -# dpkg -L packagename list content of installed package -# dpkg --purge remove interactive saved answers -# set -e diff --git a/build/deb/control b/build/deb/control index 07a08b7d045..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,7 +3,7 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 31200 +Installed-Size: 61200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional @@ -14,6 +14,7 @@ Description: Easy to use ERP & CRM software to manage your activity. 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. + Dolibarr was designed to provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. Most common used modules are: @@ -41,4 +42,6 @@ Description: Easy to use ERP & CRM software to manage your activity. * LDAP connectivity * PDF exports * And a lot of more modules... -You can also add third parties external modules or develop yours. \ No newline at end of file + . + You can also add third parties external modules or develop yours. + \ No newline at end of file diff --git a/build/deb/postinst b/build/deb/postinst index 12e3fdbd07a..be9fb7521b7 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -108,12 +108,6 @@ case "$1" in done - # Copy icon file - #echo "Copy icon file" - #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" - #target="/usr/share/pixmaps/" - #cp -f $fileorig $target - #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/rpm/README b/build/rpm/README index d868ed411b8..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,15 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# rpm -i --test dolibarr-...rpm To list dependencies of RPM -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 11090951bdd..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,32 +19,20 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org +#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandriva-Mageia +# For Mandrake Group: Networking/WWW # For all other distrib Group: Applications/Internet -# Requires can use lua to be defined dynamically (but still at build time) -# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } - -# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Requires for OpenSuse -#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mandriva-Mageia -#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl - -#Requires(pre): -#Requires(postun): - -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -55,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -100,19 +69,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -178,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -245,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -264,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' +export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -311,17 +234,11 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi -# Removed dirs after apache restart -echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install -rmdir $targetdir/doc >/dev/null 2>&1 -rmdir $targetdir/htdocs >/dev/null 2>&1 + %changelog From 40d29e9b145fbad19630eda0ec634036b27bbde7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 18:29:46 +0000 Subject: [PATCH 064/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2cc4b0b880e..532bf16a2da 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -529,8 +529,8 @@ if ($nboftargetok) { $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + #$ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; From da4c95a55fac0c696c2d2bde738d9d8a58dd86bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:18:50 +0000 Subject: [PATCH 065/252] Prepare release 3.1 From 2dd58fa44643bb4c8371d4d66ba2547030bb0b09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:26:53 +0000 Subject: [PATCH 066/252] Work on packaging RPM & DEB --- build/deb/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/deb/control b/build/deb/control index 3d8878f4569..2d356fc7b2b 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,6 +14,8 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. From d213ae0ddae3802dbb700131d79e71b720688006 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:33:27 +0000 Subject: [PATCH 067/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.desktop | 5 ++++- build/rpm/dolibarr.spec | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index e3be821080c..ab2a758867f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,9 +5,12 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM +Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations +Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs +Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti +Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b1def13ae37..4bfbcfaae65 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -43,12 +43,34 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. +%description -l es +Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones +que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores +ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource +que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier +lugar disponiendo de una conexión a Internet. +Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, +pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: +Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). +Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). +Simple de desarrollar (sin frameworks pesados). + %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. +%description -l it +Dolibarr è un programma gestionale open source e gratuito per piccole e medie +imprese, fondazioni e liberi professionisti. Include varie funzionalità per +Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori +attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno +ed essere facile da usare. +Dolibar è completamente web-based, progettato per poter fornire solo ciò di +cui hai bisogno ed essere facile da usare. + + #---- prep %prep From e97f1f9e370631d9e6b96def77bb0991c43f0967 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:33:53 +0000 Subject: [PATCH 068/252] Use global option if local not defined From ae0fd563b301598c87e982f00be68ca1d1fd322b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:39:34 +0000 Subject: [PATCH 069/252] Add comment From fbff48828784fda1b7f1a3a6182bf76b0372d5c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:48:25 +0000 Subject: [PATCH 070/252] Fix: Param of constructor must be only database handler From 6f0ce698cfd5bd67fb3148f1f30d59e2ce284a5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 16:50:40 +0000 Subject: [PATCH 071/252] Fix: Missing fields and missing encoding of special chars --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e97abed808..4863b52689e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ + * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From bea9c7e6d409369fb5e3087ea03b846fc2c7f47f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 17:28:09 +0000 Subject: [PATCH 072/252] Fix: missing htmlname in ajax response --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4863b52689e..7e97abed808 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ + * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 74547d14f572f7a0d9af925c9203cd51db66ac8e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 18:24:18 +0000 Subject: [PATCH 073/252] Fix: possibility to change status of another input element From 5cef0009eca0f9c054b5947478ca573bc903b5df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 20:03:38 +0000 Subject: [PATCH 074/252] Fix: file add and delte in email forms was broken with firefox 5 --- htdocs/admin/mails.php | 12 +++++----- htdocs/core/class/html.formmail.class.php | 28 +++++++++++++++-------- htdocs/lib/files.lib.php | 5 ++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 05b12ff10b8..c9d5ac88812 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ + * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ */ require("../main.inc.php"); @@ -80,7 +80,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +127,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -468,7 +468,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; - + // From $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -574,7 +574,7 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - + // Errors To $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -737,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); +llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0de9a763c66..3164f86d8e1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +124,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param $path - * @param $file - * @param $type + * @param string $path Full absolute path on filesystem of file, including file name + * @param string $file Only filename + * @param string $type Mime type */ function add_attached_files($path,$file,$type) { @@ -505,14 +505,26 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - //print '
'; + // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript + $out.= ''."\n"; + $out.= ''."\n"; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { $out.= '
'; $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; + if (! $this->withfilereadonly) + { + $out.= ' '; + //$out.= ' '.img_delete($langs->trans("Delete").''; + } $out.= '
'; } } @@ -522,11 +534,9 @@ class FormMail } if ($this->withfile == 2) // Can add other files { - //print '
'; $out.= ''; $out.= ' '; $out.= ''; - //print '
'; } $out.= "\n"; } @@ -546,7 +556,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 3dbbef2c6b2..8b6ea639ec8 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ + * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ */ /** @@ -561,8 +561,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger && is_object($object)) + if (! $notrigger) { + if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 6846277ae8a3290ffeaee2723b7a9c5b33ac8e74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 21:17:14 +0000 Subject: [PATCH 075/252] Fix: Missing name on form From 827ade6737dc828fb055d984bd20499252e4de53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 22:45:44 +0000 Subject: [PATCH 076/252] Work on packaging RPM & DEB --- build/rpm/README | 12 +++++-- build/rpm/dolibarr.spec | 70 +++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index 1b2d4745dc4..f2077ceac36 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,6 +10,14 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# yum install dolibarr To remove package -# yum erase dolibarr To remove package +# On Fedora +# yum install dolibarr-...rpm To install package and dependencies +# yum erase dolibarr To remove package # +# On OpenSuse +# yast --install dolibarr-...rpm To install package and dependencies +# yast --remove dolibarr To remove package +# +# On Mageia +# urpmi dolibarr-...rpm To install package and dependencies +# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 4bfbcfaae65..a9003afcac3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -44,16 +44,13 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones -que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores -ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource -que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier -lugar disponiendo de una conexión a Internet. -Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, -pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: -Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). -Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). -Simple de desarrollar (sin frameworks pesados). +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y +medianas empresas, asociaciones o autónomos. Incluye diferentes +funcionalidades para la Planificación de Recursos Empresariales (ERP) y +Gestión de la Relación con los Clientes (CRM) así como para para otras +diferentes actividades. Dolibarr ha sido diseñado para suministrarle +solamente las funcionalidades que necesita y haciendo hincapié en su +facilidad de uso. %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, @@ -182,19 +179,35 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi -# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf -if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then - echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf - ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf + +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + apacheuser='apache'; + apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + apacheuser='wwwrun'; + apachegroup='wwwrun'; +fi + +# Create a config link dolibarr.conf for Fedora or Redhat +if [ ! -f $conffile ]; then + echo Create dolibarr web server config link $conffile + ln -fs /etc/dolibarr/apache.conf $conffile fi # Set permissions -echo Set permission on $targetdir -chown -R apache.apache $targetdir +echo Set permission to $apacheuser:$apachegroup on $targetdir +chown -R $apacheuser:$apachegroup $targetdir chmod -R a-w $targetdir -echo Set permission on $docdir -chown -R apache.apache $docdir +echo Set permission to $apacheuser:$apachegroup on $docdir +chown -R $apacheuser:$apachegroup $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer @@ -205,7 +218,7 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -220,6 +233,9 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi +if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart +fi # Show result echo @@ -236,12 +252,23 @@ echo %postun %clean_menus +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +fi + + # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' -export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -256,6 +283,9 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi fi rm -rf /etc/dolibarr From a357f1e2a2b1a83a8e512d621a86a76c8a9adfbc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Jul 2011 06:23:22 +0000 Subject: [PATCH 077/252] Fix: need complete object --- htdocs/lib/files.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 8b6ea639ec8..3dbbef2c6b2 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ */ /** @@ -561,9 +561,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger) + if (! $notrigger && is_object($object)) { - if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From b9b3365fdcda18add182efff72022d7a7593d8fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 07:50:22 +0000 Subject: [PATCH 078/252] RPM works alos on ubuntu and debian --- build/rpm/dolibarr.spec | 57 +++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index a9003afcac3..46c0b734ca3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,7 +32,8 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -AutoReqProv: yes +# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) +AutoReqProv: no %description @@ -103,17 +104,6 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr -# menu -#%{__install} -d $RPM_BUILD_ROOT%{_menudir} -#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} -#?package(%{name}):\ -#command="Dolibarr" \ -#section="Office" \ -#title="Dolibarr" \ -#icon="dolibarr_48x48.png" \ -#longtitle="Dolibarr ERP & CRM" -#EOF - #---- clean %clean @@ -181,19 +171,26 @@ fi # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - apacheuser='apache'; - apachegroup='apache'; + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - apacheuser='wwwrun'; - apachegroup='wwwrun'; + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $conffile ]; then @@ -214,11 +211,11 @@ chmod -R o-w $docdir if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown apache.apache $targetdir/htdocs/conf/conf.php + chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -253,16 +250,26 @@ echo %clean_menus # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi - +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' From 0db1c521a713c7d0d981dfcf6bc133b136e3d099 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 07:51:31 +0000 Subject: [PATCH 079/252] Trad: add possibility to force mail errors-to to all mails sent --- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 848deab542a..b79ba3f2c77 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 5645bd6ff6f..de8ec9133ef 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails From 3805a5012842426dc948e13374a16f2981397925 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:36:11 +0000 Subject: [PATCH 080/252] Work on packaging RPM & DEB --- build/rpm/README | 2 +- build/rpm/dolibarr.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index f2077ceac36..c072a212632 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -18,6 +18,6 @@ with format RPM (for Redhat, Mandriva, ...). # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package # -# On Mageia +# On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies # urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 46c0b734ca3..b3aaca1d494 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -171,20 +171,26 @@ fi # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; @@ -250,20 +256,26 @@ echo %clean_menus # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; From 8c3f3b38cd32aa1b555ad534f7a5ddc0a7e7b195 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 08:38:02 +0000 Subject: [PATCH 081/252] Fix: Missing translation From 9d44f39a5af0017f0da37e06f5ff981542636cfb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:54:57 +0000 Subject: [PATCH 082/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 18 ++++++++++-------- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index 568dd605dca..cfedcbc4dbb 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -14,7 +14,9 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # # Directory for web pages - + + Order deny,allow + Allow from all DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -54,23 +56,23 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - + # Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + # Directory for data files - + AllowOverride All Order deny,allow Allow from all - - + + AllowOverride All Order deny,allow Allow from all - + diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 4a395f235a2..e1fcb3f77e5 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From 1faceeaa44f42767e6a3e9ae12fec78ba5ebabb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:55:53 +0000 Subject: [PATCH 083/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 2 +- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index cfedcbc4dbb..fa29149ee59 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index e1fcb3f77e5..4a395f235a2 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From 026a430f4de7bcb5a73be7a29d5be623e3304371 Mon Sep 17 00:00:00 2001 From: cdelambert Date: Mon, 11 Jul 2011 09:32:35 +0000 Subject: [PATCH 084/252] Correction paiement Ajax From 19d022b6510820635d33c1b3f7c5c143b3aaa526 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 10:41:29 +0000 Subject: [PATCH 085/252] Trad: add translation From e4af5531f1ea4381383563509db20624ae7f8dce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 10:53:37 +0000 Subject: [PATCH 086/252] Fix: Removed install warning From e140052e4fc2fcb5c6db7987c637b0fe64445546 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 11:09:02 +0000 Subject: [PATCH 087/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 532bf16a2da..8e0e3a0b1d1 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -262,6 +262,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; From d3233c96ab92b736ff1f8c185461d0a1dfdf7b71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 12:31:38 +0000 Subject: [PATCH 088/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b3aaca1d494..44051435047 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -31,7 +31,13 @@ Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql +# Requires for OpenSuse +#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl +# Requires for Mageia +#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -182,7 +188,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -267,7 +273,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -307,9 +313,12 @@ then fi fi +# Removed dirs after apache restart +echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install - +rmdir $targetdir/doc >/dev/null 2>&1 +rmdir $targetdir/htdocs >/dev/null 2>&1 %changelog From f821c61cd6b3e9019448d5b2062f3b29457b41d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 21:16:25 +0000 Subject: [PATCH 089/252] Work on packaging RPM & DEB --- build/rpm/README | 1 + build/rpm/dolibarr.spec | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index c072a212632..d868ed411b8 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -11,6 +11,7 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # # On Fedora +# rpm -i --test dolibarr-...rpm To list dependencies of RPM # yum install dolibarr-...rpm To install package and dependencies # yum erase dolibarr To remove package # diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 44051435047..11090951bdd 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,25 +19,30 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org -#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandrake +# For Mandriva-Mageia Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires can use lua to be defined dynamically (but still at build time) +# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } + # Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql # Requires for OpenSuse #Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mageia +# Requires for Mandriva-Mageia #Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl +#Requires(pre): +#Requires(postun): + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -95,19 +100,17 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr From eb4a051f8b2372cdf7204162de930dc6be465a57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 07:17:11 +0000 Subject: [PATCH 090/252] Fix: Uniformise code From 95a493a2d9f31964ec310ec305120726a5c77fb0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Jul 2011 08:07:59 +0000 Subject: [PATCH 091/252] Fix: update jstree plugin From 2d42011e76552e113a97deef49e7270904d21512 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:16:03 +0000 Subject: [PATCH 092/252] Fix: Upgrade detection fails From 592f1e83acb688d8c34348d6e683aae1e0104819 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:48:08 +0000 Subject: [PATCH 093/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 9de8cdf662d..0f6034488dd 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ + * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From d82ba58d7ad564d4083c7728c9516297ae15dc14 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:52:41 +0000 Subject: [PATCH 094/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0f6034488dd..9de8cdf662d 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ + * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From 5817826d483fe8b4e16c70b0cbbd9c4281d1672e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 21:07:24 +0000 Subject: [PATCH 095/252] Fix: Type of amount From e10c9257d83031fd833c4f1eda86a26fed330026 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:03:44 +0000 Subject: [PATCH 096/252] Fix: Add civility for all peopal tables From 2e54cfe68cce0c5b86e3cd157ea86e501b616166 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:12:12 +0000 Subject: [PATCH 097/252] Fix: Add civility for all peopal tables From c6a53f3990b823a3f2bae500a1bae72c8aadb78b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:19:02 +0000 Subject: [PATCH 098/252] Fix: Attachment fails if content was empty From f16bdb60d9b83dcfcc42f5a9eafa5960c9454d29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 21:52:07 +0000 Subject: [PATCH 099/252] Fix: Parent class must be declared. From 976f49b5bfb591a1318fe3f16b4ac9aebee3f190 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 23:35:05 +0000 Subject: [PATCH 100/252] Test with phpunit --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 79a4cba739b..4b573b22b3e 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a timeout before end, try this: +If there is a fu... timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -10 du process php +puis renice -11 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php +> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs From 53880e26ba98444660952cfb441651be212b6e48 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:11:55 +0000 Subject: [PATCH 101/252] Test with phpcs --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 4b573b22b3e..79a4cba739b 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a fu... timeout before end, try this: +If there is a timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -11 du process php +puis renice -10 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs +> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php From 876c395775bb3d2504276b64a4f22e109211b4bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:15:16 +0000 Subject: [PATCH 102/252] Qual: Removed errors and warnings reported by codesniffer From 918dd688ace30621519b0779b05d0d7cc7b35cb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 01:39:07 +0000 Subject: [PATCH 103/252] Removed useless files to avoid warning in packages From ae1023b797d3683a367cb7776e7c6c05f329d1b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 02:41:36 +0000 Subject: [PATCH 104/252] Prepare packaging for debian --- build/deb/config | 11 +++++++++++ build/deb/control | 27 ++++++++++----------------- build/deb/copyright | 3 --- build/deb/templates | 15 +++------------ build/makepack-dolibarr.pl | 38 ++++++++++++++++---------------------- 5 files changed, 40 insertions(+), 54 deletions(-) diff --git a/build/deb/config b/build/deb/config index 1965ef73cc5..e006ebda186 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,6 +1,17 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # +# lintian package To test a package +# +# dpkg -l list all packages +# dpkg -b is to build package +# dpkg -c package.deb list content of package +# dpkg -I package.deb give informations on package +# dpkg -i package.deb install a package +# +# dpkg -L packagename list content of installed package +# dpkg --purge remove interactive saved answers +# set -e diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..19eb51664e7 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,39 +3,35 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 61200 +Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: firefox +Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: Easy to use ERP & CRM software to manage your activity. +Description: An ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. + Management (CRM) but also other features for different activities. . - Only features you need are visible, depending on which module were activated. - Most common used modules are: + Dolibarr features are activated by modules. Most common modules are: . + * Products and services catalog + * Stock management + * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management - * Products and services catalog - * Stock management - * Foundations members management - * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management + * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -43,7 +39,4 @@ Description: Easy to use ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of more modules... - . - You can also add third parties external modules or develop yours. - \ No newline at end of file + * And a lot of other modules diff --git a/build/deb/copyright b/build/deb/copyright index 00aafd563b1..74752ea4864 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1,4 +1 @@ -Copyright 2011 Laurent Destailleur - -This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/templates b/build/deb/templates index 1d1c133f99a..82fcaa1ba48 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running ? +Description: Which Web Server are you running? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,15 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Delete the Dolibarr MySQL database and all its datas (datas related - to this quetion are the Dolibarr DBMS account and all + Do I have to delete also the Dolibarr MySQL database and all its datas + (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? - -Template: dolibarr/postrmfile -Type: boolean -Default: true -Description: Delete attached files ? - Delete also all uploaded and generated files (datas related - to this quetion are all files found into /usr/share/dolibarr/documents, - uploaded or generated when using Dolibarr) ? - \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8e0e3a0b1d1..799a17c5ff4 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; # Use - before number of choice to avoid copy +my $copyalreadydone=0; my $batch=0; for (0..@ARGV-1) { @@ -262,7 +262,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; @@ -458,6 +457,7 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; + print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,11 +498,13 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -514,28 +516,20 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Set owners on files/dir\n"; + print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; + + print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; - $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From e597a6313f788f187cbf4b1ac4457e8090bff075 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 05:28:41 +0000 Subject: [PATCH 105/252] Fix: remove deprecated constant --- htdocs/admin/mails.php | 22 ++++------------------ htdocs/langs/ca_ES/admin.lang | 1 - htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/es_ES/admin.lang | 1 - htdocs/langs/fr_FR/admin.lang | 1 - 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c9d5ac88812..ab12d1419b6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ + * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ */ require("../main.inc.php"); @@ -63,7 +63,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -80,7 +79,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +126,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -469,12 +468,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''; - // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -575,13 +568,6 @@ else if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - // Errors To - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; - if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -737,5 +723,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); +llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); ?> diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index b79ba3f2c77..848deab542a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f43c1c9e82..9f153916ea5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,7 +229,6 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index de8ec9133ef..5645bd6ff6f 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3cb19e89ba8..2729073a3b8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) -MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From 852010ddfac9a0d738c51e2a8b3a4c412520d621 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 06:10:04 +0000 Subject: [PATCH 106/252] Fix: add possibility to force mail errors-to to all mails sent --- htdocs/admin/mails.php | 18 ++++++++++-- htdocs/core/class/html.formmail.class.php | 36 ++++++++--------------- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ab12d1419b6..05b12ff10b8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ + * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ */ require("../main.inc.php"); @@ -63,6 +63,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -467,6 +468,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; + + // From + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''; // Autocopy to $var=!$var; @@ -567,6 +574,13 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; + + // Errors To + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); + print ''; // Autocopy to $var=!$var; @@ -723,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); +llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3164f86d8e1..25c96d54498 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,6 +1,5 @@ - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -22,7 +21,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +123,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param string $path Full absolute path on filesystem of file, including file name - * @param string $file Only filename - * @param string $type Mime type + * @param $path + * @param $file + * @param $type */ function add_attached_files($path,$file,$type) { @@ -505,27 +504,14 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out.= ''."\n"; - $out.= ''."\n"; + //print '
'; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { - $out.= '
'; - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) - { - $out.= ' '; - //$out.= ' '.img_delete($langs->trans("Delete").''; - } - $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else @@ -534,9 +520,11 @@ class FormMail } if ($this->withfile == 2) // Can add other files { + //print '
'; $out.= ''; $out.= ' '; $out.= ''; + //print '
'; } $out.= "\n"; } @@ -556,7 +544,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f153916ea5..0f43c1c9e82 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,6 +229,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) +MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2729073a3b8..3cb19e89ba8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) +MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From 37eb54c55fd95f1448f2347a2ff6e71f087853d5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 08:05:08 +0000 Subject: [PATCH 107/252] New: add jquery method for random generation From 5b235748010977cedd7eaf1ea7042b2293ab265a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 10:26:19 +0000 Subject: [PATCH 108/252] Fix: add div for jquery --- htdocs/core/class/html.formmail.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 25c96d54498..0de9a763c66 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -21,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -509,9 +510,10 @@ class FormMail { foreach($listofpaths as $key => $val) { - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; - $out.= '
'; + $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else From ca3ab4c88ca2e072606bb67f49727c1ccc5c1989 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 11:24:32 +0000 Subject: [PATCH 109/252] Fix: Set x bit required to directories From 684dd2c15771c410334326f68bf5c080eb682468 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 14:11:40 +0000 Subject: [PATCH 110/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 24 +++++++----------------- build/deb/changelog | 2 +- build/deb/control | 2 +- build/deb/copyright | 3 +++ build/deb/install.forced.php.install | 7 +++---- build/deb/postinst | 22 +++++++++++++--------- build/deb/templates | 4 ++-- 7 files changed, 30 insertions(+), 34 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index fa29149ee59..d37b433fb98 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com @@ -13,10 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # -# Directory for web pages - - Order deny,allow - Allow from all + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -56,23 +53,16 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - +
-# Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + -# Directory for data files - + AllowOverride All Order deny,allow Allow from all - - - AllowOverride All - Order deny,allow - Allow from all - + diff --git a/build/deb/changelog b/build/deb/changelog index d75fd100a60..182110624de 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ -dolibarr 3.1.0 unstable; urgency=low + dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 19eb51664e7..3f564f5608f 100644 --- a/build/deb/control +++ b/build/deb/control @@ -9,7 +9,7 @@ Section: web Priority: optional Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: An ERP & CRM software to manage your activity. +Description: ERP & CRM software to manage your activity. 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 diff --git a/build/deb/copyright b/build/deb/copyright index 74752ea4864..00aafd563b1 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1 +1,4 @@ +Copyright 2011 Laurent Destailleur + +This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 1166abe41ae..198565d3211 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,13 +4,12 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ +// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ // - $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -$force_install_main_data_root='/usr/share/dolibarr/documents'; -#$force_install_main_data_root='/var/lib/dolibarr'; +#$force_install_main_data_root='/usr/share/dolibarr/documents'; +$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index be9fb7521b7..4d065f58ca0 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,21 +49,19 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create document directory - #docdir='/var/lib/dolibarr/documents' - docdir='/usr/share/dolibarr/documents' - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir + # Create /var/lib/dolibarr/documents + mkdir -p /var/lib/dolibarr/documents + chown -R www-data:www-data /var/lib/dolibarr/documents; + chmod -R 775 /var/lib/dolibarr/documents; + chmod -R g+s /var/lib/dolibarr/documents; # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; fi #db_reset "dolibarr/webserver" @@ -108,6 +106,12 @@ case "$1" in done + # Copy icon file + #echo "Copy icon file" + #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" + #target="/usr/share/pixmaps/" + #cp -f $fileorig $target + #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/deb/templates b/build/deb/templates index 82fcaa1ba48..3b370ee68f2 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -91,6 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Do I have to delete also the Dolibarr MySQL database and all its datas - (datas subjected to this quetion are the Dolibarr DBMS account and all + Answer yes if you want to delete also the Dolibarr MySQL database and all + its datas (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? From 94f3b453058daaba6f486e4c47dedebe11351981 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 15:48:19 +0000 Subject: [PATCH 111/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 8 ++++++ build/deb/changelog | 2 +- build/deb/control | 20 ++++++++------- build/deb/install.forced.php.install | 7 +++--- build/deb/postinst | 16 ++++++------ build/deb/templates | 15 ++++++++--- build/makepack-dolibarr.pl | 37 ++++++++++++++++------------ 7 files changed, 66 insertions(+), 39 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index d37b433fb98..568dd605dca 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -13,6 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # +# Directory for web pages DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -55,12 +56,19 @@ Alias /dolibarr /usr/share/dolibarr/htdocs +# Directory for public pages AllowOverride All Order deny,allow Allow from all +# Directory for data files + + AllowOverride All + Order deny,allow + Allow from all + AllowOverride All Order deny,allow diff --git a/build/deb/changelog b/build/deb/changelog index 182110624de..d75fd100a60 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ - dolibarr 3.1.0 unstable; urgency=low +dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 3f564f5608f..07a08b7d045 100644 --- a/build/deb/control +++ b/build/deb/control @@ -7,31 +7,32 @@ Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: mozilla | netscape +Recommends: firefox Homepage: http://www.dolibarr.org -Description: ERP & CRM software to manage your activity. +Description: Easy to use ERP & CRM software to manage your activity. 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 other features for different activities. + Management (CRM) but also for different other activities. . - Dolibarr features are activated by modules. Most common modules are: + Only features you need are visible, depending on which module were activated. + Most common used modules are: . - * Products and services catalog - * Stock management - * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management + * Products and services catalog + * Stock management + * Foundations members management + * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management - * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -39,4 +40,5 @@ Description: ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of other modules + * And a lot of more modules... +You can also add third parties external modules or develop yours. \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 198565d3211..1166abe41ae 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,12 +4,13 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ +// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ // + $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -#$force_install_main_data_root='/usr/share/dolibarr/documents'; -$force_install_main_data_root='/var/lib/dolibarr'; +$force_install_main_data_root='/usr/share/dolibarr/documents'; +#$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index 4d065f58ca0..12e3fdbd07a 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,19 +49,21 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create /var/lib/dolibarr/documents - mkdir -p /var/lib/dolibarr/documents - chown -R www-data:www-data /var/lib/dolibarr/documents; - chmod -R 775 /var/lib/dolibarr/documents; - chmod -R g+s /var/lib/dolibarr/documents; + # Create document directory + #docdir='/var/lib/dolibarr/documents' + docdir='/usr/share/dolibarr/documents' + mkdir -p $docdir + chown -R www-data:www-data $docdir + chmod -R 775 $docdir + chmod -R g+s $docdir # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php fi #db_reset "dolibarr/webserver" diff --git a/build/deb/templates b/build/deb/templates index 3b370ee68f2..1d1c133f99a 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running? +Description: Which Web Server are you running ? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,6 +91,15 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Answer yes if you want to delete also the Dolibarr MySQL database and all - its datas (datas subjected to this quetion are the Dolibarr DBMS account and all + Delete the Dolibarr MySQL database and all its datas (datas related + to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? + +Template: dolibarr/postrmfile +Type: boolean +Default: true +Description: Delete attached files ? + Delete also all uploaded and generated files (datas related + to this quetion are all files found into /usr/share/dolibarr/documents, + uploaded or generated when using Dolibarr) ? + \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 799a17c5ff4..2cc4b0b880e 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; +my $copyalreadydone=0; # Use - before number of choice to avoid copy my $batch=0; for (0..@ARGV-1) { @@ -457,7 +457,6 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; - print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,13 +497,11 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -516,20 +513,28 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; - - print "Set permissions/owners on files/dir\n"; + print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; + + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; + $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From fa65f47c3630e3c9333abc6fee509f899912de0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH 112/252] Work on packaging RPM & DEB --- build/deb/config | 11 --- build/deb/control | 7 +- build/deb/postinst | 6 -- build/rpm/README | 13 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 149 ++++++++----------------------------- 6 files changed, 41 insertions(+), 150 deletions(-) diff --git a/build/deb/config b/build/deb/config index e006ebda186..1965ef73cc5 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,17 +1,6 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # -# lintian package To test a package -# -# dpkg -l list all packages -# dpkg -b is to build package -# dpkg -c package.deb list content of package -# dpkg -I package.deb give informations on package -# dpkg -i package.deb install a package -# -# dpkg -L packagename list content of installed package -# dpkg --purge remove interactive saved answers -# set -e diff --git a/build/deb/control b/build/deb/control index 07a08b7d045..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,7 +3,7 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 31200 +Installed-Size: 61200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional @@ -14,6 +14,7 @@ Description: Easy to use ERP & CRM software to manage your activity. 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. + Dolibarr was designed to provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. Most common used modules are: @@ -41,4 +42,6 @@ Description: Easy to use ERP & CRM software to manage your activity. * LDAP connectivity * PDF exports * And a lot of more modules... -You can also add third parties external modules or develop yours. \ No newline at end of file + . + You can also add third parties external modules or develop yours. + \ No newline at end of file diff --git a/build/deb/postinst b/build/deb/postinst index 12e3fdbd07a..be9fb7521b7 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -108,12 +108,6 @@ case "$1" in done - # Copy icon file - #echo "Copy icon file" - #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" - #target="/usr/share/pixmaps/" - #cp -f $fileorig $target - #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/rpm/README b/build/rpm/README index d868ed411b8..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,15 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# rpm -i --test dolibarr-...rpm To list dependencies of RPM -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 11090951bdd..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,32 +19,20 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org +#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandriva-Mageia +# For Mandrake Group: Networking/WWW # For all other distrib Group: Applications/Internet -# Requires can use lua to be defined dynamically (but still at build time) -# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } - -# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Requires for OpenSuse -#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mandriva-Mageia -#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl - -#Requires(pre): -#Requires(postun): - -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -55,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -100,19 +69,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -178,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -245,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -264,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' +export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -311,17 +234,11 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi -# Removed dirs after apache restart -echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install -rmdir $targetdir/doc >/dev/null 2>&1 -rmdir $targetdir/htdocs >/dev/null 2>&1 + %changelog From 8d9d48104762f6ec2de38a849e5b4ddab0fd13fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 18:29:46 +0000 Subject: [PATCH 113/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2cc4b0b880e..532bf16a2da 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -529,8 +529,8 @@ if ($nboftargetok) { $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + #$ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; From a803a470c8758a8d227997bd5f79208eefa35e0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:18:50 +0000 Subject: [PATCH 114/252] Prepare release 3.1 From dca7824c7158dd697436e1ead640135aed6c12a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:26:53 +0000 Subject: [PATCH 115/252] Work on packaging RPM & DEB --- build/deb/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/deb/control b/build/deb/control index 3d8878f4569..2d356fc7b2b 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,6 +14,8 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. From 570d79107c28ab21f5143fce90492b3db27e134b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:33:27 +0000 Subject: [PATCH 116/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.desktop | 5 ++++- build/rpm/dolibarr.spec | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index e3be821080c..ab2a758867f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,9 +5,12 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM +Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations +Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs +Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti +Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b1def13ae37..4bfbcfaae65 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -43,12 +43,34 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. +%description -l es +Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones +que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores +ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource +que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier +lugar disponiendo de una conexión a Internet. +Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, +pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: +Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). +Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). +Simple de desarrollar (sin frameworks pesados). + %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. +%description -l it +Dolibarr è un programma gestionale open source e gratuito per piccole e medie +imprese, fondazioni e liberi professionisti. Include varie funzionalità per +Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori +attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno +ed essere facile da usare. +Dolibar è completamente web-based, progettato per poter fornire solo ciò di +cui hai bisogno ed essere facile da usare. + + #---- prep %prep From 7c4745fe79a04299a1aeb92eb4b3c3f080a871cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:33:53 +0000 Subject: [PATCH 117/252] Use global option if local not defined From bc4b9f100e6ab2c59ae13f44fdd141d24c567e51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:39:34 +0000 Subject: [PATCH 118/252] Add comment From 259072f0e36e6c1404ca78da71189f1a32cda911 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:48:25 +0000 Subject: [PATCH 119/252] Fix: Param of constructor must be only database handler From a459af4f7a2b682bc28560c373f81c27ac964d8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 16:50:40 +0000 Subject: [PATCH 120/252] Fix: Missing fields and missing encoding of special chars --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e97abed808..4863b52689e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ + * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 196751eae9f12301e3ff5f09bc29dbb2226d8c40 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 17:28:09 +0000 Subject: [PATCH 121/252] Fix: missing htmlname in ajax response --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4863b52689e..7e97abed808 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ + * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 8089212e2cbbd5a747b3c022e2f0d384a8a69404 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 18:24:18 +0000 Subject: [PATCH 122/252] Fix: possibility to change status of another input element From d99156c52f89c7013f07a38671c9eb86033c79c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 20:03:38 +0000 Subject: [PATCH 123/252] Fix: file add and delte in email forms was broken with firefox 5 --- htdocs/admin/mails.php | 12 +++++----- htdocs/core/class/html.formmail.class.php | 28 +++++++++++++++-------- htdocs/lib/files.lib.php | 5 ++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 05b12ff10b8..c9d5ac88812 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ + * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ */ require("../main.inc.php"); @@ -80,7 +80,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +127,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -468,7 +468,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; - + // From $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -574,7 +574,7 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - + // Errors To $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -737,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); +llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0de9a763c66..3164f86d8e1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +124,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param $path - * @param $file - * @param $type + * @param string $path Full absolute path on filesystem of file, including file name + * @param string $file Only filename + * @param string $type Mime type */ function add_attached_files($path,$file,$type) { @@ -505,14 +505,26 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - //print '
'; + // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript + $out.= ''."\n"; + $out.= ''."\n"; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { $out.= '
'; $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; + if (! $this->withfilereadonly) + { + $out.= ' '; + //$out.= ' '.img_delete($langs->trans("Delete").''; + } $out.= '
'; } } @@ -522,11 +534,9 @@ class FormMail } if ($this->withfile == 2) // Can add other files { - //print '
'; $out.= ''; $out.= ' '; $out.= ''; - //print '
'; } $out.= "\n"; } @@ -546,7 +556,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 3dbbef2c6b2..8b6ea639ec8 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ + * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ */ /** @@ -561,8 +561,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger && is_object($object)) + if (! $notrigger) { + if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From fe26cc9cca756d1c04e38a1ff4f483c4eee3a70b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 21:17:14 +0000 Subject: [PATCH 124/252] Fix: Missing name on form From 0cd799374276097d1d51d8e4a9048cfbdd82f723 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 22:45:44 +0000 Subject: [PATCH 125/252] Work on packaging RPM & DEB --- build/rpm/README | 12 +++++-- build/rpm/dolibarr.spec | 70 +++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index 1b2d4745dc4..f2077ceac36 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,6 +10,14 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# yum install dolibarr To remove package -# yum erase dolibarr To remove package +# On Fedora +# yum install dolibarr-...rpm To install package and dependencies +# yum erase dolibarr To remove package # +# On OpenSuse +# yast --install dolibarr-...rpm To install package and dependencies +# yast --remove dolibarr To remove package +# +# On Mageia +# urpmi dolibarr-...rpm To install package and dependencies +# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 4bfbcfaae65..a9003afcac3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -44,16 +44,13 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones -que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores -ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource -que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier -lugar disponiendo de una conexión a Internet. -Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, -pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: -Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). -Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). -Simple de desarrollar (sin frameworks pesados). +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y +medianas empresas, asociaciones o autónomos. Incluye diferentes +funcionalidades para la Planificación de Recursos Empresariales (ERP) y +Gestión de la Relación con los Clientes (CRM) así como para para otras +diferentes actividades. Dolibarr ha sido diseñado para suministrarle +solamente las funcionalidades que necesita y haciendo hincapié en su +facilidad de uso. %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, @@ -182,19 +179,35 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi -# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf -if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then - echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf - ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf + +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + apacheuser='apache'; + apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + apacheuser='wwwrun'; + apachegroup='wwwrun'; +fi + +# Create a config link dolibarr.conf for Fedora or Redhat +if [ ! -f $conffile ]; then + echo Create dolibarr web server config link $conffile + ln -fs /etc/dolibarr/apache.conf $conffile fi # Set permissions -echo Set permission on $targetdir -chown -R apache.apache $targetdir +echo Set permission to $apacheuser:$apachegroup on $targetdir +chown -R $apacheuser:$apachegroup $targetdir chmod -R a-w $targetdir -echo Set permission on $docdir -chown -R apache.apache $docdir +echo Set permission to $apacheuser:$apachegroup on $docdir +chown -R $apacheuser:$apachegroup $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer @@ -205,7 +218,7 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -220,6 +233,9 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi +if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart +fi # Show result echo @@ -236,12 +252,23 @@ echo %postun %clean_menus +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +fi + + # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' -export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -256,6 +283,9 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi fi rm -rf /etc/dolibarr From e6391b6ed65329ca850da3f0a425f6598338bd90 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Jul 2011 06:23:22 +0000 Subject: [PATCH 126/252] Fix: need complete object --- htdocs/lib/files.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 8b6ea639ec8..3dbbef2c6b2 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ */ /** @@ -561,9 +561,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger) + if (! $notrigger && is_object($object)) { - if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From e8980b5e7561a72d224a224d5644d3b28d18c616 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 07:50:22 +0000 Subject: [PATCH 127/252] RPM works alos on ubuntu and debian --- build/rpm/dolibarr.spec | 57 +++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index a9003afcac3..46c0b734ca3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,7 +32,8 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -AutoReqProv: yes +# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) +AutoReqProv: no %description @@ -103,17 +104,6 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr -# menu -#%{__install} -d $RPM_BUILD_ROOT%{_menudir} -#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} -#?package(%{name}):\ -#command="Dolibarr" \ -#section="Office" \ -#title="Dolibarr" \ -#icon="dolibarr_48x48.png" \ -#longtitle="Dolibarr ERP & CRM" -#EOF - #---- clean %clean @@ -181,19 +171,26 @@ fi # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - apacheuser='apache'; - apachegroup='apache'; + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - apacheuser='wwwrun'; - apachegroup='wwwrun'; + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $conffile ]; then @@ -214,11 +211,11 @@ chmod -R o-w $docdir if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown apache.apache $targetdir/htdocs/conf/conf.php + chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -253,16 +250,26 @@ echo %clean_menus # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi - +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' From 67927db80a18f3a39b9683d002f50941f7307c11 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 07:51:31 +0000 Subject: [PATCH 128/252] Trad: add possibility to force mail errors-to to all mails sent --- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 848deab542a..b79ba3f2c77 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 5645bd6ff6f..de8ec9133ef 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails From f642ea85b499b3a75fd8d3f38f8d11879fd95e92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:36:11 +0000 Subject: [PATCH 129/252] Work on packaging RPM & DEB --- build/rpm/README | 2 +- build/rpm/dolibarr.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index f2077ceac36..c072a212632 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -18,6 +18,6 @@ with format RPM (for Redhat, Mandriva, ...). # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package # -# On Mageia +# On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies # urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 46c0b734ca3..b3aaca1d494 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -171,20 +171,26 @@ fi # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; @@ -250,20 +256,26 @@ echo %clean_menus # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; From 27e703e3eaa2f36ec92afe518028aecf21664f2f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 08:38:02 +0000 Subject: [PATCH 130/252] Fix: Missing translation From c5d56d4ba28527a45b7e2f33cc4f7201f9b61168 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:54:57 +0000 Subject: [PATCH 131/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 18 ++++++++++-------- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index 568dd605dca..cfedcbc4dbb 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -14,7 +14,9 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # # Directory for web pages - + + Order deny,allow + Allow from all DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -54,23 +56,23 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - + # Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + # Directory for data files - + AllowOverride All Order deny,allow Allow from all - - + + AllowOverride All Order deny,allow Allow from all - + diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 4a395f235a2..e1fcb3f77e5 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From 405d35a120526c8fb9bf2ffb94f1e8abc640b61f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:55:53 +0000 Subject: [PATCH 132/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 2 +- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index cfedcbc4dbb..fa29149ee59 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index e1fcb3f77e5..4a395f235a2 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From c4cbc6abf1e5aaa61d89c7a9e1db6a53d34950e3 Mon Sep 17 00:00:00 2001 From: cdelambert Date: Mon, 11 Jul 2011 09:32:35 +0000 Subject: [PATCH 133/252] Correction paiement Ajax From 9a225fbae12582fa896fea4efa50eedac1737515 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 10:41:29 +0000 Subject: [PATCH 134/252] Trad: add translation From aca6287b2e42103dc9df2f79f104bce53fadfe24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 10:53:37 +0000 Subject: [PATCH 135/252] Fix: Removed install warning From cf19639ca14c52d9dada8d91ebcc73f2e16807a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 11:09:02 +0000 Subject: [PATCH 136/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 532bf16a2da..8e0e3a0b1d1 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -262,6 +262,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; From e70ece515fa991878ac3ad7ba5e90fc949140715 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 12:31:38 +0000 Subject: [PATCH 137/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b3aaca1d494..44051435047 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -31,7 +31,13 @@ Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql +# Requires for OpenSuse +#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl +# Requires for Mageia +#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -182,7 +188,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -267,7 +273,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -307,9 +313,12 @@ then fi fi +# Removed dirs after apache restart +echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install - +rmdir $targetdir/doc >/dev/null 2>&1 +rmdir $targetdir/htdocs >/dev/null 2>&1 %changelog From b0748670d29c5cff4f973e6bc485f543d6093182 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 21:16:25 +0000 Subject: [PATCH 138/252] Work on packaging RPM & DEB --- build/rpm/README | 1 + build/rpm/dolibarr.spec | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index c072a212632..d868ed411b8 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -11,6 +11,7 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # # On Fedora +# rpm -i --test dolibarr-...rpm To list dependencies of RPM # yum install dolibarr-...rpm To install package and dependencies # yum erase dolibarr To remove package # diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 44051435047..11090951bdd 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,25 +19,30 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org -#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandrake +# For Mandriva-Mageia Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires can use lua to be defined dynamically (but still at build time) +# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } + # Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql # Requires for OpenSuse #Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mageia +# Requires for Mandriva-Mageia #Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl +#Requires(pre): +#Requires(postun): + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -95,19 +100,17 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr From b0dc0de90a567c801f1f12e5ddea1c73df3c0ee3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 07:17:11 +0000 Subject: [PATCH 139/252] Fix: Uniformise code From 9006d2fefb8a537651dafcd5eacb7994916513ff Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Jul 2011 08:07:59 +0000 Subject: [PATCH 140/252] Fix: update jstree plugin From 9641d571403b22674f6e4544e6d7f08b064ce0bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:16:03 +0000 Subject: [PATCH 141/252] Fix: Upgrade detection fails From 01080677a3e7a9e31e3411d030b1e2e849ab7a0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:48:08 +0000 Subject: [PATCH 142/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 9de8cdf662d..0f6034488dd 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ + * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From e61d3f107577c177eb381feb5e102caacb9654f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:52:41 +0000 Subject: [PATCH 143/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0f6034488dd..9de8cdf662d 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ + * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From a9f2991c4733f188cc739f90d7cf1f6bc0e9761c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 21:07:24 +0000 Subject: [PATCH 144/252] Fix: Type of amount From 0c5a55974588518f394c242eb0e8aa4f8bf02055 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:03:44 +0000 Subject: [PATCH 145/252] Fix: Add civility for all peopal tables From 1c1f10a95b48157809fe080296e5107bc4db7939 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:12:12 +0000 Subject: [PATCH 146/252] Fix: Add civility for all peopal tables From b757290f8d9186ebcb98a255028af4376b2a9cd5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:19:02 +0000 Subject: [PATCH 147/252] Fix: Attachment fails if content was empty From db9c889647cf107355f40fd3054bad8d7fc44f50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 21:52:07 +0000 Subject: [PATCH 148/252] Fix: Parent class must be declared. From 35111bd851e8a4cdac43373a7749d52257d6f32c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 23:35:05 +0000 Subject: [PATCH 149/252] Test with phpunit --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 79a4cba739b..4b573b22b3e 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a timeout before end, try this: +If there is a fu... timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -10 du process php +puis renice -11 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php +> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs From 9e3ce33259e7a5da503b39129654d163b51472a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:11:55 +0000 Subject: [PATCH 150/252] Test with phpcs --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 4b573b22b3e..79a4cba739b 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a fu... timeout before end, try this: +If there is a timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -11 du process php +puis renice -10 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs +> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php From 50fe1cfce21a93c18a46cb8f0a747648073c4c7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:15:16 +0000 Subject: [PATCH 151/252] Qual: Removed errors and warnings reported by codesniffer From 211eecd9a7f367d7b708f120640c1a849d1030c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 01:39:07 +0000 Subject: [PATCH 152/252] Removed useless files to avoid warning in packages From b906c2bad9092a041d2585df73ae88c7e6538385 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 02:41:36 +0000 Subject: [PATCH 153/252] Prepare packaging for debian --- build/deb/config | 11 +++++++++++ build/deb/control | 27 ++++++++++----------------- build/deb/copyright | 3 --- build/deb/templates | 15 +++------------ build/makepack-dolibarr.pl | 38 ++++++++++++++++---------------------- 5 files changed, 40 insertions(+), 54 deletions(-) diff --git a/build/deb/config b/build/deb/config index 1965ef73cc5..e006ebda186 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,6 +1,17 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # +# lintian package To test a package +# +# dpkg -l list all packages +# dpkg -b is to build package +# dpkg -c package.deb list content of package +# dpkg -I package.deb give informations on package +# dpkg -i package.deb install a package +# +# dpkg -L packagename list content of installed package +# dpkg --purge remove interactive saved answers +# set -e diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..19eb51664e7 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,39 +3,35 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 61200 +Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: firefox +Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: Easy to use ERP & CRM software to manage your activity. +Description: An ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. + Management (CRM) but also other features for different activities. . - Only features you need are visible, depending on which module were activated. - Most common used modules are: + Dolibarr features are activated by modules. Most common modules are: . + * Products and services catalog + * Stock management + * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management - * Products and services catalog - * Stock management - * Foundations members management - * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management + * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -43,7 +39,4 @@ Description: Easy to use ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of more modules... - . - You can also add third parties external modules or develop yours. - \ No newline at end of file + * And a lot of other modules diff --git a/build/deb/copyright b/build/deb/copyright index 00aafd563b1..74752ea4864 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1,4 +1 @@ -Copyright 2011 Laurent Destailleur - -This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/templates b/build/deb/templates index 1d1c133f99a..82fcaa1ba48 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running ? +Description: Which Web Server are you running? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,15 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Delete the Dolibarr MySQL database and all its datas (datas related - to this quetion are the Dolibarr DBMS account and all + Do I have to delete also the Dolibarr MySQL database and all its datas + (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? - -Template: dolibarr/postrmfile -Type: boolean -Default: true -Description: Delete attached files ? - Delete also all uploaded and generated files (datas related - to this quetion are all files found into /usr/share/dolibarr/documents, - uploaded or generated when using Dolibarr) ? - \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8e0e3a0b1d1..799a17c5ff4 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; # Use - before number of choice to avoid copy +my $copyalreadydone=0; my $batch=0; for (0..@ARGV-1) { @@ -262,7 +262,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; @@ -458,6 +457,7 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; + print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,11 +498,13 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -514,28 +516,20 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Set owners on files/dir\n"; + print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; + + print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; - $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From 64445ccc7c5b39e7f698ef74f987df431c16e4fc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 05:28:41 +0000 Subject: [PATCH 154/252] Fix: remove deprecated constant --- htdocs/admin/mails.php | 22 ++++------------------ htdocs/langs/ca_ES/admin.lang | 1 - htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/es_ES/admin.lang | 1 - htdocs/langs/fr_FR/admin.lang | 1 - 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c9d5ac88812..ab12d1419b6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ + * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ */ require("../main.inc.php"); @@ -63,7 +63,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -80,7 +79,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +126,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -469,12 +468,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''; - // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -575,13 +568,6 @@ else if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - // Errors To - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; - if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -737,5 +723,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); +llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); ?> diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index b79ba3f2c77..848deab542a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f43c1c9e82..9f153916ea5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,7 +229,6 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index de8ec9133ef..5645bd6ff6f 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3cb19e89ba8..2729073a3b8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) -MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From 62379d5b114cb73c182d970deb4b336833a33679 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 06:10:04 +0000 Subject: [PATCH 155/252] Fix: add possibility to force mail errors-to to all mails sent --- htdocs/admin/mails.php | 18 ++++++++++-- htdocs/core/class/html.formmail.class.php | 36 ++++++++--------------- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ab12d1419b6..05b12ff10b8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ + * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ */ require("../main.inc.php"); @@ -63,6 +63,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -467,6 +468,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; + + // From + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''; // Autocopy to $var=!$var; @@ -567,6 +574,13 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; + + // Errors To + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); + print ''; // Autocopy to $var=!$var; @@ -723,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); +llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3164f86d8e1..25c96d54498 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,6 +1,5 @@ - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -22,7 +21,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +123,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param string $path Full absolute path on filesystem of file, including file name - * @param string $file Only filename - * @param string $type Mime type + * @param $path + * @param $file + * @param $type */ function add_attached_files($path,$file,$type) { @@ -505,27 +504,14 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out.= ''."\n"; - $out.= ''."\n"; + //print '
'; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { - $out.= '
'; - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) - { - $out.= ' '; - //$out.= ' '.img_delete($langs->trans("Delete").''; - } - $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else @@ -534,9 +520,11 @@ class FormMail } if ($this->withfile == 2) // Can add other files { + //print '
'; $out.= ''; $out.= ' '; $out.= ''; + //print '
'; } $out.= "\n"; } @@ -556,7 +544,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f153916ea5..0f43c1c9e82 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,6 +229,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) +MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2729073a3b8..3cb19e89ba8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) +MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From 87774ab2c172eadd604453e9b053f5f8ec3f2436 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 08:05:08 +0000 Subject: [PATCH 156/252] New: add jquery method for random generation From ff221cdcc903cfd69ac01d3f1bbba78fd60f7d5e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 10:26:19 +0000 Subject: [PATCH 157/252] Fix: add div for jquery --- htdocs/core/class/html.formmail.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 25c96d54498..0de9a763c66 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -21,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -509,9 +510,10 @@ class FormMail { foreach($listofpaths as $key => $val) { - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; - $out.= '
'; + $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else From 266fa2707e227fbe3c42f4bff943f2d31b17d8a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 11:24:32 +0000 Subject: [PATCH 158/252] Fix: Set x bit required to directories From e08e1524e705729fd00efb74701e49ec860bee2d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 14:11:40 +0000 Subject: [PATCH 159/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 24 +++++++----------------- build/deb/changelog | 2 +- build/deb/control | 2 +- build/deb/copyright | 3 +++ build/deb/install.forced.php.install | 7 +++---- build/deb/postinst | 22 +++++++++++++--------- build/deb/templates | 4 ++-- 7 files changed, 30 insertions(+), 34 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index fa29149ee59..d37b433fb98 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com @@ -13,10 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # -# Directory for web pages - - Order deny,allow - Allow from all + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -56,23 +53,16 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - +
-# Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + -# Directory for data files - + AllowOverride All Order deny,allow Allow from all - - - AllowOverride All - Order deny,allow - Allow from all - + diff --git a/build/deb/changelog b/build/deb/changelog index d75fd100a60..182110624de 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ -dolibarr 3.1.0 unstable; urgency=low + dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 19eb51664e7..3f564f5608f 100644 --- a/build/deb/control +++ b/build/deb/control @@ -9,7 +9,7 @@ Section: web Priority: optional Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: An ERP & CRM software to manage your activity. +Description: ERP & CRM software to manage your activity. 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 diff --git a/build/deb/copyright b/build/deb/copyright index 74752ea4864..00aafd563b1 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1 +1,4 @@ +Copyright 2011 Laurent Destailleur + +This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 1166abe41ae..198565d3211 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,13 +4,12 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ +// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ // - $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -$force_install_main_data_root='/usr/share/dolibarr/documents'; -#$force_install_main_data_root='/var/lib/dolibarr'; +#$force_install_main_data_root='/usr/share/dolibarr/documents'; +$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index be9fb7521b7..4d065f58ca0 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,21 +49,19 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create document directory - #docdir='/var/lib/dolibarr/documents' - docdir='/usr/share/dolibarr/documents' - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir + # Create /var/lib/dolibarr/documents + mkdir -p /var/lib/dolibarr/documents + chown -R www-data:www-data /var/lib/dolibarr/documents; + chmod -R 775 /var/lib/dolibarr/documents; + chmod -R g+s /var/lib/dolibarr/documents; # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; fi #db_reset "dolibarr/webserver" @@ -108,6 +106,12 @@ case "$1" in done + # Copy icon file + #echo "Copy icon file" + #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" + #target="/usr/share/pixmaps/" + #cp -f $fileorig $target + #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/deb/templates b/build/deb/templates index 82fcaa1ba48..3b370ee68f2 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -91,6 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Do I have to delete also the Dolibarr MySQL database and all its datas - (datas subjected to this quetion are the Dolibarr DBMS account and all + Answer yes if you want to delete also the Dolibarr MySQL database and all + its datas (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? From 4d9db8209a6c6553b140ba5dcff574a806342b23 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 15:48:19 +0000 Subject: [PATCH 160/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 8 ++++++ build/deb/changelog | 2 +- build/deb/control | 20 ++++++++------- build/deb/install.forced.php.install | 7 +++--- build/deb/postinst | 16 ++++++------ build/deb/templates | 15 ++++++++--- build/makepack-dolibarr.pl | 37 ++++++++++++++++------------ 7 files changed, 66 insertions(+), 39 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index d37b433fb98..568dd605dca 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -13,6 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # +# Directory for web pages DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -55,12 +56,19 @@ Alias /dolibarr /usr/share/dolibarr/htdocs +# Directory for public pages AllowOverride All Order deny,allow Allow from all +# Directory for data files + + AllowOverride All + Order deny,allow + Allow from all + AllowOverride All Order deny,allow diff --git a/build/deb/changelog b/build/deb/changelog index 182110624de..d75fd100a60 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ - dolibarr 3.1.0 unstable; urgency=low +dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 3f564f5608f..07a08b7d045 100644 --- a/build/deb/control +++ b/build/deb/control @@ -7,31 +7,32 @@ Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: mozilla | netscape +Recommends: firefox Homepage: http://www.dolibarr.org -Description: ERP & CRM software to manage your activity. +Description: Easy to use ERP & CRM software to manage your activity. 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 other features for different activities. + Management (CRM) but also for different other activities. . - Dolibarr features are activated by modules. Most common modules are: + Only features you need are visible, depending on which module were activated. + Most common used modules are: . - * Products and services catalog - * Stock management - * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management + * Products and services catalog + * Stock management + * Foundations members management + * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management - * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -39,4 +40,5 @@ Description: ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of other modules + * And a lot of more modules... +You can also add third parties external modules or develop yours. \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 198565d3211..1166abe41ae 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,12 +4,13 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ +// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ // + $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -#$force_install_main_data_root='/usr/share/dolibarr/documents'; -$force_install_main_data_root='/var/lib/dolibarr'; +$force_install_main_data_root='/usr/share/dolibarr/documents'; +#$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index 4d065f58ca0..12e3fdbd07a 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,19 +49,21 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create /var/lib/dolibarr/documents - mkdir -p /var/lib/dolibarr/documents - chown -R www-data:www-data /var/lib/dolibarr/documents; - chmod -R 775 /var/lib/dolibarr/documents; - chmod -R g+s /var/lib/dolibarr/documents; + # Create document directory + #docdir='/var/lib/dolibarr/documents' + docdir='/usr/share/dolibarr/documents' + mkdir -p $docdir + chown -R www-data:www-data $docdir + chmod -R 775 $docdir + chmod -R g+s $docdir # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php fi #db_reset "dolibarr/webserver" diff --git a/build/deb/templates b/build/deb/templates index 3b370ee68f2..1d1c133f99a 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running? +Description: Which Web Server are you running ? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,6 +91,15 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Answer yes if you want to delete also the Dolibarr MySQL database and all - its datas (datas subjected to this quetion are the Dolibarr DBMS account and all + Delete the Dolibarr MySQL database and all its datas (datas related + to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? + +Template: dolibarr/postrmfile +Type: boolean +Default: true +Description: Delete attached files ? + Delete also all uploaded and generated files (datas related + to this quetion are all files found into /usr/share/dolibarr/documents, + uploaded or generated when using Dolibarr) ? + \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 799a17c5ff4..2cc4b0b880e 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; +my $copyalreadydone=0; # Use - before number of choice to avoid copy my $batch=0; for (0..@ARGV-1) { @@ -457,7 +457,6 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; - print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,13 +497,11 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -516,20 +513,28 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; - - print "Set permissions/owners on files/dir\n"; + print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; + + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; + $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From 748d14b1257157ba68ae84672841a573722657b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH 161/252] Work on packaging RPM & DEB --- build/deb/config | 11 --- build/deb/control | 7 +- build/deb/postinst | 6 -- build/rpm/README | 13 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 149 ++++++++----------------------------- 6 files changed, 41 insertions(+), 150 deletions(-) diff --git a/build/deb/config b/build/deb/config index e006ebda186..1965ef73cc5 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,17 +1,6 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # -# lintian package To test a package -# -# dpkg -l list all packages -# dpkg -b is to build package -# dpkg -c package.deb list content of package -# dpkg -I package.deb give informations on package -# dpkg -i package.deb install a package -# -# dpkg -L packagename list content of installed package -# dpkg --purge remove interactive saved answers -# set -e diff --git a/build/deb/control b/build/deb/control index 07a08b7d045..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,7 +3,7 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 31200 +Installed-Size: 61200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional @@ -14,6 +14,7 @@ Description: Easy to use ERP & CRM software to manage your activity. 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. + Dolibarr was designed to provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. Most common used modules are: @@ -41,4 +42,6 @@ Description: Easy to use ERP & CRM software to manage your activity. * LDAP connectivity * PDF exports * And a lot of more modules... -You can also add third parties external modules or develop yours. \ No newline at end of file + . + You can also add third parties external modules or develop yours. + \ No newline at end of file diff --git a/build/deb/postinst b/build/deb/postinst index 12e3fdbd07a..be9fb7521b7 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -108,12 +108,6 @@ case "$1" in done - # Copy icon file - #echo "Copy icon file" - #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" - #target="/usr/share/pixmaps/" - #cp -f $fileorig $target - #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/rpm/README b/build/rpm/README index d868ed411b8..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,15 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# rpm -i --test dolibarr-...rpm To list dependencies of RPM -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 11090951bdd..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,32 +19,20 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org +#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandriva-Mageia +# For Mandrake Group: Networking/WWW # For all other distrib Group: Applications/Internet -# Requires can use lua to be defined dynamically (but still at build time) -# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } - -# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Requires for OpenSuse -#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mandriva-Mageia -#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl - -#Requires(pre): -#Requires(postun): - -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -55,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -100,19 +69,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -178,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -245,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -264,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' +export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -311,17 +234,11 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi -# Removed dirs after apache restart -echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install -rmdir $targetdir/doc >/dev/null 2>&1 -rmdir $targetdir/htdocs >/dev/null 2>&1 + %changelog From b92c8dd61d01152c4a26376d207b830e58bd0874 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 18:29:46 +0000 Subject: [PATCH 162/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2cc4b0b880e..532bf16a2da 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -529,8 +529,8 @@ if ($nboftargetok) { $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + #$ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; From 156906e0ffbd1e993e36c4f6c1eabbfd2af9d993 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:18:50 +0000 Subject: [PATCH 163/252] Prepare release 3.1 From aa9ab8e4eb603e8be56f027c2a44337c5ce7e37d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:26:53 +0000 Subject: [PATCH 164/252] Work on packaging RPM & DEB --- build/deb/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/deb/control b/build/deb/control index 3d8878f4569..2d356fc7b2b 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,6 +14,8 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. From bd464527273e8bbd05bdef7ca6fcc7cc16a8ab89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:33:27 +0000 Subject: [PATCH 165/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.desktop | 5 ++++- build/rpm/dolibarr.spec | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index e3be821080c..ab2a758867f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,9 +5,12 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM +Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations +Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs +Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti +Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b1def13ae37..4bfbcfaae65 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -43,12 +43,34 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. +%description -l es +Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones +que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores +ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource +que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier +lugar disponiendo de una conexión a Internet. +Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, +pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: +Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). +Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). +Simple de desarrollar (sin frameworks pesados). + %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. +%description -l it +Dolibarr è un programma gestionale open source e gratuito per piccole e medie +imprese, fondazioni e liberi professionisti. Include varie funzionalità per +Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori +attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno +ed essere facile da usare. +Dolibar è completamente web-based, progettato per poter fornire solo ciò di +cui hai bisogno ed essere facile da usare. + + #---- prep %prep From 3c5fd5d6e9158629d850847299f58a0615573dce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:33:53 +0000 Subject: [PATCH 166/252] Use global option if local not defined From 05da015e9e4975f37f83b7cd93d1160b720a694f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:39:34 +0000 Subject: [PATCH 167/252] Add comment From f0562648b3280e6092a86141deeb937347124953 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:48:25 +0000 Subject: [PATCH 168/252] Fix: Param of constructor must be only database handler From 051f54f5596cf9984a952949129926d933428589 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 16:50:40 +0000 Subject: [PATCH 169/252] Fix: Missing fields and missing encoding of special chars --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e97abed808..4863b52689e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ + * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 742223f74f3b16e8a7dedc982a7924bf7846c8a5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 17:28:09 +0000 Subject: [PATCH 170/252] Fix: missing htmlname in ajax response --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4863b52689e..7e97abed808 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ + * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 47df3af0c727c2a5527ff9eb76b544c5112d4e08 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 18:24:18 +0000 Subject: [PATCH 171/252] Fix: possibility to change status of another input element From 0a2b3611819fe791ac025326a06ebf780c083a8d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 20:03:38 +0000 Subject: [PATCH 172/252] Fix: file add and delte in email forms was broken with firefox 5 --- htdocs/admin/mails.php | 12 +++++----- htdocs/core/class/html.formmail.class.php | 28 +++++++++++++++-------- htdocs/lib/files.lib.php | 5 ++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 05b12ff10b8..c9d5ac88812 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ + * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ */ require("../main.inc.php"); @@ -80,7 +80,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +127,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -468,7 +468,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; - + // From $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -574,7 +574,7 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - + // Errors To $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -737,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); +llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0de9a763c66..3164f86d8e1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +124,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param $path - * @param $file - * @param $type + * @param string $path Full absolute path on filesystem of file, including file name + * @param string $file Only filename + * @param string $type Mime type */ function add_attached_files($path,$file,$type) { @@ -505,14 +505,26 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - //print '
'; + // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript + $out.= ''."\n"; + $out.= ''."\n"; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { $out.= '
'; $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; + if (! $this->withfilereadonly) + { + $out.= ' '; + //$out.= ' '.img_delete($langs->trans("Delete").''; + } $out.= '
'; } } @@ -522,11 +534,9 @@ class FormMail } if ($this->withfile == 2) // Can add other files { - //print '
'; $out.= ''; $out.= ' '; $out.= ''; - //print '
'; } $out.= "\n"; } @@ -546,7 +556,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 3dbbef2c6b2..8b6ea639ec8 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ + * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ */ /** @@ -561,8 +561,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger && is_object($object)) + if (! $notrigger) { + if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 8438ecfa83f4b66a3bbea02bde90230c8b05958f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 21:17:14 +0000 Subject: [PATCH 173/252] Fix: Missing name on form From d28af54450add321721934163b1d85f7b646af4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 22:45:44 +0000 Subject: [PATCH 174/252] Work on packaging RPM & DEB --- build/rpm/README | 12 +++++-- build/rpm/dolibarr.spec | 70 +++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index 1b2d4745dc4..f2077ceac36 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,6 +10,14 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# yum install dolibarr To remove package -# yum erase dolibarr To remove package +# On Fedora +# yum install dolibarr-...rpm To install package and dependencies +# yum erase dolibarr To remove package # +# On OpenSuse +# yast --install dolibarr-...rpm To install package and dependencies +# yast --remove dolibarr To remove package +# +# On Mageia +# urpmi dolibarr-...rpm To install package and dependencies +# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 4bfbcfaae65..a9003afcac3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -44,16 +44,13 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones -que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores -ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource -que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier -lugar disponiendo de una conexión a Internet. -Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, -pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: -Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). -Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). -Simple de desarrollar (sin frameworks pesados). +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y +medianas empresas, asociaciones o autónomos. Incluye diferentes +funcionalidades para la Planificación de Recursos Empresariales (ERP) y +Gestión de la Relación con los Clientes (CRM) así como para para otras +diferentes actividades. Dolibarr ha sido diseñado para suministrarle +solamente las funcionalidades que necesita y haciendo hincapié en su +facilidad de uso. %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, @@ -182,19 +179,35 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi -# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf -if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then - echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf - ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf + +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + apacheuser='apache'; + apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + apacheuser='wwwrun'; + apachegroup='wwwrun'; +fi + +# Create a config link dolibarr.conf for Fedora or Redhat +if [ ! -f $conffile ]; then + echo Create dolibarr web server config link $conffile + ln -fs /etc/dolibarr/apache.conf $conffile fi # Set permissions -echo Set permission on $targetdir -chown -R apache.apache $targetdir +echo Set permission to $apacheuser:$apachegroup on $targetdir +chown -R $apacheuser:$apachegroup $targetdir chmod -R a-w $targetdir -echo Set permission on $docdir -chown -R apache.apache $docdir +echo Set permission to $apacheuser:$apachegroup on $docdir +chown -R $apacheuser:$apachegroup $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer @@ -205,7 +218,7 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -220,6 +233,9 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi +if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart +fi # Show result echo @@ -236,12 +252,23 @@ echo %postun %clean_menus +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +fi + + # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' -export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -256,6 +283,9 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi fi rm -rf /etc/dolibarr From 5ccf576114ac5b0ec147c69dc1bd10f4babc4a58 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Jul 2011 06:23:22 +0000 Subject: [PATCH 175/252] Fix: need complete object --- htdocs/lib/files.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 8b6ea639ec8..3dbbef2c6b2 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ */ /** @@ -561,9 +561,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger) + if (! $notrigger && is_object($object)) { - if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 2b9b81a2cc3d33dcc5bd12c2e9e74b8c280806e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 07:50:22 +0000 Subject: [PATCH 176/252] RPM works alos on ubuntu and debian --- build/rpm/dolibarr.spec | 57 +++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index a9003afcac3..46c0b734ca3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,7 +32,8 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -AutoReqProv: yes +# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) +AutoReqProv: no %description @@ -103,17 +104,6 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr -# menu -#%{__install} -d $RPM_BUILD_ROOT%{_menudir} -#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} -#?package(%{name}):\ -#command="Dolibarr" \ -#section="Office" \ -#title="Dolibarr" \ -#icon="dolibarr_48x48.png" \ -#longtitle="Dolibarr ERP & CRM" -#EOF - #---- clean %clean @@ -181,19 +171,26 @@ fi # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - apacheuser='apache'; - apachegroup='apache'; + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - apacheuser='wwwrun'; - apachegroup='wwwrun'; + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $conffile ]; then @@ -214,11 +211,11 @@ chmod -R o-w $docdir if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown apache.apache $targetdir/htdocs/conf/conf.php + chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -253,16 +250,26 @@ echo %clean_menus # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi - +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' From 1fafdb424b4dda26de7356b2714c97005059b730 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 07:51:31 +0000 Subject: [PATCH 177/252] Trad: add possibility to force mail errors-to to all mails sent --- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 848deab542a..b79ba3f2c77 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 5645bd6ff6f..de8ec9133ef 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails From 3b1b9ef9ad0a45c9e38952e1aa30a595e508ab3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:36:11 +0000 Subject: [PATCH 178/252] Work on packaging RPM & DEB --- build/rpm/README | 2 +- build/rpm/dolibarr.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index f2077ceac36..c072a212632 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -18,6 +18,6 @@ with format RPM (for Redhat, Mandriva, ...). # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package # -# On Mageia +# On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies # urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 46c0b734ca3..b3aaca1d494 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -171,20 +171,26 @@ fi # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; @@ -250,20 +256,26 @@ echo %clean_menus # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; From 097414dfac9897b401b7117bc820aa0f64787bb0 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 08:38:02 +0000 Subject: [PATCH 179/252] Fix: Missing translation From e80d8731e6218d268ae3b1fd7d1dfc9a865f2453 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:54:57 +0000 Subject: [PATCH 180/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 18 ++++++++++-------- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index 568dd605dca..cfedcbc4dbb 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -14,7 +14,9 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # # Directory for web pages - + + Order deny,allow + Allow from all DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -54,23 +56,23 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - + # Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + # Directory for data files - + AllowOverride All Order deny,allow Allow from all - - + + AllowOverride All Order deny,allow Allow from all - + diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 4a395f235a2..e1fcb3f77e5 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From 4b1c9dcc99ef3aa4f37e0efd00e68056730a7e4c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:55:53 +0000 Subject: [PATCH 181/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 2 +- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index cfedcbc4dbb..fa29149ee59 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index e1fcb3f77e5..4a395f235a2 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From e607a6cd67337598f3cd9e121f93b77b985c2ce8 Mon Sep 17 00:00:00 2001 From: cdelambert Date: Mon, 11 Jul 2011 09:32:35 +0000 Subject: [PATCH 182/252] Correction paiement Ajax From a0cf7ffea811ff942219d6a54edb4de5371c3901 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 10:41:29 +0000 Subject: [PATCH 183/252] Trad: add translation From 0e23091b5895d06afb3e5b47c1e3f02d02574636 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 10:53:37 +0000 Subject: [PATCH 184/252] Fix: Removed install warning From a930755ad10dc56e0e92ad24231e9cfcfadb4b20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 11:09:02 +0000 Subject: [PATCH 185/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 532bf16a2da..8e0e3a0b1d1 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -262,6 +262,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; From 7572a18d0f3b5593c00efe78df890d5188ecfa4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 12:31:38 +0000 Subject: [PATCH 186/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b3aaca1d494..44051435047 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -31,7 +31,13 @@ Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql +# Requires for OpenSuse +#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl +# Requires for Mageia +#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -182,7 +188,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -267,7 +273,7 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; - export apachegroup='wwwrun'; + export apachegroup='www'; fi if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then export os='mageia-mandriva'; @@ -307,9 +313,12 @@ then fi fi +# Removed dirs after apache restart +echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install - +rmdir $targetdir/doc >/dev/null 2>&1 +rmdir $targetdir/htdocs >/dev/null 2>&1 %changelog From a7ab99f90be51e52d330549970b2a89c47b76821 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 21:16:25 +0000 Subject: [PATCH 187/252] Work on packaging RPM & DEB --- build/rpm/README | 1 + build/rpm/dolibarr.spec | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index c072a212632..d868ed411b8 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -11,6 +11,7 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # # On Fedora +# rpm -i --test dolibarr-...rpm To list dependencies of RPM # yum install dolibarr-...rpm To install package and dependencies # yum erase dolibarr To remove package # diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 44051435047..11090951bdd 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,25 +19,30 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org -#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandrake +# For Mandriva-Mageia Group: Networking/WWW # For all other distrib Group: Applications/Internet +# Requires can use lua to be defined dynamically (but still at build time) +# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } + # Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql # Requires for OpenSuse #Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mageia +# Requires for Mandriva-Mageia #Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl +#Requires(pre): +#Requires(postun): + # Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) AutoReqProv: no @@ -95,19 +100,17 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr -#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr From 16ef1b00adb5196ec30d91b6fc916ddbccffa580 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 07:17:11 +0000 Subject: [PATCH 188/252] Fix: Uniformise code From 6da8cafd3d295680f366f2fc487ba87c8278222d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Jul 2011 08:07:59 +0000 Subject: [PATCH 189/252] Fix: update jstree plugin From 2cef7c54e84dc4a7efb62648d558f6bc0b4ec03e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:16:03 +0000 Subject: [PATCH 190/252] Fix: Upgrade detection fails From ab1055a2dfbf8becd19f210f47ee8a46a830a24b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:48:08 +0000 Subject: [PATCH 191/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 9de8cdf662d..0f6034488dd 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ + * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From 8c48fbb2079a8973553f27b4a1152828a0508517 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 20:52:41 +0000 Subject: [PATCH 192/252] Fix: Upgrade detection fails --- htdocs/install/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0f6034488dd..9de8cdf662d 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -23,7 +23,7 @@ * \file htdocs/install/check.php * \ingroup install * \brief Test if file conf can be modified and if does not exists, test if install process can create it - * \version $Id: check.php,v 1.83 2011/07/12 20:48:08 eldy Exp $ + * \version $Id: check.php,v 1.84 2011/07/12 20:52:41 eldy Exp $ */ include_once("./inc.php"); @@ -393,7 +393,7 @@ else $dolibarrversiontoarray=preg_split('/[\.-]/',$versionto); $version=preg_split('/[\.-]/',DOL_VERSION); $newversionfrombis=''; - if (versioncompare($dolibarrversiontoarray,$version) < 2) $newversionfrombis='/'.$versionto; + if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto; print ''.$langs->trans("Upgrade").'
'.$newversionfrom.' -> '.$newversionto.'
'; print ''; print $langs->trans("UpgradeDesc"); From aa5caf1a9fea6ee9326033fddb1d33dadf699cea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 21:07:24 +0000 Subject: [PATCH 193/252] Fix: Type of amount From 56f65b0afcf3840fe914d5f39f4cd87683e45866 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:03:44 +0000 Subject: [PATCH 194/252] Fix: Add civility for all peopal tables From b084aa0a8777ef575c19f99bac4d72b092788de0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:12:12 +0000 Subject: [PATCH 195/252] Fix: Add civility for all peopal tables From bed8a43b7de42438d3ef1e1466c05a62bbca25d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2011 22:19:02 +0000 Subject: [PATCH 196/252] Fix: Attachment fails if content was empty From 0412ae869d322be21e4547029da929560e665e46 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 21:52:07 +0000 Subject: [PATCH 197/252] Fix: Parent class must be declared. From 5503ea27edfda965ca9303b750febad9b294147a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2011 23:35:05 +0000 Subject: [PATCH 198/252] Test with phpunit --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 79a4cba739b..4b573b22b3e 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a timeout before end, try this: +If there is a fu... timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -10 du process php +puis renice -11 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php +> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs From 4e5640c884589f3952515ebf32cdab8a9d23f6e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:11:55 +0000 Subject: [PATCH 199/252] Test with phpcs --- test/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/README b/test/README index 4b573b22b3e..79a4cba739b 100644 --- a/test/README +++ b/test/README @@ -35,10 +35,10 @@ Remove all files into dolibarr root found with "find . | grep CVS\/Base\/ | grep > cd test > phpunit -d memory_limit=-1 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml phpunit/AllTests.php -If there is a fu... timeout before end, try this: +If there is a timeout before end, try this: > cd test > php -d max_input_time=0 -d max_execution_time=0 /usr/bin/phpunit -d memory_limit=-1 -d max_input_time=0 -d max_execution_time=0 --configuration ./phpunit/phpunittest.xml --coverage-html ./report phpunit/AllTests.php -puis renice -11 du process php +puis renice -10 du process php @@ -48,7 +48,7 @@ PHP-CODESNIFFER * Launch PHP-Codesniffer: > cd test -> phpcs --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg --ignore=custom,custom2,adodbtime,artichow,ckeditor,efc_xfss,fckeditor,fpdf,geoip,magpierss,nusoap,odtphp,phpexcel,php_writeexcel,smarty,smtps,tcpdf,vcard ../htdocs +> /usr/bin/php5 -c ./codesniffer/php.ini /usr/bin/phpcs --report=xml --standard=./codesniffer ../htdocs/test.php From 2f7f477880e79fca6b1b6bbd4c21b33ee25652e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 00:15:16 +0000 Subject: [PATCH 200/252] Qual: Removed errors and warnings reported by codesniffer From 744b3136ccc87b16bcd0b9c27fd85e3cc407f59f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 01:39:07 +0000 Subject: [PATCH 201/252] Removed useless files to avoid warning in packages From 366721651781a5db855bd06575ca7f5f26e52507 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 02:41:36 +0000 Subject: [PATCH 202/252] Prepare packaging for debian --- build/deb/config | 11 +++++++++++ build/deb/control | 27 ++++++++++----------------- build/deb/copyright | 3 --- build/deb/templates | 15 +++------------ build/makepack-dolibarr.pl | 38 ++++++++++++++++---------------------- 5 files changed, 40 insertions(+), 54 deletions(-) diff --git a/build/deb/config b/build/deb/config index 1965ef73cc5..e006ebda186 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,6 +1,17 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # +# lintian package To test a package +# +# dpkg -l list all packages +# dpkg -b is to build package +# dpkg -c package.deb list content of package +# dpkg -I package.deb give informations on package +# dpkg -i package.deb install a package +# +# dpkg -L packagename list content of installed package +# dpkg --purge remove interactive saved answers +# set -e diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..19eb51664e7 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,39 +3,35 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 61200 +Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: firefox +Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: Easy to use ERP & CRM software to manage your activity. +Description: An ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. + Management (CRM) but also other features for different activities. . - Only features you need are visible, depending on which module were activated. - Most common used modules are: + Dolibarr features are activated by modules. Most common modules are: . + * Products and services catalog + * Stock management + * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management - * Products and services catalog - * Stock management - * Foundations members management - * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management + * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -43,7 +39,4 @@ Description: Easy to use ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of more modules... - . - You can also add third parties external modules or develop yours. - \ No newline at end of file + * And a lot of other modules diff --git a/build/deb/copyright b/build/deb/copyright index 00aafd563b1..74752ea4864 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1,4 +1 @@ -Copyright 2011 Laurent Destailleur - -This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/templates b/build/deb/templates index 1d1c133f99a..82fcaa1ba48 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running ? +Description: Which Web Server are you running? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,15 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Delete the Dolibarr MySQL database and all its datas (datas related - to this quetion are the Dolibarr DBMS account and all + Do I have to delete also the Dolibarr MySQL database and all its datas + (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? - -Template: dolibarr/postrmfile -Type: boolean -Default: true -Description: Delete attached files ? - Delete also all uploaded and generated files (datas related - to this quetion are all files found into /usr/share/dolibarr/documents, - uploaded or generated when using Dolibarr) ? - \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8e0e3a0b1d1..799a17c5ff4 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.109 2011/07/11 11:09:02 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.109 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; # Use - before number of choice to avoid copy +my $copyalreadydone=0; my $batch=0; for (0..@ARGV-1) { @@ -262,7 +262,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/document`; @@ -458,6 +457,7 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; + print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,11 +498,13 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; + $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -514,28 +516,20 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Set owners on files/dir\n"; + print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; + + print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; - $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From 8d5c1f2a3f8a3e5471e94d14949f20dfe8d3955a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 05:28:41 +0000 Subject: [PATCH 203/252] Fix: remove deprecated constant --- htdocs/admin/mails.php | 22 ++++------------------ htdocs/langs/ca_ES/admin.lang | 1 - htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/es_ES/admin.lang | 1 - htdocs/langs/fr_FR/admin.lang | 1 - 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index c9d5ac88812..ab12d1419b6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ + * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ */ require("../main.inc.php"); @@ -63,7 +63,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -80,7 +79,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +126,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp'; + $upload_dir = $vardir.'/temp/'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -469,12 +468,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''; - // From - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -575,13 +568,6 @@ else if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - // Errors To - $var=!$var; - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; - if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); - print ''; - // Autocopy to $var=!$var; print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; @@ -737,5 +723,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); +llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); ?> diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index b79ba3f2c77..848deab542a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0f43c1c9e82..9f153916ea5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,7 +229,6 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index de8ec9133ef..5645bd6ff6f 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) -MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3cb19e89ba8..2729073a3b8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,7 +230,6 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) -MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From f09a2dbcfa26e13bfb01fcfb1247c2af5eab6c8f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 06:10:04 +0000 Subject: [PATCH 204/252] Fix: add possibility to force mail errors-to to all mails sent --- htdocs/admin/mails.php | 18 ++++++++++-- htdocs/core/class/html.formmail.class.php | 36 ++++++++--------------- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ab12d1419b6..05b12ff10b8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $ + * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ */ require("../main.inc.php"); @@ -63,6 +63,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -467,6 +468,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; + + // From + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''; // Autocopy to $var=!$var; @@ -567,6 +574,13 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; + + // Errors To + $var=!$var; + print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; + print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); + print ''; // Autocopy to $var=!$var; @@ -723,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $'); +llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3164f86d8e1..25c96d54498 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,6 +1,5 @@ - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -22,7 +21,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +123,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param string $path Full absolute path on filesystem of file, including file name - * @param string $file Only filename - * @param string $type Mime type + * @param $path + * @param $file + * @param $type */ function add_attached_files($path,$file,$type) { @@ -505,27 +504,14 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out.= ''."\n"; - $out.= ''."\n"; + //print '
'; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { - $out.= '
'; - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) - { - $out.= ' '; - //$out.= ' '.img_delete($langs->trans("Delete").''; - } - $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else @@ -534,9 +520,11 @@ class FormMail } if ($this->withfile == 2) // Can add other files { + //print '
'; $out.= ''; $out.= ' '; $out.= ''; + //print '
'; } $out.= "\n"; } @@ -556,7 +544,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f153916ea5..0f43c1c9e82 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -229,6 +229,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems) MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) +MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2729073a3b8..3cb19e89ba8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix) MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: %s) +MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos) MAIN_MAIL_SENDMODE= Méthode d'envoi des mails From a4540323346c51e809118c1432ee90969d5ed229 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 08:05:08 +0000 Subject: [PATCH 205/252] New: add jquery method for random generation From 750592c15cfda79e4a22be3289ab78a5378a6b2d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Jul 2011 10:26:19 +0000 Subject: [PATCH 206/252] Fix: add div for jquery --- htdocs/core/class/html.formmail.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 25c96d54498..0de9a763c66 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -21,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -509,9 +510,10 @@ class FormMail { foreach($listofpaths as $key => $val) { - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; - $out.= '
'; + $out.= '
'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) $out.= ' '; + $out.= '
'; } } else From e85a112ca662435731bd8bc439a26e9c43944f0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 11:24:32 +0000 Subject: [PATCH 207/252] Fix: Set x bit required to directories From fbd0afbb8d9d1eea024e1516a49687c7de8ee16b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 14:11:40 +0000 Subject: [PATCH 208/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 24 +++++++----------------- build/deb/changelog | 2 +- build/deb/control | 2 +- build/deb/copyright | 3 +++ build/deb/install.forced.php.install | 7 +++---- build/deb/postinst | 22 +++++++++++++--------- build/deb/templates | 4 ++-- 7 files changed, 30 insertions(+), 34 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index fa29149ee59..d37b433fb98 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com @@ -13,10 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # -# Directory for web pages - - Order deny,allow - Allow from all + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -56,23 +53,16 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - +
-# Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + -# Directory for data files - + AllowOverride All Order deny,allow Allow from all - - - AllowOverride All - Order deny,allow - Allow from all - + diff --git a/build/deb/changelog b/build/deb/changelog index d75fd100a60..182110624de 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ -dolibarr 3.1.0 unstable; urgency=low + dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 19eb51664e7..3f564f5608f 100644 --- a/build/deb/control +++ b/build/deb/control @@ -9,7 +9,7 @@ Section: web Priority: optional Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: An ERP & CRM software to manage your activity. +Description: ERP & CRM software to manage your activity. 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 diff --git a/build/deb/copyright b/build/deb/copyright index 74752ea4864..00aafd563b1 100644 --- a/build/deb/copyright +++ b/build/deb/copyright @@ -1 +1,4 @@ +Copyright 2011 Laurent Destailleur + +This software is distributed under GPL v2 licence. See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 1166abe41ae..198565d3211 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,13 +4,12 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ +// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ // - $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -$force_install_main_data_root='/usr/share/dolibarr/documents'; -#$force_install_main_data_root='/var/lib/dolibarr'; +#$force_install_main_data_root='/usr/share/dolibarr/documents'; +$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index be9fb7521b7..4d065f58ca0 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,21 +49,19 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create document directory - #docdir='/var/lib/dolibarr/documents' - docdir='/usr/share/dolibarr/documents' - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir + # Create /var/lib/dolibarr/documents + mkdir -p /var/lib/dolibarr/documents + chown -R www-data:www-data /var/lib/dolibarr/documents; + chmod -R 775 /var/lib/dolibarr/documents; + chmod -R g+s /var/lib/dolibarr/documents; # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; fi #db_reset "dolibarr/webserver" @@ -108,6 +106,12 @@ case "$1" in done + # Copy icon file + #echo "Copy icon file" + #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" + #target="/usr/share/pixmaps/" + #cp -f $fileorig $target + #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/deb/templates b/build/deb/templates index 82fcaa1ba48..3b370ee68f2 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -91,6 +91,6 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Do I have to delete also the Dolibarr MySQL database and all its datas - (datas subjected to this quetion are the Dolibarr DBMS account and all + Answer yes if you want to delete also the Dolibarr MySQL database and all + its datas (datas subjected to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? From 64657ad46b12a975e8224de286b52353a8b7dcd2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 15:48:19 +0000 Subject: [PATCH 209/252] Qual: A lot of fixes to enhance package quality --- build/deb/apache.conf | 8 ++++++ build/deb/changelog | 2 +- build/deb/control | 20 ++++++++------- build/deb/install.forced.php.install | 7 +++--- build/deb/postinst | 16 ++++++------ build/deb/templates | 15 ++++++++--- build/makepack-dolibarr.pl | 37 ++++++++++++++++------------ 7 files changed, 66 insertions(+), 39 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index d37b433fb98..568dd605dca 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -13,6 +13,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # CustomLog logs/ldap.example.com-access.log common # +# Directory for web pages DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -55,12 +56,19 @@ Alias /dolibarr /usr/share/dolibarr/htdocs +# Directory for public pages AllowOverride All Order deny,allow Allow from all +# Directory for data files + + AllowOverride All + Order deny,allow + Allow from all + AllowOverride All Order deny,allow diff --git a/build/deb/changelog b/build/deb/changelog index 182110624de..d75fd100a60 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -1,4 +1,4 @@ - dolibarr 3.1.0 unstable; urgency=low +dolibarr 3.1.0 unstable; urgency=low * New 3.1.0 release More information into /usr/share/dolibarr/ChangeLog file. -- maintainer Laurent Destailleur 2011-07-09 \ No newline at end of file diff --git a/build/deb/control b/build/deb/control index 3f564f5608f..07a08b7d045 100644 --- a/build/deb/control +++ b/build/deb/control @@ -7,31 +7,32 @@ Installed-Size: 31200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional -Recommends: mozilla | netscape +Recommends: firefox Homepage: http://www.dolibarr.org -Description: ERP & CRM software to manage your activity. +Description: Easy to use ERP & CRM software to manage your activity. 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 other features for different activities. + Management (CRM) but also for different other activities. . - Dolibarr features are activated by modules. Most common modules are: + Only features you need are visible, depending on which module were activated. + Most common used modules are: . - * Products and services catalog - * Stock management - * Bank accounts management * Customers, Suppliers or Prospects directory * Contacts directory * Orders management * Commercial proposals management * Invoices management + * Products and services catalog + * Stock management + * Foundations members management + * Bank accounts management * Point of Sale * Payments management * Commercial actions management * Contracts management * Standing orders management * Shipping management - * Foundations members management * Donations management * Bookmarks management * Mass Emailings @@ -39,4 +40,5 @@ Description: ERP & CRM software to manage your activity. * Data export and import tools * LDAP connectivity * PDF exports - * And a lot of other modules + * And a lot of more modules... +You can also add third parties external modules or develop yours. \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 198565d3211..1166abe41ae 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,12 +4,13 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.6 2011/07/09 14:11:40 eldy Exp $ +// $Id: install.forced.php.install,v 1.7 2011/07/09 15:48:19 eldy Exp $ // + $force_install_noedit=1; $force_install_message='KeepDefaultValuesDeb'; -#$force_install_main_data_root='/usr/share/dolibarr/documents'; -$force_install_main_data_root='/var/lib/dolibarr'; +$force_install_main_data_root='/usr/share/dolibarr/documents'; +#$force_install_main_data_root='/var/lib/dolibarr'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; diff --git a/build/deb/postinst b/build/deb/postinst index 4d065f58ca0..12e3fdbd07a 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,19 +49,21 @@ case "$1" in cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - # Create /var/lib/dolibarr/documents - mkdir -p /var/lib/dolibarr/documents - chown -R www-data:www-data /var/lib/dolibarr/documents; - chmod -R 775 /var/lib/dolibarr/documents; - chmod -R g+s /var/lib/dolibarr/documents; + # Create document directory + #docdir='/var/lib/dolibarr/documents' + docdir='/usr/share/dolibarr/documents' + mkdir -p $docdir + chown -R www-data:www-data $docdir + chmod -R 775 $docdir + chmod -R g+s $docdir # Create an empty conf.php with permission to web server if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php touch /usr/share/dolibarr/htdocs/conf/conf.php - chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php; - chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; + chown -R www-data:www-data /usr/share/dolibarr/htdocs/conf/conf.php + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php fi #db_reset "dolibarr/webserver" diff --git a/build/deb/templates b/build/deb/templates index 3b370ee68f2..1d1c133f99a 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -15,7 +15,7 @@ Description: Package configuration note Template: dolibarr/webserver Type: select Choices: Apache, Apache-ssl, Both, None -Description: Which Web Server are you running? +Description: Which Web Server are you running ? Dolibarr supports any web server with PHP capabilities, but this configuration process only supports Apache and Apache-SSL. @@ -91,6 +91,15 @@ Template: dolibarr/postrm Type: boolean Default: true Description: Delete database ? - Answer yes if you want to delete also the Dolibarr MySQL database and all - its datas (datas subjected to this quetion are the Dolibarr DBMS account and all + Delete the Dolibarr MySQL database and all its datas (datas related + to this quetion are the Dolibarr DBMS account and all Dolibarr tables) ? + +Template: dolibarr/postrmfile +Type: boolean +Default: true +Description: Delete attached files ? + Delete also all uploaded and generated files (datas related + to this quetion are all files found into /usr/share/dolibarr/documents, + uploaded or generated when using Dolibarr) ? + \ No newline at end of file diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 799a17c5ff4..2cc4b0b880e 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -98,7 +98,7 @@ if (! $TEMP || ! -d $TEMP) { $BUILDROOT="$TEMP/buildroot"; -my $copyalreadydone=0; +my $copyalreadydone=0; # Use - before number of choice to avoid copy my $batch=0; for (0..@ARGV-1) { @@ -457,7 +457,6 @@ if ($nboftargetok) { print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT\""; $ret=`$cmd`; - print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; print "Copy $SOURCE/build/deb/* to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; @@ -498,13 +497,11 @@ if ($nboftargetok) { $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; - $ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; @@ -516,20 +513,28 @@ if ($nboftargetok) { print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; - $ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + #$ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + $ret=`gzip -9 -c $BUILDROOT/$PROJECT.tmp/DEBIAN/changelog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; - print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; - - print "Set permissions/owners on files/dir\n"; + print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; + + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; + $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Go to directory $BUILDROOT\n"; $olddir=getcwd(); From 253222cae6bf1d7ec495b99022b34f6cca1c4816 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH 210/252] Work on packaging RPM & DEB --- build/deb/config | 11 --- build/deb/control | 7 +- build/deb/postinst | 6 -- build/rpm/README | 13 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 149 ++++++++----------------------------- 6 files changed, 41 insertions(+), 150 deletions(-) diff --git a/build/deb/config b/build/deb/config index e006ebda186..1965ef73cc5 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,17 +1,6 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # -# lintian package To test a package -# -# dpkg -l list all packages -# dpkg -b is to build package -# dpkg -c package.deb list content of package -# dpkg -I package.deb give informations on package -# dpkg -i package.deb install a package -# -# dpkg -L packagename list content of installed package -# dpkg --purge remove interactive saved answers -# set -e diff --git a/build/deb/control b/build/deb/control index 07a08b7d045..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -3,7 +3,7 @@ Version: __VERSION__ Architecture: all Maintainer: Laurent Destailleur Essential: no -Installed-Size: 31200 +Installed-Size: 61200 Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Section: web Priority: optional @@ -14,6 +14,7 @@ Description: Easy to use ERP & CRM software to manage your activity. 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. + Dolibarr was designed to provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. Most common used modules are: @@ -41,4 +42,6 @@ Description: Easy to use ERP & CRM software to manage your activity. * LDAP connectivity * PDF exports * And a lot of more modules... -You can also add third parties external modules or develop yours. \ No newline at end of file + . + You can also add third parties external modules or develop yours. + \ No newline at end of file diff --git a/build/deb/postinst b/build/deb/postinst index 12e3fdbd07a..be9fb7521b7 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -108,12 +108,6 @@ case "$1" in done - # Copy icon file - #echo "Copy icon file" - #fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm" - #target="/usr/share/pixmaps/" - #cp -f $fileorig $target - #echo "Install menu entry" # This one is for Gnome ubuntu #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" diff --git a/build/rpm/README b/build/rpm/README index d868ed411b8..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,15 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# rpm -i --test dolibarr-...rpm To list dependencies of RPM -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 11090951bdd..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -19,32 +19,20 @@ Packager: Laurent Destailleur (Eldy) Vendor: Dolibarr dev team URL: http://www.%{name}.org +#Source: http://sourceforge.net/projects/%{name}/files/Dolibarr%20ERP-CRM/%{version}/%{name}-%{version}.tgz/download Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz #BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif -# For Mandriva-Mageia +# For Mandrake Group: Networking/WWW # For all other distrib Group: Applications/Internet -# Requires can use lua to be defined dynamically (but still at build time) -# %{lua: if posix.access("/aaa") then print("Requires: bidon1 mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql") end } - -# Requires for Fedora-Redhat Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Requires for OpenSuse -#Requires: mysql-community-server mysql-community-server-client apache2 apache2-mod_php5 php5 php5-gd php5-ldap php5-imap php5-mysql php5-openssl -# Requires for Mandriva-Mageia -#Requires: mysql mysql-client apache-base apache-mod_php php-cgi php-cli php-bz2 php-gd php-ldap php-imap php-mysqli php-openssl - -#Requires(pre): -#Requires(postun): - -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -55,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -100,19 +69,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/build mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/dolibarr +#mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop +cp build/rpm/dolibarr.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/dolibarr.desktop -install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README +install -m 444 README $RPM_BUILD_ROOT/var/www/dolibarr/README install -m 444 COPYRIGHT $RPM_BUILD_ROOT/var/www/dolibarr/COPYRIGHT -cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr -cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr build $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr +cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -178,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -245,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -264,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='www'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' +export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -311,17 +234,11 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi -# Removed dirs after apache restart -echo Removed remaining dirs rm -rf /etc/dolibarr rm -rf $targetdir/htdocs/conf rm -rf $targetdir/htdocs/install -rmdir $targetdir/doc >/dev/null 2>&1 -rmdir $targetdir/htdocs >/dev/null 2>&1 + %changelog From 20ba8b7ecc2e9e83b2e0187452321d34d241a1dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 18:29:46 +0000 Subject: [PATCH 211/252] Work on packaging RPM & DEB --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2cc4b0b880e..532bf16a2da 100644 --- 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) -# \version $Id: makepack-dolibarr.pl,v 1.107 2011/07/09 15:48:19 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.108 2011/07/09 18:29:46 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.107 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.108 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -529,8 +529,8 @@ if ($nboftargetok) { $ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; + #$cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build -name *.pl -type f -exec chmod 755 {} \\; "; + #$ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/dev -name *.php -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; $cmd="find $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/scripts -name *.php -type f -exec chmod 755 {} \\; "; From 938f834ce3772e6ec35c4ab7b90b3d798d2714e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:18:50 +0000 Subject: [PATCH 212/252] Prepare release 3.1 From 8e98cb72c12e16d091d21bd1ad59d9c0c975ef48 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:26:53 +0000 Subject: [PATCH 213/252] Work on packaging RPM & DEB --- build/deb/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/deb/control b/build/deb/control index 3d8878f4569..2d356fc7b2b 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,6 +14,8 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. From 5c9656a794b3998bd19a3291507d72b9e2705c5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:33:27 +0000 Subject: [PATCH 214/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.desktop | 5 ++++- build/rpm/dolibarr.spec | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index e3be821080c..ab2a758867f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,9 +5,12 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM +Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations +Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs +Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti +Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b1def13ae37..4bfbcfaae65 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -43,12 +43,34 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. +%description -l es +Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones +que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores +ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource +que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier +lugar disponiendo de una conexión a Internet. +Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, +pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: +Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). +Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). +Simple de desarrollar (sin frameworks pesados). + %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. +%description -l it +Dolibarr è un programma gestionale open source e gratuito per piccole e medie +imprese, fondazioni e liberi professionisti. Include varie funzionalità per +Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori +attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno +ed essere facile da usare. +Dolibar è completamente web-based, progettato per poter fornire solo ciò di +cui hai bisogno ed essere facile da usare. + + #---- prep %prep From 3e4554df47857d7e1cb8a6bd87bf2270638d4ee3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:33:53 +0000 Subject: [PATCH 215/252] Use global option if local not defined From 6be672840727aa09eca8811ab7aacf5d9c233299 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:39:34 +0000 Subject: [PATCH 216/252] Add comment From d6e1e323e4c6fe685907702d4315476681153460 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:48:25 +0000 Subject: [PATCH 217/252] Fix: Param of constructor must be only database handler From f4da924ee090aebb927863b989f765a6db6737ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 16:50:40 +0000 Subject: [PATCH 218/252] Fix: Missing fields and missing encoding of special chars --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e97abed808..4863b52689e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ + * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 6b58e222d1f6c580e7151e876db3623e66cbbe66 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 17:28:09 +0000 Subject: [PATCH 219/252] Fix: missing htmlname in ajax response --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4863b52689e..7e97abed808 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ + * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 39303eb63c4bb0acef47245afc9d4639be85a4b5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 18:24:18 +0000 Subject: [PATCH 220/252] Fix: possibility to change status of another input element From a41071dbd555c47311e9851dcded330256ec0571 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 20:03:38 +0000 Subject: [PATCH 221/252] Fix: file add and delte in email forms was broken with firefox 5 --- htdocs/admin/mails.php | 12 +++++----- htdocs/core/class/html.formmail.class.php | 28 +++++++++++++++-------- htdocs/lib/files.lib.php | 5 ++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 05b12ff10b8..c9d5ac88812 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/mails.php * \brief Page to setup emails sending - * \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $ + * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $ */ require("../main.inc.php"); @@ -80,7 +80,7 @@ if ($_POST['addfile'] || $_POST['addfilehtml']) // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; if (create_exdir($upload_dir) >= 0) { @@ -127,7 +127,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml'])) { // Set tmp user directory $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir = $vardir.'/temp/'; + $upload_dir = $vardir.'/temp'; $keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml']; $keytodelete--; @@ -468,7 +468,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''; print ''; - + // From $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -574,7 +574,7 @@ else print ''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print ''; - + // Errors To $var=!$var; print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; @@ -737,5 +737,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $'); +llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $'); ?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0de9a763c66..3164f86d8e1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/html.formmail.class.php * \ingroup core * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire - * \version $Id: html.formmail.class.php,v 1.30 2011/07/09 10:26:19 hregis Exp $ + * \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); @@ -124,9 +124,9 @@ class FormMail /** * Add a file into the list of attached files (stored in SECTION array) * - * @param $path - * @param $file - * @param $type + * @param string $path Full absolute path on filesystem of file, including file name + * @param string $file Only filename + * @param string $type Mime type */ function add_attached_files($path,$file,$type) { @@ -505,14 +505,26 @@ class FormMail $out.= ''; $out.= ''.$langs->trans("MailFile").''; $out.= ''; - //print '
'; + // FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript + $out.= ''."\n"; + $out.= ''."\n"; if (sizeof($listofpaths)) { foreach($listofpaths as $key => $val) { $out.= '
'; $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) $out.= ' '; + if (! $this->withfilereadonly) + { + $out.= ' '; + //$out.= ' '.img_delete($langs->trans("Delete").''; + } $out.= '
'; } } @@ -522,11 +534,9 @@ class FormMail } if ($this->withfile == 2) // Can add other files { - //print '
'; $out.= ''; $out.= ' '; $out.= ''; - //print '
'; } $out.= "\n"; } @@ -546,7 +556,7 @@ class FormMail if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - + if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) { require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 3dbbef2c6b2..8b6ea639ec8 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ + * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ */ /** @@ -561,8 +561,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger && is_object($object)) + if (! $notrigger) { + if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From e091c6e9fd9dcd9f38cc1b9877ba8bd38a20d696 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 21:17:14 +0000 Subject: [PATCH 222/252] Fix: Missing name on form From ce4a9ac59644e7f228df141ad2038c705476496f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 22:45:44 +0000 Subject: [PATCH 223/252] Work on packaging RPM & DEB --- build/rpm/README | 12 +++++-- build/rpm/dolibarr.spec | 70 +++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index 1b2d4745dc4..f2077ceac36 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,6 +10,14 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# yum install dolibarr To remove package -# yum erase dolibarr To remove package +# On Fedora +# yum install dolibarr-...rpm To install package and dependencies +# yum erase dolibarr To remove package # +# On OpenSuse +# yast --install dolibarr-...rpm To install package and dependencies +# yast --remove dolibarr To remove package +# +# On Mageia +# urpmi dolibarr-...rpm To install package and dependencies +# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 4bfbcfaae65..a9003afcac3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -44,16 +44,13 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones -que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores -ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource -que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier -lugar disponiendo de una conexión a Internet. -Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, -pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: -Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). -Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). -Simple de desarrollar (sin frameworks pesados). +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y +medianas empresas, asociaciones o autónomos. Incluye diferentes +funcionalidades para la Planificación de Recursos Empresariales (ERP) y +Gestión de la Relación con los Clientes (CRM) así como para para otras +diferentes actividades. Dolibarr ha sido diseñado para suministrarle +solamente las funcionalidades que necesita y haciendo hincapié en su +facilidad de uso. %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, @@ -182,19 +179,35 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi -# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf -if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then - echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf - ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf + +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + apacheuser='apache'; + apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + apacheuser='wwwrun'; + apachegroup='wwwrun'; +fi + +# Create a config link dolibarr.conf for Fedora or Redhat +if [ ! -f $conffile ]; then + echo Create dolibarr web server config link $conffile + ln -fs /etc/dolibarr/apache.conf $conffile fi # Set permissions -echo Set permission on $targetdir -chown -R apache.apache $targetdir +echo Set permission to $apacheuser:$apachegroup on $targetdir +chown -R $apacheuser:$apachegroup $targetdir chmod -R a-w $targetdir -echo Set permission on $docdir -chown -R apache.apache $docdir +echo Set permission to $apacheuser:$apachegroup on $docdir +chown -R $apacheuser:$apachegroup $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer @@ -205,7 +218,7 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -220,6 +233,9 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi +if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart +fi # Show result echo @@ -236,12 +252,23 @@ echo %postun %clean_menus +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +fi + + # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' -export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -256,6 +283,9 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi fi rm -rf /etc/dolibarr From fd82cdce74dbe0c1a4dc2212cbd6fdb7e8608683 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Jul 2011 06:23:22 +0000 Subject: [PATCH 224/252] Fix: need complete object --- htdocs/lib/files.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 8b6ea639ec8..3dbbef2c6b2 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ */ /** @@ -561,9 +561,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger) + if (! $notrigger && is_object($object)) { - if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 980e44230c6a1f58abad9f7f0b4088c073125f86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 07:50:22 +0000 Subject: [PATCH 225/252] RPM works alos on ubuntu and debian --- build/rpm/dolibarr.spec | 57 +++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index a9003afcac3..46c0b734ca3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,7 +32,8 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -AutoReqProv: yes +# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) +AutoReqProv: no %description @@ -103,17 +104,6 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr -# menu -#%{__install} -d $RPM_BUILD_ROOT%{_menudir} -#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} -#?package(%{name}):\ -#command="Dolibarr" \ -#section="Office" \ -#title="Dolibarr" \ -#icon="dolibarr_48x48.png" \ -#longtitle="Dolibarr ERP & CRM" -#EOF - #---- clean %clean @@ -181,19 +171,26 @@ fi # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - apacheuser='apache'; - apachegroup='apache'; + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - apacheuser='wwwrun'; - apachegroup='wwwrun'; + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $conffile ]; then @@ -214,11 +211,11 @@ chmod -R o-w $docdir if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown apache.apache $targetdir/htdocs/conf/conf.php + chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -253,16 +250,26 @@ echo %clean_menus # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi - +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' From 6c7e3811894fe7c01429e0b472803f248620aac1 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 07:51:31 +0000 Subject: [PATCH 226/252] Trad: add possibility to force mail errors-to to all mails sent --- htdocs/langs/ca_ES/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 848deab542a..b79ba3f2c77 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nom host o ip del servidor SMTP (Per defecte en php.ini: < MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Port del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nom servidor o ip del servidor SMTP (No definit en PHP en sistemes de tipus Unix) MAIN_MAIL_EMAIL_FROM=Correu electrònic de l'emissor per trameses e automàtics (Per defecte en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usat per als retorns d'error dels e-mails enviats MAIN_MAIL_AUTOCOPY_TO=Enviar automàticament còpia oculta dels e-mails enviats a MAIN_DISABLE_ALL_MAILS=Desactivar globalment tot enviament de correus electrònics (per mode de proves) MAIN_MAIL_SENDMODE=Mètode d'enviament d'e-mails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 5645bd6ff6f..de8ec9133ef 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_EMAIL_FROM=E-Mail del emisor para envíos E-Mail automáticos (Por defecto en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-Mail usado para los retornos de error de los e-mails enviados MAIN_MAIL_AUTOCOPY_TO=Enviar automáticamente copia oculta de los e-mails enviados a MAIN_DISABLE_ALL_MAILS=Desactivar globalmente todo envío de correos electrónicos (para modo de pruebas o demo) MAIN_MAIL_SENDMODE=Método de envío de e-mails From 346ce02e6c3224cece7798e118adbdd885c15bb5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:36:11 +0000 Subject: [PATCH 227/252] Work on packaging RPM & DEB --- build/rpm/README | 2 +- build/rpm/dolibarr.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index f2077ceac36..c072a212632 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -18,6 +18,6 @@ with format RPM (for Redhat, Mandriva, ...). # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package # -# On Mageia +# On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies # urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 46c0b734ca3..b3aaca1d494 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -171,20 +171,26 @@ fi # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; @@ -250,20 +256,26 @@ echo %clean_menus # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; From 8a26ffc12501f67ba20725ecade4574f961aeb8a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 08:38:02 +0000 Subject: [PATCH 228/252] Fix: Missing translation From a7124426effca15001329e2bb04a8c44441e9f43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:54:57 +0000 Subject: [PATCH 229/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 18 ++++++++++-------- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index 568dd605dca..cfedcbc4dbb 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -14,7 +14,9 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # # Directory for web pages - + + Order deny,allow + Allow from all DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -54,23 +56,23 @@ Alias /dolibarr /usr/share/dolibarr/htdocs #ExpiresByType application/x-javascript A2592000 #ExpiresByType application/javascript A2592000 - + # Directory for public pages - + AllowOverride All Order deny,allow Allow from all - + # Directory for data files - + AllowOverride All Order deny,allow Allow from all - - + + AllowOverride All Order deny,allow Allow from all - + diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 4a395f235a2..e1fcb3f77e5 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From 7c8fb3fbd30086b9131996e5ca3fe790e64c2d1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:55:53 +0000 Subject: [PATCH 230/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 2 +- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index cfedcbc4dbb..fa29149ee59 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index e1fcb3f77e5..4a395f235a2 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use phpLDAPadmin as a VirtualHost +# You can also use dolibarr as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com From b9c34a40b3ef62210be5bdd4e70c4664ada4abfb Mon Sep 17 00:00:00 2001 From: cdelambert Date: Mon, 11 Jul 2011 09:32:35 +0000 Subject: [PATCH 231/252] Correction paiement Ajax From 42ce249a69d81fd8db96bb0e8ee76e20fa4758ee Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 10:41:29 +0000 Subject: [PATCH 232/252] Trad: add translation From 9818d8639ab690da91fbffa95a0c2b55724297bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 17:42:07 +0000 Subject: [PATCH 233/252] Work on packaging RPM & DEB --- build/deb/control | 2 - build/rpm/README | 12 +--- build/rpm/dolibarr.desktop | 5 +- build/rpm/dolibarr.spec | 117 ++++++++----------------------------- 4 files changed, 26 insertions(+), 110 deletions(-) diff --git a/build/deb/control b/build/deb/control index 2d356fc7b2b..3d8878f4569 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,8 +14,6 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. diff --git a/build/rpm/README b/build/rpm/README index c072a212632..1b2d4745dc4 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,14 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# On Fedora -# yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum install dolibarr To remove package +# yum erase dolibarr To remove package # -# On OpenSuse -# yast --install dolibarr-...rpm To install package and dependencies -# yast --remove dolibarr To remove package -# -# On Mageia (after su - root) -# urpmi dolibarr-...rpm To install package and dependencies -# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index ab2a758867f..e3be821080c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,12 +5,9 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM -Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs -Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti -Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones +Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b3aaca1d494..b1def13ae37 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,8 +32,7 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) -AutoReqProv: no +AutoReqProv: yes %description @@ -44,31 +43,12 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. -%description -l es -Dolibarr ERP y CRM es un software open source/gratis para pequeñas y -medianas empresas, asociaciones o autónomos. Incluye diferentes -funcionalidades para la Planificación de Recursos Empresariales (ERP) y -Gestión de la Relación con los Clientes (CRM) así como para para otras -diferentes actividades. Dolibarr ha sido diseñado para suministrarle -solamente las funcionalidades que necesita y haciendo hincapié en su -facilidad de uso. - %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. -%description -l it -Dolibarr è un programma gestionale open source e gratuito per piccole e medie -imprese, fondazioni e liberi professionisti. Include varie funzionalità per -Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori -attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno -ed essere facile da usare. -Dolibar è completamente web-based, progettato per poter fornire solo ciò di -cui hai bisogno ed essere facile da usare. - - #---- prep %prep @@ -104,6 +84,17 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr +# menu +#%{__install} -d $RPM_BUILD_ROOT%{_menudir} +#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} +#?package(%{name}):\ +#command="Dolibarr" \ +#section="Office" \ +#title="Dolibarr" \ +#icon="dolibarr_48x48.png" \ +#longtitle="Dolibarr ERP & CRM" +#EOF + #---- clean %clean @@ -169,59 +160,30 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi - -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='wwwrun'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - -# Create a config link dolibarr.conf for Fedora or Redhat -if [ ! -f $conffile ]; then - echo Create dolibarr web server config link $conffile - ln -fs /etc/dolibarr/apache.conf $conffile +# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf +if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then + echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf + ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf fi # Set permissions -echo Set permission to $apacheuser:$apachegroup on $targetdir -chown -R $apacheuser:$apachegroup $targetdir +echo Set permission on $targetdir +chown -R apache.apache $targetdir chmod -R a-w $targetdir -echo Set permission to $apacheuser:$apachegroup on $docdir -chown -R $apacheuser:$apachegroup $docdir +echo Set permission on $docdir +chown -R apache.apache $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php + chown apache.apache $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then +if [ -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -236,9 +198,6 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi -if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart -fi # Show result echo @@ -255,39 +214,12 @@ echo %postun %clean_menus -# Detect OS -os='unknown'; -if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora-redhat'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then - export os='opensuse'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='wwwrun'; - export apachegroup='wwwrun'; -fi -if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then - export os='mageia-mandriva'; - export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - export apacheuser='apache'; - export apachegroup='apache'; -fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then - export os='ubuntu-debian'; - export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - export apacheuser='www-data'; - export apachegroup='www-data'; -fi -echo OS detected: $os - # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' +export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -302,9 +234,6 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi - if [ -f %{_sysconfdir}/init.d/apache2 ]; then - %{_sysconfdir}/init.d/apache2 restart - fi fi rm -rf /etc/dolibarr From 3f0fe755938ca1276f98cb9dc4364b7b27e28805 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 18:29:46 +0000 Subject: [PATCH 234/252] Work on packaging RPM & DEB From 156de4447ddaa6e31627e459d9ba1f21500b9a63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:18:50 +0000 Subject: [PATCH 235/252] Prepare release 3.1 From 5d9caa159f8bb51d19f744856830d5f2464a82a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:26:53 +0000 Subject: [PATCH 236/252] Work on packaging RPM & DEB --- build/deb/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/deb/control b/build/deb/control index 3d8878f4569..2d356fc7b2b 100644 --- a/build/deb/control +++ b/build/deb/control @@ -14,6 +14,8 @@ Description: Easy to use ERP & CRM software to manage your activity. 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 provide only features you need and be easy to use. . Only features you need are visible, depending on which module were activated. From 3c4c116b4a724798718b71b8102cca7778972275 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 22:33:27 +0000 Subject: [PATCH 237/252] Work on packaging RPM & DEB --- build/rpm/dolibarr.desktop | 5 ++++- build/rpm/dolibarr.spec | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index e3be821080c..ab2a758867f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -5,9 +5,12 @@ Version=1.0 Encoding=UTF-8 Name=Dolibarr ERP & CRM Name[fr]=Dolibarr ERP & CRM +Name[it]=Dolibarr ERP & CRM GenericName=Dolibarr ERP & CRM Comment=The easy to use manager (ERP & CRM) for small and medium enterprises or foundations -Comment[fr]=L'ERP & CRM simple pour la gestion des PME et associations +Comment[fr]=L'ERP & CRM simple pour la gestion des TPE, PME, associations et auto-entrepreneurs +Comment[it]=Programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti +Comment[es]=Software para gestión de PYMES, profesionales independientes, auto emprendedores ó asociaciones # Command to open an URL # For Fedora: xdg-open # For Debian/Ubuntu: x-www-browser diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index b1def13ae37..4bfbcfaae65 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -43,12 +43,34 @@ Management (CRM) but also for different other activities. Dolibarr was designed to provide only features you need and be easy to use. +%description -l es +Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones +que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores +ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource +que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier +lugar disponiendo de una conexión a Internet. +Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, +pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: +Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). +Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). +Simple de desarrollar (sin frameworks pesados). + %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. +%description -l it +Dolibarr è un programma gestionale open source e gratuito per piccole e medie +imprese, fondazioni e liberi professionisti. Include varie funzionalità per +Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori +attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno +ed essere facile da usare. +Dolibar è completamente web-based, progettato per poter fornire solo ciò di +cui hai bisogno ed essere facile da usare. + + #---- prep %prep From 9f3b5018cfc298f0608e220fca89d303382a7312 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:33:53 +0000 Subject: [PATCH 238/252] Use global option if local not defined From edcb8dedaccc7b638fbba00ea22418d572703f3d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:39:34 +0000 Subject: [PATCH 239/252] Add comment From b4281ad5c8d7559819dc4a10484b4f000af4faee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 13:48:25 +0000 Subject: [PATCH 240/252] Fix: Param of constructor must be only database handler From d233af3733eb3a23dbda3ba0f7e7d9e920830ad5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 16:50:40 +0000 Subject: [PATCH 241/252] Fix: Missing fields and missing encoding of special chars --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e97abed808..4863b52689e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ + * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 8e25a057ded274db3cfc2aa992beef92d9aa9bec Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 17:28:09 +0000 Subject: [PATCH 242/252] Fix: missing htmlname in ajax response --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4863b52689e..7e97abed808 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -31,7 +31,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.187 2011/07/10 16:50:40 eldy Exp $ + * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $ */ @@ -876,7 +876,7 @@ class Form $selected_input_value=$product->ref; } // mode=1 means customers products - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); if (! $hidelabel) print $langs->trans("RefOrLabel").' : '; print ''; print '
'; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print '
'; } From 6883363d806fc8ae347f44a90308fd8ef36ca20d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Jul 2011 18:24:18 +0000 Subject: [PATCH 243/252] Fix: possibility to change status of another input element From d6cc5d924b50f112336c00364466174732e6f177 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 20:03:38 +0000 Subject: [PATCH 244/252] Fix: file add and delte in email forms was broken with firefox 5 --- htdocs/lib/files.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 3dbbef2c6b2..8b6ea639ec8 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ + * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ */ /** @@ -561,8 +561,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger && is_object($object)) + if (! $notrigger) { + if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From 5c8cfd95943b2811e7599e5369f4ffb2ec685edf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 21:17:14 +0000 Subject: [PATCH 245/252] Fix: Missing name on form From a3240089fa95823dc2ffa9a6b54b3ac0c8577506 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2011 22:45:44 +0000 Subject: [PATCH 246/252] Work on packaging RPM & DEB --- build/rpm/README | 12 +++++-- build/rpm/dolibarr.spec | 70 +++++++++++++++++++++++++++++------------ 2 files changed, 60 insertions(+), 22 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index 1b2d4745dc4..f2077ceac36 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,6 +10,14 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# yum install dolibarr To remove package -# yum erase dolibarr To remove package +# On Fedora +# yum install dolibarr-...rpm To install package and dependencies +# yum erase dolibarr To remove package # +# On OpenSuse +# yast --install dolibarr-...rpm To install package and dependencies +# yast --remove dolibarr To remove package +# +# On Mageia +# urpmi dolibarr-...rpm To install package and dependencies +# urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 4bfbcfaae65..a9003afcac3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -44,16 +44,13 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Dolibarr ERP/CRM es un software completamente modular (sólo activaremos las funciones -que deseemos) para gestión de PYMES, profesionales independientes, auto emprendedores -ó asociaciones. En términos más técnicos, es un ERP y CRM. Es un proyecto OpenSource -que se ejecuta en el seno de un servidor Web, siendo pues accesible desde cualquier -lugar disponiendo de una conexión a Internet. -Dolibarr viene a completar la oferta de numerosas aplicaciones de esta categoría, -pero desmarcándose por el hecho de que se hace todo lo posible para proporcionar simplicidad: -Simple de instalar (con instaladores para los que ignoran como instalar un servidor Web). -Simple de usar (funciones modulares para no sobrecargar los menús, informaciones claras y concisas). -Simple de desarrollar (sin frameworks pesados). +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y +medianas empresas, asociaciones o autónomos. Incluye diferentes +funcionalidades para la Planificación de Recursos Empresariales (ERP) y +Gestión de la Relación con los Clientes (CRM) así como para para otras +diferentes actividades. Dolibarr ha sido diseñado para suministrarle +solamente las funcionalidades que necesita y haciendo hincapié en su +facilidad de uso. %description -l fr Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, @@ -182,19 +179,35 @@ if [ ! -f %{_sysconfdir}/dolibarr/apache.conf ]; then chmod go-w %{_sysconfdir}/dolibarr/apache.conf fi -# Create a config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf -if [ ! -f %{_sysconfdir}/httpd/conf.d/dolibarr.conf ]; then - echo Create dolibarr web server config link %{_sysconfdir}/httpd/conf.d/dolibarr.conf - ln -fs /etc/dolibarr/apache.conf %{_sysconfdir}/httpd/conf.d/dolibarr.conf + +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + apacheuser='apache'; + apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + apacheuser='wwwrun'; + apachegroup='wwwrun'; +fi + +# Create a config link dolibarr.conf for Fedora or Redhat +if [ ! -f $conffile ]; then + echo Create dolibarr web server config link $conffile + ln -fs /etc/dolibarr/apache.conf $conffile fi # Set permissions -echo Set permission on $targetdir -chown -R apache.apache $targetdir +echo Set permission to $apacheuser:$apachegroup on $targetdir +chown -R $apacheuser:$apachegroup $targetdir chmod -R a-w $targetdir -echo Set permission on $docdir -chown -R apache.apache $docdir +echo Set permission to $apacheuser:$apachegroup on $docdir +chown -R $apacheuser:$apachegroup $docdir chmod -R o-w $docdir # Create empty conf.php file for web installer @@ -205,7 +218,7 @@ if [ ! -s $targetdir/htdocs/conf/conf.php ]; then chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -220,6 +233,9 @@ echo Restart web server if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi +if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart +fi # Show result echo @@ -236,12 +252,23 @@ echo %postun %clean_menus +# Detect OS +os='fedora'; +if [ -d %{_sysconfdir}/httpd/conf.d ]; then + export os='fedora'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" +fi +if [ -d %{_sysconfdir}/apache2/conf.d ]; then + export os='opensuse'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" +fi + + # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' # Dolibarr uploaded files and generated documents are stored into /usr/share/dolibarr/documents export docdir='/usr/share/dolibarr/documents' -export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" if [ -f $conffile ] ; then echo Delete apache config file for Dolibarr @@ -256,6 +283,9 @@ then if [ -f %{_sysconfdir}/init.d/httpd ]; then %{_sysconfdir}/init.d/httpd restart fi + if [ -f %{_sysconfdir}/init.d/apache2 ]; then + %{_sysconfdir}/init.d/apache2 restart + fi fi rm -rf /etc/dolibarr From e1034cd76eaa71f15b03039440d15397532f171c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Jul 2011 06:23:22 +0000 Subject: [PATCH 247/252] Fix: need complete object --- htdocs/lib/files.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 8b6ea639ec8..3dbbef2c6b2 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/files.lib.php * \brief Library for file managing functions - * \version $Id: files.lib.php,v 1.67 2011/07/10 20:03:41 eldy Exp $ + * \version $Id: files.lib.php,v 1.68 2011/07/11 06:23:22 hregis Exp $ */ /** @@ -561,9 +561,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK)); dol_syslog("Functions.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG); - if (! $notrigger) + if (! $notrigger && is_object($object)) { - if (! is_object($object)) $object=(object) 'dummy'; $object->src_file=$dest_file; // Appel des triggers From f6891c208f317e7cca2928bb6b9737705a5ba427 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 07:50:22 +0000 Subject: [PATCH 248/252] RPM works alos on ubuntu and debian --- build/rpm/dolibarr.spec | 57 +++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index a9003afcac3..46c0b734ca3 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -32,7 +32,8 @@ Group: Networking/WWW Group: Applications/Internet Requires: mysql-server mysql httpd php php-cli php-gd php-ldap php-imap php-mysql -AutoReqProv: yes +# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse) +AutoReqProv: no %description @@ -103,17 +104,6 @@ cp -pr doc $RPM_BUILD_ROOT/var/www/dolibarr cp -pr htdocs $RPM_BUILD_ROOT/var/www/dolibarr cp -pr scripts $RPM_BUILD_ROOT/var/www/dolibarr -# menu -#%{__install} -d $RPM_BUILD_ROOT%{_menudir} -#%{__cat} <$RPM_BUILD_ROOT%{_menudir}/%{name} -#?package(%{name}):\ -#command="Dolibarr" \ -#section="Office" \ -#title="Dolibarr" \ -#icon="dolibarr_48x48.png" \ -#longtitle="Dolibarr ERP & CRM" -#EOF - #---- clean %clean @@ -181,19 +171,26 @@ fi # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" - apacheuser='apache'; - apachegroup='apache'; + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" - apacheuser='wwwrun'; - apachegroup='wwwrun'; + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $conffile ]; then @@ -214,11 +211,11 @@ chmod -R o-w $docdir if [ ! -s $targetdir/htdocs/conf/conf.php ]; then echo Create empty Dolibarr conf.php file touch $targetdir/htdocs/conf/conf.php - chown apache.apache $targetdir/htdocs/conf/conf.php + chown $apacheuser:$apachegroup $targetdir/htdocs/conf/conf.php chmod ug+rw $targetdir/htdocs/conf/conf.php fi -if [ "x$os" = "xfedora" -a -s /usr/bin/chcon ]; then +if [ "x$os" = "xfedora-redhat" -a -s /usr/bin/chcon ]; then echo Set SELinux permissions # Warning: chcon seems not cumulative #chcon -R -h -t httpd_sys_content_t $targetdir @@ -253,16 +250,26 @@ echo %clean_menus # Detect OS -os='fedora'; +os='fedora-redhat'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then - export os='fedora'; + export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='wwwrun'; + export apachegroup='wwwrun'; fi - +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then + export os='ubuntu-debian'; + export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" + export apacheuser='www-data'; + export apachegroup='www-data'; +fi +echo OS detected: $os # Dolibarr files are stored into /var/www export targetdir='/var/www/dolibarr' From e70d04a9084c4c087fc7c3daf85fc3728fa98b0f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 07:51:31 +0000 Subject: [PATCH 249/252] Trad: add possibility to force mail errors-to to all mails sent From 72dd1942a0a8526b985726698717d11372638b69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:36:11 +0000 Subject: [PATCH 250/252] Work on packaging RPM & DEB --- build/rpm/README | 2 +- build/rpm/dolibarr.spec | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/rpm/README b/build/rpm/README index f2077ceac36..c072a212632 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -18,6 +18,6 @@ with format RPM (for Redhat, Mandriva, ...). # yast --install dolibarr-...rpm To install package and dependencies # yast --remove dolibarr To remove package # -# On Mageia +# On Mageia (after su - root) # urpmi dolibarr-...rpm To install package and dependencies # urpme dolibarr To remove package \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 46c0b734ca3..b3aaca1d494 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -171,20 +171,26 @@ fi # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; @@ -250,20 +256,26 @@ echo %clean_menus # Detect OS -os='fedora-redhat'; +os='unknown'; if [ -d %{_sysconfdir}/httpd/conf.d ]; then export os='fedora-redhat'; export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" export apacheuser='apache'; export apachegroup='apache'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep wwwrun /etc/passwd` ]; then +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then export os='opensuse'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='wwwrun'; export apachegroup='wwwrun'; fi -if [ -d %{_sysconfdir}/apache2/conf.d -a `grep www-data /etc/passwd` ]; then +if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then + export os='mageia-mandriva'; + export conffile="%{_sysconfdir}/httpd/conf.d/dolibarr.conf" + export apacheuser='apache'; + export apachegroup='apache'; +fi +if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then export os='ubuntu-debian'; export conffile="%{_sysconfdir}/apache2/conf.d/dolibarr.conf" export apacheuser='www-data'; From 5f43a2477dc4a832657909cabde4c0fb76f1e721 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 11 Jul 2011 08:38:02 +0000 Subject: [PATCH 251/252] Fix: Missing translation From 61b8d255c405558c1ad1eea57b26425f904e0897 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jul 2011 08:54:57 +0000 Subject: [PATCH 252/252] Work on packaging RPM & DEB --- build/deb/apache.conf | 2 +- build/rpm/httpd-dolibarr.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/apache.conf b/build/deb/apache.conf index fa29149ee59..cfedcbc4dbb 100644 --- a/build/deb/apache.conf +++ b/build/deb/apache.conf @@ -4,7 +4,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 4a395f235a2..e1fcb3f77e5 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -4,7 +4,7 @@ Alias /dolibarr /var/www/dolibarr/htdocs -# You can also use dolibarr as a VirtualHost +# You can also use phpLDAPadmin as a VirtualHost # # ServerName mydolibarrhostname.com # ServerAdmin root@example.com