diff --git a/build/deb/control.debian b/build/deb/control.debian index 6055a785027..7a0ba704458 100755 --- a/build/deb/control.debian +++ b/build/deb/control.debian @@ -10,8 +10,9 @@ Package: dolibarr Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, php5-mysql | php5-mysqli, php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, - ${misc:Depends}, xdg-utils, - mysql-server, perl + xdg-utils, + mysql-server, + ${misc:Depends} Recommends: apache2 | lighttpd | httpd, mysql-client Suggests: www-browser Architecture: all diff --git a/build/deb/postinst b/build/deb/postinst index e5ba6135f8d..dbfb12557d3 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -49,15 +49,16 @@ echo Run the dolibarr postinst script # Define vars docdir='/var/lib/dolibarr/documents' -#docdir='/usr/share/dolibarr/documents' 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) + + # Remove lock file + rm -f $docdir/install.lock # Create document directory for uploaded data files mkdir -p $docdir diff --git a/build/deb/postrm b/build/deb/postrm index 27ce3777b7e..031f3f70d66 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -54,10 +54,8 @@ echo Run the dolibarr postrm script docdir='/var/lib/dolibarr/documents' -#docdir='/usr/share/dolibarr/documents' -#config="/usr/share/dolibarr/htdocs/conf/conf.php" config="/etc/dolibarr/conf.php" -lockfile="/usr/share/dolibarr/install.lock" +lockfile="$docdir/install.lock" diff --git a/build/rpm/README b/build/rpm/README index 81517bcefa9..4de02aa45e5 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -11,7 +11,7 @@ with format RPM (for Redhat, OpenSuse, Mandriva, ...). # This is standard command to work on RPM packaging: # # To install all packagers tools: -# yum -y install rpmlint mock hunspell-en hunspell-es hunspell-fr hunspell-it +# yum -y install rpmlint fedora-packager mock koji hunspell-en hunspell-es hunspell-fr hunspell-it # # rpmlint file.rpm Test a package # mock -r fedora-15-i386 --rebuild ../SRPMS/hello-2.7-1.fc15.src.rpm diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 06cebcfcb2f..6829d98e847 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -154,8 +154,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf" export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf" #export config="/usr/share/dolibarr/htdocs/conf/conf.php" export config="%{_sysconfdir}/dolibarr/conf.php" -export lockfile="/usr/share/dolibarr/install.lock" - # Detect OS os='unknown'; @@ -185,6 +183,8 @@ if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -g fi echo OS detected: $os +# Remove lock file +%{__rm} -f $docdir/install.lock # Create empty directory for uploaded files and generated documents echo Create document directory $docdir @@ -223,11 +223,9 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then # semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)" #semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)" - semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr/install.lock" semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)" restorecon -R -v /etc/dolibarr #restorecon -R -v /usr/share/dolibarr - restorecon -v /usr/share/dolibarr/install.lock restorecon -R -v /var/lib/dolibarr fi @@ -288,7 +286,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf" export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf" #export config="/usr/share/dolibarr/htdocs/conf/conf.php" export config="%{_sysconfdir}/dolibarr/conf.php" -export lockfile="$targetdir/install.lock" # Detect OS @@ -345,8 +342,8 @@ echo Removed remaining $config %{__rm} -f $config echo Removed remaining $installconfig %{__rm} -f $installconfig -echo Removed remaining $lockfile -%{__rm} -f $lockfile +echo Removed remaining $docdir/install.lock +%{__rm} -f $docdir/install.lock %changelog diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 671bd69a0e4..b1f395d52b7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +23,7 @@ /** * \file htdocs/admin/modules.php * \brief Page to activate/disable all modules - * \version $Id: modules.php,v 1.157 2011/08/01 12:25:15 hregis Exp $ + * \version $Id: modules.php,v 1.159 2011/08/04 21:07:33 simnandez Exp $ */ require("../main.inc.php"); @@ -89,10 +90,10 @@ foreach ($conf->file->dol_document_root as $type => $dirroot) if ($type == 'alt') { - $althandle=@opendir($dirroot); - if (is_resource($althandle)) + $handle=@opendir($dirroot); + if (is_resource($handle)) { - while (($file = readdir($althandle))!==false) + while (($file = readdir($handle))!==false) { if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') { @@ -102,6 +103,7 @@ foreach ($conf->file->dol_document_root as $type => $dirroot) } } } + closedir($handle); } } } @@ -373,7 +375,7 @@ if ($mode != 4) else { print ''; - print img_picto($langs->trans("Activated"),'on'); + print img_picto($langs->trans("Activated"),'switch_on'); print ''."\n"; } @@ -431,7 +433,7 @@ if ($mode != 4) // Module non actif print ''; - print img_picto($langs->trans("Disabled"),'off'); + print img_picto($langs->trans("Disabled"),'switch_off'); print "\n  \n"; } @@ -472,5 +474,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/08/01 12:25:15 $ - $Revision: 1.157 $'); +llxFooter('$Date: 2011/08/04 21:07:33 $ - $Revision: 1.159 $'); ?> diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index fb6f6c0e24a..d836864b7bb 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -21,7 +21,7 @@ * \file htdocs/comm/remx.php * \ingroup societe * \brief Page to edit absolute discounts for a customer - * \version $Id: remx.php,v 1.52 2011/08/03 00:46:26 eldy Exp $ + * \version $Id: remx.php,v 1.53 2011/08/04 21:46:51 eldy Exp $ */ require("../main.inc.php"); @@ -270,7 +270,7 @@ if ($_socid > 0) print ' '.$langs->trans("Currency".$conf->monnaie).''; print ''.$langs->trans("VAT").''; print ''; - $form->select_tva('tva_tx','0','',$mysoc,''); + print $form->load_tva('tva_tx','0','',$mysoc,''); print ''; print ''.$langs->trans("NoteReason").''; print ''; @@ -538,5 +538,5 @@ if ($_socid > 0) $db->close(); -llxFooter('$Date: 2011/08/03 00:46:26 $ - $Revision: 1.52 $'); +llxFooter('$Date: 2011/08/04 21:46:51 $ - $Revision: 1.53 $'); ?> diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index b0145e14628..86c21b1378b 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.198 2011/08/02 12:44:20 simnandez Exp $ + * \version $Id: fiche.php,v 1.199 2011/08/04 21:46:51 eldy Exp $ */ require ("../main.inc.php"); @@ -875,7 +875,7 @@ else } print ''; print ''; - print $form->select_tva("eltva_tx",$objp->tva_tx,$mysoc,$object->societe); + print $form->load_tva("eltva_tx",$objp->tva_tx,$mysoc,$object->societe); print ''; print ''; print ''; @@ -1195,7 +1195,7 @@ else print ''; print ''; - $form->select_tva("tva_tx",$conf->defaulttx,$mysoc,$object->societe); + print $form->load_tva("tva_tx",-1,$mysoc,$object->societe); print ''; print ''; print ''; @@ -1286,5 +1286,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/02 12:44:20 $ - $Revision: 1.198 $'); +llxFooter('$Date: 2011/08/04 21:46:51 $ - $Revision: 1.199 $'); ?> diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index c5664164e74..8f0280a959a 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -24,7 +24,7 @@ * \ingroup core * \brief File of class to manage storage of current setup * Config is stored into file conf.php - * \version $Id: conf.class.php,v 1.64 2011/08/01 13:26:22 hregis Exp $ + * \version $Id: conf.class.php,v 1.65 2011/08/04 21:46:51 eldy Exp $ */ @@ -325,15 +325,6 @@ class Conf $this->compta->mode = 'RECETTES-DEPENSES'; // By default if (isset($this->global->COMPTA_MODE)) $this->compta->mode = $this->global->COMPTA_MODE; // Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES' - // $this->defaulttx - if (isset($this->global->FACTURE_TVAOPTION) && $this->global->FACTURE_TVAOPTION == 'franchise') - { - $this->defaulttx='0'; // Taux par defaut des factures clients - } - else { - $this->defaulttx=''; // Pas de taux par defaut des factures clients, le plus élevé sera pris - } - // $this->liste_limit = constante de taille maximale des listes if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25; $this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e24b3c7c717..d56dc9d2f51 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -30,7 +30,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.193 2011/07/31 23:45:14 eldy Exp $ + * \version $Id: html.form.class.php,v 1.194 2011/08/04 21:46:51 eldy Exp $ */ @@ -2669,11 +2669,10 @@ class Form * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu autre que transport neuf alors la TVA par defaut=TVA du produit vendu. Fin de regle. * Sinon la TVA proposee par defaut=0. Fin de regle. + * @deprecated */ function select_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='') { - // TODO size of field is too large - //print ''; print $this->load_tva($htmlname, $selectedrate, $societe_vendeuse, $societe_acheteuse, $idprod, $info_bits, $type); } @@ -2800,6 +2799,7 @@ class Form $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$idprod); $defaultnpr=get_default_npr($societe_vendeuse,$societe_acheteuse,$idprod); } + // Si taux par defaut n'a pu etre determine, on prend dernier de la liste. // Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 2347cf47f92..a9f84fe4ee1 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * $Id: freeproductline_create.tpl.php,v 1.15 2011/07/31 23:45:13 eldy Exp $ + * $Id: freeproductline_create.tpl.php,v 1.16 2011/08/04 21:46:50 eldy Exp $ * * Need to have following variables defined: * $conf @@ -46,7 +46,7 @@ select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); if (($conf->product->enabled && $conf->service->enabled) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; - + if (! empty($this->hooks)) { foreach($this->hooks as $hook) { if (! empty($hook['modules'])) { @@ -59,7 +59,7 @@ } } } - + // Editor wysiwyg require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $nbrows=ROWS_2; @@ -72,7 +72,7 @@ tva_assuj == "0") echo '0'; - else $html->select_tva('np_tva_tx', $conf->defaulttx, $seller, $buyer); + else echo $html->load_tva('np_tva_tx', -1, $seller, $buyer); ?> diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php index 4eb6b873070..701d5c2c52d 100644 --- a/htdocs/core/tpl/freeproductline_edit.tpl.php +++ b/htdocs/core/tpl/freeproductline_edit.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * $Id: freeproductline_edit.tpl.php,v 1.15 2011/07/31 23:45:11 eldy Exp $ + * $Id: freeproductline_edit.tpl.php,v 1.16 2011/08/04 21:46:50 eldy Exp $ * * Need to have following variables defined: * $conf @@ -37,7 +37,7 @@ > - + hooks)) { foreach($this->hooks as $hook) { @@ -61,7 +61,7 @@ ?> - select_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?> + load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?> diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php index 16f9813339c..09b7d7dd81e 100644 --- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * $Id: predefinedproductline_edit.tpl.php,v 1.14 2011/07/31 23:45:11 eldy Exp $ + * $Id: predefinedproductline_edit.tpl.php,v 1.15 2011/08/04 21:46:50 eldy Exp $ * * Need to have following variables defined: * $conf @@ -69,7 +69,7 @@ ?> - select_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?> + load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?> diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 3148174f5af..0bb3054197d 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -27,7 +27,7 @@ * \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.22 2011/08/04 12:07:29 eldy Exp $ */ define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z) @@ -60,6 +60,7 @@ error_reporting(E_ALL ^ E_NOTICE); //error_reporting(E_ALL); +# Define vars $conffiletoshowshort = "conf.php"; # Define localization of conf file $conffile = "conf/conf.php"; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index b977bfe42a1..cd489412845 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/fourn/commande/fiche.php * \ingroup supplier, order * \brief Card supplier order - * \version $Id: fiche.php,v 1.232 2011/07/10 20:03:40 eldy Exp $ + * \version $Id: fiche.php,v 1.233 2011/08/04 21:46:51 eldy Exp $ */ require("../../main.inc.php"); @@ -1174,7 +1174,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - $html->select_tva('tva_tx',$line->tva_tx); + print $html->load_tva('tva_tx',$line->tva_tx); print ''; print ''; print ''; @@ -1227,10 +1227,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - //if($soc->tva_assuj == "0") - //print '0'; - //else - print $html->select_tva('tva_tx',($_POST["tva_tx"]?$_POST["tva_tx"]:$conf->defaulttx),$soc,$mysoc); + print $html->load_tva('tva_tx',($_POST["tva_tx"]?$_POST["tva_tx"]:-1),$soc,$mysoc); print ''; print ''; print ''; @@ -1545,5 +1542,5 @@ if ($id > 0 || ! empty($ref)) $db->close(); -llxFooter('$Date: 2011/07/10 20:03:40 $ - $Revision: 1.232 $'); +llxFooter('$Date: 2011/08/04 21:46:51 $ - $Revision: 1.233 $'); ?> diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 2997c99350a..b6453dbba2d 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -24,7 +24,7 @@ * \file htdocs/fourn/facture/fiche.php * \ingroup facture, fournisseur * \brief Page for supplier invoice card (view, edit, validate) - * \version $Id: fiche.php,v 1.262 2011/07/31 23:57:00 eldy Exp $ + * \version $Id: fiche.php,v 1.263 2011/08/04 21:46:50 eldy Exp $ */ require("../../main.inc.php"); @@ -1114,7 +1114,7 @@ if ($_GET['action'] == 'create') print ''; print ''; print ''; - $html->select_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc); + print $html->load_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc); print ''; print ''; print ''; @@ -1549,7 +1549,7 @@ else // VAT print ''; - $html->select_tva('tauxtva',$fac->lines[$i]->tva_tx,$societe,$mysoc); + print $html->load_tva('tauxtva',$fac->lines[$i]->tva_tx,$societe,$mysoc); print ''; // Unit price @@ -1678,7 +1678,7 @@ else print ''; print ''; - print $html->select_tva('tauxtva',$conf->defaulttx,$societe,$mysoc); + print $html->load_tva('tauxtva',($_POST["tauxtva"]?$_POST["tauxtva"]:-1),$societe,$mysoc); print ''; print ''; print ''; @@ -1915,5 +1915,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 23:57:00 $ - $Revision: 1.262 $'); +llxFooter('$Date: 2011/08/04 21:46:50 $ - $Revision: 1.263 $'); ?> diff --git a/htdocs/includes/modules/modBarcode.class.php b/htdocs/includes/modules/modBarcode.class.php index 216c4363a8a..0da98992757 100644 --- a/htdocs/includes/modules/modBarcode.class.php +++ b/htdocs/includes/modules/modBarcode.class.php @@ -20,7 +20,7 @@ /** * \defgroup barcode Module barcode * \brief Module pour gerer les codes barres - * \version $Id: modBarcode.class.php,v 1.28 2011/07/31 23:28:11 eldy Exp $ + * \version $Id: modBarcode.class.php,v 1.29 2011/08/04 12:40:17 eldy Exp $ */ /** @@ -70,7 +70,9 @@ class modBarcode extends DolibarrModules // Constants // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); - $this->const = array(0=>array('GENBARCODE_LOCATION','chaine',DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/genbarcode/genbarcode','Path to genbarcode command line tool',0)); + $this->const = array( + //0=>array('GENBARCODE_LOCATION','chaine',DOL_DOCUMENT_ROOT.'/includes/barcode/php-barcode/genbarcode/genbarcode','Path to genbarcode command line tool',0) + ); // Boxes $this->boxes = array(); diff --git a/htdocs/index.php b/htdocs/index.php index f027e94a35a..adbe84b25e1 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -20,7 +20,7 @@ /** * \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.201 2011/08/04 12:07:30 eldy Exp $ */ define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site. @@ -545,8 +545,9 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { $message=''; - // Install lock missing - if (! file_exists('../install.lock') && is_dir(DOL_DOCUMENT_ROOT."/install")) + // Check if install lock file is present + $lockfile=DOL_DATA_ROOT.'/install.lock'; + if (! empty($lockfile) && ! file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { $langs->load("other"); //if (! empty($message)) $message.='
'; @@ -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/08/04 12:07:30 $ - $Revision: 1.201 $'); /** diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index c9713870c22..1365e7102eb 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -23,7 +23,7 @@ * \file htdocs/install/etape1.php * \ingroup install * \brief Build conf file on disk - * \version $Id: etape1.php,v 1.136 2011/07/31 23:26:18 eldy Exp $ + * \version $Id: etape1.php,v 1.137 2011/08/04 13:19:26 eldy Exp $ */ define('DONOTLOADCONF',1); // To avoid loading conf by file inc.php @@ -64,14 +64,14 @@ $error = 0; // Repertoire des pages dolibarr $main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):''; -// On supprime / de fin dans main_dir +// Remove last / into dans main_dir if (substr($main_dir, dol_strlen($main_dir) -1) == "/") { $main_dir = substr($main_dir, 0, dol_strlen($main_dir)-1); } -// On supprime / de fin dans main_url -if (substr($_POST["main_url"], dol_strlen($_POST["main_url"]) -1) == "/") +// Remove last / into dans main_url +if (! empty($_POST["main_url"]) && substr($_POST["main_url"], dol_strlen($_POST["main_url"]) -1) == "/") { $_POST["main_url"] = substr($_POST["main_url"], 0, dol_strlen($_POST["main_url"])-1); } diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 50fa9904890..b64f01b4b80 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -23,7 +23,7 @@ * \file htdocs/install/etape5.php * \ingroup install * \brief Last page of upgrade or install process - * \version $Id: etape5.php,v 1.107 2011/07/31 23:26:19 eldy Exp $ + * \version $Id: etape5.php,v 1.108 2011/08/04 12:07:30 eldy Exp $ */ include_once("./inc.php"); @@ -314,7 +314,8 @@ if ($action == "set") if (! empty($force_install_lockinstall)) { // Install is finished, we create the lock file - $fp = @fopen($lockfile, "w"); + $lockfile=DOL_DATA_ROOT.'/install.lock'; + $fp = @fopen($lockfile, "w"); if ($fp) { if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility @@ -363,7 +364,8 @@ elseif (preg_match('/upgrade/i',$action)) if (! empty($force_install_lockinstall)) { // Upgrade is finished, we create the lock file - $fp = @fopen($lockfile, "w"); + $lockfile=DOL_DATA_ROOT.'/install.lock'; + $fp = @fopen($lockfile, "w"); if ($fp) { if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 223a2eb6d92..039d8c8b67b 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -21,7 +21,7 @@ /** \file htdocs/install/inc.php * \ingroup core * \brief File that define environment for install pages - * \version $Id: inc.php,v 1.137 2011/07/31 23:26:18 eldy Exp $ + * \version $Id: inc.php,v 1.138 2011/08/04 12:07:30 eldy Exp $ */ define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z) @@ -70,16 +70,15 @@ else $includeconferror=''; +# Define vars $conffiletoshowshort = "conf.php"; # Define localization of conf file $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; -$lockfile = '../../install.lock'; # For debian/redhat like systems #$conffile = "/etc/dolibarr/conf.php"; #$conffiletoshow = "/etc/dolibarr/conf.php"; -#$lockfile = '/etc/dolibarr/install.lock'; # Web has no permission to write here -$lockfile = '../../install.lock'; + if (! defined('DONOTLOADCONF') && file_exists($conffile)) { @@ -128,7 +127,6 @@ if (! defined('DONOTLOADCONF') && file_exists($conffile)) } $conf->global->MAIN_LOGTOHTML=1; - // Define prefix if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_'; define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:'')); @@ -179,6 +177,7 @@ if (preg_match('/install.lock/i',$_SERVER["SCRIPT_FILENAME"])) } exit; } +$lockfile=DOL_DATA_ROOT.'/install.lock'; if (file_exists($lockfile)) { print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).
'; diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 24252ef481f..6f3c17c0b42 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -1135,6 +1135,7 @@ BarcodeDescUPC=Codis de barra tipus UPC BarcodeDescISBN=Codis de barra tipus ISBN BarcodeDescC39=Codis de barra tipus C39 BarcodeDescC128=Codis de barra tipus C128 +NoActivatedBarcode=Cap tipus de codi de barres activat ##### Prelevements ##### WithdrawalsSetup=Configuració del mòdul domiciliacions ##### ExternalRSS ##### diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 80a5580d383..93d52d908bb 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1125,6 +1125,7 @@ BarcodeDescUPC=Barcode of type UPC BarcodeDescISBN=Barcode of type ISBN BarcodeDescC39=Barcode of type C39 BarcodeDescC128=Barcode of type C128 +NoActivatedBarcode=No barcode type activated ##### Prelevements ##### WithdrawalsSetup=Withdrawal module setup ##### ExternalRSS ##### diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index c4ea6eac339..f23546093cc 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1135,6 +1135,7 @@ BarcodeDescUPC=Códigos de barra tipo UPC BarcodeDescISBN=Códigos de barra tipo ISBN BarcodeDescC39=Códigos de barra tipo C39 BarcodeDescC128=Códigos de barra tipo C128 +NoActivatedBarcode=Ningún tipo de código de barra activado ##### Prelevements ##### WithdrawalsSetup=Configuración del módulo domiciliaciones ##### ExternalRSS ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index bc58c85a93c..cf5125b4653 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1137,6 +1137,7 @@ BarcodeDescUPC= code-barres de type UPC BarcodeDescISBN= code-barres de type ISBN BarcodeDescC39= code-barres de type C39 BarcodeDescC128= code-barres de type C128 +NoActivatedBarcode=Aucun type de code bar activé ##### Prelevements ##### WithdrawalsSetup= Configuration du module prélèvement ##### ExternalRSS ##### diff --git a/htdocs/lib/databases/mssql.lib.php b/htdocs/lib/databases/mssql.lib.php index 9328e2cb852..b99a1678444 100644 --- a/htdocs/lib/databases/mssql.lib.php +++ b/htdocs/lib/databases/mssql.lib.php @@ -21,7 +21,7 @@ /** * \file htdocs/lib/databases/mssql.lib.php * \brief Fichier de la classe permettant de gerer une base mssql - * \version $Id: mssql.lib.php,v 1.86 2011/07/31 23:26:03 eldy Exp $ + * \version $Id: mssql.lib.php,v 1.87 2011/08/04 13:58:14 eldy Exp $ */ // Pour compatibilite lors de l'upgrade @@ -1022,14 +1022,24 @@ class DoliDb return ''; // attente debugage } + /* + * Return full path of dump program + * @return string Full path of dump program + */ function getPathOfDump() { + return ''; } + /** + * Return full path of restore program + * @return string Full path of restore program + */ function getPathOfRestore() { + return ''; } } diff --git a/htdocs/lib/databases/mysql.lib.php b/htdocs/lib/databases/mysql.lib.php index bccac28c77e..d7d36383a24 100644 --- a/htdocs/lib/databases/mysql.lib.php +++ b/htdocs/lib/databases/mysql.lib.php @@ -22,7 +22,7 @@ /** * \file htdocs/lib/databases/mysql.lib.php * \brief Class file to manage Dolibarr database access for a Mysql database - * \version $Id: mysql.lib.php,v 1.119 2011/07/31 23:26:03 eldy Exp $ + * \version $Id: mysql.lib.php,v 1.121 2011/08/04 13:58:55 eldy Exp $ */ // For compatibility during upgrade if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..'); @@ -1144,8 +1144,8 @@ class DoliDb } /** - * \brief Return full path of dump program - * \return string Full path of dump program + * Return full path of dump program + * @return string Full path of dump program */ function getPathOfDump() { @@ -1156,7 +1156,7 @@ class DoliDb { $liste=$this->fetch_array($resql); $basedir=$liste['Value']; - $fullpathofdump=$basedir.'bin/mysqldump'; + $fullpathofdump=$basedir.(preg_match('/\/$/',$basedir)?'':'/').'bin/mysqldump'; } return $fullpathofdump; } @@ -1174,7 +1174,7 @@ class DoliDb { $liste=$this->fetch_array($resql); $basedir=$liste['Value']; - $fullpathofimport=$basedir.'bin/mysql'; + $fullpathofimport=$basedir.(preg_match('/\/$/',$basedir)?'':'/').'bin/mysql'; } return $fullpathofimport; } diff --git a/htdocs/lib/databases/mysqli.lib.php b/htdocs/lib/databases/mysqli.lib.php index 7aaba18459e..5ca31f120bb 100644 --- a/htdocs/lib/databases/mysqli.lib.php +++ b/htdocs/lib/databases/mysqli.lib.php @@ -22,7 +22,7 @@ /** * \file htdocs/lib/databases/mysqli.lib.php * \brief Class file to manage Dolibarr database access for a Mysql database - * \version $Id: mysqli.lib.php,v 1.113 2011/07/31 23:26:03 eldy Exp $ + * \version $Id: mysqli.lib.php,v 1.115 2011/08/04 13:58:55 eldy Exp $ */ // For compatibility during upgrade @@ -1155,8 +1155,8 @@ class DoliDb } /** - * \brief Return full path of dump program - * \return string Full path of dump program + * Return full path of dump program + * @return string Full path of dump program */ function getPathOfDump() { @@ -1167,14 +1167,14 @@ class DoliDb { $liste=$this->fetch_array($resql); $basedir=$liste['Value']; - $fullpathofdump=$basedir.'bin/mysqldump'; + $fullpathofdump=$basedir.(preg_match('/\/$/',$basedir)?'':'/').'bin/mysqldump'; } return $fullpathofdump; } /** - * \brief Return full path of restore program - * \return string Full path of restore program + * Return full path of restore program + * @return string Full path of restore program */ function getPathOfRestore() { @@ -1185,7 +1185,7 @@ class DoliDb { $liste=$this->fetch_array($resql); $basedir=$liste['Value']; - $fullpathofimport=$basedir.'bin/mysql'; + $fullpathofimport=$basedir.(preg_match('/\/$/',$basedir)?'':'/').'bin/mysql'; } return $fullpathofimport; } diff --git a/htdocs/lib/databases/pgsql.lib.php b/htdocs/lib/databases/pgsql.lib.php index 4e1a249b429..d9c9676d74e 100644 --- a/htdocs/lib/databases/pgsql.lib.php +++ b/htdocs/lib/databases/pgsql.lib.php @@ -23,7 +23,7 @@ /** * \file htdocs/lib/databases/pgsql.lib.php * \brief Fichier de la classe permettant de gerer une base pgsql - * \version $Id: pgsql.lib.php,v 1.110 2011/07/31 23:26:03 eldy Exp $ + * \version $Id: pgsql.lib.php,v 1.111 2011/08/04 13:58:14 eldy Exp $ */ // For compatibility during upgrade if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..'); @@ -1233,8 +1233,8 @@ class DoliDb } /** - * \brief Return full path of dump program - * \return string Full path of dump program + * Return full path of dump program + * @return string Full path of dump program */ function getPathOfDump() { @@ -1259,10 +1259,10 @@ class DoliDb return $fullpathofdump; } - /** - * \brief Return full path of restore program - * \return string Full path of restore program - */ + /** + * Return full path of restore program + * @return string Full path of restore program + */ function getPathOfRestore() { $fullpathofdump='/pathtopgrestore/pg_restore'; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 2209b8777e3..2b56ceabceb 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -28,7 +28,7 @@ * \file htdocs/lib/functions.lib.php * \brief A set of functions for Dolibarr * This file contains all frequently used functions. - * \version $Id: functions.lib.php,v 1.549 2011/07/31 23:25:25 eldy Exp $ + * \version $Id: functions.lib.php,v 1.552 2011/08/04 22:01:23 eldy Exp $ */ // For compatibility during upgrade @@ -1639,6 +1639,7 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0) global $conf; if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; if ($pictoisfullpath) return ''.dol_escape_htmltag($alt).''; + if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/'.$picto)) return ''.dol_escape_htmltag($alt).''; return ''.dol_escape_htmltag($alt).''; } @@ -3148,14 +3149,24 @@ function get_default_tva($societe_vendeuse, $societe_acheteuse, $idprod=0) dol_syslog("get_default_tva: seller use vat=".$societe_vendeuse->tva_assuj.", seller country=".$societe_vendeuse->pays_code.", seller in cee=".$societe_vendeuse->isInEEC().", buyer country=".$societe_acheteuse->pays_code.", buyer in cee=".$societe_acheteuse->isInEEC().", idprod=".$idprod.", SERVICE_ARE_ECOMMERCE_200238EC=".$conf->global->SERVICES_ARE_ECOMMERCE_200238EC); // Si vendeur non assujeti a TVA (tva_assuj vaut 0/1 ou franchise/reel) - if (is_numeric($societe_vendeuse->tva_assuj) && ! $societe_vendeuse->tva_assuj) return 0; - if (! is_numeric($societe_vendeuse->tva_assuj) && $societe_vendeuse->tva_assuj=='franchise') return 0; + if (is_numeric($societe_vendeuse->tva_assuj) && ! $societe_vendeuse->tva_assuj) + { + //print 'VATRULE 1'; + return 0; + } + if (! is_numeric($societe_vendeuse->tva_assuj) && $societe_vendeuse->tva_assuj=='franchise') + { + //print 'VATRULE 2'; + return 0; + } - // Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle. //if (is_object($societe_acheteuse) && ($societe_vendeuse->pays_id == $societe_acheteuse->pays_id) && ($societe_acheteuse->tva_assuj == 1 || $societe_acheteuse->tva_assuj == 'reel')) // Le test ci-dessus ne devrait pas etre necessaire. Me signaler l'exemple du cas juridique concerne si le test suivant n'est pas suffisant. - if ($societe_vendeuse->pays_code == $societe_acheteuse->pays_code) // Warning ->pays_id not always defined + + // Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle. + if ($societe_vendeuse->pays_code == $societe_acheteuse->pays_code) // Warning ->pays_code not always defined { + //print 'VATRULE 3'; return get_product_vat_for_country($idprod,$societe_vendeuse->pays_code); } @@ -3169,10 +3180,12 @@ function get_default_tva($societe_vendeuse, $societe_acheteuse, $idprod=0) $isacompany=$societe_acheteuse->isACompany(); if ($isacompany) { + //print 'VATRULE 4'; return 0; } else { + //print 'VATRULE 5'; return get_product_vat_for_country($idprod,$societe_vendeuse->pays_code); } } @@ -3184,12 +3197,14 @@ function get_default_tva($societe_vendeuse, $societe_acheteuse, $idprod=0) //print "eee".$societe_acheteuse->isACompany();exit; if (! $societe_vendeuse->isInEEC() && $societe_acheteuse->isInEEC() && ! $societe_acheteuse->isACompany()) { + //print 'VATRULE 6'; return get_product_vat_for_country($idprod,$societe_acheteuse->pays_code); } } // Sinon la TVA proposee par defaut=0. Fin de regle. // Rem: Cela signifie qu'au moins un des 2 est hors Communaute europeenne et que le pays differe + //print 'VATRULE 7'; return 0; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8bccf934120..de7eb9ed069 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -24,7 +24,7 @@ * \file htdocs/product/class/product.class.php * \ingroup produit * \brief Fichier de la classe des produits predefinis - * \version $Id: product.class.php,v 1.48 2011/07/31 23:24:03 eldy Exp $ + * \version $Id: product.class.php,v 1.49 2011/08/04 21:46:51 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); @@ -2861,7 +2861,7 @@ class Product extends CommonObject $this->tpl['price_base_type'] = $html->load_PriceBaseType($this->price_base_type, "price_base_type"); // VAT - $this->tpl['tva_tx'] = $html->load_tva("tva_tx",$conf->defaulttx,$mysoc,''); + $this->tpl['tva_tx'] = $html->load_tva("tva_tx",-1,$mysoc,''); } if ($action == 'create' || $action == 'edit') diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index efbd289cb3f..c0b9dfabb70 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/product/fiche.php * \ingroup product * \brief Page to show product - * \version $Id: fiche.php,v 1.374 2011/07/31 23:19:26 eldy Exp $ + * \version $Id: fiche.php,v 1.375 2011/08/04 21:46:50 eldy Exp $ */ require("../main.inc.php"); @@ -793,7 +793,7 @@ if ($action == 'create' && ($user->rights->produit->creer || $user->rights->serv // VAT print ''.$langs->trans("VATRate").''; - print $html->select_tva("tva_tx",$conf->defaulttx,$mysoc,''); + print $html->load_tva("tva_tx",-1,$mysoc,''); print ''; print ''; @@ -1645,6 +1645,6 @@ if ($product->id && $action == '' && $product->status) $db->close(); -llxFooter('$Date: 2011/07/31 23:19:26 $ - $Revision: 1.374 $'); +llxFooter('$Date: 2011/08/04 21:46:50 $ - $Revision: 1.375 $'); ?> diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 2ddb4aecbd2..a4cda019993 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -23,7 +23,7 @@ * \file htdocs/product/price.php * \ingroup product * \brief Page to show product prices - * \version $Id: price.php,v 1.110 2011/07/31 23:19:25 eldy Exp $ + * \version $Id: price.php,v 1.111 2011/08/04 21:46:50 eldy Exp $ */ require("../main.inc.php"); @@ -317,7 +317,7 @@ if ($_GET["action"] == 'edit_price' && ($user->rights->produit->creer || $user-> // VAT print ''.$langs->trans("VATRate").''; - print $html->select_tva("tva_tx",$product->tva_tx,$mysoc,'',$product->id); + print $html->load_tva("tva_tx",$product->tva_tx,$mysoc,'',$product->id); print ''; // Price base @@ -377,7 +377,7 @@ if ($_GET["action"] == 'edit_price' && ($user->rights->produit->creer || $user-> if ($i == 1) { print ''.$langs->trans("VATRate").''; - print $html->select_tva("tva_tx_".$i,$product->multiprices_tva_tx["$i"],$mysoc,'',$product->id); + print $html->load_tva("tva_tx_".$i,$product->multiprices_tva_tx["$i"],$mysoc,'',$product->id); print ''; } else @@ -534,5 +534,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 23:19:25 $ - $Revision: 1.110 $'); +llxFooter('$Date: 2011/08/04 21:46:50 $ - $Revision: 1.111 $'); ?>