cvsimport

This commit is contained in:
Laurent Destailleur 2011-08-04 22:01:23 +00:00
commit ff2057ae98
33 changed files with 137 additions and 116 deletions

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* 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 '<a href="modules.php?id='.$objMod->numero.'&amp;action=reset&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Activated"),'on');
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>'."\n";
}
@ -431,7 +433,7 @@ if ($mode != 4)
// Module non actif
print '<a href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Disabled"),'off');
print img_picto($langs->trans("Disabled"),'switch_off');
print "</a></td>\n <td>&nbsp;</td>\n";
}
@ -472,5 +474,5 @@ print '</div>';
$db->close();
llxFooter('$Date: 2011/08/01 12:25:15 $ - $Revision: 1.157 $');
llxFooter('$Date: 2011/08/04 21:07:33 $ - $Revision: 1.159 $');
?>

View File

@ -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 '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'">&nbsp;'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
print '<td>';
$form->select_tva('tva_tx','0','',$mysoc,'');
print $form->load_tva('tva_tx','0','',$mysoc,'');
print '</td></tr>';
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
@ -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 $');
?>

View File

@ -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 '<textarea name="eldesc" cols="70" rows="1">'.$objp->description.'</textarea></td>';
print '<td align="right">';
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 '</td>';
print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>';
@ -1195,7 +1195,7 @@ else
print '<td><textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea></td>';
print '<td>';
$form->select_tva("tva_tx",$conf->defaulttx,$mysoc,$object->societe);
print $form->load_tva("tva_tx",-1,$mysoc,$object->societe);
print '</td>';
print '<td align="right"><input type="text" class="flat" size="4" name="pu" value=""></td>';
print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>';
@ -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 $');
?>

View File

@ -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;

View File

@ -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 '<script>jQuery(function() { jQuery( "#'.$htmlname.'" ).combobox(); });</script>';
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)

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $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 @@
<?php
echo $html->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 '<br>';
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 @@
<td align="right">
<?php
if ($buyer->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
else $html->select_tva('np_tva_tx', $conf->defaulttx, $seller, $buyer);
else echo $html->load_tva('np_tva_tx', -1, $seller, $buyer);
?>
</td>
<td align="right"><input type="text" size="5" name="np_price"></td>

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $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 @@
<tr <?php echo $bc[$var]; ?>>
<td>
<a name="<?php echo $line->id; ?>"></a>
<?php
if (! empty($this->hooks)) {
foreach($this->hooks as $hook) {
@ -61,7 +61,7 @@
?>
</td>
<td align="right"><?php echo $html->select_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?></td>
<td align="right"><?php echo $html->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,0,$line->info_bits,$line->product_type); ?></td>
<td align="right"><input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>"></td>

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $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 @@
?>
</td>
<td align="right"><?php echo $html->select_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?></td>
<td align="right"><?php echo $html->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?></td>
<td align="right"><input size="6" type="text" class="flat" name="subprice" value="<?php echo price($line->subprice,0,'',0); ?>"></td>

View File

@ -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";

View File

@ -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 '</td>';
print '<td>';
$html->select_tva('tva_tx',$line->tva_tx);
print $html->load_tva('tva_tx',$line->tva_tx);
print '</td>';
print '<td align="right"><input size="5" type="text" name="pu" value="'.price($line->subprice).'"></td>';
print '<td align="right"><input size="2" type="text" name="qty" value="'.$line->qty.'"></td>';
@ -1227,10 +1227,7 @@ if ($id > 0 || ! empty($ref))
print '</td>';
print '<td align="center">';
//if($soc->tva_assuj == "0")
//print '<input type="hidden" name="tva_tx" value="0">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 '</td>';
print '<td align="right"><input type="text" name="pu" size="5" value="'.$_POST["pu"].'"></td>';
print '<td align="right"><input type="text" name="qty" value="'.($_POST["qty"]?$_POST["qty"]:'1').'" size="2"></td>';
@ -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 $');
?>

View File

@ -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 '<td><input size="50" name="label'.$i.'" value="'.$value_label.'" type="text"></td>';
print '<td align="right"><input type="text" size="8" name="amount'.$i.'" value="'.$value_pu.'"></td>';
print '<td align="right">';
$html->select_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc);
print $html->load_tva('tauxtva'.$i,$value_tauxtva,$societe,$mysoc);
print '</td>';
print '<td align="right"><input type="text" size="3" name="qty'.$i.'" value="'.$value_qty.'"></td>';
print '<td align="right"><input type="text" size="8" name="amountttc'.$i.'" value=""></td></tr>';
@ -1549,7 +1549,7 @@ else
// VAT
print '<td align="right">';
$html->select_tva('tauxtva',$fac->lines[$i]->tva_tx,$societe,$mysoc);
print $html->load_tva('tauxtva',$fac->lines[$i]->tva_tx,$societe,$mysoc);
print '</td>';
// Unit price
@ -1678,7 +1678,7 @@ else
print '</td>';
print '<td align="right">';
print $html->select_tva('tauxtva',$conf->defaulttx,$societe,$mysoc);
print $html->load_tva('tauxtva',($_POST["tauxtva"]?$_POST["tauxtva"]:-1),$societe,$mysoc);
print '</td>';
print '<td align="right">';
print '<input size="4" name="amount" type="text">';
@ -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 $');
?>

View File

@ -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();

View File

@ -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.='<br>';
@ -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 $');
/**

View File

@ -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);
}

View File

@ -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

View File

@ -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).<br>';

View File

@ -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 #####

View File

@ -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 #####

View File

@ -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 #####

View File

@ -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 #####

View File

@ -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 '';
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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';

View File

@ -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 '<img src="'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/'.$picto)) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
return '<img src="'.DOL_URL_ROOT.'/theme/common/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
}
@ -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;
}

View File

@ -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')

View File

@ -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 '<tr><td width="20%">'.$langs->trans("VATRate").'</td><td>';
print $html->select_tva("tva_tx",$conf->defaulttx,$mysoc,'');
print $html->load_tva("tva_tx",-1,$mysoc,'');
print '</td></tr>';
print '</table>';
@ -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 $');
?>

View File

@ -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 '<tr><td>'.$langs->trans("VATRate").'</td><td>';
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 '</td></tr>';
// Price base
@ -377,7 +377,7 @@ if ($_GET["action"] == 'edit_price' && ($user->rights->produit->creer || $user->
if ($i == 1)
{
print '<tr><td>'.$langs->trans("VATRate").'</td><td>';
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 '</td></tr>';
}
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 $');
?>