Compare commits

...

249 Commits
3.6.0 ... 3.5

Author SHA1 Message Date
Laurent Destailleur
122b33d87d Try to fix travis for very old versions 2019-05-11 16:56:10 +02:00
Laurent Destailleur
9413f9ddfc Fix compatibility php7 2019-05-08 00:09:01 +02:00
Laurent Destailleur
a45ffeecca Missing changelog 2016-03-11 18:21:57 +01:00
Laurent Destailleur
d9e089256e Fix path to copyrighted files 2016-01-31 16:16:46 +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
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
60debe31c4 Merge pull request #3894 from altatof/stockvalue
FIX bad calculation for stock value
2015-11-05 21:44:15 +01:00
Christophe Battarel
316b7453e4 FIX bad stock valo 2015-11-05 17:04:08 +01:00
Christophe Battarel
75bcb7e53f fix pmp 2015-11-05 15:32:56 +01:00
Christophe Battarel
9b797c1831 FIX bad calculation for stock value 2015-11-05 12:49:43 +01:00
Laurent Destailleur
384c89dcef Merge pull request #3701 from altatof/fix_orderdateonclone
FIX: change order date on clone (as everywhere else)
2015-10-09 20:44:03 +02:00
Laurent Destailleur
e886c89e06 Merge pull request #3668 from altatof/fix_stock_entity
fix entities warehouse share
2015-10-09 20:16:32 +02:00
Christophe Battarel
00f0aff6f0 FIX: change order date on clone (as everywhere else) 2015-10-08 15:58:19 +02:00
Christophe Battarel
f3ef9b868f fix entities warehouse share 2015-10-05 16:19:54 +02:00
Laurent Destailleur
a3032d5674 Merge pull request #3504 from fappels/3.5-patch-Dispatch-rounding
Fix #3471 3.5 Rounding issue when dispatching non-integer
2015-09-12 11:07:55 +02:00
fappels
8bdfdc0127 Fix #3471 3.5 Rounding issue when dispatching non-integer 2015-09-10 23:12:27 +02:00
fappels
249883dda2 Merge remote-tracking branch 'Dolibarr/3.5' into 3.5 2015-09-10 22:19:41 +02:00
Laurent Destailleur
897686a752 Merge pull request #3447 from fmarcet/3.5
FIX: The hours of date filter aren't correct
2015-09-03 10:33:00 +02:00
Laurent Destailleur
9efecbf52b Merge pull request #3443 from GPCsolutions/3.5-3442
Fix #3442 Remove useless syslog
2015-09-03 10:30:42 +02:00
Laurent Destailleur
e3d4b104e2 Merge pull request #3449 from GPCsolutions/3.5-3448
Fix #3448 Pass expected date format
2015-09-03 10:26:00 +02:00
Raphaël Doursenaud
870882257d Fix #3448 Pass expected date format 2015-09-01 11:06:44 +02:00
fmarcet
2b6a481011 FIX: The hours of date filter aren't correct 2015-09-01 09:46:45 +02:00
Raphaël Doursenaud
51d5bff15d Fix #3442 Remove useless syslog
Not having the permission to read the box is not an error.
Furthermore, no other boxes have this behavior.
2015-08-31 19:41:42 +02:00
Laurent Destailleur
58988d3084 3.5.8 2015-08-14 16:12:36 +02:00
Laurent Destailleur
8d18507d5f Bad help 2015-08-14 15:35:25 +02:00
Laurent Destailleur
45aed1e0aa Merge branch 'marcosgdf-bug-3313' into 3.5 2015-08-13 00:14:17 +02:00
Laurent Destailleur
dc4b429a33 Merge branch 'bug-3313' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-3313

Conflicts:
	ChangeLog
2015-08-13 00:13:36 +02:00
Laurent Destailleur
4b51fc80a6 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Conflicts:
	ChangeLog
2015-08-13 00:06:27 +02:00
Laurent Destailleur
a8c2dfd445 Merge branch 'marcosgdf-bug-3310' into 3.5 2015-08-13 00:05:16 +02:00
Laurent Destailleur
d3f004d407 Merge pull request #3275 from marcosgdf/bug-3206
Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information
2015-08-12 23:25:29 +02:00
Marcos García de La Fuente
f3ef4fed93 Fix: [ bug #3313 ] Error enabling module with PostgreSQL database
Close #3313
2015-08-09 13:58:03 +02:00
Marcos García de La Fuente
7cb564586e Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything
Close #3310
2015-08-09 13:52:02 +02:00
Marcos García de La Fuente
a1f74763da Merge branch '3.5' into bug-3206
Conflicts:
	ChangeLog
2015-08-03 18:55:01 +02:00
Laurent Destailleur
6b2d7f7d19 Merge pull request #3200 from atm-maxime/3.5
Fix #3188 SQL error if qty or discount is not a number on proposal ad…
2015-07-23 22:53:44 +02:00
Maxime Kohlhaas
73c7ef5a88 Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5 2015-07-22 17:10:46 +02:00
Maxime Kohlhaas
646ad48bd0 Better fix for not numeric qty or discount 2015-07-21 10:50:07 +02:00
Maxime Kohlhaas
428bd14b55 Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5
# Veuillez entrer un message de validation pour expliquer en quoi cette fusion est
# nécessaire, surtout si cela fusionne une branche amont mise à jour dans une branche de sujet.
#
# Les lignes commençant par '#' seront ignorées, et un message vide
# abandonne la validation.
2015-07-21 10:49:47 +02:00
Laurent Destailleur
14eee82a64 Merge pull request #3277 from marcosgdf/bug-1791
Fix: [ bug 1791 ] Margin menu not available if any Finance module is not enabled
2015-07-19 15:26:29 +02:00
Marcos García de La Fuente
5b0c216b42 Merge branch '3.5' into bug-1791
Conflicts:
	ChangeLog
2015-07-19 13:48:04 +02:00
Marcos García de La Fuente
8505e91469 Fix: [ bug 1791 ] Margin menu not available if any Finance module is not enabled 2015-07-19 13:46:25 +02:00
Laurent Destailleur
5c2059a79f Merge branch 'marcosgdf-bug-3180' into 3.5 2015-07-19 11:29:57 +02:00
Laurent Destailleur
2e2f99c351 Merge branch 'bug-3180' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-3180

Conflicts:
	ChangeLog
2015-07-19 11:28:48 +02:00
Laurent Destailleur
739eaedecc Merge branch 'marcosgdf-bug-3268' into 3.5 2015-07-19 11:27:42 +02:00
Laurent Destailleur
4100026c71 Merge branch 'bug-3268' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-3268

Conflicts:
	ChangeLog
2015-07-19 11:27:28 +02:00
Laurent Destailleur
8d7c1f8d4c Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid 2015-07-19 11:21:21 +02:00
Marcos García de La Fuente
3d6c5b09e8 Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
Close #3268
2015-07-19 11:19:47 +02:00
Marcos García de La Fuente
538c8c072b Merge branch '3.5' into bug-3180
Conflicts:
	ChangeLog
2015-07-19 11:16:36 +02:00
Marcos García de La Fuente
d0b1652efd Merge branch '3.5' into bug-3206
Conflicts:
	ChangeLog
2015-07-19 11:16:10 +02:00
Laurent Destailleur
d422fac3fe Merge pull request #3272 from marcosgdf/bug-2715
Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names
2015-07-18 23:53:30 +02:00
Marcos García de La Fuente
4649cf7210 Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information
Close #3206
2015-07-18 19:40:48 +02:00
Marcos García de La Fuente
b28c4df0d6 Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result
Close #3180
2015-07-18 17:35:36 +02:00
Marcos García de La Fuente
7185cfeb84 Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names 2015-07-18 14:48:59 +02:00
Laurent Destailleur
d7e9bccad6 Merge pull request #3199 from atm-maxime/fix_rejet_prel
Fix : withdrawal rejection were taking the total amount of the invoic…
2015-07-16 10:20:46 +02:00
Maxime Kohlhaas
5223934ff0 Fix #3188 SQL error if qty or discount is not a number on proposal add line 2015-07-14 12:17:50 +02:00
Maxime Kohlhaas
20bdfdb286 Fix : withdrawal rejection were taking the total amount of the invoice instead of the amount of the withdrawal 2015-07-14 11:57:47 +02:00
Laurent Destailleur
bd4d108217 Merge pull request #3058 from fmarcet/3.5
Fix: Date filter on customer orders
2015-06-17 00:19:03 +02:00
fmarcet
05cb1f7ba7 Fix: Date filter on customer orders 2015-06-16 16:59:48 +02:00
Laurent Destailleur
fa8defa1bf Merge pull request #3034 from marcosgdf/bug-2814-2
Fix #2814 JPEG photos are not displayed in Product photos page
2015-06-16 11:10:24 +02:00
Marcos García de La Fuente
2d3ab3b658 Merge remote-tracking branch 'upstream/3.5' into bug-2814-2
Conflicts:
	ChangeLog
2015-06-15 09:39:17 +02:00
Laurent Destailleur
1fc4716617 Merge branch 'marcosgdf-bug-2835' into 3.5 2015-06-14 16:07:38 +02:00
Laurent Destailleur
fadc640335 Merge branch 'bug-2835' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-2835

Conflicts:
	ChangeLog
2015-06-14 16:07:19 +02:00
Laurent Destailleur
c4ff9c326a Merge branch 'marcosgdf-bug-2837' into 3.5 2015-06-14 16:06:24 +02:00
Laurent Destailleur
d0b2c492a0 Merge branch 'bug-2837' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-2837

Conflicts:
	ChangeLog
2015-06-14 16:06:14 +02:00
Laurent Destailleur
288ae5de78 Merge branch 'marcosgdf-bug-2861' into 3.5 2015-06-14 16:04:02 +02:00
Laurent Destailleur
e915a54c39 Merge branch 'bug-2861' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-2861

Conflicts:
	ChangeLog
2015-06-14 16:03:44 +02:00
Laurent Destailleur
f8d2e93878 Merge pull request #3044 from hregis/3.5_bug
Fix: select date problem with mobile device (#3039)
2015-06-14 15:29:35 +02:00
Regis Houssin
b96ed08260 Fix: select date problem with mobile device (#3039) 2015-06-14 12:46:27 +02:00
Laurent Destailleur
a9bf38b8d3 Merge pull request #3022 from marcosgdf/bug-2976
FIX Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
2015-06-14 02:03:39 +02:00
Marcos García de La Fuente
1215502927 Fix Close bug #2814 JPEG photos are not displayed in Product photos page 2015-06-13 03:11:17 +02:00
Marcos García de La Fuente
f9574fa458 FIX Close #2835 Customer prices of a product shows incorrect history order 2015-06-12 19:05:08 +02:00
Marcos García de La Fuente
2051a66cd7 FIX Close #2837 Product list table column header does not match column body 2015-06-12 18:46:05 +02:00
Marcos García de La Fuente
e3aa63f3c3 Added log 2015-06-12 18:33:37 +02:00
Marcos García de La Fuente
0335892521 FIX Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0 2015-06-12 18:31:49 +02:00
Marcos García de La Fuente
87a00d6924 FIX Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI 2015-06-12 15:02:05 +02:00
Laurent Destailleur
fd42b17027 Merge pull request #2984 from GPCsolutions/dolibarr-2983
FIX #2983 Load gravatar avatar images securely over HTTPS
2015-06-08 17:53:30 +02:00
Raphaël Doursenaud
08c9dd358d FIX #2983 Load gravatar avatar images securely over HTTPS 2015-06-08 15:51:41 +02:00
Laurent Destailleur
0b40502878 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2015-05-22 17:14:53 +02:00
Laurent Destailleur
dcc197eb6b Fix bug debian 786479 2015-05-22 17:13:32 +02:00
Laurent Destailleur
f32215a9fc Merge pull request #2866 from GPCsolutions/3.5-2857
Properly escape untrusted data to prevent HTML injection.
2015-05-21 21:10:02 +02:00
Raphaël Doursenaud
a7f6bbd316 Properly escape untrusted data to prevent HTML injection.
First pass for #2857
2015-05-20 17:34:00 +02:00
Laurent Destailleur
e8fb89f89f Prepare packaging 3.7 2015-05-16 16:38:47 +02:00
Laurent Destailleur
4dcdea5219 Prepare package 3.5.7
Removed hardcoded version from rpm spec files, so it will not be
necessary to update this files when making a new release.
2015-05-16 16:08:05 +02:00
Laurent Destailleur
1d8a3809f0 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2015-05-16 15:27:18 +02:00
Laurent Destailleur
80943111cc Prepare 3.5.7 2015-05-16 15:26:34 +02:00
Laurent Destailleur
f8e8fe6f34 Merge pull request #2816 from marcosgdf/bug-2757
Close bug #2757 Deleting product category photo gives "Forbidden access" error
2015-05-12 22:36:33 +02:00
Marcos García de La Fuente
190f12c4c4 Merge branch '3.5' into bug-2757
Conflicts:
	ChangeLog
2015-05-12 10:16:48 +02:00
Marcos García de La Fuente
ea7eb241e3 Close bug #2757 Deleting product category photo gives "Forbidden access" error 2015-05-12 10:15:43 +02:00
Laurent Destailleur
5f594d55ac Merge pull request #2805 from marcosgdf/bug-2758
FIX #2758 Product::update sets product note to "null" when $prod->note is null
2015-05-11 23:00:25 +02:00
Marcos García de La Fuente
f6616deef3 Removed debugging function 2015-05-10 01:28:40 +02:00
Marcos García de La Fuente
f8e8b39ff2 FIX #2758 Product::update sets product note to "null" when $prod->note is null 2015-05-10 01:27:28 +02:00
Juanjo Menent
6309d2133f Merge pull request #2731 from GPCsolutions/dolibarr-2729
Allow exporting projects without a third party
2015-05-01 15:55:40 +02:00
Raphaël Doursenaud
f1032baaab Allow exporting projects without a third party
FIX #2729
2015-04-30 11:48:32 +02:00
Laurent Destailleur
b8c512a3d5 Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5 2015-04-18 23:34:42 +02:00
Laurent Destailleur
be9ddb7748 Merge pull request #2595 from marcosgdf/bug-2576
Close #2576 Bug: Unable to edit a dictionary entry that has # in its ref
2015-04-18 22:24:21 +02:00
Marcos García de La Fuente
37d8dafd40 Merge branch '3.5' into bug-2576
Conflicts:
	ChangeLog
2015-04-18 21:44:24 +02:00
Laurent Destailleur
4de4c66bb7 git push origin 3.5Merge branch 'marcosgdf-bug-2576' into 3.5 2015-04-18 20:56:40 +02:00
Laurent Destailleur
ed6abb0f79 Merge branch 'bug-2576' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2576
Conflicts:
	ChangeLog
2015-04-18 20:56:27 +02:00
Laurent Destailleur
5f49b2a9bb git push origin 3.5Merge branch 'marcosgdf-bug-2577' into 3.5 2015-04-18 20:12:49 +02:00
Laurent Destailleur
b7cf0ded00 Merge branch 'bug-2577' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2577
Conflicts:
	ChangeLog
2015-04-18 20:12:27 +02:00
Laurent Destailleur
b75722d450 git push origin 3.5Merge branch 'marcosgdf-bug-2583' into 3.5 2015-04-18 20:10:41 +02:00
Laurent Destailleur
9b69b64626 Merge branch 'bug-2583' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2583
Conflicts:
	ChangeLog
2015-04-18 20:10:06 +02:00
Laurent Destailleur
0000043c96 Merge pull request #2629 from atm-maxime/3.5_fix_shipment_model
Fix : shipment model selection
2015-04-18 15:23:52 +02:00
Maxime Kohlhaas
2b8efc302a Fix : shipment model selection 2015-04-18 11:24:55 +02:00
Laurent Destailleur
c0ddfbfab7 Merge pull request #2597 from marcosgdf/bug-1906
Fixes for bugs #1906 and #1905
2015-04-13 01:04:23 +02:00
Marcos García de La Fuente
8f0c41dbd2 Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card 2015-04-12 22:02:25 +02:00
Marcos García de La Fuente
6173706531 Fix: [ bug #1906 ] Deplacement does not allow translated decimal format 2015-04-12 21:55:20 +02:00
Marcos García de La Fuente
9cfb295675 Fix: Bug #2576 Unable to edit a dictionary entry that has # in its ref 2015-04-12 21:05:26 +02:00
Marcos García de La Fuente
bbd01c0c8d Fix: Bug #2577 Incorrect invoice status in "Linked objects" page of a project 2015-04-12 20:59:58 +02:00
Marcos García de La Fuente
728b64e334 Fix Bug #2583: Unable to create a bank transfer with localized numbers 2015-04-12 20:24:22 +02:00
Laurent Destailleur
a9eebb33fd Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2015-03-14 13:45:27 +01:00
Laurent Destailleur
89b22be063 FIXED: Allowed 0 to be used as an account mask. Required by CEGID. 2015-03-14 13:44:26 +01:00
Laurent Destailleur
da72cf387b Merge pull request #2451 from Dolibarr/revert-2318-3.5-accountingmask
Revert "FIXED Allowed 0 to be used as an account mask"
2015-03-14 13:43:04 +01:00
Laurent Destailleur
4a9a3ab04b Revert "FIXED Allowed 0 to be used as an account mask" 2015-03-14 13:42:58 +01:00
Laurent Destailleur
da042c1677 Merge pull request #2318 from GPCsolutions/3.5-accountingmask
FIXED Allowed 0 to be used as an account mask
2015-03-14 13:42:46 +01:00
Laurent Destailleur
d549c00b2e Merge pull request #2365 from marcosgdf/3.5
Fix: [ bug #1846 ] Browser IE11 not detected
2015-02-20 20:02:11 +01:00
Laurent Destailleur
9f8bee3501 Merge pull request #2331 from altatof/fix_natural_search
FIX: select DISTINCT for natural search on proposal list (in the same way it's done in invoices list)
2015-02-18 22:16:43 +01:00
Marcos García de La Fuente
3efb737cbf Fix: [ bug #1845 ] Undefined "$conf->browser->ie" var in "functions.lib.php" 2015-02-16 12:30:10 +01:00
Marcos García de La Fuente
6f08893016 Fix: [ bug #1846 ] Browser IE11 not detected 2015-02-16 12:26:20 +01:00
Raphaël Doursenaud
7dea799a9e FIXED Allowed 0 to be used as an account mask
0 is used by some accounting systems and software.
2015-02-10 17:18:32 +01:00
Christophe Battarel
3940abe7c1 FIX: select DISTINCT for natural search on proposal list (in the same
way it's done in invoices list)
2015-02-07 10:48:03 +01:00
Laurent Destailleur
3ec5b46864 Merge pull request #2294 from altatof/fix_fournprice_visibility
FIX: always show fournprice select
2015-01-31 19:47:46 +01:00
Christophe Battarel
04f83ae4ff FIX: always show fournprice select 2015-01-28 16:19:56 +01:00
Laurent Destailleur
a51ea308f5 Merge branch 'marcosgdf-bug-1762' into 3.5 2015-01-18 13:46:15 +01:00
Laurent Destailleur
05f08a7181 Merge branch 'bug-1762' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1762

Conflicts:
	ChangeLog
2015-01-18 13:43:57 +01:00
Laurent Destailleur
5087ac8153 Merge pull request #2237 from marcosgdf/bug-1797
Fix:  [ bug #1797 ] Tulip Supplier invoice module takes creation date instead of invoice date
2015-01-16 12:08:09 +01:00
Marcos García de La Fuente
4da52cf733 Fix: [ bug #1797 ] Tulip Supplier invoice module takes creation date instead of invoice date 2015-01-13 11:11:37 +01:00
Marcos García de La Fuente
7e16d0c1d3 Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled 2015-01-13 01:48:58 +01:00
Laurent Destailleur
490b0c5f3a Merge branch 'marcosgdf-bug-1768' into 3.5 2014-12-26 04:13:36 +01:00
Laurent Destailleur
77e48f8c3e Merge branch 'bug-1768' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-1768 2014-12-26 04:12:58 +01:00
Laurent Destailleur
882fd9a798 Merge branch 'marcosgdf-bug-1757' into 3.5 2014-12-26 04:11:30 +01:00
Laurent Destailleur
38c9d39c2b Merge branch 'bug-1757' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1757

Conflicts:
	ChangeLog
2014-12-26 04:11:15 +01:00
Laurent Destailleur
4e2c321e4d Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Conflicts:
	ChangeLog
2014-12-26 04:09:08 +01:00
Laurent Destailleur
83e34a1c4e Merge branch 'marcosgdf-bug-1769' into 3.5 2014-12-26 04:07:53 +01:00
Laurent Destailleur
f31bf5d80e Merge pull request #2175 from marcosgdf/bug-1752
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
2014-12-26 03:49:02 +01:00
Marcos García de La Fuente
8e47fe9e1c Fix: [ bug #1757 ] Sorting breaks product/service statistics 2014-12-26 00:19:09 +01:00
Marcos García de La Fuente
1d39c1acc2 Fix: [ bug #1768 ] PHP Warning when error connecting to a PostgreSQL server in install script 2014-12-26 00:12:16 +01:00
Marcos García de La Fuente
f4def9ea28 Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers 2014-12-26 00:07:24 +01:00
Marcos García de La Fuente
416f13c708 Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H 2014-12-23 16:00:04 +01:00
Laurent Destailleur
1c2c1ff3d8 Update codesniffer to remove travis errors. 2014-12-19 19:09:15 +01:00
Laurent Destailleur
47cab90336 Update codesniffer to remove travis errors. 2014-12-19 19:01:29 +01:00
Laurent Destailleur
f5da9b5e33 Merge pull request #2149 from altatof/3.5
FIX: dont put a mess with date and datetime extrafield value if already in right format
2014-12-18 10:04:03 +01:00
Laurent Destailleur
6728ad3c37 Merge pull request #2148 from altatof/fixhook
FIX: hook insertExtraFields must return a returnvalue (0,1,-1)
2014-12-18 10:03:32 +01:00
Laurent Destailleur
4887f51174 Merge pull request #2158 from altatof/fix_fichinter_pdf_pagebreak
FIX: pagebreak on fichinter like in other documents
2014-12-18 10:02:25 +01:00
Laurent Destailleur
615456382d Merge pull request #2157 from altatof/fix_margin_jalon
FIX: avoid milestones in margin calculation
2014-12-18 10:01:11 +01:00
Christophe Battarel
c9f69279c7 FIX: pagebreak on fichinter like in other documents 2014-12-16 16:21:31 +01:00
Christophe Battarel
a4a1a991b8 FIX: avoid milestones in margin calculation 2014-12-15 14:13:57 +01:00
Christophe Battarel
27b47a4f48 FIX: dont put a mess with date and datetime extrafield value if already
in right format (the bug was in propale/order/invoice extrafields,
mainly visible with 2 datetime extrafields)
2014-12-12 14:31:36 +01:00
Christophe Battarel
a1bba472a0 FIX: hook insertExtraFields must return a returnvalue (0,1,-1) 2014-12-12 11:57:20 +01:00
Laurent Destailleur
fbb25eae11 Merge pull request #2138 from aspangaro/3.5-patch1
Correct in activity box
2014-12-10 11:31:48 +01:00
aspangaro
81dc1415de Untranslatable token in activity box 2014-12-09 05:04:39 +01:00
aspangaro
666e66e78f Correct link in activity box 2014-12-09 05:04:12 +01:00
Laurent Destailleur
b11ac14cf0 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-12-09 01:13:34 +01:00
Laurent Destailleur
1461072801 Fix: Paypal link were broken dur to SSL v3 closed. 2014-12-09 01:12:52 +01:00
Laurent Destailleur
293726c5e8 Merge pull request #2135 from FHenry/3.5
3.5
2014-12-07 23:58:30 +01:00
Florian HENRY
bd8b393d8a Fix [ bug #1740 ] Clone project make task date crazy 2014-12-05 21:25:43 +01:00
Florian HENRY
aaf2cca45f Fix bug n sellist extrafield filtered 2014-12-05 21:25:43 +01:00
Laurent Destailleur
9e1b0d1abc Prepare 3.5.6 2014-12-04 15:09:47 +01:00
Laurent Destailleur
bd8391163a Merge pull request #2067 from frederic34/patch-2
Fix bug 1692 Can't update phone_pro with the contact webservice
2014-11-23 16:48:33 +01:00
Laurent Destailleur
989cd87446 Merge pull request #2066 from altatof/fix_margin_recap
FIX: bad margin and buy_price calculation when total_ht = 0 (discount 100%) on a line
2014-11-23 16:48:21 +01:00
Frédéric FRANCE
891f8d9442 Fix bug 1692 Can't update phone_pro with the contact webservice 2014-11-22 19:02:15 +01:00
Laurent Destailleur
2f4de2ef75 Merge pull request #2016 from altatof/3.5
FIX: copy extrafields when creating order from propale and creating
2014-11-22 16:02:13 +01:00
Christophe Battarel
7d8cf99d58 FIX: bad margin and buy_price calculation when total_ht = 0 (discount
100%) on a line
2014-11-19 18:19:27 +01:00
Christophe Battarel
d0dc792b3c check extrafields before inserting in DB 2014-11-17 11:17:45 +01:00
Laurent Destailleur
2aeb0f4f5b Merge pull request #1941 from jfefe/patch-3
Avoid missing class error for fetch_thirdparty method
2014-11-15 12:36:41 +01:00
Christophe Battarel
7ed496d7d9 FIX: copy extrafields when creating order from propale and creating
invoice from order
2014-11-12 17:51:26 +01:00
Laurent Destailleur
606a3f9917 Merge remote-tracking branch 'origin/3.4' into 3.5 2014-11-04 17:54:09 +01:00
Laurent Destailleur
45d57b0492 Merge pull request #1995 from atm-maxime/3.4
Fix : actioncomme report was not filtering by entity...
2014-11-04 17:41:40 +01:00
Maxime Kohlhaas
ccddf0d1be Fix : actioncomme report was not filtering by entity... 2014-10-31 16:56:14 +01:00
Laurent Destailleur
e3041f45ee Update changelog 2014-10-30 18:08:42 +01:00
Laurent Destailleur
aac24c887f Merge pull request #1973 from jfefe/patch-6
Avoid missing class error for fetch_thirdparty method
2014-10-30 18:07:49 +01:00
jfefe
29db45c763 Avoid missing class error for fetch_thirdparty method 2014-10-23 01:15:05 +02:00
Laurent Destailleur
a94f7dc3ad Revert "Add function dolEscapeXML"
This reverts commit 756b1d31ad.
2014-10-16 01:21:33 +02:00
Laurent Destailleur
efa171819a Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-10-16 01:19:33 +02:00
Laurent Destailleur
756b1d31ad Add function dolEscapeXML 2014-10-16 01:01:30 +02:00
Regis Houssin
104592b349 Fix: wrong function name 2014-10-12 19:08:34 +02:00
Laurent Destailleur
797ab8a150 Merge pull request #1940 from aternatik/fix-cron
Missing reprogramming task into GUI for cron module.
2014-10-12 02:10:09 +02:00
jfefe
6a4468d94e Not need to test if class exists with require_once 2014-10-06 14:18:28 +02:00
jfefe
87fc27c7e6 Avoid missing class error for fetch_thirdparty method 2014-10-06 13:31:01 +02:00
jfefe
fdbf2fb45d Missing reprogramming task into GUI for cron module.
Without this, a new task is never executed (because without datenextrun defined)
2014-10-06 13:28:07 +02:00
Laurent Destailleur
c73f4a14ee Fix: Bad days returned by function 2014-10-05 16:17:09 +02:00
Laurent Destailleur
742d0e37ee Fix: Bad month return by function 2014-10-05 12:54:51 +02:00
Laurent Destailleur
05fe8e45b3 Exclude module dire from package 2014-10-03 19:07:49 +02:00
Laurent Destailleur
d455ee7b56 Merge pull request #1933 from atm-maxime/3.5
Fix : tva not coming from multiprice
2014-10-03 02:46:22 +02:00
Maxime Kohlhaas
920c9c7251 Fix : tva not coming from multiprice 2014-09-30 17:36:01 +02:00
Laurent Destailleur
959d463fc5 Merge pull request #1921 from altairis-fr/clone_extra
FIX: clone line extrafields value on quote, order and invoice
2014-09-24 17:44:49 +02:00
Christophe Battarel
2c52de3840 fix missing "," 2014-09-24 12:12:10 +02:00
Christophe Battarel
d1868b643e FIX: clone line extrafields value on quote, order and invoice 2014-09-24 11:47:34 +02:00
Laurent Destailleur
3a38153889 Typo error 2014-09-18 22:42:43 +02:00
Laurent Destailleur
015b0d8036 Fix: Bad calculation of total
Fix: Warning message not translated
2014-09-18 10:05:37 +02:00
Laurent Destailleur
f0ebd7721d Fix: Restore sort feature. Still did not see why previous commit is a
bug fix of dolibarr bug.
2014-09-17 17:49:39 +02:00
Regis Houssin
c6b5d0f96c Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-09-17 16:07:21 +02:00
Regis Houssin
d225d92c0b Fix: remove hook restriction ! 2014-09-17 16:03:21 +02:00
Laurent Destailleur
2c0a2937f6 Merge pull request #1887 from FHenry/3.5
add refext into fecth product
2014-09-15 23:19:58 +02:00
Florian HENRY
9493e252c9 add refext into fecth product 2014-09-15 09:56:40 +02:00
Laurent Destailleur
76ba3301c3 Fix: Syntax for license key 2014-09-14 22:34:17 +02:00
Laurent Destailleur
d812262ed8 Fix: Missing source 2014-09-14 21:52:52 +02:00
Laurent Destailleur
0dcd41ff01 Merge branch 'marcosgdf-bug-1546' into 3.5 2014-09-14 21:39:42 +02:00
Laurent Destailleur
c4facf20e6 Merge branch 'bug-1546' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1546

Conflicts:
	ChangeLog
2014-09-14 21:39:25 +02:00
Laurent Destailleur
e8758bc19b Merge branch 'marcosgdf-bug-1548' into 3.5 2014-09-14 21:37:41 +02:00
Laurent Destailleur
822a3ebe7e Merge branch 'bug-1548' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1548

Conflicts:
	ChangeLog
2014-09-14 21:37:15 +02:00
Laurent Destailleur
e93d474393 Merge branch 'marcosgdf-bug-1555' into 3.5 2014-09-14 21:35:24 +02:00
Laurent Destailleur
ef99de4e84 Merge branch 'bug-1555' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1555

Conflicts:
	ChangeLog
2014-09-14 21:35:07 +02:00
Laurent Destailleur
85338bacb4 Merge branch 'marcosgdf-bug-1577' into 3.5 2014-09-14 21:32:11 +02:00
Laurent Destailleur
2704f50bd4 Merge branch 'bug-1577' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1577

Conflicts:
	ChangeLog
2014-09-14 21:31:51 +02:00
Laurent Destailleur
f0d4ebe417 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Conflicts:
	ChangeLog
2014-09-14 21:26:56 +02:00
Laurent Destailleur
fcbb388a72 Merge branch 'marcosgdf-bug-1589' into 3.5 2014-09-14 21:26:04 +02:00
Laurent Destailleur
3daaaadf65 Merge pull request #1880 from marcosgdf/bug-1591
[ bug #1591 ] Linked object block shows Total HT/TTC even if not having permission to read them
2014-09-14 21:24:27 +02:00
Marcos García de La Fuente
7bac9444e6 [ bug #1546 ] Incorrect page number when searching in the list of bank transactions 2014-09-14 14:32:17 +02:00
Marcos García de La Fuente
9426298b95 [ bug #1548 ] Supplier payment card shows type in French 2014-09-14 14:19:46 +02:00
Marcos García de La Fuente
7a28f8e4aa [ bug #1555 ] Update accountancy code of products does not throw PRODUCT_MODIFY trigger 2014-09-14 13:59:06 +02:00
Marcos García de La Fuente
afd631e6e3 [ bug #1577 ] When creating new Private individual third, selected third type is ignored 2014-09-14 13:22:05 +02:00
Marcos García de La Fuente
74e16db632 [ bug #1589 ] Menu type in "Edit menu" page is not translated 2014-09-14 13:14:03 +02:00
Marcos García de La Fuente
949ae2f160 [ bug #1591 ] Linked object block shows Total HT/TTC even if not having permission to read them 2014-09-14 13:09:31 +02:00
Laurent Destailleur
ba70c1a08a Fix: typo on debian files 2014-09-13 20:47:34 +02:00
Laurent Destailleur
09878a3a32 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-09-13 19:05:03 +02:00
Laurent Destailleur
8dd9358214 Fix: SQL injection 2014-09-13 19:04:25 +02:00
Laurent Destailleur
b728ccb52f Merge pull request #1865 from FHenry/3.5
Add missing image into amarok theme
2014-09-11 17:13:06 +02:00
Laurent Destailleur
522b5a91bc Fix: Filter on direction of payment mode was not working.
Conflicts:
	htdocs/core/class/html.form.class.php
	htdocs/fourn/facture/fiche.php
2014-09-06 00:21:09 +02:00
Florian HENRY
b536c8a10c Add missing image into amarok theme 2014-09-03 10:24:41 +02:00
Laurent Destailleur
660557b4dd Merge pull request #1862 from FHenry/3.5
Fix: list event view lost type event filter
2014-09-02 19:34:07 +02:00
Laurent Destailleur
576512e339 Merge pull request #1815 from GPCsolutions/catbug
Fix categories bug
2014-09-02 19:05:05 +02:00
Florian HENRY
911aca399d save code event 2014-09-02 11:30:35 +02:00
Florian HENRY
67b308cb25 Fix: list event view lost type event filter 2014-09-02 11:15:01 +02:00
Juanjo Menent
1f0653dd6d Merge pull request #1860 from FHenry/3.5
Fix missing $user in create method
2014-09-01 18:31:22 +02:00
Florian HENRY
bff33166a5 Fix missing $user in create method 2014-09-01 11:49:44 +02:00
Regis Houssin
ff04729a07 Fix: strict mode 2014-08-28 19:38:18 +02:00
Regis Houssin
1aad1b6acd Fix: strict mode 2014-08-28 19:32:41 +02:00
Regis Houssin
48f9ef2574 Fix: php strict mode saga 2014-08-28 15:53:29 +02:00
Regis Houssin
4fdd98c4a7 Fix: another strict mode alert 2014-08-28 15:34:50 +02:00
Regis Houssin
a446318649 Fix: strict mode anarchy ;-)
check your variable please
2014-08-27 19:03:32 +02:00
Regis Houssin
cdd716eb9d Fix: error with php strict mode 2014-08-27 10:44:40 +02:00
Regis Houssin
28ad819ab4 Fix: error in strict mode 2014-08-26 09:49:15 +02:00
Juanjo Menent
4d0301f5df Merge pull request #1844 from atm-alexis/3.5
FIX error sql on update ficheinter
2014-08-23 14:32:25 +02:00
Alexis Algoud
b0163fbed2 FIX error sql on update ficheinter 2014-08-22 16:17:45 +02:00
Laurent Destailleur
8705dd4d1b Merge branch 'KreizIT-fix_1544' into 3.5 2014-08-21 23:30:04 +02:00
Laurent Destailleur
2cba55758b Merge branch 'fix_1544' of github.com:KreizIT/dolibarr into
KreizIT-fix_1544

Conflicts:
	ChangeLog
2014-08-21 23:29:38 +02:00
Regis Houssin
9fdfc740de Fix: define new ref before trigger 2014-08-18 20:25:57 +02:00
Laurent Destailleur
50eb2e2c15 Fix: backlink was wrong after deleting product or service. 2014-08-18 18:24:57 +02:00
Laurent Destailleur
741c093ac9 Merge pull request #1828 from atm-maxime/3.5
Fix : VAT and NPR rates where coming from multiprice...
2014-08-17 23:36:30 +02:00
Regis Houssin
86f1d59e3c Fix: broken feature: add param for use only "disabled" with delConstant
and "enabled" with setConstant
2014-08-17 15:12:20 +02:00
Laurent Destailleur
e7a8de18bf Fix: Minimum size for captcha 2014-08-17 15:05:42 +02:00
Maxime Kohlhaas
e760201a59 Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5 2014-08-14 14:26:01 +02:00
Maxime Kohlhaas
c6637207f8 Fix : VAT and NPR rates where coming from multiprice... 2014-08-14 14:25:41 +02:00
Raphaël Doursenaud
739d309a0d Updated category fix
Categories ID can be passed as strings
PSR code formatting
2014-08-14 08:46:51 +02:00
Cedric
8670a89ecb Fix #1544: Can remove date from invoice 2014-08-14 08:41:24 +02:00
Raphaël Doursenaud
1a9e98cda9 Fix categories bug
When using the string type,
$typeid == 1 matched all strings making other conditions ineffective.
2014-08-14 08:33:39 +02:00
Laurent Destailleur
0b2a81f4b8 Merge pull request #1821 from astebert/patch-1
Update bills.lang
2014-08-14 00:09:55 +02:00
astebert
9c7647a7ae Update bills.lang
Ligne 252 : Changement grammatical
- de "Paiements issue de l'acompte"
- en "Paiement issu de l'acompte"
2014-08-12 11:45:11 +02:00
149 changed files with 2795 additions and 1739 deletions

View File

@@ -8,9 +8,6 @@ notifications:
on_success: never # [always|never|change] default: change
on_failure: change # [always|never|change] default: always
services:
- memcached # will start memcached
# This will tell travis to run phpunit
language: php
php:
@@ -29,12 +26,6 @@ before_script:
- echo Home dir is `echo ~`
- export PHPV=`phpenv version-name`
- echo PHP version $PHPV
# - echo Update composer
# - ~/.phpenv/versions/$(phpenv version-name)/bin/composer.phar self-update
- echo Install phpcs then show installed rules
- pyrus install pear/PHP_CodeSniffer
- phpenv rehash
- phpcs -i
- echo Create dir $(pwd)/htdocs/documents
- sudo mkdir -p $(pwd)/htdocs/documents/admin/temp;
- sudo touch $(pwd)/htdocs/documents/dolibarr.log;
@@ -42,46 +33,87 @@ before_script:
- sudo chmod -R a+rwx $(pwd);
- sudo chown -R www-data:travis $(pwd)/htdocs/documents;
- find $(pwd)/htdocs/documents -type d -exec ls -alt {} \;
- echo Edit php.ini file
- echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# - echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo Init database
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo '<?php ' > htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then echo '$'dolibarr_main_db_type=\'mysqli\'';' >> htdocs/conf/conf.php; fi"
- echo '$'dolibarr_main_url_root=\'http://localhost/\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_document_root=\'$(pwd)/htdocs\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_data_root=\'$(pwd)/htdocs/documents\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_db_host=\'localhost\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_db_name=\'myapp_test\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_db_user=\'travis\'';' >> htdocs/conf/conf.php
- echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> htdocs/conf/conf.php
- echo '?>' >> htdocs/conf/conf.php
- echo Show conf.php content
- cat htdocs/conf/conf.php
- echo Install apache server
- sudo apt-get update
- sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 php5-curl php5-mysql php5-pgsql php5-intl
- sudo sed -i -e "s,/var/www,$(pwd)/htdocs,g" /etc/apache2/sites-available/default
- echo Show default virtual host
- sudo cat /etc/apache2/sites-available/default
- sudo /etc/init.d/apache2 restart
- wget http://localhost/
- cat index.html
- |
echo "Setting up PHP"
echo
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"
# 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
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!
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash
echo
- |
echo "Setting up database"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo "MySQL"
mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
mysql -D travis < dev/initdata/mysqldump_dolibarr_3.5.0.sql
fi
# FIXME: find a way to import a MySQL dump into PostgreSQL
#if [ "$DB" = 'postgresql' ]; then
# pgsql travis < dev/initdata/mysqldump_dolibarr_3.5.0.sql
#fi
# TODO: SQLite
echo
- |
export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE"
echo '<?php ' > $CONF_FILE
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
fi
# FIXME
#if [ "$DB" = 'postgresql' ]; then
# echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE
#fi
# TODO: SQLite
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
cat $CONF_FILE
echo
- |
echo "Setting up Apache + FPM"
# enable php-fpm
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
fi
if [ "$DEBUG" = true ]; then
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
fi
sudo a2enmod rewrite actions fastcgi alias
echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$DEBUG" = true ]; then
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm
# configure apache virtual hosts
sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default
sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default
if [ "$DEBUG" = true ]; then
sudo cat /etc/apache2/sites-available/default
fi
sudo service apache2 restart
echo
script:
- cd htdocs/install

View File

@@ -2,6 +2,58 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** 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
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
Fix: [ bug #1757 ] Sorting breaks product/service statistics
Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date
Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled
Fix: [ bug #1846 ] Browser IE11 not detected
Fix: [ bug #1906 ] Deplacement does not allow translated decimal format
Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card
Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers
Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null
Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error
Fix: [ bug #2976 ] "Report" tab is the current tab but it is not marked as selected by the UI
Fix: [ bug #2861 ] Undefined variable $res when migrating
Fix: [ bug #2837 ] Product list table column header does not match column body
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names
Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid
Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result
Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled
Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything
Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information
Fix: [ bug #3313 ] Error enabling module with PostgreSQL database
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973
Fix: Can't update phone_pro from web service
Fix: Some security holes.
Fix: copy extrafields when creating order from proposal.
Fix: report on action was not filtering by environment.
Fix: Avoid missing class error.
Fix: Add function dolEscapeXML.
Fix: Bad days and month reported by function.
Fix: Bad margin calculation.
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
@@ -18,9 +70,19 @@ Fix: Update impayees.php
Fix: Link product, In list view and label product.
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
Fix: When disabled, all fields to add time into task line must be disabled.
Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive.
Fix: Missing include files.lib.php in some pages to use dol_delete_recursive.
Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref.
Fix: [ bug #1553 ] Saving User displays setup removes menu.
Fix: [ bug #1544 ] Can remove date from invoice.
Fix: list event view lost type event filter.
Fix: Add code save on create event.
Fix: SQL injection.
Fix: [ bug #1589 ] Menu type in "Edit menu" page is not translated
Fix: [ bug #1591 ] Linked object block shows Total HT/TTC even if not having permission to read them
Fix: [ bug #1577 ] When creating new Private individual third, selected third type is ignored
Fix: [ bug #1555 ] Update accountancy code of products does not throw PRODUCT_MODIFY trigger
Fix: [ bug #1548 ] Supplier payment card shows type in French
Fix: [ bug #1546 ] Incorrect page number when searching in the list of bank transactions
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.

View File

@@ -1,3 +1,17 @@
dolibarr (3.5.7-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 12 May 2015 12:00:00 +0100
dolibarr (3.5.6-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 2 Dec 2014 12:00:00 +0100
dolibarr (3.5.5-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]

View File

@@ -39,10 +39,10 @@ Description: Web based software to manage a company or foundation
It's a web software you can install as a standalone program or on any web
hosting provider to use it from anywhere with any web browser.
.
Dolibarr was designed to be easy to use. Only the features that you need are
visible, depending on which modules were activated.
Dolibarr was designed to be easy to use. Only the features that you need
are visible, depending on which modules were activated.
.
Most common used modules are:
This is an example of most common used modules:
.
Customers, Suppliers or Prospects directory,
Contacts directory,
@@ -66,6 +66,6 @@ Description: Web based software to manage a company or foundation
Wizards to export and import data,
LDAP connectivity,
PDF exports,
And a lot of more modules...
And a lot more modules...
.
You can also add third parties external modules or develop yours.
You can also add external modules from third parties or develop yours.

View File

@@ -61,7 +61,7 @@ License: GPL-3+
Files: htdocs/includes/adodbtime/*
Copyright: 2003-2005, John Lim
unknown, jackbbs
License: BSD
License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@@ -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
@@ -272,7 +272,7 @@ Comment:
Files: htdocs/includes/jquery/plugins/flot/*
Copyright: Flot team
License: Public Domain
License: Public-Domain
This work is not subject to copyright in any jurisdiction
Comment:
Those files are not shipped in the binary package because we configure

View File

@@ -8,16 +8,20 @@ echo "tmpdir = $tmpdir"
if [ -n "$1" ]; then
uscan_opts="--download-version=$1"
fi
uscan --noconf --force-download --no-symlink --verbose --destdir=$tmpdir $uscan_opts
#uscan --noconf --force-download --no-symlink --verbose --destdir=$tmpdir $uscan_opts
cd $tmpdir
# Other method to download (comment uscan if you use this)
wget http://www.dolibarr.org/files/stable/standard/dolibarr-3.5.4.tgz
# Rename file to add +dfsg
tgzfile=$(echo *.tgz)
version=$(echo "$tgzfile" | perl -pi -e 's/^dolibarr-//; s/\.tgz$//; s/_/./g; s/\+nmu1//; ')
cd - >/dev/null
mv $tmpdir/dolibarr-${version}.tgz ../
echo "File ../dolibarr-${version}.tgz is ready for git-import"
echo "File ../dolibarr-${version}.tgz is ready for git-import-orig"
rm -rf $tmpdir

View File

@@ -17,9 +17,9 @@
; ----- Change this -----
AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
AppVerName=DoliWamp-3.5.5
AppVerName=__FILENAMEEXEDOLIWAMP__
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
OutputBaseFilename=DoliWamp-3.5.5
OutputBaseFilename=__FILENAMEEXEDOLIWAMP__
; ----- End of change
;OutputManifestFile=build\doliwampbuild.log
; Define full path from which all relative path are defined
@@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com
AppSupportURL=http://www.dolibarr.org
AppUpdatesURL=http://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno
AppCopyright=Copyright (C) 2008-2015 Laurent Destailleur, NLTechno
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
@@ -109,7 +109,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
; Dolibarr
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,xdebug\*"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
Source: "*.*"; DestDir: "{app}\www\dolibarr"; Flags: ignoreversion; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,default.properties,install.lock"

File diff suppressed because it is too large Load Diff

View File

@@ -12,8 +12,6 @@ beta version of Dolibarr, step by step.
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
- Update version number with x.y.z-w in build/debian/changelog
- Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z-w in build/rpm/*.spec
- Update version number with x.y in build/doxygen/dolibarr-doxygen.doxyfile
- Commit all changes.
- Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags
- Create a branch (x.y).
@@ -35,7 +33,6 @@ complete release of Dolibarr, step by step.
- Update version number with x.y.z in htdocs/filefunc.inc.php
- Update version number with x.y.z in build/debian/changelog
- Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z in build/rpm/*.spec
- Commit all changes.
- Add a Tag (x.y.z)

View File

@@ -331,20 +331,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3
- Upstream release
* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3
- Upstream release
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
- Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)
__CHANGELOGSTRING__

View File

@@ -567,20 +567,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3
- Upstream release
* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3
- Upstream release
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
- Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)
__CHANGELOGSTRING__

View File

@@ -336,20 +336,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3
- Upstream release
* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3
- Upstream release
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
- Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)
__CHANGELOGSTRING__

View File

@@ -347,20 +347,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Tue Jul 8 2014 Laurent Destailleur 3.5.5-0.3
- Upstream release
* Tue Jul 1 2014 Laurent Destailleur 3.5.4-0.3
- Upstream release
* Fri May 2 2014 Laurent Destailleur 3.5.3-0.3
- Upstream release
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
- Upstream release
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
- Upstream release
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)
__CHANGELOGSTRING__

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT ruleset (description,rule+)>
<!ELEMENT ruleset (description,exclude-pattern*,rule+)>
<!ATTLIST ruleset name CDATA "">
<!ELEMENT description (#PCDATA)>
<!ELEMENT exclude-pattern (#PCDATA)>
<!ELEMENT rule (properties*,severity*)>
<!ATTLIST rule ref CDATA "">
<!ELEMENT properties (property+)>

View File

@@ -3,6 +3,13 @@
<ruleset name="Dolibarr">
<description>Dolibarr coding standard.</description>
<exclude-pattern>*/conf.php</exclude-pattern>
<exclude-pattern>*/includes/*</exclude-pattern>
<exclude-pattern>*/documents/*</exclude-pattern>
<exclude-pattern>*/dev/vagrant/*</exclude-pattern>
<exclude-pattern>*/custom/*</exclude-pattern>
<exclude-pattern>*/nltechno*</exclude-pattern>
<!-- List of all tests -->
<rule ref="Internal.NoCodeFound">
@@ -10,7 +17,20 @@
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowed">
<severity>0</severity>
</rule>
@@ -46,6 +66,9 @@
</rule>
-->
<!-- PHP code MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark"/>
<!-- Lines can be 85 chars long, but never show errors -->
<rule ref="Generic.Files.LineLength">
<properties>
@@ -93,7 +116,7 @@
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="80" />
<property name="absoluteComplexity" value="200" />
<property name="absoluteComplexity" value="250" />
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
@@ -150,7 +173,75 @@
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@categoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@licenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@linkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<!--
<rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
@@ -207,6 +298,24 @@
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue" />
@@ -224,6 +333,10 @@
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
<severity>0</severity>
</rule>

1
htdocs/.gitignore vendored
View File

@@ -2,6 +2,7 @@
/custom*
/extensions*
/nltechno*
/teclib*
/bootstrap*
/google*
/multicompany*

View File

@@ -1072,7 +1072,7 @@ class Adherent extends CommonObject
if ($rowid) $sql.= " AND d.rowid=".$rowid;
elseif ($ref || $fk_soc) {
$sql.= " AND d.entity IN (".getEntity().")";
if ($ref) $sql.= " AND d.rowid='".$ref."'";
if ($ref) $sql.= " AND d.rowid='".$this->db->escape($ref)."'";
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
}
elseif ($ref_ext)

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013-2015 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
@@ -97,7 +97,7 @@ $sql.= ", ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
if ($catid > 0) $sql.= " AND cm.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cm.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$search_categ;
if ($search_categ > 0) $sql.= " AND cm.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL";
$sql.= " AND d.entity = ".$conf->entity;
if ($sall)
@@ -106,36 +106,36 @@ if ($sall)
$scrit = explode(' ', $sall);
foreach ($scrit as $crit) {
$sql.=" AND (";
if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR ";
$sql.=" d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
$sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
$sql.=" OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
if (is_numeric($sall)) $sql.= "d.rowid = ".$db->escape($sall)." OR ";
$sql.=" d.firstname LIKE '%".$db->escape($sall)."%' OR d.lastname LIKE '%".$db->escape($sall)."%' OR d.societe LIKE '%".$db->escape($sall)."%'";
$sql.=" OR d.email LIKE '%".$db->escape($sall)."%' OR d.login LIKE '%".$db->escape($sall)."%' OR d.address LIKE '%".$db->escape($sall)."%'";
$sql.=" OR d.town LIKE '%".$db->escape($sall)."%' OR d.note LIKE '%".$db->escape($sall)."%')";
}
}
if ($type > 0)
{
$sql.=" AND t.rowid=".$type;
$sql.=" AND t.rowid=".$db->escape($type);
}
if (isset($_GET["statut"]) || isset($_POST["statut"]))
{
$sql.=" AND d.statut in (".$statut.")"; // Peut valoir un nombre ou liste de nombre separes par virgules
$sql.=" AND d.statut in (".$db->escape($statut).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
}
if ($search_ref)
{
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$search_ref.")";
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_lastname)
{
$sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
$sql.= " AND (d.firstname LIKE '%".$db->escape($search_lastname)."%' OR d.lastname LIKE '%".$db->escape($search_lastname)."%')";
}
if ($search_login)
{
$sql.= " AND d.login LIKE '%".$search_login."%'";
$sql.= " AND d.login LIKE '%".$db->escape($search_logi)."%'";
}
if ($search_email)
{
$sql.= " AND (d.email LIKE '%".$search_email."%')";
$sql.= " AND (d.email LIKE '%".$db->escape($search_email)."%')";
}
if ($filter == 'uptodate')
{
@@ -188,17 +188,17 @@ if ($resql)
}
$param="";
if ($statut != "") $param.="&statut=".$statut;
if ($search_nom) $param.="&search_nom=".$search_nom;
if ($search_login) $param.="&search_login=".$search_login;
if ($search_email) $param.="&search_email=".$search_email;
if ($filter) $param.="&filter=".$filter;
if ($type > 0) $param.="&type=".$type;
if ($statut != "") $param.="&statut=".htmlspecialchars($statut);
if ($search_nom) $param.="&search_nom=".htmlspecialchars($search_nom);
if ($search_login) $param.="&search_login=".htmlspecialchars($search_login);
if ($search_email) $param.="&search_email=".htmlspecialchars($search_email);
if ($filter) $param.="&filter=".htmlspecialchars($filter);
if ($type > 0) $param.="&type=".htmlspecialchars($type);
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
if ($sall)
{
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".htmlspecialchars($sall);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
@@ -236,13 +236,13 @@ if ($resql)
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_ref" value="'.$search_ref.'" size="4"></td>';
print '<input class="flat" type="text" name="search_ref" value="'.htmlspecialchars($search_ref).'" size="4"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_lastname" value="'.$search_lastname.'" size="12"></td>';
print '<input class="flat" type="text" name="search_lastname" value="'.htmlspecialchars($search_lastname).'" size="12"></td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_login" value="'.$search_login.'" size="7"></td>';
print '<input class="flat" type="text" name="search_login" value="'.htmlspecialchars($search_login).'" size="7"></td>';
print '<td class="liste_titre">';
$listetype=$membertypestatic->liste_array();
@@ -252,7 +252,7 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_email" value="'.$search_email.'" size="12"></td>';
print '<input class="flat" type="text" name="search_email" value="'.htmlspecialchars($search_email).'" size="12"></td>';
print '<td class="liste_titre">&nbsp;</td>';

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
@@ -88,7 +89,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;
@@ -201,9 +202,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

@@ -6,7 +6,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
@@ -1104,7 +1104,7 @@ if ($id)
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;';
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?urlencode($obj->code):'').'&amp;id='.$id.'&amp;';
// Active
print '<td align="center" class="nowrap">';

View File

@@ -317,7 +317,7 @@ if ($action == 'create')
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td><td>';
if ($parent_rowid)
{
print 'Left';
print $langs->trans('Left');
print '<input type="hidden" name="type" value="left">';
}
else

View File

@@ -39,6 +39,7 @@ if ( $_SESSION['uid'] > 0 )
}
$usertxt=GETPOST('user','',1);
$err=GETPOST("err");
/*
@@ -64,7 +65,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
<div class="contenu">
<div class="principal_login">
<?php if (! empty($_GET["err"])) print $_GET["err"]."<br><br>\n"; ?>
<?php if ($err) print dol_escape_htmltag($err)."<br><br>\n"; ?>
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Identification"); ?></legend>
<form id="frmLogin" method="POST" action="index_verif.php">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />

View File

@@ -1122,12 +1122,29 @@ class Categorie
{
$cats = array();
$table=''; $type='';
if ($typeid == 0 || $typeid == 'product') { $typeid=0; $table='product'; $type='product'; }
else if ($typeid == 1 || $typeid == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; }
else if ($typeid == 2 || $typeid == 'customer') { $typeid=2; $table='societe'; $type='societe'; }
else if ($typeid == 3 || $typeid == 'member') { $typeid=3; $table='member'; $type='member'; }
else if ($typeid == 4 || $typeid == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; }
$table = '';
$type = '';
if ($typeid === 0 || $typeid === '0' || $typeid == 'product') {
$typeid = 0;
$table = 'product';
$type = 'product';
} else if ($typeid === 1 || $typeid === '1' || $typeid == 'supplier') {
$typeid = 1;
$table = 'societe';
$type = 'fournisseur';
} else if ($typeid === 2 || $typeid === '2' || $typeid == 'customer') {
$typeid = 2;
$table = 'societe';
$type = 'societe';
} else if ($typeid === 3 || $typeid === '3' || $typeid == 'member') {
$typeid = 3;
$table = 'member';
$type = 'member';
} else if ($typeid === 4 || $typeid === '4' || $typeid == 'contact') {
$typeid = 4;
$table = 'socpeople';
$type = 'contact';
}
$sql = "SELECT ct.fk_categorie, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";

View File

@@ -132,7 +132,7 @@ if ($action == 'add' && $user->rights->categorie->creer)
// Create category in database
if (! $error)
{
$result = $object->create();
$result = $object->create($user);
if ($result > 0)
{
$action = 'confirmed';

View File

@@ -264,11 +264,11 @@ if ($object->id)
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight))
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->entity.'&amp;action=addthumb&amp;type='.$type.'&amp;file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=addthumb&amp;type='.$type.'&amp;file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>';
}
if ($user->rights->categorie->creer)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->entity.'&amp;action=delete&amp;type='.$type.'&amp;file='.urlencode($pdir.$viewfilename).'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete&amp;type='.$type.'&amp;file='.urlencode($pdir.$viewfilename).'">';
print img_delete().'</a>';
}
if ($nbbyrow) print '</td>';

View File

@@ -140,6 +140,7 @@ class ActionComm extends CommonObject
if ($result > 0)
{
$this->type_id=$cactioncomm->id;
$this->code=$cactioncomm->code;
}
else if ($result == 0)
{

View File

@@ -184,18 +184,19 @@ if ($action=='show_week')
$prev_month = $prev['prev_month'];
$prev_day = $prev['prev_day'];
$first_day = $prev['first_day'];
$first_month= $prev['first_month'];
$first_year = $prev['first_year'];
$week = $prev['week'];
$day = (int) $day;
$next = dol_get_next_week($day, $week, $month, $year);
$next = dol_get_next_week($first_day, $week, $first_month, $first_year);
$next_year = $next['year'];
$next_month = $next['month'];
$next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$first_day,$prev_year);
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@@ -870,39 +871,27 @@ elseif ($action == 'show_week') // View by week
}
echo " </tr>\n";
// In loops, tmpday contains day nb in current month (can be zero or negative for days of previous month)
//var_dump($eventarray);
//print $tmpday;
echo " <tr>\n";
for($iter_day = 0; $iter_day < 7; $iter_day++)
{
if(($tmpday <= $max_day_in_month))
{
// Show days of the current week
$curtime = dol_mktime(0, 0, 0, $month, $tmpday, $year);
// Show days of the current week
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
$tmparray = dol_getdate($curtime,'fast');
$tmpday = $tmparray['mday'];
$tmpmonth = $tmparray['mon'];
$tmpyear = $tmparray['year'];
$style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month_right';
$today=0;
$todayarray=dol_getdate($now,'fast');
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
if ($today) $style='cal_today';
$style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month_right';
$today=0;
$todayarray=dol_getdate($now,'fast');
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
if ($today) $style='cal_today';
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo " </td>\n";
}
else
{
$style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month_right';
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo "</td>\n";
}
$tmpday++;
echo ' <td class="'.$style.'" width="14%" valign="top">';
show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo " </td>\n";
}
echo " </tr>\n";

View File

@@ -211,7 +211,7 @@ if ($resql)
$head = calendars_prepare_head('');
dol_fiche_head($head, 'card', $langs->trans('Events'), 0, 'list');
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1);
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,$actioncode);
dol_fiche_end();
// Add link to show birthdays

View File

@@ -494,6 +494,27 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}
}
if ($_POST['sendtocc'])
{
// Le destinataire a ete fourni via le champ libre
$sendtocc = $_POST['sendtocc'];
$sendtoccid = 0;
}
elseif ($_POST['receivercc'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receivercc'] == 'thirdparty') // Id of third party
{
$sendtocc = $object->client->email;
$sendtoccid = 0;
}
else // Id du contact
{
$sendtocc = $object->client->contact_get_property($_POST['receivercc'],'email');
$sendtoccid = $_POST['receivercc'];
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
@@ -501,7 +522,6 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
@@ -738,8 +758,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
else
{

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
@@ -528,13 +528,14 @@ class Propal extends CommonObject
$price = $pu - $remise;
}
// Update line
$this->line=new PropaleLigne($this->db);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new PropaleLigne($this->db);
$line->fetch($rowid);
// Stock previous line records
$staticline=new PropaleLigne($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)
@@ -787,7 +788,10 @@ class Propal extends CommonObject
$fk_parent_line,
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label
$this->lines[$i]->label,
$this->lines[$i]->date_start,
$this->lines[$i]->date_end,
$this->lines[$i]->array_options
);
if ($result < 0)
@@ -922,6 +926,10 @@ class Propal extends CommonObject
$this->db->begin();
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);
@@ -2838,10 +2846,12 @@ class PropaleLigne extends CommonObject
$this->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result);
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}
@@ -2869,11 +2879,12 @@ class PropaleLigne extends CommonObject
if (empty($this->total_localtax2)) $this->total_localtax2=0;
if (empty($this->rang)) $this->rang=0;
if (empty($this->remise)) $this->remise=0;
if (empty($this->remise_percent)) $this->remise_percent=0;
if (empty($this->remise_percent) || ! is_numeric($this->remise_percent)) $this->remise_percent=0;
if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
if (! is_numeric($this->qty)) $this->qty = 0;
if (empty($this->pa_ht)) $this->pa_ht=0;

View File

@@ -141,7 +141,9 @@ if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client,';
if (! $sall) $sql = 'SELECT';
else $sql = 'SELECT DISTINCT';
$sql.= ' s.rowid, s.nom, s.town, s.client, s.code_client,';
$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -27,6 +28,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@@ -52,17 +55,23 @@ foreach($linkedObjectBlock as $object)
<a href="<?php echo DOL_URL_ROOT.'/comm/propal.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowPropal"),"propal").' '.$object->ref; ?></a></td>
<td><?php echo $object->ref_client; ?></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->propale->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="3"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->propale->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

@@ -1,15 +1,15 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
@@ -290,6 +290,13 @@ class Commande extends CommonOrder
}
}
// Set new ref and current status
if (! $error)
{
$this->ref = $num;
$this->statut = 1;
}
if (! $error)
{
// Appel des triggers
@@ -300,13 +307,6 @@ class Commande extends CommonOrder
// Fin appel triggers
}
// Set new ref and current status
if (! $error)
{
$this->ref = $num;
$this->statut = 1;
}
if (! $error)
{
$this->db->commit();
@@ -367,7 +367,7 @@ class Commande extends CommonOrder
{
$mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
if ($result < 0) { $error++; }
}
}
@@ -555,7 +555,7 @@ class Commande extends CommonOrder
{
$mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderCanceledInDolibarr",$this->ref));
if ($result < 0) {
$error++;
}
@@ -712,7 +712,8 @@ class Commande extends CommonOrder
$fk_parent_line,
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label
$this->lines[$i]->label,
$this->lines[$i]->array_options
);
if ($result < 0)
{
@@ -850,6 +851,10 @@ class Commande extends CommonOrder
$this->db->begin();
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);
@@ -876,6 +881,7 @@ class Commande extends CommonOrder
// Clear fields
$this->user_author_id = $user->id;
$this->user_valid = '';
$this->date = dol_now();
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
@@ -967,7 +973,12 @@ class Commande extends CommonOrder
$line->marge_tx = $marginInfos[1];
$line->marque_tx = $marginInfos[2];
$this->lines[$i] = $line;
// get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;
$this->lines[$i] = $line;
}
$this->socid = $object->socid;
@@ -986,6 +997,11 @@ class Commande extends CommonOrder
$this->origin = $object->element;
$this->origin_id = $object->id;
// get extrafields from original line
$object->fetch_optionals($object->id);
foreach($object->array_options as $options_key => $value)
$this->array_options[$options_key] = $value;
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
@@ -2334,13 +2350,14 @@ class Commande extends CommonOrder
$price = ($pu - $remise);
}
// Update line
$this->line=new OrderLine($this->db);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new OrderLine($this->db);
$line->fetch($rowid);
// Stock previous line records
$staticline=new OrderLine($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)
@@ -3141,10 +3158,12 @@ class OrderLine extends CommonOrderLine
$this->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result);
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@@ -686,8 +686,6 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
else
{

View File

@@ -34,7 +34,7 @@ $langs->load("sendings");
// Security check
$socid=0;
$comid = isset($_GET["id"])?$_GET["id"]:'';
$comid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'commande',$comid,'');
@@ -47,8 +47,8 @@ $result=restrictedArea($user,'commande',$comid,'');
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
$commande = new Commande($db);
$commande->fetch($_GET["id"]);
$commande->info($_GET["id"]);
$commande->fetch($comid);
$commande->info($comid);
$soc = new Societe($db);
$soc->fetch($commande->socid);

View File

@@ -45,7 +45,7 @@ $langs->load('companies');
if (! $user->rights->facture->creer)
accessforbidden();
$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$id = (GETPOST('id')?GETPOST('id','int'):GETPOST("facid")); // For backward compatibility
$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
@@ -97,7 +97,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('bills');
$langs->load('products');
$langs->load('main');
@@ -213,7 +213,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$result=$objectsrc->fetch($orders_id[$ii]);
if ($result > 0)
{
if ($closeOrders)
if ($closeOrders)
{
$objectsrc->classifyBilled();
$objectsrc->setStatut(3);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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,6 +23,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@@ -47,17 +50,23 @@ foreach($linkedObjectBlock as $object)
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->commande->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="2"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->commande->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -253,17 +253,22 @@ if ($id > 0 || ! empty($ref))
//Total pages
$totalPages = ceil($total_lines/$viewline);
if ($page > 0)
{
$limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) $limitsql = $viewline;
$nbline = $limitsql;
}
else
{
if ($totalPages == 0) {
$page = 0;
$limitsql = $nbline;
} else {
if ($page > 0) {
$limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) {
$limitsql = $viewline;
}
$nbline = $limitsql;
} else {
$page = 0;
$limitsql = $nbline;
}
}
//print $limitsql.'-'.$page.'-'.$viewline;
// Onglets

View File

@@ -34,7 +34,7 @@ $langs->load("categories");
$langs->load("bills");
$action=GETPOST('action');
$id=GETPOST('id');
$id=GETPOST('id','int');
// Security check
if (isset($_GET["id"]) || isset($_GET["ref"]))

View File

@@ -1133,7 +1133,6 @@ class AccountLine extends CommonObject
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copytight (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copytight (C) 2012 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
* it under the terms of the GNU General Public License as published by
@@ -48,7 +49,7 @@ if ($action == 'add')
$mesg='';
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$label = GETPOST('label','alpha');
$amount= GETPOST('amount','int');
$amount= GETPOST('amount');
if (! $label)
{
@@ -179,7 +180,7 @@ print $form->select_comptes($account_to,'account_to',0,'',1);
print "</td>\n";
print "<td>";
$form->select_date($dateo,'','','','','add');
$form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
print "</td>\n";
print '<td><input name="label" class="flat" type="text" size="40" value="'.$label.'"></td>';
print '<td><input name="amount" class="flat" type="text" size="8" value="'.$amount.'"></td>';

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -123,8 +124,14 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
{
$error=0;
$km = GETPOST('km');
if ($km) {
$km = price2num($km);
}
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$object->km = GETPOST('km','int');
$object->km = $km;
$object->type = GETPOST('type','alpha');
$object->socid = GETPOST('socid','int');
$object->fk_user = GETPOST('fk_user','int');
@@ -182,8 +189,14 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
{
$result = $object->fetch($id);
$km = GETPOST('km');
if ($km) {
$km = price2num($km);
}
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$object->km = GETPOST('km','int');
$object->km = $km;
$object->type = GETPOST('type','alpha');
$object->socid = GETPOST('socid','int');
$object->fk_user = GETPOST('fk_user','int');
@@ -225,12 +238,6 @@ else if ($action == 'setdated' && $user->rights->deplacement->creer)
$result=$object->setValueFrom('dated',$dated,'','','date');
if ($result < 0) dol_print_error($db, $object->error);
}
else if ($action == 'setkm' && $user->rights->deplacement->creer)
{
$object->fetch($id);
$result=$object->setValueFrom('km',GETPOST('km','int'));
if ($result < 0) dol_print_error($db, $object->error);
}
else if ($action == 'setnote_public' && $user->rights->deplacement->creer)
{
$object->fetch($id);
@@ -385,7 +392,7 @@ else if ($id)
// Km
print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td>';
print '<input name="km" class="flat" size="10" value="'.$object->km.'">';
print '<input name="km" class="flat" size="10" value="'.price($object->km).'">';
print '</td></tr>';
// Where
@@ -453,10 +460,12 @@ else if ($id)
print '</td></tr>';
// Type
$form->load_cache_types_fees();
print '<tr><td>';
print $form->editfieldkey("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
print '</td><td>';
print $form->editfieldval("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
print $form->editfieldval("Type",'type', $form->cache_types_fees[$object->type],$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
print '</td></tr>';
// Who
@@ -477,7 +486,7 @@ else if ($id)
print '<tr><td valign="top">';
print $form->editfieldkey("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
print '</td><td>';
print $form->editfieldval("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
print $form->editfieldval("FeesKilometersOrAmout",'km',price($object->km),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
print "</td></tr>";
// Where

View File

@@ -282,7 +282,15 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
{
$object->fetch($id);
$old_date_lim_reglement=$object->date_lim_reglement;
$object->date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
$date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
if (empty($date))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate');
exit;
}
$object->date=$date;
$new_date_lim_reglement=$object->calculate_date_lim_reglement();
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;
@@ -1254,8 +1262,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
$price_min = $prod->multiprices_min[$object->client->price_level];
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
}
else
{
@@ -1706,6 +1712,27 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
}
if ($_POST['sendtocc'])
{
// Le destinataire a ete fourni via le champ libre
$sendtocc = $_POST['sendtocc'];
$sendtoccid = 0;
}
elseif ($_POST['receivercc'] != '-1')
{
// Recipient was provided from combo list
if ($_POST['receivercc'] == 'thirdparty') // Id of third party
{
$sendtocc = $object->client->email;
$sendtoccid = 0;
}
else // Id du contact
{
$sendtocc = $object->client->contact_get_property($_POST['receivercc'],'email');
$sendtoccid = $_POST['receivercc'];
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
@@ -1713,7 +1740,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
$deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send')
@@ -2344,7 +2370,7 @@ if ($action == 'create')
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
$form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id, 'mode_reglement_id', 'CRDT');
print '</td></tr>';
// Project
@@ -3348,11 +3374,11 @@ else if ($id > 0 || ! empty($ref))
print '</td><td colspan="3">';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
}
else
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id,$object->mode_reglement_id,'none');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none', 'CRDT');
}
print '</td></tr>';
@@ -3804,7 +3830,7 @@ else if ($id > 0 || ! empty($ref))
// Linked object block
$somethingshown=$object->showLinkedObjectBlock();
if (empty($somethingshown) && ! empty($conf->commande->enabled))
if (empty($somethingshown) && ! empty($conf->commande->enabled))
{
print '<br><a href="#" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>';

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 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>
@@ -367,7 +367,8 @@ class Facture extends CommonInvoice
$fk_parent_line,
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label
$this->lines[$i]->label,
$this->lines[$i]->array_options
);
if ($result < 0)
{
@@ -569,6 +570,10 @@ class Facture extends CommonInvoice
$this->db->begin();
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);
@@ -696,6 +701,11 @@ class Facture extends CommonInvoice
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
$line->pa_ht = $marginInfos[0];
// get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;
$this->lines[$i] = $line;
}
@@ -715,6 +725,11 @@ class Facture extends CommonInvoice
$this->origin = $object->element;
$this->origin_id = $object->id;
// get extrafields from original line
$object->fetch_optionals($object->id);
foreach($object->array_options as $options_key => $value)
$this->array_options[$options_key] = $value;
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects))
@@ -1781,7 +1796,7 @@ class Facture extends CommonInvoice
{
$mouvP = new MouvementStock($this->db);
// We decrease stock for product
if ($this->type == 2) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($this->type == 2) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr",$num));
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($result < 0) {
$error++;
@@ -2209,13 +2224,14 @@ class Facture extends CommonInvoice
}
$price = price2num($price);
// Update line into database
$this->line=new FactureLigne($this->db);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new FactureLigne($this->db);
$line->fetch($rowid);
// Stock previous line records
$staticline=new FactureLigne($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)
@@ -3456,10 +3472,12 @@ class FactureLigne extends CommonInvoiceLine
$this->product_desc = $objp->product_desc;
$this->db->free($result);
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@@ -217,6 +217,13 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1);
//Array passed as an argument to Form::selectarray to build a proper select input
$companies = array();
foreach ($tmp_companies as $value) {
$companies[$value['value']] = $value['label'];
}
print '<div class="fichecenter"><div class="fichethirdleft">';
@@ -232,7 +239,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1';
print $form->select_company($socid,'socid',$filter,1);
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"');
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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,6 +23,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@@ -47,16 +50,22 @@ foreach($linkedObjectBlock as $object)
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/compta/facture.php?facid='.$object->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->facture->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="2"><?php echo $langs->trans("TotalHT"); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->facture->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 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
@@ -685,7 +686,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$chargestatic->lib=$obj->libelle;
$chargestatic->paye=$obj->paye;
print '<td>'.$chargestatic->getNomUrl(1).'</td>';
print '<td align="center">'.dol_print_date($obj->date_ech,'day').'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_ech),'day').'</td>';
print '<td align="right">'.price($obj->amount).'</td>';
print '<td align="right">'.price($obj->sumpaid).'</td>';
print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
@@ -1026,7 +1027,7 @@ if ($resql)
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var]."><td>".dol_print_date($obj->da,"day")."</td>";
print "<tr ".$bc[$var]."><td>".dol_print_date($db->jdate($obj->da),"day")."</td>";
print "<td><a href=\"action/fiche.php\">$obj->libelle $obj->label</a></td></tr>";
$i++;
}

View File

@@ -907,7 +907,7 @@ class BonPrelevement extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
$sql.= " ref, entity, datec";
$sql.= ") VALUES (";
$sql.= "'".$ref."'";
$sql.= "'".$this->db->escape($ref)."'";
$sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ")";

View File

@@ -87,7 +87,7 @@ class RejetPrelevement
dol_syslog("RejetPrelevement::Create id $id");
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
$facs = $this->getListInvoices();
$facs = $this->getListInvoices(1);
$this->db->begin();
@@ -132,7 +132,7 @@ class RejetPrelevement
for ($i = 0; $i < $num; $i++)
{
$fac = new Facture($this->db);
$fac->fetch($facs[$i]);
$fac->fetch($facs[$i][0]);
// Make a negative payment
$pai = new Paiement($this->db);
@@ -144,7 +144,7 @@ class RejetPrelevement
* PHP installs sends only the part integer negative
*/
$pai->amounts[$facs[$i]] = price2num($fac->total_ttc * -1);
$pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * -1);
$pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal
$pai->num_paiement = $fac->ref;
@@ -152,7 +152,7 @@ class RejetPrelevement
if ($pai->create($this->user) < 0) // we call with no_commit
{
$error++;
dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i]);
dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]);
}
else
{
@@ -269,22 +269,24 @@ class RejetPrelevement
}
/**
* Retrieve the list of invoices
* Retrieve the list of invoices
* @param int $amounts If you want to get the amount of the order for each invoice
*
* @return void
* @return Array List of invoices related to the withdrawal line
* @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ?
*/
private function getListInvoices()
private function getListInvoices($amounts=0)
{
global $conf;
$arr = array();
//Returns all invoices of a withdrawal
$sql = "SELECT f.rowid as facid";
$sql = "SELECT f.rowid as facid, pl.amount";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf";
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_lignes as pl ON (pf.fk_prelevement_lignes = pl.rowid)";
$sql.= " WHERE pf.fk_prelevement_lignes = ".$this->id;
$sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND f.entity = ".$conf->entity;
$resql=$this->db->query($sql);
@@ -298,7 +300,14 @@ class RejetPrelevement
while ($i < $num)
{
$row = $this->db->fetch_row($resql);
$arr[$i] = $row[0];
if (!$amounts) $arr[$i] = $row[0];
else
{
$arr[$i] = array(
$row[0],
$row[1]
);
}
$i++;
}
}

View File

@@ -78,19 +78,19 @@ $sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_line)
{
$sql.= " AND pl.rowid = '".$search_line."'";
$sql.= " AND pl.rowid = '".$db->escape($search_line)."'";
}
if ($search_bon)
{
$sql.= " AND p.ref LIKE '%".$search_bon."%'";
$sql.= " AND p.ref LIKE '%".$db->escape($search_bon)."%'";
}
if ($search_code)
{
$sql.= " AND s.code_client LIKE '%".$search_code."%'";
$sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
}
if ($search_societe)
{
$sql .= " AND s.nom LIKE '%".$search_societe."%'";
$sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'";
}
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($conf->liste_limit+1, $offset);
@@ -104,7 +104,7 @@ if ($result)
$urladd = "&amp;statut=".$statut;
$urladd .= "&amp;search_bon=".$search_bon;
print_barre_liste($langs->trans("WithdrawalsLines"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num);
print"\n<!-- debut table -->\n";
print '<table class="liste" width="100%">';

View File

@@ -76,7 +76,8 @@ $sql.= " AND pl.fk_prelevement_bons = p.rowid";
$sql.= " AND pl.fk_soc = s.rowid";
$sql.= " AND p.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
$sql.= " ".$db->order($sortfield, $sortorder);
$sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql);
if ($result)

View File

@@ -30,7 +30,7 @@ $langs->load("companies");
if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check
$socid = $_GET["socid"];
$socid = GETPOST("socid",'int');
if ($user->societe_id > 0)
{
$action = '';

View File

@@ -33,81 +33,80 @@ $id = GETPOST('id', 'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db);
/*
* View
*/
$form = new Form($db);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db);
$contact = new Contact($db);
$contact->fetch($id, $user);
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
if ($id > 0)
{
if ($contact->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($contact->socid);
$contact->fetch($id, $user);
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
if ($contact->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($contact->socid);
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td width="15%">'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $contact->getCivilityLabel();
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
print $langs->trans("ExportCardToFormat").': ';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
print img_picto($langs->trans("VCard"),'vcard.png').' ';
print $langs->trans("VCard");
print '</a>';
}
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $contact->getCivilityLabel();
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
print $langs->trans("ExportCardToFormat").': ';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
print img_picto($langs->trans("VCard"),'vcard.png').' ';
print $langs->trans("VCard");
print '</a>';
$db->close();
llxFooter();
?>

View File

@@ -31,37 +31,40 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
$langs->load("companies");
// Security check
$contactid = isset($_GET["id"])?$_GET["id"]:'';
$contactid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
$contact = new Contact($db);
/*
* View
*/
* View
*/
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
if ($contactid > 0)
{
$result = $contact->fetch($contactid, $user);
$contact = new Contact($db);
$contact->fetch($_GET["id"], $user);
$contact->info($_GET["id"]);
$contact->info($contactid);
$head = contact_prepare_head($contact);
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'info', $langs->trans("ContactsAddresses"), 0, 'contact');
dol_fiche_head($head, 'info', $langs->trans("ContactsAddresses"), 0, 'contact');
print '<table width="100%"><tr><td>';
print '</td></tr></table>';
print '<table width="100%"><tr><td>';
print '</td></tr></table>';
dol_print_object_info($contact);
dol_print_object_info($contact);
print "</div>";
print "</div>";
}
llxFooter();
$db->close();
?>

View File

@@ -40,37 +40,40 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db);
$contact->fetch($id, $user);
/*
* Actions
*/
if ($action == 'dolibarr2ldap')
if ($id > 0)
{
$message="";
$contact->fetch($id, $user);
$db->begin();
/*
* Actions
*/
$ldap=new Ldap();
$result=$ldap->connect_bind();
$info=$contact->_load_ldap_info();
$dn=$contact->_load_ldap_dn($info);
$olddn=$dn; // We can say that old dn = dn as we force synchro
$result=$ldap->update($dn,$info,$user,$olddn);
if ($result >= 0)
if ($action == 'dolibarr2ldap')
{
$message.='<div class="ok">'.$langs->trans("ContactSynchronized").'</div>';
$db->commit();
}
else
{
$message.='<div class="error">'.$ldap->error.'</div>';
$db->rollback();
$message="";
$db->begin();
$ldap=new Ldap();
$result=$ldap->connect_bind();
$info=$contact->_load_ldap_info();
$dn=$contact->_load_ldap_dn($info);
$olddn=$dn; // We can say that old dn = dn as we force synchro
$result=$ldap->update($dn,$info,$user,$olddn);
if ($result >= 0)
{
$message.='<div class="ok">'.$langs->trans("ContactSynchronized").'</div>';
$db->commit();
}
else
{
$message.='<div class="error">'.$ldap->error.'</div>';
$db->rollback();
}
}
}
@@ -79,138 +82,139 @@ if ($action == 'dolibarr2ldap')
* View
*/
$form = new Form($db);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db);
$head = contact_prepare_head($contact);
dol_fiche_head($head, 'ldap', $title, 0, 'contact');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($contact,'id');
print '</td></tr>';
// Name
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td>'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company
if ($contact->socid > 0)
if ($id > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($contact->socid);
$head = contact_prepare_head($contact);
print '<tr><td width="20%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td width="20%">'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
dol_fiche_head($head, 'ldap', $title, 0, 'contact');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($contact,'id');
print '</td></tr>';
}
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $contact->getCivilityLabel();
print '</td></tr>';
// Name
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td>'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// LDAP DN
print '<tr><td>LDAP '.$langs->trans("LDAPContactDn").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_CONTACT_DN."</td></tr>\n";
// LDAP Cle
print '<tr><td>LDAP '.$langs->trans("LDAPNamingAttribute").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_KEY_CONTACTS."</td></tr>\n";
// LDAP Server
print '<tr><td>LDAP '.$langs->trans("LDAPPrimaryServer").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_HOST."</td></tr>\n";
print '<tr><td>LDAP '.$langs->trans("LDAPSecondaryServer").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_HOST_SLAVE."</td></tr>\n";
print '<tr><td>LDAP '.$langs->trans("LDAPServerPort").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_PORT."</td></tr>\n";
print '</table>';
print '</div>';
dol_htmloutput_mesg($message);
/*
* Barre d'actions
*/
print '<div class="tabsAction">';
if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr')
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$contact->id.'&amp;action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
}
print "</div>\n";
if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') print "<br>\n";
// Affichage attributs LDAP
print_titre($langs->trans("LDAPInformationsForThisContact"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("LDAPAttributes").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '</tr>';
// Lecture LDAP
$ldap=new Ldap();
$result=$ldap->connect_bind();
if ($result > 0)
{
$info=$contact->_load_ldap_info();
$dn=$contact->_load_ldap_dn($info,1);
$search = "(".$contact->_load_ldap_dn($info,2).")";
$records=$ldap->getAttribute($dn,$search);
//var_dump($records);
// Affichage arbre
if (count($records) && $records != false && (! isset($records['count']) || $records['count'] > 0))
// Company
if ($contact->socid > 0)
{
if (! is_array($records))
{
print '<tr '.$bc[false].'><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
}
else
{
$result=show_ldap_content($records,0,$records['count'],true);
}
$objsoc = new Societe($db);
$objsoc->fetch($contact->socid);
print '<tr><td width="20%">'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr '.$bc[false].'><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
$ldap->unbind();
$ldap->close();
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $contact->getCivilityLabel();
print '</td></tr>';
// LDAP DN
print '<tr><td>LDAP '.$langs->trans("LDAPContactDn").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_CONTACT_DN."</td></tr>\n";
// LDAP Cle
print '<tr><td>LDAP '.$langs->trans("LDAPNamingAttribute").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_KEY_CONTACTS."</td></tr>\n";
// LDAP Server
print '<tr><td>LDAP '.$langs->trans("LDAPPrimaryServer").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_HOST."</td></tr>\n";
print '<tr><td>LDAP '.$langs->trans("LDAPSecondaryServer").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_HOST_SLAVE."</td></tr>\n";
print '<tr><td>LDAP '.$langs->trans("LDAPServerPort").'</td><td class="valeur" colspan="3">'.$conf->global->LDAP_SERVER_PORT."</td></tr>\n";
print '</table>';
print '</div>';
dol_htmloutput_mesg($message);
/*
* Barre d'actions
*/
print '<div class="tabsAction">';
if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr')
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$contact->id.'&amp;action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
}
print "</div>\n";
if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') print "<br>\n";
// Affichage attributs LDAP
print_titre($langs->trans("LDAPInformationsForThisContact"));
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("LDAPAttributes").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '</tr>';
// Lecture LDAP
$ldap=new Ldap();
$result=$ldap->connect_bind();
if ($result > 0)
{
$info=$contact->_load_ldap_info();
$dn=$contact->_load_ldap_dn($info,1);
$search = "(".$contact->_load_ldap_dn($info,2).")";
$records=$ldap->getAttribute($dn,$search);
//var_dump($records);
// Affichage arbre
if (count($records) && $records != false && (! isset($records['count']) || $records['count'] > 0))
{
if (! is_array($records))
{
print '<tr '.$bc[false].'><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
}
else
{
$result=show_ldap_content($records,0,$records['count'],true);
}
}
else
{
print '<tr '.$bc[false].'><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>';
}
$ldap->unbind();
$ldap->close();
}
else
{
dol_print_error('',$ldap->error);
}
print '</table>';
}
else
{
dol_print_error('',$ldap->error);
}
print '</table>';
$db->close();
llxFooter();
?>

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
@@ -151,7 +151,7 @@ else
if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")";
}
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_lastname) { // filter on lastname
@@ -245,11 +245,11 @@ if ($result)
{
$contactstatic=new Contact($db);
$param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email);
if (!empty($search_categ)) $param.='&search_categ='.$search_categ;
if ($search_status != '') $param.='&amp;search_status='.$search_status;
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
$param ='&begin='.htmlspecialchars($begin).'&view='.htmlspecialchars($view).'&userid='.htmlspecialchars($userid).'&contactname='.htmlspecialchars($sall);
$param.='&type='.htmlspecialchars($type).'&view='.htmlspecialchars($view).'&search_lastname='.htmlspecialchars($search_lastname).'&search_firstname='.htmlspecialchars($search_firstname).'&search_societe='.htmlspecialchars($search_societe).'&search_email='.htmlspecialchars($search_email);
if (!empty($search_categ)) $param.='&search_categ='.htmlspecialchars($search_categ);
if ($search_status != '') $param.='&amp;search_status='.htmlspecialchars($search_status);
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".htmlspecialchars($search_priv);
$num = $db->num_rows($result);
$i = 0;
@@ -258,7 +258,7 @@ if ($result)
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="view" value="'.$view.'">';
print '<input type="hidden" name="view" value="'.htmlspecialchars($view).'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
@@ -277,7 +277,7 @@ if ($result)
if ($sall)
{
print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall;
print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".htmlspecialchars($sall);
}
print '<table class="liste" width="100%">';
@@ -302,36 +302,36 @@ if ($result)
// Ligne des champs de filtres
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_lastname" size="9" value="'.$search_lastname.'">';
print '<input class="flat" type="text" name="search_lastname" size="9" value="'.htmlspecialchars($search_lastname).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_firstname" size="9" value="'.$search_firstname.'">';
print '<input class="flat" type="text" name="search_firstname" size="9" value="'.htmlspecialchars($search_firstname).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_poste" size="9" value="'.$search_poste.'">';
print '<input class="flat" type="text" name="search_poste" size="9" value="'.htmlspecialchars($search_poste).'">';
print '</td>';
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_societe" size="9" value="'.$search_societe.'">';
print '<input class="flat" type="text" name="search_societe" size="9" value="'.htmlspecialchars($search_societe).'">';
print '</td>';
}
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_phonepro" size="8" value="'.$search_phonepro.'">';
print '<input class="flat" type="text" name="search_phonepro" size="8" value="'.htmlspecialchars($search_phonepro).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_phonemob" size="8" value="'.$search_phonemob.'">';
print '<input class="flat" type="text" name="search_phonemob" size="8" value="'.htmlspecialchars($search_phonemob).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_fax" size="8" value="'.$search_fax.'">';
print '<input class="flat" type="text" name="search_fax" size="8" value="'.htmlspecialchars($search_fax).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_email" size="8" value="'.$search_email.'">';
print '<input class="flat" type="text" name="search_email" size="8" value="'.htmlspecialchars($search_email).'">';
print '</td>';
if (! empty($conf->skype->enabled))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_skype" size="8" value="'.$search_skype.'">';
print '<input class="flat" type="text" name="search_skype" size="8" value="'.htmlspecialchars($search_skype).'">';
print '</td>';
}
print '<td class="liste_titre">&nbsp;</td>';

View File

@@ -38,210 +38,213 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$object = new Contact($db);
/*
* Action
*/
$result = $object->fetch($id, $user);
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
if ($id > 0)
{
$ret = $object->fetch($id);
/*
* Action
*/
// Note: Correct date should be completed with location to have exact GM time of birth.
$object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
$object->birthday_alert = $_POST["birthday_alert"];
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
{
// Note: Correct date should be completed with location to have exact GM time of birth.
$object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]);
$object->birthday_alert = $_POST["birthday_alert"];
$result = $object->update_perso($id, $user);
if ($result > 0)
{
$object->old_name='';
$object->old_firstname='';
}
else
{
$error = $object->error;
}
$result = $object->update_perso($id, $user);
if ($result > 0)
{
$object->old_name='';
$object->old_firstname='';
}
else
{
$error = $object->error;
}
}
}
/*
* View
*/
$form = new Form($db);
$now=dol_now();
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
$form = new Form($db);
$object->fetch($id, $user);
$head = contact_prepare_head($object);
dol_fiche_head($head, 'perso', $title, 0, 'contact');
if ($action == 'edit')
if ($id > 0)
{
/*
* Fiche en mode edition
*/
$head = contact_prepare_head($object);
print '<form name="perso" method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
dol_fiche_head($head, 'perso', $title, 0, 'contact');
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $object->id;
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
if ($action == 'edit')
{
if ($object->socid > 0)
/*
* Fiche en mode edition
*/
print '<form name="perso" method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $object->id;
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
if ($object->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td>';
}
else
{
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';
// Date To Birth
print '<tr><td>'.$langs->trans("DateToBirth").'</td><td>';
$form=new Form($db);
print $form->select_date($object->birthday,'birthday',0,0,1,"perso");
print '</td>';
print '<td colspan="2">'.$langs->trans("Alert").': ';
if (! empty($object->birthday_alert))
{
print '<input type="checkbox" name="birthday_alert" checked="checked"></td>';
}
else
{
print '<input type="checkbox" name="birthday_alert"></td>';
}
print '</tr>';
print "</table><br>";
print '<center>';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
print "</form>";
}
else
{
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
if ($object->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td>';
}
else
{
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
else
{
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';
// Date To Birth
print '<tr>';
if (! empty($object->birthday))
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");
print ' &nbsp; ';
//var_dump($birthdatearray);
$ageyear=convertSecondToTime($now-$object->birthday,'year')-1970;
$agemonth=convertSecondToTime($now-$object->birthday,'month')-1;
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
print ' &nbsp; - &nbsp; ';
if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn");
else print $langs->trans("BirthdayAlertOff");
// Date To Birth
print '<tr><td>'.$langs->trans("DateToBirth").'</td><td>';
$form=new Form($db);
print $form->select_date($object->birthday,'birthday',0,0,1,"perso");
print '</td>';
print '<td colspan="2">'.$langs->trans("Alert").': ';
if (! empty($object->birthday_alert))
{
print '<input type="checkbox" name="birthday_alert" checked="checked"></td>';
}
else
{
print '<input type="checkbox" name="birthday_alert"></td>';
}
print '</tr>';
print "</table><br>";
print '<center>';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
print "</form>";
}
else
{
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.$langs->trans("Unknown")."</td>";
}
print "</tr>";
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';
print "</table>";
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
}
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';
dol_fiche_end();
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
if ($action != 'edit')
{
// Barre d'actions
if ($user->societe_id == 0)
{
print '<div class="tabsAction">';
if ($user->rights->societe->contact->creer)
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
if ($object->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}
}
print "</div>";
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';
// Date To Birth
print '<tr>';
if (! empty($object->birthday))
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");
print ' &nbsp; ';
//var_dump($birthdatearray);
$ageyear=convertSecondToTime($now-$object->birthday,'year')-1970;
$agemonth=convertSecondToTime($now-$object->birthday,'month')-1;
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
print ' &nbsp; - &nbsp; ';
if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn");
else print $langs->trans("BirthdayAlertOff");
print '</td>';
}
else
{
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.$langs->trans("Unknown")."</td>";
}
print "</tr>";
print "</table>";
}
dol_fiche_end();
if ($action != 'edit')
{
// Barre d'actions
if ($user->societe_id == 0)
{
print '<div class="tabsAction">';
if ($user->rights->societe->contact->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
}
print "</div>";
}
}
}
@@ -249,4 +252,3 @@ if ($action != 'edit')
llxFooter();
$db->close();
?>

View File

@@ -35,70 +35,72 @@ $id = GETPOST('id', 'int');
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db);
$result=$contact->fetch($id);
$physicalperson=1;
$company = new Societe($db);
if ($contact->socid)
if ($id > 0)
{
$result=$company->fetch($contact->socid);
//print "ee";
$result=$contact->fetch($id);
$physicalperson=1;
$company = new Societe($db);
if ($contact->socid)
{
$result=$company->fetch($contact->socid);
//print "ee";
}
// We create VCard
$v = new vCard();
$v->setProdId('Dolibarr '.DOL_VERSION);
$v->setUid('DOLIBARR-CONTACTID-'.$contact->id);
$v->setName($contact->lastname, $contact->firstname, "", "", "");
$v->setFormattedName($contact->getFullName($langs));
// By default, all informations are for work (except phone_perso and phone_mobile)
$v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
$v->setPhoneNumber($contact->fax, "WORK;FAX");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL");
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK");
$v->setEmail($contact->email,'internet,pref');
$v->setNote($contact->note);
$v->setTitle($contact->poste);
// Data from linked company
if ($company->id)
{
$v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
// Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom);
}
// Personal informations
$v->setPhoneNumber($contact->phone_perso, "HOME;VOICE");
if ($contact->birthday) $v->setBirthday($contact->birthday);
$db->close();
// Renvoi la VCard au navigateur
$output = $v->getVCard();
$filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
$filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
//$filename = dol_sanitizeFileName($filename);
header("Content-Disposition: attachment; filename=\"".$filename."\"");
header("Content-Length: ".dol_strlen($output));
header("Connection: close");
header("Content-Type: text/x-vcard; name=\"".$filename."\"");
print $output;
}
// We create VCard
$v = new vCard();
$v->setProdId('Dolibarr '.DOL_VERSION);
$v->setUid('DOLIBARR-CONTACTID-'.$contact->id);
$v->setName($contact->lastname, $contact->firstname, "", "", "");
$v->setFormattedName($contact->getFullName($langs));
// By default, all informations are for work (except phone_perso and phone_mobile)
$v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
$v->setPhoneNumber($contact->fax, "WORK;FAX");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL");
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK");
$v->setEmail($contact->email,'internet,pref');
$v->setNote($contact->note);
$v->setTitle($contact->poste);
// Data from linked company
if ($company->id)
{
$v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
// Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom);
}
// Personal informations
$v->setPhoneNumber($contact->phone_perso, "HOME;VOICE");
if ($contact->birthday) $v->setBirthday($contact->birthday);
$db->close();
// Renvoi la VCard au navigateur
$output = $v->getVCard();
$filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
$filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
//$filename = dol_sanitizeFileName($filename);
header("Content-Disposition: attachment; filename=\"".$filename."\"");
header("Content-Length: ".dol_strlen($output));
header("Connection: close");
header("Content-Type: text/x-vcard; name=\"".$filename."\"");
print $output;
?>

View File

@@ -410,7 +410,7 @@ class Contrat extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
if ($ref)
{
$sql.= " WHERE ref='".$ref."'";
$sql.= " WHERE ref='".$this->db->escape($ref)."'";
$sql.= " AND entity IN (".getEntity('contract').")";
}
else $sql.= " WHERE rowid=".$id;
@@ -1942,7 +1942,7 @@ class ContratLigne
$sql.= " t.commentaire";
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as t";
if ($id) $sql.= " WHERE t.rowid = ".$id;
if ($ref) $sql.= " WHERE t.rowid = '".$ref."'";
if ($ref) $sql.= " WHERE t.rowid = '".$this->db->escape($ref)."'";
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$langs->load("contracts");
// Security check
$contratid = isset($_GET["id"])?$_GET["id"]:'';
$contratid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contrat',$contratid,'');
@@ -41,8 +41,8 @@ $result = restrictedArea($user, 'contrat',$contratid,'');
llxHeader();
$contrat = new Contrat($db);
$contrat->fetch($_GET["id"]);
$contrat->info($_GET["id"]);
$contrat->fetch($contratid);
$contrat->info($contratid);
$head = contract_prepare_head($contrat);

View File

@@ -78,7 +78,7 @@ $sql.= ", ".MAIN_DB_PREFIX."contrat as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
$sql.= " WHERE c.fk_soc = s.rowid ";
$sql.= " AND c.entity = ".$conf->entity;
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($socid) $sql.= " AND s.rowid = ".$db->escape($socid);
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($search_nom) {
$sql .= natural_search('s.nom', $search_nom);
@@ -100,13 +100,13 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_nom='.$search_nom, $sortfield, $sortorder,'',$num);
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.htmlspecialchars($search_contract).'&search_nom='.htmlspecialchars($search_nom), $sortfield, $sortorder,'',$num);
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
$param='&amp;search_contract='.$search_contract;
$param.='&amp;search_nom='.$search_nom;
$param='&amp;search_contract='.htmlspecialchars($search_contract);
$param.='&amp;search_nom='.htmlspecialchars($search_nom);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder);
@@ -122,10 +122,10 @@ if ($resql)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="3" name="search_contract" value="'.$search_contract.'">';
print '<input type="text" class="flat" size="3" name="search_contract" value="'.htmlspecialchars($search_contract).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="24" name="search_nom" value="'.$search_nom.'">';
print '<input type="text" class="flat" size="24" name="search_nom" value="'.htmlspecialchars($search_nom).'">';
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
//print '<td class="liste_titre">&nbsp;</td>';

View File

@@ -114,7 +114,7 @@ class box_activity extends ModeleBoxes
$billurl="viewstatut=2&paye=1&year=".$objp->annee;
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/liste.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',

View File

@@ -119,7 +119,6 @@ class box_prospect extends ModeleBoxes
}
}
else {
dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
$this->info_box_contents[0][0] = array('td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed"));
}

View File

@@ -575,6 +575,11 @@ abstract class CommonObject
global $conf;
if (empty($this->socid)) return 0;
if (!class_exists('Societe'))
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$thirdparty = new Societe($this->db);
$result=$thirdparty->fetch($this->socid);
@@ -1053,7 +1058,6 @@ abstract class CommonObject
}
}
/**
* Save a new position (field rang) for details lines.
* You can choose to set position for lines with already a position or lines without any position defined.
@@ -2002,7 +2006,7 @@ abstract class CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
if (! empty($id)) $sql.= " AND rowid = ".$id;
if (! empty($ref)) $sql.= " AND ref = '".$ref."'";
if (! empty($ref)) $sql.= " AND ref = '".$this->db->escape($ref)."'";
$resql = $this->db->query($sql);
if ($resql)
@@ -2176,10 +2180,10 @@ abstract class CommonObject
$this->array_options[$key] = price2num($this->array_options[$key]);
break;
case 'date':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
if (is_numeric($this->array_options[$key])) $this->array_options[$key]=$this->db->idate($this->array_options[$key]);
break;
case 'datetime':
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
if (is_numeric($this->array_options[$key])) $this->array_options[$key]=$this->db->idate($this->array_options[$key]);
break;
}
}
@@ -2193,7 +2197,7 @@ abstract class CommonObject
{
$attributeKey = substr($key,8); // Remove 'options_' prefix
// Add field of attribut
if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate
if (isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate
$sql.=",".$attributeKey;
}
$sql .= ") VALUES (".$this->id;
@@ -2201,7 +2205,7 @@ abstract class CommonObject
{
$attributeKey = substr($key,8); // Remove 'options_' prefix
// Add field o fattribut
if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate)
if(isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate)
{
if ($this->array_options[$key] != '')
{

View File

@@ -727,11 +727,11 @@ class ExtraFields
if (strpos($InfoFieldList[4], 'extra')!==false)
{
$sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra';
$sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
$sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
}
else
{
$sqlwhere.= ' AND '.$InfoFieldList[4];
$sqlwhere.= ' WHERE '.$InfoFieldList[4];
}
}
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.

View File

@@ -131,6 +131,7 @@ class HookManager
// Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated.
$hooktype='output';
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
if ($method =='insertExtraFields') $hooktype='returnvalue';
if (in_array(
$method,
array(

View File

@@ -836,7 +836,7 @@ class Form
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
}
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->name, 'label'=>$obj->name));
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->rowid, 'label'=>$label));
$i++;
if (($i % 10) == 0) $out.="\n";
@@ -2275,8 +2275,8 @@ class Form
dol_syslog(get_class($this)."::select_type_paiements ".$selected.", ".$htmlname.", ".$filtertype.", ".$format,LOG_DEBUG);
$filterarray=array();
if ($filtertype == 'CRDT') $filterarray=array(0,2);
elseif ($filtertype == 'DBIT') $filterarray=array(1,2);
if ($filtertype == 'CRDT') $filterarray=array(0,2,3);
elseif ($filtertype == 'DBIT') $filterarray=array(1,2,3);
elseif ($filtertype != '' && $filtertype != '-1') $filterarray=explode(',',$filtertype);
$this->load_cache_types_paiements();
@@ -3000,12 +3000,13 @@ class Form
/**
* Affiche formulaire de selection des modes de reglement
*
* @param string $page Page
* @param int $selected Id mode pre-selectionne
* @param string $htmlname Name of select html field
* @param string $page Page
* @param int $selected Id mode pre-selectionne
* @param string $htmlname Name of select html field
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
* @return void
*/
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id')
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='')
{
global $langs;
if ($htmlname != "none")
@@ -3015,7 +3016,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
$this->select_types_paiements($selected,$htmlname);
$this->select_types_paiements($selected,$htmlname,$filtertype);
print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
@@ -4109,7 +4110,7 @@ class Form
{
global $dolibarr_main_url_root;
$ret.='<!-- Put link to gravatar -->';
$ret.='<img alt="Photo found on Gravatar" title="Photo Gravatar.com - email '.$email.'" border="0" width="'.$width.'" src="http://www.gravatar.com/avatar/'.dol_hash($email).'?s='.$width.'&d='.urlencode(dol_buildpath('/theme/common/nophoto.jpg',2)).'">';
$ret.='<img alt="Photo found on Gravatar" title="Photo Gravatar.com - email '.$email.'" border="0" width="'.$width.'" src="https://www.gravatar.com/avatar/'.dol_hash($email).'?s='.$width.'&d='.urlencode(dol_buildpath('/theme/common/nophoto.jpg',2)).'">';
}
else
{

View File

@@ -1,10 +1,10 @@
<?php
/* Copyright (c) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (c) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (c) 2014 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2008-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -268,7 +268,7 @@ class FormFile
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
$printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false;
$printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false;
$hookmanager->initHooks(array('formfile'));
$forname='builddoc';
$out='';
@@ -513,11 +513,11 @@ class FormFile
$out.= $genbutton;
$out.= '</th>';
if($hookmanager->hooks['formfile'])
if (!empty($hookmanager->hooks['formfile']))
{
foreach($hookmanager->hooks['formfile'] as $module)
{
if(method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>';
if (method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>';
}
}
$out.= '</tr>';

View File

@@ -1017,6 +1017,7 @@ class FormOther
if ($nbboxactivated)
{
$langs->load("boxes");
$langs->load("projects");
$emptybox=new ModeleBoxes($db);

View File

@@ -152,7 +152,7 @@ class Menubase
$sql.= " '".$this->fk_menu."',";
$sql.= " ".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").",";
$sql.= " ".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").",";
$sql.= " '".$this->position."',";
$sql.= " '".(int) $this->position."',";
$sql.= " '".$this->db->escape($this->url)."',";
$sql.= " '".$this->db->escape($this->target)."',";
$sql.= " '".$this->db->escape($this->titre)."',";

View File

@@ -703,7 +703,7 @@ class Translate
*/
function getCurrencyAmount($currency_code, $amount)
{
$symbol=$this->getCurrencSymbol($currency_code);
$symbol=$this->getCurrencySymbol($currency_code);
if (in_array($currency_code, array('USD'))) return $symbol.$amount;
else return $amount.$symbol;

View File

@@ -402,7 +402,7 @@ class DoliDBPgsql extends DoliDB
if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT'))
{
$con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty
$this->db = pg_connect($con_string);
$this->db = @pg_connect($con_string);
}
// if local connection failed or not requested, use TCP/IP
@@ -412,7 +412,7 @@ class DoliDBPgsql extends DoliDB
if (! $port) $port = 5432;
$con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'";
$this->db = pg_connect($con_string);
$this->db = @pg_connect($con_string);
}
// now we test if at least one connect method was a success
@@ -1021,7 +1021,7 @@ class DoliDBPgsql extends DoliDB
// Test charset match LC_TYPE (pgsql error otherwise)
//print $charset.' '.setlocale(LC_CTYPE,'0'); exit;
$sql='CREATE DATABASE '.$database.' OWNER '.$owner.' ENCODING \''.$charset.'\'';
$sql='CREATE DATABASE "'.$database.'" OWNER "'.$owner.'" ENCODING \''.$charset.'\'';
dol_syslog($sql,LOG_DEBUG);
$ret=$this->query($sql);
return $ret;

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
// Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
// Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
//
// 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
@@ -631,7 +631,7 @@ function hideMessage(fieldId,message) {
/*
* TODO Used by admin page only ?
*/
function setConstant(url, code, input, entity) {
function setConstant(url, code, input, entity, strict) {
$.get( url, {
action: "set",
name: code,
@@ -642,7 +642,7 @@ function setConstant(url, code, input, entity) {
$("#del_" + code).show();
$.each(input, function(type, data) {
// Enable another element
if (type == "disabled") {
if (type == "disabled" && strict != 1) {
$.each(data, function(key, value) {
var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value;
$(newvalue).removeAttr("disabled");
@@ -654,7 +654,10 @@ function setConstant(url, code, input, entity) {
} else if (type == "enabled") {
$.each(data, function(key, value) {
var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value;
$(newvalue).attr("disabled", true);
if (strict == 1)
$(newvalue).removeAttr("disabled");
else
$(newvalue).attr("disabled", true);
if ($(newvalue).hasClass("butAction") == true) {
$(newvalue).removeClass("butAction");
$(newvalue).addClass("butActionRefused");
@@ -686,7 +689,7 @@ function setConstant(url, code, input, entity) {
/*
* TODO Used by admin page only ?
*/
function delConstant(url, code, input, entity) {
function delConstant(url, code, input, entity, strict) {
$.get( url, {
action: "del",
name: code,
@@ -706,7 +709,7 @@ function delConstant(url, code, input, entity) {
$(newvalue).addClass("butActionRefused");
}
});
} else if (type == "enabled") {
} else if (type == "enabled" && strict != 1) {
$.each(data, function(key, value) {
var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value;
$(newvalue).removeAttr("disabled");
@@ -740,7 +743,7 @@ function delConstant(url, code, input, entity) {
/*
* TODO Used by admin page only ?
*/
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton) {
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
var boxConfirm = box;
$("#confirm_" + code)
.attr("title", boxConfirm.title)
@@ -756,9 +759,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
text : yesButton,
click : function() {
if (action == "set") {
setConstant(url, code, input, entity);
setConstant(url, code, input, entity, strict);
} else if (action == "del") {
delConstant(url, code, input, entity);
delConstant(url, code, input, entity, strict);
}
// Close dialog
$(this).dialog("close");

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -380,9 +380,10 @@ function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0)
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
* @param int $entity Entity to set
* @param int $revertonoff Revert on/off
* @param bool $strict Use only "disabled" with delConstant and "enabled" with setConstant
* @return void
*/
function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0)
{
global $conf, $langs;
@@ -395,6 +396,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\';
var code = \''.$code.'\';
var entity = \''.$entity.'\';
var strict = \''.$strict.'\';
var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'";
var noButton = "'.dol_escape_js($langs->transnoentities("No")).'";
@@ -403,9 +405,9 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
if (input.alert && input.alert.set) {
if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton;
if (input.alert.set.noButton) noButton = input.alert.set.noButton;
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict);
} else {
setConstant(url, code, input, entity);
setConstant(url, code, input, entity, strict);
}
});
@@ -414,9 +416,9 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
if (input.alert && input.alert.del) {
if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton;
if (input.alert.del.noButton) noButton = input.alert.del.noButton;
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict);
} else {
delConstant(url, code, input, entity);
delConstant(url, code, input, entity, strict);
}
});
});

View File

@@ -518,8 +518,8 @@ function dol_get_last_day($year,$month=12,$gm=false)
* @param int $day Day
* @param int $month Month
* @param int $year Year
* @param int $gm False = Return date to compare with server TZ, True to compare with GM date.
* @return array year,month, week,first_day,prev_year,prev_month,prev_day
* @param int $gm False or 0 or 'server' = Return date to compare with server TZ, True or 1 to compare with GM date.
* @return array year,month,week,first_day,prev_year,prev_month,prev_day
*/
function dol_get_first_day_week($day,$month,$year,$gm=false)
{
@@ -542,7 +542,7 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
$tmpday = date($tmparray[0])-$seconds;
$tmpday = date("d",$tmpday);
//Check first day of week is form this month or not
//Check first day of week is in same month than current day or not
if ($tmpday>$day)
{
$prev_month = $month-1;
@@ -559,15 +559,17 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
$prev_month = $month;
$prev_year = $year;
}
$tmpmonth = $prev_month;
$tmpyear = $prev_year;
//Get first day of next week
//Get first day of next week
$tmptime=dol_mktime(12,0,0,$month,$tmpday,$year,1,0);
$tmptime-=24*60*60*7;
$tmparray=dol_getdate($tmptime,true);
$prev_day = $tmparray['mday'];
//Check first day of week is form this month or not
if ($prev_day>$tmpday)
//Check prev day of week is in same month than first day or not
if ($prev_day > $tmpday)
{
$prev_month = $month-1;
$prev_year = $year;
@@ -579,9 +581,9 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
}
}
$week = date("W",dol_mktime(0,0,0,$month,$tmpday,$year,$gm));
$week = date("W",dol_mktime(0,0,0,$tmpmonth,$tmpday,$tmpyear,$gm));
return array('year' => $year, 'month' => $month, 'week' => $week, 'first_day' => $tmpday, 'prev_year' => $prev_year, 'prev_month' => $prev_month, 'prev_day' => $prev_day);
return array('year' => $year, 'month' => $month, 'week' => $week, 'first_day' => $tmpday, 'first_month' => $tmpmonth, 'first_year' => $tmpyear, 'prev_year' => $prev_year, 'prev_month' => $prev_month, 'prev_day' => $prev_day);
}
/**

View File

@@ -10,6 +10,7 @@
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -146,7 +147,7 @@ function getBrowserInfo()
elseif (preg_match('/epiphany/i',$_SERVER["HTTP_USER_AGENT"])) { $name='epiphany'; $version=$reg[2]; }
elseif ((empty($phone) || preg_match('/iphone/i',$_SERVER["HTTP_USER_AGENT"])) && preg_match('/safari(\/|\s)([\d\.]*)/i',$_SERVER["HTTP_USER_AGENT"], $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/msie(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version=$reg[2]; } // MS products at end
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version= end($reg); } // MS products at end
// Other
$firefox=0;
if (in_array($name,array('firefox','iceweasel'))) $firefox=1;
@@ -2515,7 +2516,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
$return='';
if ($picto == 'setup') $picto='title.png';
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif';
if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
$return.= "\n";
$return.= '<table '.($id?'id="'.$id.'" ':'').'summary="" width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
@@ -2553,7 +2554,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
global $conf,$langs;
if ($picto == 'setup') $picto='title.png';
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif';
if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
if (($num > $conf->liste_limit) || ($num == -1))
{

View File

@@ -1325,7 +1325,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
if (! $tmpdir) { unset($listofdir[$key]); continue; }
if (is_dir($tmpdir))
{
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0,true); // Disable hook for the moment
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0);
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
}
}

View File

@@ -228,7 +228,14 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$numlines=count($lines);
$total=0;
// We declare counter as global because we want to edit them into recursive call
global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned;
if ($level == 0)
{
$total_projectlinesa_spent=0;
$total_projectlinesa_planned=0;
$total_projectlinesa_spent_if_planned=0;
}
for ($i = 0 ; $i < $numlines ; $i++)
{
@@ -293,8 +300,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if ($showproject)
{
// Project ref
print "<td>";
//var_dump($taskrole);
if ($showlineingray) print '<i>';
$projectstatic->id=$lines[$i]->fk_project;
$projectstatic->ref=$lines[$i]->projectref;
@@ -390,7 +397,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$level++;
if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick);
$level--;
$total += $lines[$i]->duration;
$total_projectlinesa_spent += $lines[$i]->duration;
$total_projectlinesa_planned += $lines[$i]->planned_workload;
if ($lines[$i]->planned_workload) $total_projectlinesa_spent_if_planned += $lines[$i]->duration;
}
}
else
@@ -399,7 +408,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
}
}
if ($total>0 && $level==0)
if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0) && $level==0)
{
print '<tr class="liste_total">';
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
@@ -407,10 +416,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td align="center" class="nowrap liste_total">';
print convertSecondToTime($total_projectlinesa_planned, 'allhourmin');
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total, 'allhourmin').'</td>';
print '<td></td>';
print '<td align="right" class="nowrap liste_total">';
print convertSecondToTime($total_projectlinesa_spent, 'allhourmin');
print '</td>';
print '<td align="right" class="nowrap liste_total">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent_if_planned / $total_projectlinesa_planned,2).' %';
print '</td>';
if ($addordertick) print '<td class="hideonsmartphone"></td>';
print '</tr>';
}
@@ -459,7 +474,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
if (empty($mine) || ! empty($tasksrole[$lines[$i]->id]))
{
print "<tr ".$bc[$var].">\n";
// Project
print "<td>";
$projectstatic->id=$lines[$i]->fk_project;
@@ -468,14 +483,14 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
$projectstatic->label=$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project];
print $projectstatic->getNomUrl(1);
print "</td>";
// Ref
print '<td>';
$taskstatic->id=$lines[$i]->id;
$taskstatic->ref=$lines[$i]->id;
print $taskstatic->getNomUrl(1);
print '</td>';
// Label task
print "<td>";
for ($k = 0 ; $k < $level ; $k++)
@@ -486,28 +501,28 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
$taskstatic->ref=$lines[$i]->label;
print $taskstatic->getNomUrl(0);
print "</td>\n";
// Date start
print '<td align="center">';
print dol_print_date($lines[$i]->date_start,'dayhour');
print '</td>';
// Date end
print '<td align="center">';
print dol_print_date($lines[$i]->date_end,'dayhour');
print '</td>';
// Planned Workload
print '<td align="right">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
else print '--:--';
print '</td>';
// Progress declared %
print '<td align="right">';
print $lines[$i]->progress.' %';
print '</td>';
// Time spent
print '<td align="right">';
if ($lines[$i]->duration)
@@ -518,7 +533,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
}
else print '--:--';
print "</td>\n";
$disabledproject=1;$disabledtask=1;
//print "x".$lines[$i]->fk_project;
//var_dump($lines[$i]);
@@ -534,7 +549,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
{
$disabledtask=1;
}
print '<td class="nowrap">';
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask);
$s.='&nbsp;&nbsp;&nbsp;';
@@ -546,7 +561,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));
print '</td>';
print "</tr>\n";
}

View File

@@ -39,7 +39,7 @@
*/
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')
{
global $langs, $hselected;
global $langs;
print "\n\n<!-- debut cartouche rapport -->\n";
@@ -48,7 +48,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
$head[$h][1] = $langs->trans("Report");
$head[$h][2] = 'report';
dol_fiche_head($head, $hselected);
dol_fiche_head($head, 'report');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
foreach($moreparam as $key => $value)

View File

@@ -134,9 +134,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
}
// Financial
$tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled)),
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire)),
'module'=>'comptabilite|accounting|facture|deplacement|don|tax');
$tmpentry = array(
'enabled' => (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->facture->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->don->enabled) || !empty($conf->tax->enabled) || !empty($conf->margin->enabled)),
'perms' => (!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->plancompte->lire) || !empty($user->rights->facture->lire) || !empty($user->rights->deplacement->lire) || !empty($user->rights->don->lire) || !empty($user->rights->tax->charges->lire) || !empty($user->rights->margins->liretous)),
'module' => 'comptabilite|accounting|facture|deplacement|don|tax'
);
$showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode)
{
@@ -1176,7 +1178,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,(empty($user->societe_id)?0:1),'eldy',$tabMenu);
// We update newmenu for special dynamic menus
if ($user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account
if (!empty($user->rights->banque->lire) && $mainmenu == 'bank') // Entry for each bank account
{
$sql = "SELECT rowid, label, courant, rappro, courant";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
@@ -1206,7 +1208,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
else dol_print_error($db);
$db->free($resql);
}
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
if (!empty($conf->ftp->enabled) && $mainmenu == 'ftp') // Entry for FTP
{
$MAXFTP=20;
$i=1;

View File

@@ -1009,7 +1009,6 @@ abstract class DolibarrModules
$this->db->begin();
//var_dump($this->menu); exit;
foreach ($this->menu as $key => $value)
{
$menu = new Menubase($this->db);
@@ -1018,11 +1017,9 @@ abstract class DolibarrModules
if (! $this->menu[$key]['fk_menu'])
{
$menu->fk_menu=0;
//print 'aaa'.$this->menu[$key]['fk_menu'];
}
else
{
//print 'xxx'.$this->menu[$key]['fk_menu'];exit;
$foundparent=0;
$fk_parent=$this->menu[$key]['fk_menu'];
if (preg_match('/^r=/',$fk_parent)) // old deprecated method

View File

@@ -182,6 +182,7 @@ class CommActionRapport
$sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid";
$sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'";
$sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " ORDER BY a.datep DESC";
dol_syslog(get_class($this)."::_page sql=".$sql);

View File

@@ -255,19 +255,44 @@ class pdf_soleil extends ModelePDFFicheinter
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).'</strong>';
$desc=dol_htmlentitiesbr($objectligne->desc,1);
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0);
$pdf->startTransaction();
$pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'<br>'.$desc, LR, 1, 0);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
$pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
$pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'<br>'.$desc, LR, 1, 0);
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY();
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
{
$pdf->AddPage('','',true);
$pdf->setPage($pageposafter+1);
}
}
}
else // No pagebreak
{
$pdf->commitTransaction();
}
$nexY = $pdf->GetY();
$pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
// We suppose that a too long description is moved completely on next page
if ($pageposafter > $pageposbefore) {
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// Detect if some page were added automatically and output _tableau for past pages

View File

@@ -280,11 +280,9 @@ class modProjet extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,";
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity;
}

View File

@@ -44,8 +44,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
function __construct()
{
global $conf;
if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
if (! isset($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) || trim($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) == '') $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (! isset($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) || trim($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) == '') $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
$this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER;
$this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
}

View File

@@ -125,7 +125,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
return 0;
}
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->datef);
//Supplier invoices take invoice date instead of creation date for the mask
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date);
return $numFinal;
}

View File

@@ -74,7 +74,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
}
}
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.($withproject?'&withproject=1':''));
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':''));
exit;
}
}

View File

@@ -128,7 +128,7 @@ $coldisplay=-1; // We remove first td
<?php if (! empty($conf->margin->enabled)) { ?>
<td align="right"><?php $coldisplay++; ?>
<select id="fournprice" name="fournprice" class="hideobject"></select>
<select id="fournprice" name="fournprice"></select>
<input type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht,0,'',0); ?>">
</td>
<?php if ($user->rights->margins->creer) {

View File

@@ -131,7 +131,7 @@ class InterfaceActionsAuto
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
if ($object->prefix) $object->actionmsg.=" (".$object->prefix.")";
if (! empty($object->prefix)) $object->actionmsg.=" (".$object->prefix.")";
//$this->desc.="\n".$langs->transnoentities("Customer").': '.yn($object->client);
//$this->desc.="\n".$langs->transnoentities("Supplier").': '.yn($object->fournisseur);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;

View File

@@ -95,9 +95,18 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
}
else
{
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
else setEventMessage($langs->trans("JobFinished"),'mesgs');
$action='';
$res = $object->reprogram_jobs($user->login);
if ($res > 0)
{
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
else setEventMessage($langs->trans("JobFinished"),'mesgs');
$action='';
}
else
{
setEventMessage($object->error,'errors');
$action='';
}
}
}

View File

@@ -100,6 +100,21 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
if ($result < 0) {
setEventMessage($object->error,'errors');
}
else
{
$res = $object->reprogram_jobs($user->login);
if ($res > 0)
{
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
else setEventMessage($langs->trans("JobFinished"),'mesgs');
$action='';
}
else
{
setEventMessage($object->error,'errors');
$action='';
}
}
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back
exit;

View File

@@ -164,8 +164,6 @@ class Expedition extends CommonObject
$now=dol_now();
if (empty($this->model_pdf)) $this->model_pdf=$conf->global->EXPEDITION_ADDON_PDF;
require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php';
$error = 0;
@@ -849,7 +847,7 @@ class Expedition extends CommonObject
$mouvS = new MouvementStock($this->db);
// We decrement stock of product (and sub-products)
// We use warehouse selected for each line
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
if ($result < 0)
{
$error++;

View File

@@ -113,6 +113,7 @@ if ($action == 'add')
$object->socid = $objectsrc->socid;
$object->ref_customer = $objectsrc->ref_client;
$object->model_pdf = GETPOST('model');
$object->date_delivery = $date_delivery; // Date delivery planed
$object->fk_delivery_address = $objectsrc->fk_delivery_address;
$object->shipping_method_id = GETPOST('shipping_method_id','int');
@@ -662,6 +663,14 @@ if ($action == 'create')
print '<td colspan="3">';
print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number','alpha').'">';
print "</td></tr>\n";
// Document model
print "<tr><td>".$langs->trans("Model")."</td>";
print '<td colspan="3">';
include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php';
$liste = ModelePdfExpedition::liste_modeles($db);
print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF);
print "</td></tr>\n";
// Other attributes
$parameters=array('colspan' => ' colspan="3"');

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -21,6 +22,8 @@
<?php
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
@@ -47,17 +50,23 @@ foreach($linkedObjectBlock as $object)
<a href="<?php echo DOL_URL_ROOT.'/expedition/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowShipping"),"sending").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date_creation,'day'); ?></td>
<td align="center"><?php echo dol_print_date($object->date_delivery,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php
if ($user->rights->expedition->lire) {
$total = $total + $object->total_ht;
echo price($object->total_ht);
} ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="3"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td align="right"><?php
if ($user->rights->expedition->lire) {
echo price($total);
} ?></td>
<td>&nbsp;</td>
</tr>
</table>

View File

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

View File

@@ -235,7 +235,7 @@ class Fichinter extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
$sql.= ", description = '".$this->db->escape($this->description)."'";
$sql.= "description = '".$this->db->escape($this->description)."'";
$sql.= ", duree = ".$this->duree;
$sql.= ", fk_projet = ".$this->fk_project;
$sql.= ", note_private = ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");

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.5.5');
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.8');
if (! defined('EURO')) define('EURO',chr(128));
// Define syslog constants

View File

@@ -132,7 +132,7 @@ class CommandeFournisseur extends CommonOrder
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON (c.fk_mode_reglement = p.id)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
$sql.= " WHERE c.entity = ".$conf->entity;
if ($ref) $sql.= " AND c.ref='".$ref."'";
if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'";
else $sql.= " AND c.rowid=".$id;
dol_syslog(get_class($this)."::fetch sql=".$sql,LOG_DEBUG);

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@@ -55,6 +56,18 @@ class PaiementFourn extends Paiement
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
// fk_paiement dans llx_paiement_facture est le rowid du paiement
/**
* Label of payment type
* @var string
*/
public $type_libelle;
/**
* Code of Payment type
* @var string
*/
public $type_code;
/**
* Constructor
*
@@ -74,7 +87,7 @@ class PaiementFourn extends Paiement
function fetch($id)
{
$sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,';
$sql.= ' c.libelle as paiement_type,';
$sql.= ' c.code as paiement_code, c.libelle as paiement_type,';
$sql.= ' p.num_paiement, p.note, b.fk_account';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiementfourn as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
@@ -95,6 +108,7 @@ class PaiementFourn extends Paiement
$this->bank_line = $obj->fk_bank;
$this->montant = $obj->amount;
$this->note = $obj->note;
$this->type_code = $obj->paiement_code;
$this->type_libelle = $obj->paiement_type;
$this->statut = $obj->statut;
$error = 1;

View File

@@ -229,9 +229,17 @@ if ($id > 0 || ! empty($ref))
$resql = $db->query($sql);
if ($resql)
{
while ( $row = $db->fetch_row($resql) )
$num = $db->num_rows($resql);
$i = 0;
if ($num)
{
$products_dispatched[$row[0]] = $row[1];
while ($i < $num)
{
$objd = $db->fetch_object($resql);
$products_dispatched[$objd->fk_product] = price2num($objd->qty, 5);
$i++;
}
}
$db->free($resql);
}
@@ -277,7 +285,7 @@ if ($id > 0 || ! empty($ref))
}
else
{
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]); // Calculation of dispatched
$remaintodispatch=(price2num($objp->qty, 5) - $products_dispatched[$objp->fk_product]); // Calculation of dispatched
if ($remaintodispatch < 0) $remaintodispatch=0;
if ($remaintodispatch)
{

Some files were not shown because too many files have changed in this diff Show More