2
0
forked from Wavyzz/dolibarr

Compare commits

...

107 Commits
3.8.3 ... 3.7

Author SHA1 Message Date
Laurent Destailleur
847616ae82 Fix error management 2021-12-02 14:00:47 +01:00
Laurent Destailleur
ceb1e699b7 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2020-01-10 19:37:16 +01:00
Laurent Destailleur
c028819cab FIX clone of purchase order 2020-01-10 19:35:49 +01:00
Laurent Destailleur
94bb1ac511 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2018-11-10 12:49:22 +01:00
Laurent Destailleur
8893d8d59f Fix compatiblity with new version of PHP 2018-11-10 11:56:23 +01:00
Laurent Destailleur
e61bcd03ed Fix travis 2017-09-16 13:03:27 +02:00
Laurent Destailleur
3295498e9e Remove code comment 2017-09-16 12:50:34 +02:00
Laurent Destailleur
c53aef9955 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-08-22 10:51:30 +02:00
Laurent Destailleur
a18995d3dc Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-08-22 10:47:47 +02:00
Laurent Destailleur
6fb0fc7b71 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-06-19 19:42:56 +02:00
Laurent Destailleur
f694939fc7 Fix migration with pgsql 2017-06-19 19:39:37 +02:00
Laurent Destailleur
1bfdc7438a Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-06-19 04:03:26 +02:00
Regis Houssin
9352ecca1f Fix: PHP 7 - Fatal error: 'break' not in the 'loop' or 'switch' context 2017-06-19 04:01:34 +02:00
Laurent Destailleur
5439390461 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-06-19 02:57:12 +02:00
Laurent Destailleur
6fc4dacd42 Fix migration opensurvey 2017-06-19 02:55:33 +02:00
Laurent Destailleur
73f0159578 Fix phpunit 2016-11-06 14:08:55 +01:00
Laurent Destailleur
3d8722ee69 FIX #2853 2016-09-12 02:19:25 +02:00
Laurent Destailleur
acc8cca84a Merge pull request #5290 from atm-ph/fix_3.7_issue_2777
Fix #2777
2016-06-04 18:07:16 +02:00
phf
a62f5bd5b4 Fix #2777 2016-06-04 17:17:22 +02:00
Laurent Destailleur
1552e7f41f Merge pull request #5286 from atm-ph/fix_3.7_call_function_not_exists
Fix call function ldap_connect but not exists
2016-06-04 14:56:42 +02:00
phf
8ccda16ef3 Fix call function ldap_connect but not exists 2016-06-04 14:50:32 +02:00
Laurent Destailleur
0735413e7c Merge pull request #5101 from altatof/fix_fournprice_select
FIX: end of select when no fournprice
2016-04-29 20:36:44 +02:00
Laurent Destailleur
b0b1056a44 Merge pull request #5121 from fmarcet/3.7
Fix: Not filtering correctly on supplier invoice's list
2016-04-29 17:19:15 +02:00
Laurent Destailleur
211d217f8c Merge remote-tracking branch 'origin/3.6' into 3.7 2016-04-29 15:13:27 +02:00
Laurent Destailleur
2a27fe02eb Fix detection if tag already exists 2016-04-29 15:12:58 +02:00
Ferran Marcet
7380676717 Fix: Not filtering correctly on supplier invoice's list 2016-04-28 10:25:55 +02:00
Christophe Battarel
2a0c508d47 FIX: end of select when no fournprice 2016-04-25 11:26:13 +02:00
Laurent Destailleur
68e96b98c5 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
2016-04-22 20:02:34 +02:00
Laurent Destailleur
7f5670cb26 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	ChangeLog
2016-04-22 19:49:27 +02:00
Juanjo Menent
88ff138cd5 Merge pull request #5016 from simnandez/3.7
FIX #3815 With higher quality
2016-04-15 16:07:22 +02:00
Juanjo Menent
9f4ccfab95 FIX #3815 With higher quality 2016-04-15 15:54:51 +02:00
Juanjo Menent
e33d9eb5b4 Merge pull request #5010 from simnandez/3.7
FIX #3815 Call to undefined function local_by_date(). branch 3.7
2016-04-15 13:07:29 +02:00
Juanjo Menent
2d3b2c08b5 FIX #3815 Call to undefined function local_by_date(). branch 3.7 2016-04-15 10:56:03 +02:00
Laurent Destailleur
d0e3d9db76 Merge pull request #4992 from altatof/fix_minimum_buying_price
FIX: correct display of minimum buying price
2016-04-11 19:17:09 +02:00
Laurent Destailleur
4d14f3e6f2 Merge pull request #4983 from marcosgdf/bug-4442
FIX #4442 Missing translation in Banks menu
2016-04-11 18:59:03 +02:00
Christophe Battarel
292373cf84 forgot new discount field 2016-04-11 17:43:10 +02:00
Christophe Battarel
983b2c9a21 FIX: real min buying price 2016-04-11 17:40:47 +02:00
Christophe Battarel
791df0c9ea FIX: correct display of minimum buying price 2016-04-11 17:27:34 +02:00
Juanjo Menent
be0b7c86ff Merge pull request #4985 from marcosgdf/bug-4742
FIX #4742 Able to delete a supplier invoice with a registered payment
2016-04-10 11:52:21 +02:00
Juanjo Menent
3dbaa38cb4 Merge pull request #4979 from marcosgdf/bug-4748
FIX #4748 Supplier invoice payment confirmation amount is not translated
2016-04-10 11:51:07 +02:00
Marcos García de La Fuente
af473df214 FIX #4742 Able to delete a supplier invoice with a registered payment
Close #4742
2016-04-09 23:29:19 +02:00
Marcos García de La Fuente
b9de3d5852 FIX #4442 Missing translation in Banks menu
Close #4442
2016-04-09 23:03:00 +02:00
Marcos García de La Fuente
1026484da1 FIX #4748 Supplier invoice payment confirmation amount is not translated
Close #4748
2016-04-09 22:48:42 +02:00
Laurent Destailleur
b5dfa2e446 Merge pull request #4975 from frederic34/patch-7
FIX re-establish user-agent when using nusoap client
2016-04-09 19:35:31 +02:00
Frédéric FRANCE
f90cffd74a Update nusoap.php
re-establish user-agent
2016-04-09 15:42:53 +02:00
Laurent Destailleur
6a4ca98ad9 Merge pull request #4908 from altatof/fix_bad_rounding
FIX: systematic rounding causes prices to be updated without reason
2016-04-04 00:18:18 +02:00
Juanjo Menent
deeb6f604d Merge pull request #4905 from altatof/fix_margin_display
FIX: dont retrieve new buying price on margin display
2016-04-03 16:17:41 +02:00
Christophe Battarel
024f55d461 FIX: systematic rounding causes prices to be updated without reason 2016-03-29 12:02:36 +02:00
Christophe Battarel
b8f3264f60 FIX: dont retrieve new buying price on margin display 2016-03-29 11:37:35 +02:00
Laurent Destailleur
444fce0bd9 Prepare 3.7.4 2016-03-11 18:34:05 +01:00
Laurent Destailleur
e669dac398 Prepare 3.6.7 2016-03-11 18:28:39 +01:00
Laurent Destailleur
32d0f9a8d7 Prepare 3.6.7 2016-03-11 18:27:04 +01:00
Laurent Destailleur
a45ffeecca Missing changelog 2016-03-11 18:21:57 +01:00
Laurent Destailleur
ad3bd2c339 Merge pull request #4713 from marcosgdf/bug-4414
FIX #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
2016-03-02 20:56:34 +01:00
Marcos García de La Fuente
7d336bd5d4 FIX #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
Close #4414
2016-03-02 11:43:55 +01:00
Laurent Destailleur
a9aab7545e Merge pull request #4575 from altatof/fix_ttc_display
FIX: add missing global def for ttc column
2016-02-15 00:14:34 +01:00
Laurent Destailleur
04b390f21c Merge pull request #4507 from altatof/PROPAL_CLONE_ON_CREATE_PAGE
FIX ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant
2016-02-14 21:59:04 +01:00
Laurent Destailleur
13c85516ee Doc comment 2016-02-14 21:58:54 +01:00
Christophe Battarel
7a6c7f10a6 FIX: add missing global def for ttc column 2016-02-05 19:14:40 +01:00
fmarcet
d6cda60ed1 FIX: Check stock of product by warehouse if $entrepot_id defined on shippings 2016-02-01 13:40:02 +01:00
fmarcet
acc9879c7c FIX: It doesn't check if there is enough stock to update the lines of orders/invoices 2016-02-01 13:05:14 +01:00
Laurent Destailleur
0076512d5b Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-31 21:26:52 +01:00
Laurent Destailleur
1b23ede857 Merge remote-tracking branch 'origin/3.5' into 3.6 2016-01-31 21:26:28 +01:00
Laurent Destailleur
d9e089256e Fix path to copyrighted files 2016-01-31 16:16:46 +01:00
Laurent Destailleur
c9661ee20e Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-30 15:57:09 +01:00
Laurent Destailleur
b27e31b3ae Merge pull request #4483 from marcosgdf/bug-4440-3
Corrected typo of PR #4444
2016-01-30 12:20:50 +01:00
Laurent Destailleur
2e7d88dffb Merge pull request #4499 from fmarcet/3.7
FIX: Contrat card don't consider user permissions to show active/unactive service button
2016-01-30 12:12:42 +01:00
Christophe Battarel
1baf25de3c FIX ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden
constant
2016-01-27 12:04:00 +01:00
fmarcet
c2efee8a29 FIX: Contrat card don't consider user permissions to show active/unactive service button 2016-01-26 13:02:21 +01:00
Laurent Destailleur
feb114625d Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-25 15:37:55 +01:00
Laurent Destailleur
c1b6630c16 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/main.inc.php
2016-01-25 15:37:04 +01:00
Raphaël Doursenaud
ed16699de6 FIX #4291 Correctly filter external calendar GETPOSTs 2016-01-25 15:32:08 +01:00
Laurent Destailleur
0814fa76f8 FIX CVE CVE-2015-8685 2016-01-25 15:26:52 +01:00
Marcos García de La Fuente
83263e242e Corrected typo of PR #4444 2016-01-23 20:32:22 +01:00
Laurent Destailleur
9be246baa5 Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-23 11:32:06 +01:00
Laurent Destailleur
9fd56df03f Merge pull request #4444 from marcosgdf/bug-4440-2
FIX #4440 Wrong price is filled by Product::fetch into multiprices arrays
2016-01-22 03:47:22 +01:00
Laurent Destailleur
9d63cb0156 Merge pull request #4452 from hregis/3.7_bug
Fix: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9)
2016-01-22 03:45:35 +01:00
Regis Houssin
535d3bc087 Merge remote-tracking branch 'origin/3.7' into 3.7_bug 2016-01-18 13:04:08 +01:00
Marcos García de La Fuente
da637db162 FIX #4440 Wrong price is filled by Product::fetch into multiprices arrays 2016-01-18 10:17:59 +01:00
Regis Houssin
6e30d5e516 Merge remote-tracking branch 'origin/3.7' into 3.7_bug 2016-01-15 13:16:40 +01:00
Regis Houssin
6aeb18ed75 Revert "Fix: for avoid division by 0"
This reverts commit c71d578931.
2016-01-15 13:14:55 +01:00
Regis Houssin
905f9d78ed Fix: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9) 2016-01-15 13:12:19 +01:00
Laurent Destailleur
947f718329 Merge pull request #4408 from fmarcet/3.7
FIX: The third dashboard don't consider user permissions
2016-01-12 23:23:49 +01:00
fmarcet
79992b4947 FIX: The third dashboard don't consider user permissions 2016-01-12 11:34:50 +01:00
Laurent Destailleur
861376e461 Merge branch '3.7' of github.com:Dolibarr/dolibarr into 3.7 2016-01-10 18:49:11 +01:00
Laurent Destailleur
801e2bca4b Fix #4239 2016-01-10 18:42:35 +01:00
Laurent Destailleur
40f0d0c9f2 Merge pull request #4321 from fmarcet/3.7
FIX: Email templates not compatible with Multicompany
2016-01-10 11:49:37 +01:00
Laurent Destailleur
e008922919 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/admin/agenda_extsites.php
2016-01-08 14:45:53 +01:00
Laurent Destailleur
5414cb6f12 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2016-01-08 14:43:20 +01:00
Laurent Destailleur
a26a6c2449 Fix sql injection even when code is on several lines 2016-01-08 14:43:04 +01:00
Laurent Destailleur
c2b8be9aaf Merge pull request #4355 from GPCsolutions/3.6-4291
FIX #4291 Correctly filter external calendar GETPOSTs
2016-01-08 14:23:56 +01:00
Laurent Destailleur
36dc8b1ce7 FIX #4341 2016-01-08 13:57:53 +01:00
Raphaël Doursenaud
f2178f0369 FIX #4291 Correctly filter external calendar GETPOSTs 2016-01-08 06:42:28 +01:00
fmarcet
d8360a2a01 FIX: Email templates not compatible with Multicompany 2016-01-07 08:18:36 +01:00
fmarcet
cafe148f72 FIX: Email templates not compatible with Multicompany 2016-01-04 09:12:27 +01:00
Laurent Destailleur
e4640ca4c3 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/install/upgrade.php
2016-01-02 12:22:00 +01:00
Laurent Destailleur
0cad938e09 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/install/upgrade.php
2016-01-02 12:19:49 +01:00
Laurent Destailleur
b46aec8e7e Fix to allow phpunit of migration process for 3.5 to 3.6 2016-01-02 12:18:26 +01:00
Laurent Destailleur
35ce670bf2 Fix to allow phpunit of migration process for 3.4 to 3.5 2016-01-02 12:18:12 +01:00
Laurent Destailleur
a234482d08 FIX #3694 2015-12-31 14:55:53 +01:00
Laurent Destailleur
c004342976 FIX #3694 2015-12-31 14:55:10 +01:00
fmarcet
cebb996120 FIX: Email templates not compatible with Multicompany 2015-12-29 11:22:18 +01:00
fmarcet
f8e156ea30 FIX: Email templates not compatible with Multicompany 2015-12-29 10:35:10 +01:00
Laurent Destailleur
f13df0f952 Prepare 3.7.3 2015-12-27 20:17:46 +01:00
Laurent Destailleur
a2c8208541 Prepare 3.6.5 2015-12-27 19:17:05 +01:00
Regis Houssin
c65babf3b5 Merge remote-tracking branch 'origin/3.7' into 3.7_bug 2015-12-27 12:50:41 +01:00
Regis Houssin
c71d578931 Fix: for avoid division by 0 2015-12-16 16:39:50 +01:00
42 changed files with 297 additions and 171 deletions

View File

@@ -126,10 +126,10 @@ before_script:
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
echo
echo "Enabling APC for PHP <= 5.4"
#echo
#echo "Enabling APC for PHP <= 5.4"
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
echo
echo "Enabling Memcached for PHP <= 5.4"
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!

View File

@@ -9,6 +9,42 @@ Upgrading to any other version or database system is abolutely required BEFORE t
make a Dolibarr upgrade.
***** ChangeLog for 3.7.4 compared to 3.7.3 *****
FIX: #3694
FIX: #4239
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: #4341
FIX: #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
FIX: #4440 Wrong price is filled by Product::fetch into multiprices arrays
FIX: add missing global def for ttc column
FIX: Contrat card don't consider user permissions to show active/unactive service button
FIX: CVE CVE-2015-8685
FIX: Email templates not compatible with Multicompany
Fix: for avoid division by 0
FIX: ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant
FIX: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9)
FIX: sql injection even when code is on several lines
FIX: The third dashboard don't consider user permissions
***** ChangeLog for 3.7.3 compared to 3.7.2 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #3890 Expected transactions bank account page, shows negative numbers
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
FIX: #4081 Added missing translation
FIX: #4097 Public holiday calculation
FIX: #4242 Allow disabling dashes in documents
FIX: #4243 sql injection
FIX: Can use formated float number on old expense report module.
FIX: Change object statut when closing shipment and remove erratic db commit
FIX: Export with category contact extrafields
FIX: NB task and percent progress in box project
FIX: Not delete a product when have customer price
FIX: Not deleting contrats on element_element table
FIX: Not use localtaxes when invoice some orders
FIX: Product link in project box
FIX: Use "WHERE true" instead of "WHERE 1" #4132
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS
@@ -316,6 +352,22 @@ Dolibarr better:
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.7 compared to 3.6.6 *****
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: CVE CVE-2015-8685
***** ChangeLog for 3.6.6 compared to 3.6.5 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #4081 Added missing translation
FIX: #4097 Public holiday calculation
FIX: #4242 Allow disabling dashes in documents
FIX: #4243 sql injection
FIX: Add a protection to not make release if ChangeLog was not generated. Prepare package 3.6.5
FIX: export with category contact extrafields
FIX: Not delete a product when have customer price
FIX: Not deleting contrats on element_element table
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS
@@ -557,6 +609,17 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
- Remove add_photo_web() that is not used anymore by core code.
***** ChangeLog for 3.5.8 compared to 3.5.7 *****
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: bad calculation for stock value
FIX: bad stock valo
FIX: change order date on clone (as everywhere else)
FIX: CVE CVE-2015-8685
FIX: The hours of date filter aren't correct
FIX: #3442 Remove useless syslog
FIX: #3448 Pass expected date format
FIX: #3471 3.5 Rounding issue when dispatching non-integer
***** ChangeLog for 3.5.7 compared to 3.5.6 *****
Fix: Paypal link were broken due to SSL v3 closed.
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers

View File

@@ -159,7 +159,7 @@ Comments:
Those files are not shipped in the binary package as we
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
Files: docs/images/*
Files: doc/images/*
Copyright: Laurent Destailleur
License: CC-BY-SA-3.0
You are free:
@@ -176,7 +176,7 @@ License: CC-BY-SA-3.0
.
For more information, see http://creativecommons.org/licenses/by-sa/3.0/
Files: htdocs/includes/fpdi/*
Files: htdocs/includes/fpdfi/*
Copyright: 2004-2011 Setasign - Jan Slabon
License: GPL-2+
This program is free software; you can redistribute it

View File

@@ -376,7 +376,7 @@ if ($nboftargetok) {
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /already exists/)
if ($ret =~ /(already exists|existe déjà)/)
{
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
$QUESTIONOVERWRITETAG=<STDIN>;

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@@ -91,7 +92,7 @@ if ($actionsave)
// Save nb of agenda
if (! $error)
{
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
@@ -205,9 +206,9 @@ while ($i <= $MAXAGENDA)
// Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
// Name
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key):$conf->global->$name) . '" size="28"></td>';
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha'):$conf->global->$name) . '" size="28"></td>';
// URL
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key):$conf->global->$src) . '" size="60"></td>';
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha'):$conf->global->$src) . '" size="60"></td>';
// Color (Possible colors are limited by Google)
print '<td class="nowrap" align="right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);

View File

@@ -9,6 +9,7 @@
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Ferran Marcet <fmarcet@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
@@ -154,7 +155,7 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates";
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")";
// Criteria to sort dictionaries
$tabsqlsort=array();
@@ -266,7 +267,7 @@ $tabfieldinsert[21]= "code,label";
$tabfieldinsert[22]= "code,label";
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[24]= "code,label";
$tabfieldinsert[25]= "label,type_template,private,position,topic,content";
$tabfieldinsert[25]= "label,type_template,private,position,topic,content,entity";
// Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on

View File

@@ -189,15 +189,16 @@ if ($what == 'mysql')
$ok=0;
dol_syslog("Run command ".$fullcommandcrypted);
$handlein = popen($fullcommandclear, 'r');
while (!feof($handlein))
{
$read = fgets($handlein);
fwrite($handle,$read);
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
if ($handlein) {
while (!feof($handlein))
{
$read = fgets($handlein);
fwrite($handle,$read);
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
}
pclose($handlein);
}
pclose($handlein);
if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle);
if ($compression == 'bz') bzclose($handle);

View File

@@ -268,7 +268,7 @@ if (empty($reshook))
{
$db->begin();
// Si on a selectionne une propal a copier, on realise la copie
// If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on)
if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal'))
{
if ($object->fetch(GETPOST('copie_propal')) > 0) {
@@ -293,7 +293,8 @@ if (empty($reshook))
$object->note = GETPOST('note');
$object->statut = 0;
$id = $object->create_from($user);
// the create is done below and further more the existing create_from function is quite hilarating
//$id = $object->create_from($user);
} else {
setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors');
}

View File

@@ -946,6 +946,7 @@ class Propal extends CommonObject
*/
function create_from($user)
{
// i love this function because $this->products is not used in create function...
$this->products=$this->lines;
return $this->create($user);

View File

@@ -8,6 +8,7 @@
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@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
@@ -2372,7 +2373,7 @@ class Commande extends CommonOrder
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0)
{
global $conf, $mysoc;
global $conf, $mysoc, $langs;
dol_syslog(get_class($this)."::updateline id=$rowid, desc=$desc, pu=$pu, qty=$qty, remise_percent=$remise_percent, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, price_base_type=$price_base_type, info_bits=$info_bits, date_start=$date_start, date_end=$date_end, type=$type, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, special_code=$special_code");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@@ -2426,6 +2427,26 @@ class Commande extends CommonOrder
$line = new OrderLine($this->db);
$line->fetch($rowid);
if (!empty($line->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($line->fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback();
unset($_POST['productid']);
unset($_POST['tva_tx']);
unset($_POST['price_ht']);
unset($_POST['qty']);
unset($_POST['buying_price']);
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
}
}
$staticline = clone $line;
$line->oldline = $staticline;

View File

@@ -12,6 +12,7 @@
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Ferran Marcet <fmarcet@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
@@ -2199,6 +2200,19 @@ class Facture extends CommonInvoice
$line = new FactureLigne($this->db);
$line->fetch($rowid);
if (!empty($line->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($line->fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();
return -3;
}
}
$staticline = clone $line;
$line->oldline = $staticline;

View File

@@ -294,7 +294,8 @@ $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
$sql.= " AND localtaxtype=".$localTaxType;
$sql.= " GROUP BY dm ASC";
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm ASC";
pt($db, $sql,$langs->trans("Year")." $y");

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Rosana Romero <rromero@2byte.es>
* Copyright (C) 2014-2016 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
@@ -116,16 +116,11 @@ $product_static=new Product($db);
$payment_static=new Paiement($db);
$paymentfourn_static=new PaiementFourn($db);
//print_fiche_titre($langs->trans("VAT"),"");
//$fsearch.='<br>';
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
//$fsearch.=' <input type="text" name="min" value="'.$min.'">';
$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
// Affiche en-tete du rapport
if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services
{
$nom=$langs->trans($local==1?"LT1ReportByQuartersInDueDebtMode":"LT2ReportByQuartersInDueDebtMode");
@@ -138,14 +133,11 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice
$nextyear=$year_start; $nextquarter=$q;
if ($nextquarter < 4) $nextquarter++;
else { $nextquarter=1; $nextyear++; }
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
else $description.='<br>'.$langs->trans("DepositsAreIncluded");
$description.=$fsearch;
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
$elementcust=$langs->trans("CustomersInvoices");
$productcust=$langs->trans("ProductOrService");
@@ -170,14 +162,10 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services
$nextyear=$year_start; $nextquarter=$q;
if ($nextquarter < 4) $nextquarter++;
else { $nextquarter=1; $nextyear++; }
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded");
else $description.=' '.$langs->trans("DepositsAreIncluded");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch;
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
$elementcust=$langs->trans("CustomersInvoices");
$productcust=$langs->trans("ProductOrService");
@@ -203,16 +191,13 @@ if($local==1){
// VAT Received and paid
$y = $year_current;
$total = 0;
$i=0;
// Load arrays of datas
$x_coll= local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell', $local);
//$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell');
$x_paye = local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy', $local);
$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell');
$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy');
echo '<table class="noborder" width="100%">';
@@ -230,14 +215,14 @@ if (! is_array($x_coll) || ! is_array($x_paye))
else
{
$x_both = array();
//now, from these two arrays, get another array with one rate per line
foreach(array_keys($x_coll) as $my_coll_rate)
{
//foreach($x_coll[$my_coll_rate][localtax1_list]){
$x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
$x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
$x_both[$my_coll_rate]['coll']['localtax'.$local] = $x_coll[$my_coll_rate]['localtax'.$local];
$x_both[$my_coll_rate]['paye']['totalht'] = 0;
$x_both[$my_coll_rate]['paye']['vat'] = 0;
$x_both[$my_coll_rate]['paye']['localtax'.$local] = 0;
$x_both[$my_coll_rate]['coll']['links'] = '';
$x_both[$my_coll_rate]['coll']['detail'] = array();
foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy)
@@ -303,9 +288,6 @@ else
}
//now we have an array (x_both) indexed by rates for coll and paye
//print table headers for this quadri - incomes first
$x_coll_sum = 0;
$x_coll_ht = 0;
$x_paye_sum = 0;
@@ -313,9 +295,7 @@ else
$span=3;
if ($modetax == 0) $span+=2;
//print '<tr><td colspan="'.($span+1).'">'..')</td></tr>';
if($conf->global->$calc ==0 || $conf->global->$calc == 2){
// Customers invoices
print '<tr class="liste_titre">';
@@ -345,8 +325,6 @@ else
if($rate!=0){
print "<tr>";
//print '<td class="tax_rate">'.$langs->trans("Rate").': '.vatrate($rate).'%</td><td colspan="'.$span.'"></td>';
/**/
print '<td class="tax_rate">'.$langs->trans("Rate").': '.vatrate($rate).'%</td><td colspan="'.$span.'"></td>';
print '</tr>'."\n";
}
@@ -400,9 +378,7 @@ else
print price($fields['totalht']);
if (price2num($fields['ftotal_ttc']))
{
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
$ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
//print ' ('.round($ratiolineinvoice*100,2).'%)';
}
print '</td>';
}
@@ -413,7 +389,6 @@ else
{
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
print '<td class="nowrap" align="right">';
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
if ($fields['payment_amount'] && $fields['ftotal_ttc'])
{
$payment_static->id=$fields['payment_id'];
@@ -424,7 +399,7 @@ else
print $langs->trans("NotUsedForGoods");
}
else {
print $fields['payment_amount'];
print price($fields['payment_amount']);
if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
}
print '</td>';
@@ -491,7 +466,6 @@ else
if($conf->global->$calc ==0 || $conf->global->$calc == 1){
echo '<table class="noborder" width="100%">';
//print table headers for this quadri - expenses now
//imprime les en-tete de tables pour ce quadri - maintenant les d<>penses
print '<tr class="liste_titre">';
print '<td align="left">'.$elementsup.'</td>';
print '<td align="left">'.$productsup.'</td>';
@@ -585,7 +559,7 @@ else
}
else
{
print $fields['payment_amount'];
print price($fields['payment_amount']);
if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
}
print '</td>';
@@ -663,6 +637,5 @@ else
$i++;
}
$db->close();
llxFooter();
$db->close();

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -1548,9 +1548,11 @@ else
{
$tmpaction='activateline';
if ($objp->statut == 4) $tmpaction='unactivateline';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;ligne='.$object->lines[$cursorline-1]->id.'&amp;action='.$tmpaction.'">';
print img_edit();
print '</a>';
if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->unactiver)) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;ligne=' . $object->lines[$cursorline - 1]->id . '&amp;action=' . $tmpaction . '">';
print img_edit();
print '</a>';
}
}
}
print '</td>';

View File

@@ -2540,7 +2540,7 @@ abstract class CommonObject
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0)
{
global $conf,$langs,$user,$object,$hookmanager;
global $conf,$langs,$user,$object,$hookmanager,$inputalsopricewithtax;
print '<tr class="liste_titre nodrag nodrop">';

View File

@@ -1733,7 +1733,7 @@ class Form
$sql.= " WHERE fk_product='".$objp->rowid."'";
$sql.= " AND entity IN (".getEntity('productprice', 1).")";
$sql.= " AND price_level=".$price_level;
$sql.= " ORDER BY date_price";
$sql.= " ORDER BY date_price, rowid";
$sql.= " DESC LIMIT 1";
dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.'', LOG_DEBUG);
@@ -2160,10 +2160,10 @@ class Form
$form.= $opt;
$i++;
}
$form.= '</select>';
$this->db->free($result);
}
$form.= '</select>';
$this->db->free($result);
return $form;
}
else

View File

@@ -159,50 +159,41 @@ class Ldap
dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING);
}
// Loop on each ldap server
foreach ($this->server as $key => $host)
if (! function_exists("ldap_connect"))
{
if ($connected) break;
if (empty($host)) continue;
$this->error='LDAPFunctionsNotAvailableOnPHP';
$return=-1;
dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING);
}
if (preg_match('/^ldap/',$host))
if (empty($this->error))
{
// Loop on each ldap server
foreach ($this->server as $key => $host)
{
$this->connection = ldap_connect($host);
}
else
{
$this->connection = ldap_connect($host,$this->serverPort);
}
if (is_resource($this->connection))
{
// Execute the ldap_set_option here (after connect and before bind)
$this->setVersion();
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
if ($this->serverType == "activedirectory")
if ($connected) break;
if (empty($host)) continue;
if (preg_match('/^ldap/',$host))
{
$result=$this->setReferrals();
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
if ($this->result)
{
$this->bind=$this->result;
$connected=2;
break;
}
else
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
$this->connection = ldap_connect($host);
}
else
{
// Try in auth mode
if ($this->searchUser && $this->searchPassword)
$this->connection = ldap_connect($host,$this->serverPort);
}
if (is_resource($this->connection))
{
// Execute the ldap_set_option here (after connect and before bind)
$this->setVersion();
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
if ($this->serverType == "activedirectory")
{
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$result=$this->setReferrals();
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
if ($this->result)
{
@@ -215,26 +206,45 @@ class Ldap
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
}
// Try in anonymous
if (! $this->bind)
else
{
dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG);
$result=$this->bind();
if ($result)
// Try in auth mode
if ($this->searchUser && $this->searchPassword)
{
$this->bind=$this->result;
$connected=1;
break;
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
if ($this->result)
{
$this->bind=$this->result;
$connected=2;
break;
}
else
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
}
else
// Try in anonymous
if (! $this->bind)
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG);
$result=$this->bind();
if ($result)
{
$this->bind=$this->result;
$connected=1;
break;
}
else
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
}
}
}
if (! $connected) $this->close();
}
if (! $connected) $this->close();
}
if ($connected)

View File

@@ -732,17 +732,24 @@ function activateModule($value,$withdeps=1)
if (isset($objMod->depends) && is_array($objMod->depends) && ! empty($objMod->depends))
{
// Activation des modules dont le module depend
$TError=array();
$num = count($objMod->depends);
for ($i = 0; $i < $num; $i++)
{
$activate = false;
foreach ($modulesdir as $dir)
{
if (file_exists($dir.$objMod->depends[$i].".class.php"))
{
activateModule($objMod->depends[$i]);
$activate = true;
}
}
if (!$activate) $TError[] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
}
setEventMessages('', $TError, 'errors');
}
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -205,7 +205,6 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
}
}
/**
* Gets VAT to collect for the given year (and given quarter or month)
* The function gets the VAT in split results, as the VAT declaration asks

View File

@@ -970,6 +970,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("withdrawals");
$langs->load("banks");
$langs->load("bills");
$langs->load('categories');
// Bank-Caisse
if (! empty($conf->banque->enabled))

View File

@@ -320,18 +320,12 @@ if (! empty($usemargins) && $user->rights->margins->creer)
jQuery(document).ready(function() {
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
$('#addline').click(function (e) {
return checkFreeLine(e, "np_marginRate");
});
$("input[name='np_marginRate']:first").blur(function(e) {
return checkFreeLine(e, "np_marginRate");
});
<?php
}
if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?>
$('#addline').click(function (e) {
return checkFreeLine(e, "np_markRate");
});
$("input[name='np_markRate']:first").blur(function(e) {
return checkFreeLine(e, "np_markRate");
});

View File

@@ -247,9 +247,6 @@ if (! empty($conf->margin->enabled))
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{
?>
$('#savelinebutton').click(function (e) {
return checkEditLine(e, "np_marginRate");
});
$("input[name='np_marginRate']:first").blur(function(e) {
return checkEditLine(e, "np_marginRate");
});
@@ -258,9 +255,6 @@ if (! empty($conf->margin->enabled))
if (! empty($conf->global->DISPLAY_MARK_RATES))
{
?>
$('#savelinebutton').click(function (e) {
return checkEditLine(e, "np_markRate");
});
$("input[name='np_markRate']:first").blur(function(e) {
return checkEditLine(e, "np_markRate");
});
@@ -308,7 +302,13 @@ if (! empty($conf->margin->enabled))
if (npRate == "np_marginRate")
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
{
if (ratejs != 100) // If markRate is 100, it means buying price is 0, so it is not possible to retreive price from it and markRate. We keep it unchange
{
price = ((bpjs / (1 - (ratejs / 100))) / (1 - remisejs / 100));
}
else price=$("input[name='price_ht']:first").val();
}
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value

View File

@@ -8,6 +8,7 @@
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@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
@@ -763,13 +764,19 @@ class Expedition extends CommonObject
return -1;
}
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) // FIXME Check is done for stock of product, it must be done for stock of product into warehouse if $entrepot_id defined
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT)
{
$product=new Product($this->db);
$result=$product->fetch($fk_product);
if ($entrepot_id > 0) {
$product->load_stock();
$product_stock = $product->stock_warehouse[$entrepot_id]->real;
}
else
$product_stock = $product->stock_reel;
$product_type=$product->type;
if ($product_type == 0 && $product->stock_reel < $qty)
if ($product_type == 0 && $product_stock < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();

View File

@@ -130,11 +130,11 @@ class Export
//print_r("$perm[0]-$perm[1]-$perm[2]<br>");
if (! empty($perm[2]))
{
$bool=$user->rights->$perm[0]->$perm[1]->$perm[2];
$bool=$user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]};
}
else
{
$bool=$user->rights->$perm[0]->$perm[1];
$bool=$user->rights->{$perm[0]}->{$perm[1]};
}
if ($perm[0]=='user' && $user->admin) $bool=true;
if (! $bool) break;

View File

@@ -29,7 +29,7 @@
* \brief File that include conf.php file and commons lib like functions.lib.php
*/
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.3');
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.4');
if (! defined('EURO')) define('EURO',chr(128));
// Define syslog constants

View File

@@ -940,6 +940,7 @@ class CommandeFournisseur extends CommonOrder
$this->lines[$i]->remise_percent,
'HT',
0,
$this->lines[$i]->product_type,
$this->lines[$i]->info_bits
);
if ($result < 0)

View File

@@ -540,7 +540,7 @@ class ProductFournisseur extends Product
{
global $langs;
$langs->load("suppliers");
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
$out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
return $out;
}

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
@@ -121,7 +121,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
{
$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) dol_print_error($db, $object->error);
else $object->ref_supplier=GETPOST('ref_supplier','alpha'); // ADD : ref_supplier to object property, otherwise not visibly updated on change
@@ -615,6 +615,14 @@ if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournis
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);

View File

@@ -1577,12 +1577,6 @@ else
if ($objectref == 'PROV')
{
$savdate=$object->date;
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION))
{
$object->date=dol_now();
//TODO: Possibly will have to control payment information into suppliers
//$object->date_lim_reglement=$object->calculate_date_lim_reglement();
}
$numref = $object->getNextNumRef($societe);
}
else
@@ -2276,7 +2270,11 @@ else
// Delete
if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
if ($object->getSommePaiement()) {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>';
} else {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
}
print '</div>';
print '<br>';

View File

@@ -432,7 +432,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$preselectedchoice=$addwarning?'no':'yes';
print '<br>';
$text=$langs->trans('ConfirmSupplierPayment',$totalpayment,$langs->trans("Currency".$conf->currency));
$text=$langs->trans('ConfirmSupplierPayment', price($totalpayment),$langs->trans("Currency".$conf->currency));
if (GETPOST('closepaidinvoices'))
{
$text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");

View File

@@ -2217,7 +2217,7 @@ class soap_transport_http extends nusoap_base {
}
$this->use_curl = $use_curl;
preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
if (isset($rev[1])) $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
$this->setHeader('User-Agent', $this->title.'/'.$this->version.(isset($rev[1])?' ('.$rev[1].')':''));
}
/**

View File

@@ -440,7 +440,7 @@ if (! empty($conf->fournisseur->enabled) && ! empty($conf->facture->enabled) &&
$board->load_board($user);
$board->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
$board->label=$langs->trans("SupplierBillsToPay");
$board->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=paye:0';
$board->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=paye:0,fk_statut:1';
$board->img=img_object($langs->trans("Bills"),"bill");
$rowspan++;
$dashboardlines[]=$board;

View File

@@ -62,6 +62,21 @@ ALTER TABLE llx_societe MODIFY COLUMN fk_currency varchar(3) NULL;
ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
-- Clean corrupted values for tms
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
-- Remove default not null on date_fin
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible;
@@ -189,9 +204,14 @@ CREATE TABLE llx_payment_salary (
fk_user_modif integer
)ENGINE=innodb;
DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock);
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);

View File

@@ -1563,3 +1563,4 @@ TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both custome
IncludePath=Include path (defined into variable %s)
NoModueToManageStockDecrease=No module able to manage automatic stock decrease has been activated. Stock decrease will be done on manual input only.
NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise

View File

@@ -97,7 +97,8 @@ function test_sql_and_script_inject($val, $type)
// All examples on page: http://ha.ckers.org/xss.html#XSScalc
$sql_inj += preg_match('/<script/i', $val);
if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val);
$sql_inj += preg_match('/base[\s]+href/i', $val);
$sql_inj += preg_match('/base[\s]+href/si', $val);
$sql_inj += preg_match('/<.*onmouse/si', $val); // onmouseover can be set on img or any html tag like <img title='>' onmouseover=alert(1)>
if ($type == 1)
{
$sql_inj += preg_match('/javascript:/i', $val);

View File

@@ -104,7 +104,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
$marge_tx_ret='';
$marque_tx_ret='';
if ($fk_pa > 0) {
if ($fk_pa > 0 && empty($paht)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$product = new ProductFournisseur($db);
if ($product->fetch_product_fournisseur_price($fk_pa))

View File

@@ -1515,7 +1515,7 @@ class Product extends CommonObject
$sql.= " WHERE entity IN (".getEntity('productprice', 1).")";
$sql.= " AND price_level=".$i;
$sql.= " AND fk_product = '".$this->id."'";
$sql.= " ORDER BY date_price DESC";
$sql.= " ORDER BY date_price DESC, rowid DESC";
$sql.= " LIMIT 1";
$resql = $this->db->query($sql);
if ($resql)
@@ -1576,7 +1576,7 @@ class Product extends CommonObject
$sql.= " price_base_type, tva_tx, tosell, price_by_qty, rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."product_price";
$sql.= " WHERE fk_product = '".$this->id."'";
$sql.= " ORDER BY date_price DESC";
$sql.= " ORDER BY date_price DESC, rowid DESC";
$sql.= " LIMIT 1";
$resql = $this->db->query($sql);
if ($resql)

View File

@@ -354,7 +354,7 @@ if ($id > 0 || ! empty($ref))
else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; }
}
print '</td>';
$totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT');
$totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT');
$total+=$totalline;
print '<td align="right">'.($notdefined?'':price($totalline,'','',0,0,-1,$conf->currency)).'</td>';
if (! empty($conf->stock->enabled)) print '<td align="right">'.$langs->trans("Stock").': '.$value['stock'].'</td>'; // Real stock

View File

@@ -367,7 +367,6 @@ function activitytrim($product_type)
$result = $db->query($sql);
if ($result)
{
//$tmpyear=$beginyear; // FIXME $beginyear is not defined
$tmpyear=0;
$trim1=0;
$trim2=0;

View File

@@ -749,7 +749,7 @@ $sql .= " WHERE fk_product = " . $object->id;
$sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")";
$sql .= " AND p.fk_user_author = u.rowid";
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level;
$sql .= " ORDER BY p.date_price DESC, p.price_level ASC, p.rowid DESC";
$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
// $sql .= $db->plimit();
$result = $db->query($sql);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@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
@@ -125,9 +126,9 @@ if ($result)
while ($objp = $db->fetch_object($result))
{
$found=0;
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; }
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; }
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found=1; $third['supplier']++; }
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && $user->rights->societe->lire && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; }
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && $user->rights->societe->lire && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; }
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire && $objp->fournisseur) { $found=1; $third['supplier']++; }
if (! empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { $found=1; $third['other']++; }
if ($found) $total++;
}
@@ -140,9 +141,9 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou
{
print '<tr '.$bc[0].'><td align="center" colspan="2">';
$dataseries=array();
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && $user->rights->societe->lire) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && $user->rights->societe->lire) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other']));
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',0);
@@ -150,19 +151,19 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou
}
else
{
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS))
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && $user->rights->societe->lire)
{
$statstring = "<tr ".$bc[0].">";
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/list.php">'.$langs->trans("Prospects").'</a></td><td align="right">'.round($third['prospect']).'</td>';
$statstring.= "</tr>";
}
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS))
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && $user->rights->societe->lire)
{
$statstring.= "<tr ".$bc[1].">";
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/comm/list.php">'.$langs->trans("Customers").'</a></td><td align="right">'.round($third['customer']).'</td>';
$statstring.= "</tr>";
}
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS))
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire)
{
$statstring2 = "<tr ".$bc[0].">";
$statstring2.= '<td><a href="'.DOL_URL_ROOT.'/fourn/list.php">'.$langs->trans("Suppliers").'</a></td><td align="right">'.round($third['supplier']).'</td>';

View File

@@ -221,7 +221,7 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase
$ip='169.254.0.0';
$result=is_ip($ip);
print __METHOD__." for ".$ip." result=".$result."\n";
$this->assertEquals(0,$result,$ip);
//$this->assertEquals(2,$result,$ip); // Assertion disabled because returned value differs between PHP patch version
$ip='1.2.3.4';
$result=is_ip($ip);