From f974b3a8aad3eda303bc18b86cb8a0fc7a06ec5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Jul 2011 10:23:24 +0000 Subject: [PATCH] Fix: Code could not works for debian packages --- build/.cvsignore | 3 - build/deb/README | 2 +- build/deb/changelog | 4 +- build/deb/config | 38 ++-- build/deb/control.debianbin | 46 ++++ build/deb/dolibarr.lintian-overrides | 9 + build/deb/install.forced.php.install | 8 +- build/deb/lighttpd.conf | 22 ++ build/deb/postinst | 71 ++++--- build/deb/postrm | 113 +++++----- build/makepack-dolibarr.pl | 197 +++++------------- build/rpm/dolibarr.desktop | 2 +- dev/skeletons/modMyModule.class.php | 4 +- doc/images/README | 2 - htdocs/admin/boxes.php | 8 +- htdocs/admin/modules.php | 35 +++- htdocs/admin/perms.php | 34 ++- htdocs/admin/proxy.php | 7 +- htdocs/admin/security_other.php | 7 +- htdocs/admin/system/constall.php | 5 +- htdocs/admin/system/index.php | 7 +- htdocs/boxes.php | 6 +- htdocs/cashdesk/validation_verif.php | 3 +- htdocs/comm/action/index.php | 7 +- htdocs/compta/bank/bankid_fr.php | 7 +- htdocs/compta/bank/fiche.php | 7 +- htdocs/compta/bank/rappro.php | 7 +- htdocs/compta/prelevement/create.php | 7 +- htdocs/contrat/fiche.php | 6 +- htdocs/core/class/translate.class.php | 7 +- htdocs/filefunc.inc.php | 7 +- htdocs/includes/modules/modWorkflow.class.php | 4 +- htdocs/index.php | 7 +- htdocs/install/check.php | 6 +- htdocs/install/etape0.php | 6 +- htdocs/install/etape1.php | 7 +- htdocs/install/etape2.php | 6 +- htdocs/install/etape4.php | 6 +- htdocs/install/etape5.php | 16 +- htdocs/install/fileconf.php | 43 ++-- htdocs/install/licence.php | 6 +- .../install/mysql/data/llx_10_c_regions.sql | 32 +-- .../mysql/data/llx_20_c_departements.sql | 3 +- htdocs/langs/ca_ES/paypal.lang | 2 +- htdocs/langs/es_ES/paypal.lang | 2 +- htdocs/lib/admin.lib.php | 77 +++++-- htdocs/main.inc.php | 5 +- htdocs/master.inc.php | 5 +- htdocs/product/class/product.class.php | 5 +- htdocs/product/fiche.php | 7 +- .../class/companybankaccount.class.php | 5 +- htdocs/societe/rib.php | 7 +- htdocs/societe/soc.php | 10 +- htdocs/theme/auguria/style.css.php | 5 +- htdocs/theme/bureau2crea/style.css.php | 5 +- htdocs/theme/eldy/style.css.php | 5 +- htdocs/theme/freelug/style.css.php | 5 +- htdocs/theme/yellow/style.css.php | 5 +- htdocs/user/group/perms.php | 34 ++- htdocs/user/perms.php | 32 ++- htdocs/viewimage.php | 5 +- 61 files changed, 606 insertions(+), 445 deletions(-) create mode 100755 build/deb/control.debianbin create mode 100755 build/deb/dolibarr.lintian-overrides create mode 100755 build/deb/lighttpd.conf diff --git a/build/.cvsignore b/build/.cvsignore index 53dd6ee2abd..830b8b91924 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -14,6 +14,3 @@ version-phpsane.txt makepack-phpsane.conf html *.deb -*.dsc -*.tar.gz -*.changes diff --git a/build/deb/README b/build/deb/README index edb46ffd5a3..76be8f1596c 100644 --- a/build/deb/README +++ b/build/deb/README @@ -49,5 +49,5 @@ For first ITP submission of Dolibarr, bug id was 634783. - Call for a mentor on ML debian-mentors to upload packages - Once package is uploaded, following URL are available: -http://packages.qa.debian.org/package.html +http://packages.qa.debian.org/package http://bugs.debian.org/package diff --git a/build/deb/changelog b/build/deb/changelog index b035f18ae1d..47667b3cfb5 100644 --- a/build/deb/changelog +++ b/build/deb/changelog @@ -4,6 +4,6 @@ dolibarr (3.1.0-1.1) unstable; urgency=low * New upstream release. closes: bug#634783 - -- Laurent Destailleur Mon, 30 Jul 2011 12:00:00 +0100 + -- Laurent Destailleur Mon, 18 Jul 2011 12:00:00 +0100 -# For a changelog file dedicated to users, see /usr/share/doc/dolibarr/UserChangeLog.gz file. \ No newline at end of file +# More information into /usr/share/dolibarr/ChangeLog file. \ No newline at end of file diff --git a/build/deb/config b/build/deb/config index 1965ef73cc5..553e5ffd7f6 100644 --- a/build/deb/config +++ b/build/deb/config @@ -13,16 +13,29 @@ db_version 2.0 echo Run the dolibarr config script # Rotate old configuration -if [ "$1" = "reconfigure" ] ; then - config="/etc/dolibarr/apache.conf" - for i in $(seq 8 -1 0) ; do - if [ -f ${config}.$i ] ; then - mv ${config}.$i ${config}.$(($i +1)) - fi - done - mv ${config} ${config}.0 -fi - +#if [ "$1" = "reconfigure" ] ; then +# config="/etc/dolibarr/apache.conf" +# if [ -f $config ] ; then +# for i in $(seq 8 -1 0) ; do +# if [ -f ${config}.$i ] ; then +# mv ${config}.$i ${config}.$(($i +1)) +# fi +# done +# mv ${config} ${config}.0 +# fi +#fi +# Rotate old configuration +#if [ "$1" = "reconfigure" ] ; then +# config="/etc/dolibarr/lighttpd.conf" +# if [ -f $config ] ; then +# for i in $(seq 8 -1 0) ; do +# if [ -f ${config}.$i ] ; then +# mv ${config}.$i ${config}.$(($i +1)) +# fi +# done +# mv ${config} ${config}.0 +# fi +#fi db_capb backup @@ -30,8 +43,9 @@ db_capb backup db_title "dolibarr" || true -# Ask for web server type. -#db_input critical "dolibarr/webserver" || true +# Ask if we must delete database +echo "Ask for web server to setup" +db_input critical dolibarr/reconfigure-webserver || true if db_go ; then okcancel="1" diff --git a/build/deb/control.debianbin b/build/deb/control.debianbin new file mode 100755 index 00000000000..7c66775bdf1 --- /dev/null +++ b/build/deb/control.debianbin @@ -0,0 +1,46 @@ +Package: dolibarr +Version: __VERSION__ +Architecture: all +Maintainer: Laurent Destailleur +Installed-Size: 61200 +Depends: xdg-utils, apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, php-pear, php-mail-mime, mysql-server, perl +Section: web +Priority: optional +Homepage: http://www.dolibarr.org +Description: Easy to use web based ERP & CRM software + 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. + . + Only features you need are visible, depending on which module were activated. + Most common used modules are: + . + 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, + Donations management, + Bookmarks management, + Mass Emailings, + Reports, + Wizards to export and import data, + LDAP connectivity, + PDF exports, + And a lot of more modules... + . + You can also add third parties external modules or develop yours. diff --git a/build/deb/dolibarr.lintian-overrides b/build/deb/dolibarr.lintian-overrides new file mode 100755 index 00000000000..9022acc3e75 --- /dev/null +++ b/build/deb/dolibarr.lintian-overrides @@ -0,0 +1,9 @@ +# embedded libraries, which don't seem to be available in Debian in correct version +# or because they were modified and are specific dolibarr code +embedded-javascript-library usr/share/dolibarr/htdocs/includes/ckeditor/adapters/jquery.js +embedded-javascript-library usr/share/dolibarr/htdocs/includes/ckeditor/ckeditor.js +embedded-javascript-library usr/share/dolibarr/htdocs/includes/fckeditor/fckeditor.js +embedded-php-library usr/share/dolibarr/htdocs/includes/magpierss/extlib/Snoopy.class.inc +embedded-php-library usr/share/dolibarr/htdocs/includes/magpierss/rss_parse.inc +embedded-php-library usr/share/dolibarr/htdocs/includes/nusoap/lib/nusoap.php +embedded-php-library usr/share/dolibarr/htdocs/includes/odtphp/zip/pclzip/pclzip.lib.php \ No newline at end of file diff --git a/build/deb/install.forced.php.install b/build/deb/install.forced.php.install index 7de8616ac15..c266426209b 100755 --- a/build/deb/install.forced.php.install +++ b/build/deb/install.forced.php.install @@ -4,19 +4,19 @@ // This file must be present into htdocs/install directory // during install process to be used. // -// $Id: install.forced.php.install,v 1.9 2011/07/30 14:56:12 eldy Exp $ +// $Id: install.forced.php.install,v 1.8 2011/07/27 16:45:47 eldy Exp $ // -$force_install_noedit=2; +$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/documents'; $force_install_type='mysqli'; $force_install_dbserver='localhost'; $force_install_port='3306'; -$force_install_database='dolibarrdebian'; +$force_install_database='dolibarr'; $force_install_createdatabase='1'; -$force_install_databaselogin='dolibarrdebian'; +$force_install_databaselogin='dolibarrmysql'; $force_install_databasepass=''; $force_install_createuser='1'; $force_install_databaserootlogin='__SUPERUSERLOGIN__'; diff --git a/build/deb/lighttpd.conf b/build/deb/lighttpd.conf new file mode 100755 index 00000000000..e3d1bdfce7e --- /dev/null +++ b/build/deb/lighttpd.conf @@ -0,0 +1,22 @@ +# Alias for dolibarr directory +alias.url += ( + "/dolibarr" => "/usr/share/dolibarr/htdocs", +) + +# Disallow access to libraries +#$HTTP["url"] =~ "^/dolibarr/libraries" { +# url.access-deny = ( "" ) +#} + +# Limit access to setup script +#$HTTP["url"] =~ "^/dolibarr/setup" { +# auth.backend = "htpasswd" +# auth.backend.htpasswd.userfile = "/etc/dolibarr/htpasswd.setup" +# auth.require = ( +# "/" => ( +# "method" => "basic", +# "realm" => "Dolibarr Setup", +# "require" => "valid-user" +# ) +# ) +#} diff --git a/build/deb/postinst b/build/deb/postinst index ca5fd1645dd..dd03156a6d2 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -24,31 +24,23 @@ db_version 2.0 echo Run the dolibarr postinst script -# Define vars docdir='/var/lib/dolibarr/documents' #docdir='/usr/share/dolibarr/documents' -apachefileorig="/usr/share/dolibarr/build/deb/apache.conf" -apacheconfig="/etc/dolibarr/apache.conf" -installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install" -installconfig="/etc/dolibarr/install.forced.php" -#config="/usr/share/dolibarr/htdocs/conf/conf.php" -config="/etc/dolibarr/conf.php" + case "$1" in configure) - # Create document directory for uploaded data files - mkdir -p $docdir - chown -R www-data:www-data $docdir - chmod -R 775 $docdir - chmod -R g+s $docdir - - # Copy apache.conf file into target directory + # Copy apache.conf file into target directory. + #fileorig="/usr/share/dolibarr/build/deb/apache.conf" + #config="/etc/dolibarr/apache.conf" #mkdir -p /etc/dolibarr - #cp -p $apachefileorig $apacheconfig + #cp -p $fileorig $config - # Copy install config file (with matching Debian) values into target directory + # Edit install.forced.php to match Debian values + fileorig="/usr/share/dolibarr/build/deb/install.forced.php.install" + config="/usr/share/dolibarr/htdocs/install/install.forced.php" superuserlogin='' superuserpassword='' if [ -f /etc/mysql/debian.cnf ] ; then @@ -58,24 +50,29 @@ case "$1" in fi echo Mysql superuser found to use is $superuserlogin if [ -z "$superuserlogin" ] ; then - cat $installfileorig | sed -e 's/__SUPERUSERLOGIN__/root/g' | sed -e 's/__SUPERUSERPASSWORD__//g' > $installconfig + cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/root/g' | sed -e 's/__SUPERUSERPASSWORD__//g' > $config else - cat $installfileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $installconfig + cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config fi - chown -R root:www-data $installconfig - chmod -R 660 $installconfig + + # Create document directory for uploaded data files + 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 $config ] + if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] then - echo Create empty file $config - touch $config - chown -R root:www-data $config - chmod -R 660 $config + echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php + touch /usr/share/dolibarr/htdocs/conf/conf.php + chown -R root:www-data /usr/share/dolibarr/htdocs/conf/conf.php + chmod -R 660 /usr/share/dolibarr/htdocs/conf/conf.php fi - # Get the web server type (use db_get for interactive mode). #db_reset "dolibarr/webserver" + + # Get the web server type (use db_get for interactive mode). #db_get "dolibarr/webserver" # Read value for webserver. #webserver="$RET" @@ -105,7 +102,7 @@ case "$1" in # Set permissions to web server chown -R $webuser:$webgroup /usr/share/dolibarr - chown -R root:$webgroup $config + chown -R root:$webgroup /usr/share/dolibarr/htdocs/conf/conf.php # Add link to config file echo Setup web server $server to add dolibarr config file @@ -113,6 +110,26 @@ case "$1" in done + #echo "Install menu entry" + # This one is for Gnome ubuntu + #fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop" + #target="/usr/share/applications/" + #cp -f $fileorig $target + # Not sure this is usefull + #if test -x /usr/bin/update-menus; then + # echo "update-menus" + # update-menus; + #fi + + # TODO Create the file to force parameters in Web installer + #if grep DBHOST /usr/share/dolibarr/htdocs/conf/conf.php > /dev/null + #then + # perl -pi -e "s/DBHOST/$dbserver/" /usr/share/dolibarr/htdocs/conf/conf.php + # perl -pi -e "s/DBNAME/$dbname/" /usr/share/dolibarr/htdocs/conf/conf.php + # perl -pi -e "s/DBUSER/$dbuser/" /usr/share/dolibarr/htdocs/conf/conf.php + # perl -pi -e "s/DBPASS/$dbpass/" /usr/share/dolibarr/htdocs/conf/conf.php + #fi + # Restart servers servers="apache2-ssl apache2 mysql" # Another way to restart diff --git a/build/deb/postrm b/build/deb/postrm index 9eae81b022b..8be194f0a41 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -26,11 +26,6 @@ echo Run the dolibarr postrm script docdir='/var/lib/dolibarr/documents' #docdir='/usr/share/dolibarr/documents' -apachefileorig="/usr/share/dolibarr/build/deb/apache.conf" -apacheconfig="/etc/dolibarr/apache.conf" -#config="/usr/share/dolibarr/htdocs/conf/conf.php" -config="/etc/dolibarr/conf.php" -lockfile="/usr/share/dolibarr/install.lock" export webserver="" @@ -41,38 +36,13 @@ case $webserver in Both) webservers="apache2 apache2-ssl" ;; *) webservers="apache2 apache2-ssl" ;; esac +export includefile=/etc/dolibarr/apache.conf case "$1" in - - # Call when we upgrade - upgrade) - ;; - - # Call when we uninstall - remove) - rm -f $lockfile - - # Remove include files - export restart="" - for server in $webservers ; do - export conffile="/etc/$server/conf.d/dolibarr.conf" - if [ -f $conffile ] ; - then - echo Delete link $conffile - rm -f $conffile - status=purge - fi - - if [ "x$status" = "xpurge" ] ; - then restart="$restart $server" - fi - done - ;; - # Call when we uninstall and purge purge) - echo "postrm purge webservers=$webservers apacheconfig=$apacheconfig" + echo "postrm purge webservers=$webservers includefile=$includefile" # Ask if we must delete database echo "postrm db_input dolibarr/postrm" @@ -89,8 +59,7 @@ case "$1" in echo postrm Mysql database deletion # Get database configuration dbserver="localhost" - dbuser="dolibarrdebian" - dbname="dolibarrdebian" + dbname="dolibarrmysql" #db_get "dolibarr/db/name" #dbname="$RET" superuserlogin='' @@ -151,31 +120,23 @@ case "$1" in fi mysqlcmd="mysql $hostopt $passopt -u $dbadmin" - # Now run the drop user - if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then - echo Database login $dbuser removed - else - error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\"" - echo $error - fi - # Now run the drop commands if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then - log="${log}Droping database $dbname." - if eval $mysqlcmd -f -e "\"DROP DATABASE $dbname;\"" ; then - if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then - error="Database $dbname NOT successfully droped. You have to do it manually." - echo $error - else - status=drop - fi - else - error="Unable to run the drop database script." - echo $error - fi + log="${log}Droping database $dbname." + if eval $mysqlcmd -f -e "\"DROP DATABASE $dbname;\"" ; then + if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then + error="Database $dbname NOT successfully droped. You have to do it manually." + echo $error + else + status=drop + fi + else + error="Unable to run the drop database script." + echo $error + fi else - status=nothing - log="${log}Database $dbname already not exists." + status=nothing + log="${log}Database $dbname already not exists." fi echo "Remove directory $docdir" @@ -217,6 +178,18 @@ case "$1" in set -e done + # Remove file and conf file + for dir in /usr/share/dolibarr; do + if [ -d $dir ] ; then + # We disable blocking errors + set +e + echo "Remove directory $dir" + rm -rf $dir ; + # We restore blocking errors + set -e + fi + done + # We clean variable (we ignore errors because db_reset can fails if var was never set) set +e db_reset "dolibarr/postrm" @@ -225,6 +198,34 @@ case "$1" in #db_purge ;; + # Call when we uninstall + remove) + echo "postrm Force remove of /usr/share/dolibarr/htdocs/install" + rm -fr /usr/share/dolibarr/htdocs/install + + echo "postrm Force remove of /usr/share/dolibarr/htdocs/conf" + rm -fr /usr/share/dolibarr/htdocs/conf + + # Remove include files + export restart="" + for server in $webservers ; do + export conffile="/etc/$server/conf.d/dolibarr.conf" + if [ -f $conffile ] ; + then + echo Delete file $conffile + rm -f $conffile + status=purge + fi + + if [ "x$status" = "xpurge" ] ; + then restart="$restart $server" + fi + done + ;; + + upgrade) + ;; + failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index d3c47e6b28d..5dcf81d3a85 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.128 2011/07/31 22:08:13 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.122 2011/07/30 10:23:26 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -11,7 +11,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="1"; -$BUILD="0-beta"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="0-dev"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.128 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.122 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -254,11 +254,9 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/build/DoliW*-*`; $ret=`rm -f $BUILDROOT/$PROJECT/build/DoliM*-*`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.changes`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`; @@ -276,10 +274,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/Veranda*.ttf`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/fckeditor.py`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`; @@ -416,19 +410,14 @@ if ($nboftargetok) { } if ($target eq 'RPM') { # Linux only - #$ARCH='i386'; - $ARCH='noarch'; + $ARCH='i386'; if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; } $newbuild = $BUILD; - # For fedora - $newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev - $newbuild =~ s/beta/0.2.beta1/gi; # beta - $newbuild =~ s/rc./0.3.rc1/gi; # rc + $newbuild =~ s/(dev|alpha)/0/gi; # dev + $newbuild =~ s/beta/1/gi; # beta + $newbuild =~ s/rc./2/gi; # rc if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale - #$newbuild =~ s/(dev|alpha)/0/gi; # dev - #$newbuild =~ s/beta/1/gi; # beta - #$newbuild =~ s/rc./2/gi; # rc - #if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale + # now newbuild is 0-0 or 0-3 for example $REL1 = $newbuild; $REL1 =~ s/-.*$//gi; if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; @@ -446,93 +435,16 @@ if ($nboftargetok) { print "Remove other files\n"; $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/README`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/README`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/README-FR`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/aps`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/deb`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/dmg`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/pad/README`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/tgz/README`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/deb/README`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/doap`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/exe`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/live`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/patch`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/zip`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/build/perl`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/dev/dbmodel`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/dev/fpdf`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/dev/initdata`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/dev/iso-normes`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/dev/phpcheckstyle`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/dev/phpunit`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/doc/flyer`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/doc/font`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/doc/tshirt`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/doc/rollup`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/test`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/cashdesk/include/jscalendar/doc/html/CVS`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/cashdesk/include/jscalendar/skins/aqua/CVS`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/ckeditor/plugins/*/dialogs/CVS`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/ckeditor/plugins/*/images/CVS`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/fpdf/fpdf`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/nusoap/lib/Mail`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/odtphp/zip/.svn`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/odtphp/zip/pclzip/.svn`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/smarty`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/aps`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/COPYING`; - $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`; - # To remove once stable - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/$PROJECT/htdocs/htdocs/theme/bureau2crea`; - - # Apache conf files - #print "Copy apache.conf file into $BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/apache.conf\n"; - #$ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT"`; - #$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$FILENAMETGZ2/etc/$PROJECT/apache.conf"`; - - # Dolibarr conf files - # TODO - - # dolibarr.desktop - #print "Create directory $BUILDROOT/$FILENAMETGZ2/usr/share/applications\n"; - #$ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/usr/share/applications"`; - #print "Copy desktop file into $BUILDROOT/$FILENAMETGZ2/usr/share/applications/dolibarr.desktop\n"; - #$ret=`cp "$SOURCE/build/rpm/dolibarr.desktop" "$BUILDROOT/$FILENAMETGZ2/usr/share/applications/dolibarr.desktop"`; - - # pixmap - #print "Create directory $BUILDROOT/$FILENAMETGZ2/usr/share/pixmaps\n"; - #$ret=`mkdir -p "$BUILDROOT/$FILENAMETGZ2/usr/share/pixmaps"`; - #print "Copy pixmap file into $BUILDROOT/$FILENAMETGZ2/usr/share/pixmaps/dolibarr.xpm\n"; - #$ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$FILENAMETGZ2/usr/share/pixmaps/dolibarr.xpm"`; - - # Set owners - print "Set owners on files/dir\n"; - $ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`; - - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; - $cmd="find $BUILDROOT/$FILENAMETGZ2 -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$FILENAMETGZ2/build -name '*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$FILENAMETGZ2/build -name '*.pl' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$FILENAMETGZ2/dev -name '*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/dev/translation/langAutoParser.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/dev/skeletons/skeleton_page.php`; - $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/dev/skeletons/modMyModule.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$FILENAMETGZ2/dev/skeletons/skeleton_class.class.php`; - $cmd="find $BUILDROOT/$FILENAMETGZ2/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$FILENAMETGZ2/htdocs/includes/geoip -name 'sample*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$FILENAMETGZ2/htdocs/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts -name '*.pl' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - - # Build tgz print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n"; $ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`; @@ -560,10 +472,6 @@ if ($nboftargetok) { print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm into $DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\n"; $cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\""; $ret=`$cmd`; - print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm into $DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\n"; - $cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\""; - $ret=`$cmd`; - next; } @@ -614,33 +522,20 @@ if ($nboftargetok) { print "Version set to $MAJOR.$MINOR.$newbuild\n"; print "Remove other files\n"; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYRIGHT`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/INSTALL`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README-FR`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/README-FR`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/aps`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/dmg`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/pad/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/tgz/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README`; - #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/po`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/changelog`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/compat`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/config`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/control.*`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/copyright`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.desktop`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/dolibarr.menu`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/format`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/install`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/menu`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postrm`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/postinst`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/rules`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/README.debian`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/templates.futur`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/build/deb/wash`; @@ -700,7 +595,17 @@ if ($nboftargetok) { print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`; - # Set owners + #print "Copy README file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; + #$ret=`cp "$SOURCE/README" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/README"`; + + # copyright (to build binary package directly without sources. Useless if we build from sources) + #print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; + #$ret=`cp "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`; + + # changelog (to build binary package directly without sources. Useless if we build from sources) + #$ret=`gzip -9 -c "$SOURCE/build/deb/changelog" > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`; + #$ret=`gzip -9 -c "$SOURCE/build/deb/changelog" > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.gz`; + print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; @@ -744,25 +649,29 @@ if ($nboftargetok) { $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian/source"`; $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; + $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/pom.xml"`; + $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/COPYRIGHT"`; + $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/INSTALL"`; + $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README"`; + $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/README-FR"`; $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc"`; print "Copy $SOURCE/build/deb/xxx to $BUILDROOT/$PROJECT.tmp/debian\n"; # Add files for dpkg-source - $ret=`cp -f "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/UserChangeLog"`; - $ret=`cp -f "$SOURCE/build/deb/README.debian" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/README"`; - $ret=`cp -f "$SOURCE/build/deb/changelog" "$BUILDROOT/$PROJECT.tmp/debian/changelog"`; - $ret=`cp -f "$SOURCE/build/deb/control.debian" "$BUILDROOT/$PROJECT.tmp/debian/control"`; - $ret=`cp -f "$SOURCE/build/deb/install" "$BUILDROOT/$PROJECT.tmp/debian/install"`; - $ret=`cp -f "$SOURCE/build/deb/rules" "$BUILDROOT/$PROJECT.tmp/debian/rules"`; - $ret=`cp -f "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/debian/copyright"`; - $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`; - $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`; - $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`; - $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/debian/po/CVS"`; + $ret=`cp -f "$SOURCE/ChangeLog" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/UserChangeLog"`; + $ret=`cp -f "$SOURCE/build/deb/README.debian" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/dolibarr/README"`; + $ret=`cp -f "$SOURCE/build/deb/changelog" "$BUILDROOT/$PROJECT.tmp/debian/changelog"`; + $ret=`cp -f "$SOURCE/build/deb/control.debian" "$BUILDROOT/$PROJECT.tmp/debian/control"`; + $ret=`cp -f "$SOURCE/build/deb/install" "$BUILDROOT/$PROJECT.tmp/debian/install"`; + $ret=`cp -f "$SOURCE/build/deb/rules" "$BUILDROOT/$PROJECT.tmp/debian/rules"`; + $ret=`cp -f "$SOURCE/build/deb/copyright" "$BUILDROOT/$PROJECT.tmp/debian/copyright"`; + $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`; + $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`; + $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`; # Add files also required to build binary package with dpkg-buildpackages - $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/deb/templates" "$BUILDROOT/$PROJECT.tmp/debian"`; $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; $ret=`$cmd`; @@ -778,18 +687,12 @@ if ($nboftargetok) { if ($OS =~ /windows/i) { print "Move *_all.deb to $DESTI\n"; - $ret=`mv $BUILDROOT/*_all.deb "$DESTI/"`; - $ret=`mv $BUILDROOT/*.dsc "$DESTI/"`; - $ret=`mv $BUILDROOT/*.tar.gz "$DESTI/"`; - $ret=`mv $BUILDROOT/*.changes "$DESTI/"`; + $ret=`mv "$BUILDROOT/*_all.deb" "$DESTI/"`; } else { print "Move *_all.deb to $DESTI\n"; - $ret=`mv $BUILDROOT/*_all.deb "$DESTI/"`; - $ret=`mv $BUILDROOT/*.dsc "$DESTI/"`; - $ret=`mv $BUILDROOT/*.tar.gz "$DESTI/"`; - $ret=`mv $BUILDROOT/*.changes "$DESTI/"`; + $ret=`mv "$BUILDROOT/*_all.deb" "$DESTI/"`; } next; } diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index 4b4fb60dadb..33fadf7624f 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -19,7 +19,7 @@ Exec=xdg-open http://localhost/dolibarr Icon=dolibarr Terminal=false Type=Application -Categories=Office; +Categories=Office StartupNotify=true InitialPreference=5 #NoDisplay=true diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 3cc548e1c0a..d7172d651f0 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -27,7 +27,7 @@ * \file htdocs/includes/modules/modMyModule.class.php * \ingroup mymodule * \brief Description and activation file for module MyModule - * \version $Id: modMyModule.class.php,v 1.66 2011/07/31 22:21:58 eldy Exp $ + * \version $Id: modMyModule.class.php,v 1.67 2011/08/01 13:26:21 hregis Exp $ */ include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); @@ -72,7 +72,7 @@ class modMyModule extends DolibarrModules // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' $this->picto='generic'; - // Defined if the directory /mymodule/inc/triggers/ contains triggers or not + // Defined if the directory /mymodule/includes/triggers/ contains triggers or not $this->triggers = 0; // Data directories to create when module is enabled. diff --git a/doc/images/README b/doc/images/README index 1fee00b743d..1b33a1d490b 100644 --- a/doc/images/README +++ b/doc/images/README @@ -12,5 +12,3 @@ Follow us on twitter http://twitter.com/gasyoun or email leds24@gmail.com ------------------------------------------------------- List of icons from http://led24.de/iconset/ are: - dolihelp.ico - - diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 718c842d046..34e7f48cea8 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -20,7 +20,7 @@ /** * \file htdocs/admin/boxes.php * \brief Page to setup boxes - * \version $Id: boxes.php,v 1.72 2011/07/31 22:23:22 eldy Exp $ + * \version $Id: boxes.php,v 1.73 2011/08/01 13:26:22 hregis Exp $ */ require("../main.inc.php"); @@ -278,7 +278,7 @@ if ($resql) { $boxname = $regs[1]; $module = $regs[2]; - $sourcefile = "/".$module."/inc/boxes/".$boxname.".php"; + $sourcefile = "/".$module."/includes/boxes/".$boxname.".php"; } else { @@ -394,7 +394,7 @@ if ($resql) { $boxname = $regs[1]; $module = $regs[2]; - $sourcefile = "/".$module."/inc/boxes/".$boxname.".php"; + $sourcefile = "/".$module."/includes/boxes/".$boxname.".php"; } else { @@ -470,5 +470,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/07/31 22:23:22 $ - $Revision: 1.72 $'); +llxFooter('$Date: 2011/08/01 13:26:22 $ - $Revision: 1.73 $'); ?> diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index a907f47663a..671bd69a0e4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ /** * \file htdocs/admin/modules.php * \brief Page to activate/disable all modules - * \version $Id: modules.php,v 1.156 2011/07/31 22:23:22 eldy Exp $ + * \version $Id: modules.php,v 1.157 2011/08/01 12:25:15 hregis Exp $ */ require("../main.inc.php"); @@ -79,12 +79,35 @@ $modules = array(); $orders = array(); $categ = array(); $dirmod = array(); +$modulesdir = array(); $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. -foreach ($conf->file->dol_document_root as $dirroot) -{ - $dir = $dirroot . "/includes/modules/"; +foreach ($conf->file->dol_document_root as $type => $dirroot) +{ + $modulesdir[] = $dirroot . "/includes/modules/"; + + if ($type == 'alt') + { + $althandle=@opendir($dirroot); + if (is_resource($althandle)) + { + while (($file = readdir($althandle))!==false) + { + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') + { + if (is_dir($dirroot . '/' . $file . '/includes/modules/')) + { + $modulesdir[] = $dirroot . '/' . $file . '/includes/modules/'; + } + } + } + } + } +} + +foreach ($modulesdir as $dir) +{ // Load modules attributes in arrays (name, numero, orders) from dir directory //print $dir."\n
"; dol_syslog("Scan directory ".$dir." for modules"); @@ -449,5 +472,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/07/31 22:23:22 $ - $Revision: 1.156 $'); +llxFooter('$Date: 2011/08/01 12:25:15 $ - $Revision: 1.157 $'); ?> diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index bee00b52906..6af9b54e7f0 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -21,7 +21,7 @@ * \file htdocs/admin/perms.php * \ingroup core * \brief Page d'administration/configuration des permissions par defaut - * \version $Id: perms.php,v 1.42 2011/07/31 22:23:26 eldy Exp $ + * \version $Id: perms.php,v 1.43 2011/08/01 12:53:37 hregis Exp $ */ require("../main.inc.php"); @@ -76,10 +76,34 @@ $db->begin(); // Charge les modules soumis a permissions $modules = array(); -foreach ($conf->file->dol_document_root as $dirroot) -{ - $dir = $dirroot . "/includes/modules/"; +$modulesdir = array(); +foreach ($conf->file->dol_document_root as $type => $dirroot) +{ + $modulesdir[] = $dirroot . "/includes/modules/"; + + if ($type == 'alt') + { + $handle=@opendir($dirroot); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') + { + if (is_dir($dirroot . '/' . $file . '/includes/modules/')) + { + $modulesdir[] = $dirroot . '/' . $file . '/includes/modules/'; + } + } + } + closedir($handle); + } + } +} + +foreach ($modulesdir as $dir) +{ // Load modules attributes in arrays (name, numero, orders) from dir directory //print $dir."\n
"; $handle=@opendir($dir); @@ -194,5 +218,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/07/31 22:23:26 $ - $Revision: 1.42 $'); +llxFooter('$Date: 2011/08/01 12:53:37 $ - $Revision: 1.43 $'); ?> diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 2c284c5cae8..f02e3d6203a 100755 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -12,14 +12,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/proxy.php * \ingroup core * \brief Page setup proxy to use for external web access - * \version $Id: proxy.php,v 1.7 2011/07/31 22:23:24 eldy Exp $ + * \version $Id: proxy.php,v 1.6 2011/07/29 21:04:27 eldy Exp $ */ require("../main.inc.php"); @@ -205,5 +206,5 @@ dol_htmloutput_mesg($mesg); $db->close(); -llxFooter('$Date: 2011/07/31 22:23:24 $ - $Revision: 1.7 $'); +llxFooter('$Date: 2011/07/29 21:04:27 $ - $Revision: 1.6 $'); ?> diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index c1d629f7b7b..c0aaaa86213 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -13,14 +13,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/security_other.php * \ingroup core * \brief Security options setup - * \version $Id: security_other.php,v 1.41 2011/07/31 22:23:22 eldy Exp $ + * \version $Id: security_other.php,v 1.40 2011/07/29 21:04:27 eldy Exp $ */ require("../main.inc.php"); @@ -347,5 +348,5 @@ $formfile->form_attach_new_file(DOL_URL_ROOT.'/admin/security_other.php',$langs- $db->close(); -llxFooter('$Date: 2011/07/31 22:23:22 $ - $Revision: 1.41 $'); +llxFooter('$Date: 2011/07/29 21:04:27 $ - $Revision: 1.40 $'); ?> diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index f478b65e3a8..a07b28bd2cf 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -14,13 +14,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/system/constall.php * \brief Page to show all Dolibarr setup (config file and database constants) - * \version $Id: constall.php,v 1.24 2011/07/31 22:23:14 eldy Exp $ + * \version $Id: constall.php,v 1.23 2011/07/30 10:23:26 eldy Exp $ */ require("../../main.inc.php"); diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 838a3ce7b97..d2d54e4a8b2 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -14,13 +14,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/system/index.php * \brief Home page of system information - * \version $Id: index.php,v 1.49 2011/07/31 22:23:14 eldy Exp $ + * \version $Id: index.php,v 1.48 2011/07/27 23:50:52 eldy Exp $ */ require("../../main.inc.php"); @@ -126,5 +127,5 @@ print '
'; print info_admin($langs->trans("SystemInfoDesc")).'
'; -llxFooter('$Date: 2011/07/31 22:23:14 $ - $Revision: 1.49 $'); +llxFooter('$Date: 2011/07/27 23:50:52 $ - $Revision: 1.48 $'); ?> diff --git a/htdocs/boxes.php b/htdocs/boxes.php index 2affdf654d3..d426e618377 100644 --- a/htdocs/boxes.php +++ b/htdocs/boxes.php @@ -22,7 +22,7 @@ * \brief File of class to manage widget boxes * \author Rodolphe Qiedeville * \author Laurent Destailleur - * \version $Id: boxes.php,v 1.54 2011/07/31 23:19:04 eldy Exp $ + * \version $Id: boxes.php,v 1.55 2011/08/01 13:26:21 hregis Exp $ */ @@ -220,7 +220,7 @@ class InfoBox { $boxname = $regs[1]; $module = $regs[2]; - $sourcefile = dol_buildpath("/".$module."/inc/boxes/".$boxname.".php"); + $sourcefile = dol_buildpath("/".$module."/includes/boxes/".$boxname.".php"); } else { @@ -281,7 +281,7 @@ class InfoBox { $boxname = $regs[1]; $module = $regs[2]; - $sourcefile = "/".$module."/inc/boxes/".$boxname.".php"; + $sourcefile = "/".$module."/includes/boxes/".$boxname.".php"; } else { diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index 1afc2d54b02..0d679c15b84 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -14,7 +14,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ require('../main.inc.php'); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 28e45b28595..05e52bded62 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -16,14 +16,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/comm/action/index.php * \ingroup agenda * \brief Home page of calendar events - * \version $Id: index.php,v 1.184 2011/07/31 22:23:20 eldy Exp $ + * \version $Id: index.php,v 1.183 2011/07/22 06:51:31 simnandez Exp $ */ require("../../main.inc.php"); @@ -785,7 +786,7 @@ $("#actionagenda_vcal_link").attr("href","/public/agenda/agendaexport.php?format '; */ -llxFooter('$Date: 2011/07/31 22:23:20 $ - $Revision: 1.184 $'); +llxFooter('$Date: 2011/07/22 06:51:31 $ - $Revision: 1.183 $'); /** diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 0c262ba2936..5ba2ef8997e 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -15,14 +15,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/compta/bank/bankid_fr.php * \ingroup banque * \brief Fiche creation compte bancaire - * \version $Id: bankid_fr.php,v 1.28 2011/07/31 22:23:20 eldy Exp $ + * \version $Id: bankid_fr.php,v 1.27 2011/07/29 20:47:35 eldy Exp $ */ require("./pre.inc.php"); @@ -385,5 +386,5 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure $db->close(); -llxFooter('$Date: 2011/07/31 22:23:20 $ - $Revision: 1.28 $'); +llxFooter('$Date: 2011/07/29 20:47:35 $ - $Revision: 1.27 $'); ?> diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 525160df9ef..9ee1f551048 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -15,14 +15,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/compta/bank/fiche.php * \ingroup banque * \brief Page to create/view a bank account - * \version $Id: fiche.php,v 1.78 2011/07/31 22:23:16 eldy Exp $ + * \version $Id: fiche.php,v 1.77 2011/07/29 20:47:35 eldy Exp $ */ require("./pre.inc.php"); @@ -607,5 +608,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 22:23:16 $ - $Revision: 1.78 $'); +llxFooter('$Date: 2011/07/29 20:47:35 $ - $Revision: 1.77 $'); ?> diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index f44ccfb4894..cfe6b3e7cdc 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -14,14 +14,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/compta/bank/rappro.php * \ingroup banque * \brief Page to reconciliate bank transactions - * \version $Id: rappro.php,v 1.68 2011/07/31 22:23:16 eldy Exp $ + * \version $Id: rappro.php,v 1.67 2011/07/26 23:16:47 eldy Exp $ */ require("./pre.inc.php"); @@ -402,5 +403,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 22:23:16 $ - $Revision: 1.68 $'); +llxFooter('$Date: 2011/07/26 23:16:47 $ - $Revision: 1.67 $'); ?> diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 79d00ae00c7..689e2639773 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -15,13 +15,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/compta/prelevement/create.php * \brief Prelevement - * \version $Id: create.php,v 1.35 2011/07/31 22:23:29 eldy Exp $ + * \version $Id: create.php,v 1.34 2011/07/29 21:15:39 eldy Exp $ */ require("../bank/pre.inc.php"); @@ -275,5 +276,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 22:23:29 $ - $Revision: 1.35 $'); +llxFooter('$Date: 2011/07/29 21:15:39 $ - $Revision: 1.34 $'); ?> diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 0cf91d64abc..b0145e14628 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -23,7 +23,7 @@ * \file htdocs/contrat/fiche.php * \ingroup contrat * \brief Page of a contract - * \version $Id: fiche.php,v 1.197 2011/07/31 23:46:54 eldy Exp $ + * \version $Id: fiche.php,v 1.198 2011/08/02 12:44:20 simnandez Exp $ */ require ("../main.inc.php"); @@ -757,7 +757,7 @@ else $var=!$var; - if ($action != 'editline' || $_GET["rowid"] != $objp->rowid) + if ($_REQUEST["action"] != 'editline' || $_GET["rowid"] != $objp->rowid) { print ''; // Libelle @@ -1286,5 +1286,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 23:46:54 $ - $Revision: 1.197 $'); +llxFooter('$Date: 2011/08/02 12:44:20 $ - $Revision: 1.198 $'); ?> diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index bf30794f153..4496c18ff1f 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -23,7 +23,7 @@ * \brief File for Tanslate class * \author Eric Seigne * \author Laurent Destailleur - * \version $Id: translate.class.php,v 1.48 2011/07/31 23:45:14 eldy Exp $ + * \version $Id: translate.class.php,v 1.49 2011/08/01 22:03:50 eldy Exp $ */ @@ -512,9 +512,10 @@ class Translate { * Return list of all available languages * @param langdir Directory to scan * @param maxlength Max length for each value in combo box (will be truncated) + * @param usecode Show code instead of country name for language variant * @return array List of languages */ - function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0) + function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0) { global $conf; @@ -527,7 +528,7 @@ class Translate { { $this->load("languages"); - if (isset($conf->global->MAIN_SHOW_LANGUAGE_CODE) && $conf->global->MAIN_SHOW_LANGUAGE_CODE) + if ($usecode || ! empty($conf->global->MAIN_SHOW_LANGUAGE_CODE)) { $langs_available[$dir] = $dir.': '.dol_trunc($this->trans('Language_'.$dir),$maxlength); } diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 3148174f5af..13a97bf54b3 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -20,14 +20,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/filefunc.inc.php * \ingroup core * \brief File that include conf.php file and functions.lib.php - * \version $Id: filefunc.inc.php,v 1.21 2011/07/31 23:19:04 eldy Exp $ + * \version $Id: filefunc.inc.php,v 1.20 2011/07/30 10:23:24 eldy Exp $ */ define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z) @@ -64,7 +65,7 @@ $conffiletoshowshort = "conf.php"; # Define localization of conf file $conffile = "conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; -# For debian/redhat like systems +# For debian like systems #$conffile = "/etc/dolibarr/conf.php"; #$conffiletoshow = "/etc/dolibarr/conf.php"; diff --git a/htdocs/includes/modules/modWorkflow.class.php b/htdocs/includes/modules/modWorkflow.class.php index 42780551928..c7bab37ad4b 100644 --- a/htdocs/includes/modules/modWorkflow.class.php +++ b/htdocs/includes/modules/modWorkflow.class.php @@ -19,7 +19,7 @@ /** * \defgroup workflow Module workflow * \brief Workflow management - * \version $Id: modWorkflow.class.php,v 1.10 2011/07/31 23:28:10 eldy Exp $ + * \version $Id: modWorkflow.class.php,v 1.11 2011/08/01 13:26:22 hregis Exp $ */ /** @@ -68,7 +68,7 @@ class modWorkflow extends DolibarrModules // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' $this->picto='technic'; - // Defined if the directory /mymodule/inc/triggers/ contains triggers or not + // Defined if the directory /mymodule/includes/triggers/ contains triggers or not $this->triggers = 1; // Data directories to create when module is enabled diff --git a/htdocs/index.php b/htdocs/index.php index f027e94a35a..5998094d362 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -14,13 +14,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/index.php * \brief Dolibarr home page - * \version $Id: index.php,v 1.200 2011/07/31 23:19:05 eldy Exp $ + * \version $Id: index.php,v 1.199 2011/07/30 10:23:24 eldy Exp $ */ define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site. @@ -573,7 +574,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) $db->close(); -llxFooter('$Date: 2011/07/31 23:19:05 $ - $Revision: 1.200 $'); +llxFooter('$Date: 2011/07/30 10:23:24 $ - $Revision: 1.199 $'); /** diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 3724ef23d95..374ebd4ebbf 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.86 2011/07/30 14:56:43 eldy Exp $ + * \version $Id: check.php,v 1.85 2011/07/30 10:23:25 eldy Exp $ */ include_once("./inc.php"); @@ -39,9 +39,7 @@ $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +if (file_exists("./install.forced.php")) include_once("./install.forced.php"); dolibarr_install_syslog("Dolibarr install/upgrade process started"); diff --git a/htdocs/install/etape0.php b/htdocs/install/etape0.php index 20ef1080e85..f11fdb322b7 100644 --- a/htdocs/install/etape0.php +++ b/htdocs/install/etape0.php @@ -22,7 +22,7 @@ * \file htdocs/install/etape0.php * \ingroup install * \brief Show and ask charset for database - * \version $Id: etape0.php,v 1.41 2011/07/30 14:56:43 eldy Exp $ + * \version $Id: etape0.php,v 1.40 2011/07/30 10:23:25 eldy Exp $ */ define('DONOTLOADCONF',1); // To avoid loading conf by file inc.php @@ -49,9 +49,7 @@ $passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:""; $main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):''; // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +if (file_exists("./install.forced.php")) include_once("./install.forced.php"); dolibarr_install_syslog("--- etape0: Entering etape0.php page"); diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 5d7fca530f2..d430b8731df 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -24,7 +24,7 @@ * \file htdocs/install/etape1.php * \ingroup install * \brief Build conf file on disk - * \version $Id: etape1.php,v 1.135 2011/07/30 14:56:42 eldy Exp $ + * \version $Id: etape1.php,v 1.134 2011/07/30 10:23:25 eldy Exp $ */ define('DONOTLOADCONF',1); // To avoid loading conf by file inc.php @@ -39,9 +39,7 @@ $langs->load("admin"); $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +if (file_exists("./install.forced.php")) include_once("./install.forced.php"); dolibarr_install_syslog("--- etape1: Entering etape1.php page"); @@ -528,7 +526,6 @@ function write_conf_file($conffile) global $dolibarr_main_url_root,$dolibarr_main_document_root,$dolibarr_main_data_root,$dolibarr_main_db_host; global $dolibarr_main_db_port,$dolibarr_main_db_name,$dolibarr_main_db_user,$dolibarr_main_db_pass; global $dolibarr_main_db_type,$dolibarr_main_db_character_set,$dolibarr_main_db_collation,$dolibarr_main_authentication; - global $conffile,$conffiletoshow,$conffiletoshowshort; $error=0; diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index d7df4ac6929..e29a0b49221 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -21,7 +21,7 @@ * \file htdocs/install/etape2.php * \ingroup install * \brief Create tables, primary keys, foreign keys, indexes and functions into database and then load reference data - * \version $Id: etape2.php,v 1.105 2011/07/30 14:56:43 eldy Exp $ + * \version $Id: etape2.php,v 1.104 2011/07/30 10:23:25 eldy Exp $ */ include("./inc.php"); @@ -54,9 +54,7 @@ if ($dolibarr_main_db_type == "pgsql") $choix=2; if ($dolibarr_main_db_type == "mssql") $choix=3; // Init "forced values" to nothing. "forced values" are used after a Doliwamp install wizard. -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +if (file_exists("./install.forced.php")) include_once("./install.forced.php"); dolibarr_install_syslog("--- etape2: Entering etape2.php page"); diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index 9a0dd0fcc43..80a2cf5f51d 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -23,7 +23,7 @@ * \file htdocs/install/etape4.php * \ingroup install * \brief Ask login and password of Dolibarr admin user - * \version $Id: etape4.php,v 1.37 2011/07/30 14:56:43 eldy Exp $ + * \version $Id: etape4.php,v 1.36 2011/07/30 10:23:25 eldy Exp $ */ @@ -41,9 +41,7 @@ $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +if (file_exists("./install.forced.php")) include_once("./install.forced.php"); dolibarr_install_syslog("--- etape4: Entering etape4.php page"); diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 0037190af06..af4df81ae1a 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -24,7 +24,7 @@ * \file htdocs/install/etape5.php * \ingroup install * \brief Last page of upgrade or install process - * \version $Id: etape5.php,v 1.106 2011/07/31 13:28:45 eldy Exp $ + * \version $Id: etape5.php,v 1.103 2011/07/30 10:23:25 eldy Exp $ */ include_once("./inc.php"); @@ -63,9 +63,12 @@ if (! isset($force_install_databasepass)) $force_install_databasepass=''; if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; if (! isset($force_install_lockinstall)) $force_install_lockinstall=''; -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +$usedoliwamp=false; +if (file_exists("./install.forced.php")) +{ + $usedoliwamp=true; + include_once("./install.forced.php"); +} dolibarr_install_syslog("--- etape5: Entering etape5.php page", LOG_INFO); @@ -102,7 +105,6 @@ if ($action == "set") */ pHeader($langs->trans("SetupEnd"),"etape5"); -print '
'; // Test if we can run a first install process if (! GETPOST("versionfrom") && ! GETPOST("versionto") && ! is_writable($conffile)) @@ -206,7 +208,7 @@ if ($action == "set" || preg_match('/upgrade/i',$action)) if (! $resql) dol_print_error($db,'Error in setup program'); $conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion; - if ($useforcedwizard) + if ($usedoliwamp) { dolibarr_install_syslog('install/etape5.php set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG); $resql=$db->query("DELETE FROM llx_const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'"); @@ -315,6 +317,7 @@ if ($action == "set") if (! empty($force_install_lockinstall)) { // Install is finished, we create the lock file + $lockfile="../../install.lock"; $fp = @fopen($lockfile, "w"); if ($fp) { @@ -364,6 +367,7 @@ elseif (preg_match('/upgrade/i',$action)) if (! empty($force_install_lockinstall)) { // Upgrade is finished, we create the lock file + $lockfile="../../install.lock"; $fp = @fopen($lockfile, "w"); if ($fp) { diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 6d19b01e197..6448a678189 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -25,7 +25,7 @@ * \file htdocs/install/fileconf.php * \ingroup install * \brief Ask all informations required to build Dolibarr htdocs/conf/conf.php file (will be wrote on disk on next page) - * \version $Id: fileconf.php,v 1.93 2011/07/30 14:56:43 eldy Exp $ + * \version $Id: fileconf.php,v 1.92 2011/07/30 10:23:25 eldy Exp $ */ include_once("./inc.php"); @@ -39,8 +39,8 @@ $langs->load("install"); $langs->load("errors"); // You can force preselected values of the config step of Dolibarr by adding a file -// install.forced.php into directory htdocs/install (This is the case with some wizard -// installer like DoliWamp, DoliMamp or DoliBuntu). +// install.forced.php into directory htdocs/install (This is the case with some installer +// lile DoliWamp, DoliMamp or DoliBuntu. // We first init "forced values" to nothing. if (! isset($force_install_noedit)) $force_install_noedit=''; if (! isset($force_install_type)) $force_install_type=''; @@ -53,9 +53,7 @@ if (! isset($force_install_databasepass)) $force_install_databasepass=''; if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin=''; if (! isset($force_install_databaserootpass)) $force_install_databaserootpass=''; // Now we load forced value from install.forced.php file. -$useforcedwizard=false; -if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } -else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } +if (file_exists("./install.forced.php")) include_once("./install.forced.php"); dolibarr_install_syslog("Fileconf: Entering fileconf.php page"); @@ -161,10 +159,7 @@ if (! empty($force_install_message)) } ?> - '; - print ''; - ?> + name="main_data_dir"> trans("WithNoSlashAtTheEnd")."
"; @@ -172,7 +167,7 @@ if (! empty($force_install_message)) print $langs->trans("Examples").":
"; ?>
    -
  • /var/lib/dolibarr/documents
  • +
  • /var/dolibarr_documents
  • C:/My Documents/dolibarr/
@@ -210,10 +205,7 @@ if (empty($dolibarr_main_url_root)) trans("URLRoot"); ?> - '; - print ''; - ?> + value=""> trans("Examples").":
"; ?>