mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-12 10:52:37 +01:00
Compare commits
277 Commits
3.5.1
...
3.6.beta2_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a51e18a5a7 | ||
|
|
872e764c94 | ||
|
|
2a6b2a4540 | ||
|
|
b11ef37c58 | ||
|
|
1df758320d | ||
|
|
f34aadef3d | ||
|
|
23e951ff2a | ||
|
|
a63d085181 | ||
|
|
8840e28bc0 | ||
|
|
07bc933110 | ||
|
|
649fdd72dc | ||
|
|
df35b4d2ea | ||
|
|
2771c506e9 | ||
|
|
31ea7117f0 | ||
|
|
d1ee20dd42 | ||
|
|
dc94b6e1bf | ||
|
|
1d01377dab | ||
|
|
9c398b14c5 | ||
|
|
20ec1e6ac8 | ||
|
|
300e430024 | ||
|
|
95d8161dc1 | ||
|
|
fa733c8ba4 | ||
|
|
7acecadc79 | ||
|
|
2c05146778 | ||
|
|
43bf9ba890 | ||
|
|
a705d4e333 | ||
|
|
0d121de1a6 | ||
|
|
9cc74c36d2 | ||
|
|
77c09d887a | ||
|
|
b2f299f5e4 | ||
|
|
603c28dcdd | ||
|
|
3481884731 | ||
|
|
13da9c368e | ||
|
|
2a16a562d9 | ||
|
|
87b9d0412c | ||
|
|
4a7e9e4d0b | ||
|
|
c82ff0a146 | ||
|
|
4a89446162 | ||
|
|
b146dcad31 | ||
|
|
366bd64c4f | ||
|
|
753ef28168 | ||
|
|
ff1eb983c8 | ||
|
|
5a5c858578 | ||
|
|
56415400eb | ||
|
|
5709179cf0 | ||
|
|
0e13ded641 | ||
|
|
c2370f352b | ||
|
|
ab337c7485 | ||
|
|
6bfff8b2b8 | ||
|
|
39b0ed7fc2 | ||
|
|
fa212438c6 | ||
|
|
9ae9f062ac | ||
|
|
4fc818d329 | ||
|
|
6cebccf1b4 | ||
|
|
d7d8eba6b1 | ||
|
|
8ab09d63a2 | ||
|
|
98bd78a277 | ||
|
|
bd061f4245 | ||
|
|
f13c146908 | ||
|
|
5f0c4dbe48 | ||
|
|
3f08664eee | ||
|
|
6f4a390780 | ||
|
|
bafc53ad95 | ||
|
|
bcfc9f8aa1 | ||
|
|
09b5971b7d | ||
|
|
847fa3827b | ||
|
|
7b05944530 | ||
|
|
7bb24969d8 | ||
|
|
3fd7e18c08 | ||
|
|
1724fd2f89 | ||
|
|
4e41b721fb | ||
|
|
f855709cf4 | ||
|
|
a627dd9ae8 | ||
|
|
62537cf5a4 | ||
|
|
2aa2f896c6 | ||
|
|
02e0fac79f | ||
|
|
c0af0c3b52 | ||
|
|
1b25fdc323 | ||
|
|
70cccc907a | ||
|
|
4bf86508a5 | ||
|
|
ef2a8a0b09 | ||
|
|
ac27884b88 | ||
|
|
16b3ec8923 | ||
|
|
1bc3558307 | ||
|
|
0e2497e710 | ||
|
|
e35008b534 | ||
|
|
3f22bc7009 | ||
|
|
e6708a5072 | ||
|
|
fb7f08b33a | ||
|
|
8681079fa7 | ||
|
|
7fe5389adf | ||
|
|
182dd774b6 | ||
|
|
fe43d10c79 | ||
|
|
3abede630b | ||
|
|
5a6ad1ef5f | ||
|
|
5e12459ad1 | ||
|
|
460b5296ba | ||
|
|
7a452519e7 | ||
|
|
503924fbbc | ||
|
|
53a1e7d09a | ||
|
|
1c6c79811d | ||
|
|
215ff25ddd | ||
|
|
647d431857 | ||
|
|
4da918ce01 | ||
|
|
959b104b78 | ||
|
|
c4291c228e | ||
|
|
948e0bf753 | ||
|
|
5740c22a41 | ||
|
|
011fe254a6 | ||
|
|
a04cd99090 | ||
|
|
c9ebe7729f | ||
|
|
e8308e795d | ||
|
|
697f68c9a9 | ||
|
|
03f9f0bada | ||
|
|
08301e3478 | ||
|
|
f34a9983bd | ||
|
|
50c10d3d1e | ||
|
|
4599b22cb5 | ||
|
|
7216b2a843 | ||
|
|
876a35d1a1 | ||
|
|
2637305065 | ||
|
|
a4126fae66 | ||
|
|
4fa472518e | ||
|
|
bd8cdd337a | ||
|
|
537ada96a8 | ||
|
|
4ecfa1d6e0 | ||
|
|
6968304641 | ||
|
|
c54d9d9171 | ||
|
|
0b1bfa56e2 | ||
|
|
889ed4a49c | ||
|
|
31d56d6c38 | ||
|
|
34948ef2d6 | ||
|
|
78ce40f23b | ||
|
|
8564691896 | ||
|
|
b1fd8cf503 | ||
|
|
2213128531 | ||
|
|
ee3592c976 | ||
|
|
2ffe4f589e | ||
|
|
cb2393e663 | ||
|
|
81ff0a8643 | ||
|
|
80f1100bf9 | ||
|
|
75e76dc232 | ||
|
|
7fcf57ca5a | ||
|
|
5d4b861156 | ||
|
|
351ab9788b | ||
|
|
e061c442a6 | ||
|
|
6f40825270 | ||
|
|
13659b1528 | ||
|
|
60b37dffe1 | ||
|
|
4e619c42fa | ||
|
|
e0e64af18c | ||
|
|
9a056ab497 | ||
|
|
9dd499b133 | ||
|
|
eb0d98d406 | ||
|
|
fe49f55a48 | ||
|
|
f25ddfbc9c | ||
|
|
42b6628b76 | ||
|
|
6f47e2e154 | ||
|
|
3bc63c43dc | ||
|
|
41a2ce1a74 | ||
|
|
90f5f0823f | ||
|
|
c57c3aef84 | ||
|
|
174d4f6ff2 | ||
|
|
da0aebb2e9 | ||
|
|
63729ab508 | ||
|
|
ebb9016ad5 | ||
|
|
d5448f9ca4 | ||
|
|
cf8ff97855 | ||
|
|
d5986caed2 | ||
|
|
918fe5dbb5 | ||
|
|
f3bbf54447 | ||
|
|
a2a46f9300 | ||
|
|
46e46507ec | ||
|
|
8cb06cac08 | ||
|
|
a4797a0e4a | ||
|
|
663a3bd45c | ||
|
|
c421613da9 | ||
|
|
ab6a67054a | ||
|
|
48c77d2ceb | ||
|
|
6dab09e07a | ||
|
|
df5a009aa2 | ||
|
|
c969bc3e93 | ||
|
|
f1466e64af | ||
|
|
1fad693867 | ||
|
|
ed49f88446 | ||
|
|
e6bd3921f1 | ||
|
|
95793a5475 | ||
|
|
c506e59d8c | ||
|
|
a5c2b78565 | ||
|
|
61f649e1ae | ||
|
|
acb752c5f2 | ||
|
|
832ebb1cfe | ||
|
|
f282ffc549 | ||
|
|
ae728645d6 | ||
|
|
c6b700d449 | ||
|
|
f97c8feb54 | ||
|
|
3d12979b3f | ||
|
|
57cf384617 | ||
|
|
e16385b496 | ||
|
|
bb07d7f814 | ||
|
|
f115501ddf | ||
|
|
3f78fe8c93 | ||
|
|
6039c81845 | ||
|
|
57bd043f59 | ||
|
|
466de67b5b | ||
|
|
09e02f807f | ||
|
|
e2f51d0df2 | ||
|
|
c8c77dbdcf | ||
|
|
e0b4bd9b0d | ||
|
|
a1e778c146 | ||
|
|
1061a650d2 | ||
|
|
4bd6f11112 | ||
|
|
c8c4a10a06 | ||
|
|
10fda1956f | ||
|
|
a884673637 | ||
|
|
c1411e65b7 | ||
|
|
aabd923248 | ||
|
|
4afb85bd1d | ||
|
|
d3e951e1ec | ||
|
|
9cd7f68ae8 | ||
|
|
062c150bc1 | ||
|
|
212deb9e1c | ||
|
|
2f10198064 | ||
|
|
89f0a1bbff | ||
|
|
bf735cacbe | ||
|
|
5d14322679 | ||
|
|
dbaea6fa42 | ||
|
|
a05ea58181 | ||
|
|
ada22837a5 | ||
|
|
6ac7e22521 | ||
|
|
eb43bc4982 | ||
|
|
ed4f7fd083 | ||
|
|
b7bfadd660 | ||
|
|
de59f3aafe | ||
|
|
649f535d56 | ||
|
|
9172beb282 | ||
|
|
997e16fec7 | ||
|
|
7625629491 | ||
|
|
ee70f21f58 | ||
|
|
18c4d890dd | ||
|
|
4db8af8a53 | ||
|
|
5025d11a16 | ||
|
|
f55bdc64bd | ||
|
|
1cb71674d7 | ||
|
|
c0f41c84cb | ||
|
|
90cf1ba3a5 | ||
|
|
3f6b319d41 | ||
|
|
e7791a3ade | ||
|
|
317134c29d | ||
|
|
f9c48be2a9 | ||
|
|
561a1a1aac | ||
|
|
c8f63d6160 | ||
|
|
da5610bf3f | ||
|
|
dd7970b549 | ||
|
|
e76f2170b3 | ||
|
|
4a983811d0 | ||
|
|
7684e9e4f7 | ||
|
|
241ae7a4d1 | ||
|
|
8d081525ae | ||
|
|
86ad05c22e | ||
|
|
5ee17a2f14 | ||
|
|
324402be0d | ||
|
|
67de6699d6 | ||
|
|
20262a0164 | ||
|
|
be97066a74 | ||
|
|
78ec0054d9 | ||
|
|
4209ad740c | ||
|
|
89a4c51153 | ||
|
|
fa56fe4e8b | ||
|
|
ccc40362e7 | ||
|
|
21bf279248 | ||
|
|
92e8f54e9a | ||
|
|
97677f08a9 | ||
|
|
b8d816b208 | ||
|
|
7a741e0691 | ||
|
|
f652a4d807 | ||
|
|
b2116c37d8 |
92
ChangeLog
92
ChangeLog
@@ -2,13 +2,91 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.5.3 compared to 3.5.2 *****
|
||||
Fix: Error on field accountancy code for export profile of invoices.
|
||||
Fix: [ bug #1351 ] VIES verification link broken.
|
||||
Fix: [ bug #1352 ] Removing a shipping does not remove the delivery.
|
||||
Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template.
|
||||
Fix: Can disable features with PHPEXCEL (no DLSF compatible).
|
||||
Fix: Can disable features with CKEDITOR.
|
||||
Fix: Pb of records not correctly cleaned when module marge is
|
||||
uninstalled (conflict between 'margin' and 'margins').
|
||||
Fix: [ bug #1341 ] Lastname not added by file or direct input in mass e-mailing.
|
||||
Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents.
|
||||
Fix: Suppliers invoice mask fails using {tttt} in numbering.
|
||||
Fix: [ bug #1350 ] pdf template name for typhon was not correctly set when enabling module.
|
||||
Fix: Navigation on notes for shipments was not working.
|
||||
Fix: [ bug #1353 ] Email notifications, wrong URL.
|
||||
Fix: [ bug #1362 ] Note is not saved.
|
||||
Fix: tr/td balance.
|
||||
Fix: [ bug #1360 ] note indicator for member tab.
|
||||
Fix: Nb of notes and doc not visible onto tasks.
|
||||
Fix: [ bug #1372 ] Margin calculation does not work in proposals.
|
||||
Fix: [ bug #1381 ] PHP Warning when listing stock transactions page.
|
||||
Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error.
|
||||
Fix: TCPDF error file not found in member card generation.
|
||||
Fix: [ bug #1380 ] Customer invoices are not grouped in company results report.
|
||||
Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice.
|
||||
Fix: [ bug #1399 ] [pgsql] Silent warning when setting a propal as "facturée" in propal.php
|
||||
Fix: When number reach 9999 with default numbering module, next number
|
||||
will be 10000 instead of 0000 and error.
|
||||
Fix: element page on project give wrong href link.
|
||||
Fix: [ bug #1397 ] Filter by supplier orders with status Draft does not filter.
|
||||
Fix: [ bug #1388 ] Wrong date when invoicing several orders.
|
||||
Fix: [ bug #1411 ] Unable to set an expedition note if invoices module is not enabled.
|
||||
Fix: [ bug #1407 ] Rouget pdf overlapped when using tracking number and public notes.
|
||||
Fix: [ bug #1405 ] Rouget PDF expedition incorrect when two expeditions under the same commande
|
||||
|
||||
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
|
||||
Fix: Can't add user for a task.
|
||||
Fix: Autoselect of warehouse if there is only one warehouse.
|
||||
Fix: Install of odt template for project and tasks.
|
||||
Fix: [ bug #1318 ] Problem with enter key when adding an existing
|
||||
product to a customer invoice.
|
||||
Fix: [ bug #1307 ] Quotes get removed from several inputs.
|
||||
Fix: [ bug #1317 ] Removing a category does not remove all child categories
|
||||
Fix: [ bug #1312 ] Call to undefined function _()
|
||||
Fix: Restore build for obs and launchpad.
|
||||
Fix: deleting files into backup system tools.
|
||||
Fix: Dump using php not not include lock on tables that are deleted.
|
||||
Fix: Fixed a problem with bank accounts sharing across entities.
|
||||
Fix: fields into group by of sql requests for module margins must be
|
||||
same than fields into select.
|
||||
Fix: When select_date is called with '' as preselected date,
|
||||
automatic user date was not correctly et (We must set a date into PHP
|
||||
server timezone area)
|
||||
Fix: First param of select_date must always be forged with a dolibarr
|
||||
date function and not time().
|
||||
Fix: fix can't add line with product in supplier order
|
||||
Fix: [bug #1309]
|
||||
Fix: Solve pb of too many embedded tables
|
||||
Fix: [ bug #1306 ] Fatal error when adding an external calendar
|
||||
Fix: A fix to manage automatic creation of code for import.
|
||||
Fix: Try to add code to provide easy way to fix warning on timezone not
|
||||
defined.
|
||||
Fix: Several fix into workflow/condition for invoice payments or convert
|
||||
into discount.
|
||||
Fix: Option MAIN_PDF_DASH_BETWEEN_LINES was not working when tcpdf was
|
||||
making a pagebreak higher than 2 pages.
|
||||
Fix: form to add images should not show link form.
|
||||
Fix: Correction when adding order line with price as '0'.
|
||||
Fix: [ bug #1283 ] ROUGET Shipment PDF.
|
||||
Fix: [ bug #1300 ]
|
||||
Fix: Miscellaneous problems on task tabs (withproject parameter lost and
|
||||
download fails).
|
||||
Fix: Avoid home project page to hung when too many tasks opened.
|
||||
Fix: bug #1295: Error when creating an agenda extrafield with a number as reference
|
||||
Fix: Translation of number for pt_PT.
|
||||
Fix: Error on ajax_constantonoff function.
|
||||
Fix: [ bug #1323 ] problème pour générer un odt depuis les taches dans projet.
|
||||
Fix: Can not make withdrawals
|
||||
|
||||
***** ChangeLog for 3.5.1 compared to 3.5.0 *****
|
||||
Fix: Do not report trigger errors twice.
|
||||
Fix: Error when creating event was not reported.
|
||||
Fix: Bug of import of agenda when using https link
|
||||
Fix: Field nature not saved correctly
|
||||
Fix: Substituion of extra field was ko for order
|
||||
Fix: Substitution of extra field was ko for order
|
||||
Fix: Bad translation of date format for pt_BR.
|
||||
Fix: priority field of agenda record is smallint.
|
||||
Fix: Missing loading of lang in some pages.
|
||||
@@ -28,11 +106,11 @@ Fix: Enable extrafields for customer order, proposal and invoice lines. This fea
|
||||
Fix: user right on Holiday for month report nor working.
|
||||
Fix: [ bug #1250 ] "Supplier Ref. product" sidebar search box does not work
|
||||
Fix: Bad space in predefined messages.
|
||||
Fix: Signature was not added for email sent from thirdparty page.
|
||||
Fix: [ bug #1256 ] Signature was not added for email sent from thirdparty page.
|
||||
Fix: Action event SHIPPING_VALIDATE is not implemented
|
||||
Fix: The customer code was set to uppercase when using numbering module leopard. We
|
||||
must keep data safe of any change.
|
||||
Fix: Loading actions extrafields fails.
|
||||
Fix: [ bug #1291 ] Loading actions extrafields fails.
|
||||
Fix: [ bug #1123 ] Paid deposit invoices are always shown as partially paid when fully paid
|
||||
Fix: Corrected project contact types translation.
|
||||
Fix: [ bug #1206 ] PMP price is bad calculated.
|
||||
@@ -40,6 +118,12 @@ Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
|
||||
Fix: [ bug #1240 ] traduction.
|
||||
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
|
||||
Fix: [ bug #1280 ] service with not end of date was tagged as expired.
|
||||
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference.
|
||||
Fix: [ bug #1306 ] Fatal error when adding an external calendar.
|
||||
New: Added es_CL language
|
||||
Fix: Margin tabs bad data show
|
||||
Fix: [ bug #1318 ] Problem with enter key when adding an existing product to a customer invoice.
|
||||
Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line
|
||||
|
||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||
For users:
|
||||
@@ -185,6 +269,8 @@ Fix: Warning into bank conciliation feature.
|
||||
Fix: Bad get of localtaxes into contracts add lines.
|
||||
Fix: Add a limit into list to avoid browser to hang when database is too large.
|
||||
Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability
|
||||
Fix: Agenda and Banks module were not working with multicompany module
|
||||
Fix: [ bug #1317 ] Removing a category does not remove all child categories
|
||||
|
||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||
Fix: field's problem into company's page (RIB).
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
dolibarr (3.5.3-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 2 May 2014 12:00:00 +0100
|
||||
|
||||
dolibarr (3.5.2-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 14 March 2014 12:00:00 +0100
|
||||
|
||||
dolibarr (3.5.1-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
|
||||
@@ -6,7 +6,7 @@ Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
||||
Standards-Version: 3.9.4
|
||||
Homepage: http://www.dolibarr.org
|
||||
Build-Depends: debhelper (>= 9), po-debconf
|
||||
Comments: This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
||||
# This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
||||
|
||||
Package: dolibarr
|
||||
Architecture: all
|
||||
@@ -16,7 +16,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
||||
php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap, php5-geoip,
|
||||
# Required PHP libraries
|
||||
php-pear, php-mail-mime,
|
||||
# libfpdi-php, libfpdf-tpl-php, php-fpdf,
|
||||
# php-tcpdf, libfpdi-php, libfpdf-tpl-php, php-fpdf,
|
||||
# libphp-adodb,
|
||||
# libnusoap-php,
|
||||
# libphp-pclzip,
|
||||
|
||||
@@ -36,8 +36,8 @@ $force_install_lockinstall='444';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
//$force_dolibarr_lib_PHPEXCEL_PATH='';
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||
//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled'
|
||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
|
||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.5.1
|
||||
PROJECT_NUMBER = 3.5.3
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -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.1
|
||||
AppVerName=DoliWamp-3.5.3
|
||||
; 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.1
|
||||
OutputBaseFilename=DoliWamp-3.5.3
|
||||
; ----- End of change
|
||||
;OutputManifestFile=build\doliwampbuild.log
|
||||
; Define full path from which all relative path are defined
|
||||
|
||||
@@ -603,7 +603,7 @@ upload_max_filesize = 2M
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
|
||||
allow_url_fopen = Off
|
||||
allow_url_fopen = On
|
||||
|
||||
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
|
||||
allow_url_include = Off
|
||||
|
||||
@@ -331,7 +331,7 @@ if ($nboftargetok) {
|
||||
}
|
||||
}
|
||||
print 'Run git push --tags'."\n";
|
||||
#$ret=`git push --tags`;
|
||||
$ret=`git push --tags`;
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@@ -349,6 +349,7 @@ if ($nboftargetok) {
|
||||
mkdir "$BUILDROOT/$PROJECT";
|
||||
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
|
||||
$ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
|
||||
|
||||
print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n";
|
||||
$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`;
|
||||
}
|
||||
@@ -441,8 +442,8 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # Keep this removal in case we embed libraries
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
||||
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||
@@ -504,15 +505,17 @@ if ($nboftargetok) {
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT/\" \"$BUILDROOT/$FILENAMETGZ\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/exe`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" $FILENAMETGZ";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ";
|
||||
print "$cmd\n";
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Move to final dir
|
||||
print "Move $FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`;
|
||||
print "Move $BUILDROOT/$FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`;
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -531,6 +534,9 @@ if ($nboftargetok) {
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEXZ\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n";
|
||||
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
@@ -562,6 +568,9 @@ if ($nboftargetok) {
|
||||
$cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEZIP\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMEZIP/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMEZIP/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
|
||||
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
@@ -999,7 +1008,7 @@ if ($nboftargetok) {
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
|
||||
$command="rsync -s -n $OPTIONUPDATEDIST -e 'ssh' \"$file\" \"".$destFolder."\"";
|
||||
$command="rsync -s $OPTIONUPDATEDIST -e 'ssh' \"$file\" \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
print "$ret\n";
|
||||
|
||||
@@ -20,7 +20,8 @@ beta version of Dolibarr, step by step.
|
||||
- Create a branch (x.y).
|
||||
|
||||
- Run makepack-dolibarr.pl to generate all packages.
|
||||
- Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files).
|
||||
- Move build files into www.dolibarr.org web site
|
||||
(/home/dolibarr/wwwroot/files/lastbuild).
|
||||
|
||||
- Post a news on dolibarr.org/dolibarr.fr
|
||||
- Send mail on mailings-list
|
||||
@@ -36,17 +37,17 @@ complete release of Dolibarr, step by step.
|
||||
- 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
|
||||
- Update PAD files.
|
||||
- Commit all changes.
|
||||
- Add a Tag (x.y.z)
|
||||
|
||||
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl
|
||||
- Check content of built packages.
|
||||
- Move build files (tgz+exe+deb+rpm...), ChangeLog and PAD files
|
||||
into www.dolibarr.org web site (/home/dolibarr/wwwroot/files).
|
||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files" on server to
|
||||
point to new files (used by PAD descriptor).
|
||||
- Upload files dolibarr.*.tgz and doliwamp.*.exe on sourceforge.
|
||||
- Move build files into www.dolibarr.org web site
|
||||
(/home/dolibarr/wwwroot/files/stable).
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
sourceforge.
|
||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
|
||||
on server to point to new files (used by some web sites).
|
||||
|
||||
- Send mail on mailings-list
|
||||
- Send news on OpenSource web sites (if major beta or release)
|
||||
|
||||
@@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
return ( "3.5.3", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@@ -103,6 +103,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
@@ -330,6 +331,12 @@ 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
|
||||
* 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
|
||||
|
||||
|
||||
@@ -166,6 +166,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
@@ -305,6 +306,11 @@ done >>%{name}.lang
|
||||
%post
|
||||
|
||||
echo Run post script of packager dolibarr_generic.spec
|
||||
echo Detected constant fedora=0%{?fedora}
|
||||
echo Detected constant rhel_version=0%{?rhel_version}
|
||||
echo Detected constant centos_version=0%{?centos_version}
|
||||
echo Detected constant mdkversion=0%{?mdkversion}
|
||||
echo Detected constant suse_version=0%{?suse_version}
|
||||
|
||||
# Define vars
|
||||
export docdir="/var/lib/dolibarr/documents"
|
||||
@@ -465,9 +471,12 @@ echo Restart mysql server
|
||||
%else
|
||||
%if 0%{?suse_version}
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
else
|
||||
/sbin/service mysqld restart
|
||||
#/etc/init.d/mysqld restart
|
||||
fi
|
||||
if [ -f /etc/init.d/mysql ]; then
|
||||
/sbin/service mysql restart
|
||||
#/etc/init.d/mysql restart
|
||||
fi
|
||||
%else
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
@@ -558,6 +567,12 @@ 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
|
||||
* 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
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
@@ -335,6 +336,12 @@ 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
|
||||
* 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
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
@@ -289,8 +290,9 @@ fi
|
||||
# Restart mysql
|
||||
echo Restart mysql
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
else
|
||||
/sbin/service mysqld restart
|
||||
fi
|
||||
if [ -f /etc/init.d/mysql ]; then
|
||||
/sbin/service mysql restart
|
||||
fi
|
||||
|
||||
@@ -345,6 +347,12 @@ 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
|
||||
* 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
|
||||
|
||||
|
||||
@@ -21,4 +21,4 @@ doli*.rpm
|
||||
doli*.deb
|
||||
doli*.zip
|
||||
cvschangelogbuilder_dolibarr*
|
||||
dolibarr_install.log
|
||||
dolibarr_install.log
|
||||
|
||||
@@ -21,4 +21,4 @@ dolibarr*.rpm
|
||||
dolibarr*.deb
|
||||
dolibarr*.zip
|
||||
cvschangelogbuilder_dolibarr*
|
||||
dolibarr_install.log
|
||||
dolibarr_install.log
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -171,6 +171,7 @@ export list="
|
||||
--ignore-table=$base.llx_abonne_extrafields
|
||||
--ignore-table=$base.llx_abonne_type
|
||||
--ignore-table=$base.llx_abonnement
|
||||
--ignore-table=$base.llx_bootstrap
|
||||
--ignore-table=$base.llx_bt_namemap
|
||||
--ignore-table=$base.llx_bt_speedlimit
|
||||
--ignore-table=$base.llx_bt_summary
|
||||
|
||||
@@ -183,7 +183,7 @@ if ($resql)
|
||||
if ($type > 0)
|
||||
{
|
||||
$membertype=new AdherentType($db);
|
||||
$result=$membertype->fetch($_REQUEST["type"]);
|
||||
$result=$membertype->fetch(GETPOST("type"));
|
||||
$titre.=" (".$membertype->libelle.")";
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ if ($resql)
|
||||
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;
|
||||
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
if ($sall)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -19,7 +19,7 @@
|
||||
/**
|
||||
* \file htdocs/adherents/note.php
|
||||
* \ingroup member
|
||||
* \brief Fiche de notes sur un adherent
|
||||
* \brief Tabe for note of a member
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
@@ -62,7 +63,7 @@ if ($actionsave)
|
||||
// Save agendas
|
||||
while ($i <= $MAXAGENDA)
|
||||
{
|
||||
$name=trim(GETPOST('agenda_ext_name'.$i),'alpha');
|
||||
$name=trim(GETPOST('agenda_ext_name'.$i,'alpha'));
|
||||
$src=trim(GETPOST('agenda_ext_src'.$i,'alpha'));
|
||||
$color=trim(GETPOST('agenda_ext_color'.$i,'alpha'));
|
||||
if ($color=='-1') $color='';
|
||||
@@ -75,7 +76,7 @@ if ($actionsave)
|
||||
break;
|
||||
}
|
||||
|
||||
//print 'color='.$color;
|
||||
//print '-name='.$name.'-color='.$color;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity);
|
||||
|
||||
@@ -57,7 +57,7 @@ if ($action == 'add')
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Initialize distinctfkuser with all already existing values of fk_user (user that use a personalized view of boxes for pos)
|
||||
// Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
|
||||
$distinctfkuser=array();
|
||||
if (! $error)
|
||||
{
|
||||
@@ -85,14 +85,31 @@ if ($action == 'add')
|
||||
}
|
||||
}
|
||||
|
||||
$distinctfkuser['0']='0'; // Add entry for fk_user = 0. We must use string as key and val
|
||||
|
||||
foreach($distinctfkuser as $fk_user)
|
||||
{
|
||||
if (! $error && $fk_user != 0) // We will add fk_user = 0 later.
|
||||
if (! $error && $fk_user != '')
|
||||
{
|
||||
$nbboxonleft=$nbboxonright=0;
|
||||
$sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
||||
dol_syslog("boxes.php activate box sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$boxorder=$obj->box_order;
|
||||
if (preg_match('/A/',$boxorder)) $nbboxonleft++;
|
||||
if (preg_match('/B/',$boxorder)) $nbboxonright++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql.= "box_id, position, box_order, fk_user, entity";
|
||||
$sql.= ") values (";
|
||||
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', ".$fk_user.", ".$conf->entity;
|
||||
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("boxes.php activate box sql=".$sql);
|
||||
@@ -105,24 +122,6 @@ if ($action == 'add')
|
||||
}
|
||||
}
|
||||
|
||||
// If value 0 was not included, we add it.
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql.= "box_id, position, box_order, fk_user, entity";
|
||||
$sql.= ") values (";
|
||||
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", 'A01', 0, ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("boxes.php activate box sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$errmesg=$db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
header("Location: boxes.php");
|
||||
|
||||
@@ -522,9 +522,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$result = $db->query($sql);
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
//$oldid=$id;
|
||||
//$_POST=array('id'=>$oldid); // Clean $_POST array, we keep only
|
||||
//$_GET["id"]=$_POST["id"]; // Force affichage dictionnaire en cours d'edition
|
||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -416,24 +416,27 @@ if ($mode != 'marketplace')
|
||||
print "</td>\n";
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (! empty($conf->global->$const_name))
|
||||
if (! empty($conf->global->$const_name)) // If module is activated
|
||||
{
|
||||
$disableSetup = 0;
|
||||
|
||||
print '<td align="center" valign="middle">';
|
||||
|
||||
if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
if (! empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
{
|
||||
print $langs->trans("Required");
|
||||
if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||
print '</td>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="modules.php?id='.$objMod->numero.'&action=reset&value=' . $modName . '&mode=' . $mode . '">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>'."\n";
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
if (! empty($objMod->config_page_url) && !$disableSetup)
|
||||
{
|
||||
@@ -478,19 +481,25 @@ if ($mode != 'marketplace')
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
else // Module not activated
|
||||
{
|
||||
print '<td align="center" valign="middle">';
|
||||
|
||||
if (! empty($objMod->always_enabled))
|
||||
if (! empty($objMod->always_enabled))
|
||||
{
|
||||
// Ne devrait pas arriver.
|
||||
}
|
||||
|
||||
// Module non actif
|
||||
print '<a href="modules.php?id='.$objMod->numero.'&action=set&value=' . $modName . '&mode=' . $mode . '">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print "</a></td>\n <td> </td>\n";
|
||||
else if (! empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Module non actif
|
||||
print '<a href="modules.php?id='.$objMod->numero.'&action=set&value=' . $modName . '&mode=' . $mode . '">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print "</a>\n";
|
||||
}
|
||||
print "</td>\n <td> </td>";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -85,18 +85,35 @@ print '</br>';
|
||||
// OPCode cache
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("OPCodeCache").'</strong>: ';
|
||||
$test1=function_exists('xcache_info');
|
||||
if ($test1)
|
||||
$foundcache=0;
|
||||
$test=function_exists('xcache_info');
|
||||
if (! $foundcache && $test)
|
||||
{
|
||||
$foundcache++;
|
||||
print img_picto('','tick.png').' '.$langs->trans("XCacheInstalled");
|
||||
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php'.'">Xcache admin page</a>';
|
||||
}
|
||||
else
|
||||
$test=function_exists('eaccelerator_info');
|
||||
if (! $foundcache && $test)
|
||||
{
|
||||
$test2=function_exists('eaccelerator_info');
|
||||
if ($test2) print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled");
|
||||
else print $langs->trans("NoOPCodeCacheFound");
|
||||
$foundcache++;
|
||||
print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled");
|
||||
}
|
||||
$test=function_exists('apc_cache_info');
|
||||
if (! $foundcache && $test)
|
||||
{
|
||||
//var_dump(apc_cache_info());
|
||||
if (ini_get('apc.enabled'))
|
||||
{
|
||||
$foundcache++;
|
||||
print img_picto('','tick.png').' '.$langs->trans("APCInstalled");
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_picto('','warning').' '.$langs->trans("APCCacheInstalledButDisabled");
|
||||
}
|
||||
}
|
||||
if (! $foundcache) print $langs->trans("NoOPCodeCacheFound");
|
||||
print '<br>';
|
||||
|
||||
// HTTPCacheStaticResources
|
||||
|
||||
@@ -50,7 +50,7 @@ if (! $user->admin)
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile');
|
||||
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
|
||||
@@ -58,7 +58,7 @@ if ($file && ! $what)
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file=$conf->admin->dir_output.'/backup/'.GETPOST('urlfile');
|
||||
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
||||
$ret=dol_delete_file($file, 1);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
@@ -451,46 +451,53 @@ function backup_tables($outputfile, $tables='*')
|
||||
//fwrite($handle,"/*!40101 SET character_set_client = utf8 */;\n");
|
||||
$resqldrop=$db->query('SHOW CREATE TABLE '.$table);
|
||||
$row2 = $db->fetch_row($resqldrop);
|
||||
fwrite($handle,$row2[1].";\n");
|
||||
//fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n");
|
||||
|
||||
|
||||
// Dumping the data (locking the table and disabling the keys check while doing the process)
|
||||
fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n");
|
||||
if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back)
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n");
|
||||
|
||||
$sql='SELECT * FROM '.$table;
|
||||
$result = $db->query($sql);
|
||||
$num_fields = $db->num_rows($result);
|
||||
while($row = $db->fetch_row($result)) {
|
||||
// For each row of data we print a line of INSERT
|
||||
fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES (');
|
||||
$columns = count($row);
|
||||
for($j=0; $j<$columns; $j++) {
|
||||
// Processing each columns of the row to ensure that we correctly save the value (eg: add quotes for string - in fact we add quotes for everything, it's easier)
|
||||
if ($row[$j] == null and !is_string($row[$j])) {
|
||||
// IMPORTANT: if the field is NULL we set it NULL
|
||||
$row[$j] = 'NULL';
|
||||
} elseif(is_string($row[$j]) and $row[$j] == '') {
|
||||
// if it's an empty string, we set it as an empty string
|
||||
$row[$j] = "''";
|
||||
} elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
|
||||
// if it's a number, we return it as-is
|
||||
$row[$j] = $row[$j];
|
||||
} else { // else for all other cases we escape the value and put quotes around
|
||||
$row[$j] = addslashes($row[$j]);
|
||||
$row[$j] = preg_replace("#\n#", "\\n", $row[$j]);
|
||||
$row[$j] = "'".$row[$j]."'";
|
||||
}
|
||||
}
|
||||
fwrite($handle,implode(',', $row).");\n");
|
||||
if (empty($row2[1]))
|
||||
{
|
||||
fwrite($handle, "\n-- WARNING: Show create table ".$table." return empy string when it should not.\n");
|
||||
}
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` ENABLE KEYS;\n"); // Enabling back the keys/index checking
|
||||
if (!GETPOST("nobin_nolocks")) fwrite($handle, "UNLOCK TABLES;\n"); // Unlocking the table
|
||||
fwrite($handle,"\n\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite($handle,$row2[1].";\n");
|
||||
//fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n");
|
||||
|
||||
// Dumping the data (locking the table and disabling the keys check while doing the process)
|
||||
fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n");
|
||||
if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back)
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n");
|
||||
|
||||
$sql='SELECT * FROM '.$table;
|
||||
$result = $db->query($sql);
|
||||
$num_fields = $db->num_rows($result);
|
||||
while($row = $db->fetch_row($result))
|
||||
{
|
||||
// For each row of data we print a line of INSERT
|
||||
fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES (');
|
||||
$columns = count($row);
|
||||
for($j=0; $j<$columns; $j++) {
|
||||
// Processing each columns of the row to ensure that we correctly save the value (eg: add quotes for string - in fact we add quotes for everything, it's easier)
|
||||
if ($row[$j] == null and !is_string($row[$j])) {
|
||||
// IMPORTANT: if the field is NULL we set it NULL
|
||||
$row[$j] = 'NULL';
|
||||
} elseif(is_string($row[$j]) and $row[$j] == '') {
|
||||
// if it's an empty string, we set it as an empty string
|
||||
$row[$j] = "''";
|
||||
} elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
|
||||
// if it's a number, we return it as-is
|
||||
$row[$j] = $row[$j];
|
||||
} else { // else for all other cases we escape the value and put quotes around
|
||||
$row[$j] = addslashes($row[$j]);
|
||||
$row[$j] = preg_replace("#\n#", "\\n", $row[$j]);
|
||||
$row[$j] = "'".$row[$j]."'";
|
||||
}
|
||||
}
|
||||
fwrite($handle,implode(',', $row).");\n");
|
||||
}
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` ENABLE KEYS;\n"); // Enabling back the keys/index checking
|
||||
if (!GETPOST("nobin_nolocks")) fwrite($handle, "UNLOCK TABLES;\n"); // Unlocking the table
|
||||
fwrite($handle,"\n\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Backup Procedure structure*/
|
||||
/*
|
||||
$result = $db->query('SHOW PROCEDURE STATUS');
|
||||
|
||||
@@ -46,7 +46,7 @@ class Categorie
|
||||
var $label;
|
||||
var $description;
|
||||
var $socid;
|
||||
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member
|
||||
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member, 4=Contact
|
||||
var $import_key;
|
||||
|
||||
var $cats=array(); // Tableau en memoire des categories
|
||||
@@ -292,6 +292,20 @@ class Categorie
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
/* FIX #1317 : Check for child cat and move up 1 level*/
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " SET fk_parent = ".$this->fk_parent;
|
||||
$sql.= " WHERE fk_parent = ".$this->id;
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
|
||||
|
||||
@@ -209,7 +209,7 @@ if ($object->id)
|
||||
{
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type,$langs->trans("AddPhoto"),1);
|
||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&type='.$type, $langs->trans("AddPhoto"), 1, '', $user->rights->categorie->creer, 50, $object, '', false, '', 0);
|
||||
}
|
||||
|
||||
// Affiche photos
|
||||
|
||||
@@ -56,14 +56,13 @@ class ICal
|
||||
{
|
||||
$this->file = $file;
|
||||
$file_text='';
|
||||
|
||||
|
||||
$tmparray=file($file);
|
||||
if (is_array($tmparray))
|
||||
{
|
||||
$file_text = join("", $tmparray); //load file
|
||||
$file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text);
|
||||
$file_text = preg_replace("/[\r\n]{1,} /","",$file_text);
|
||||
}
|
||||
|
||||
return $file_text; // return all text
|
||||
}
|
||||
|
||||
@@ -115,6 +114,7 @@ class ICal
|
||||
{
|
||||
// get Key and Value VCALENDAR:Begin -> Key = VCALENDAR, Value = begin
|
||||
list($key, $value) = $this->retun_key_value($text);
|
||||
//var_dump($text.' -> '.$key.' - '.$value);
|
||||
|
||||
switch ($text) // search special string
|
||||
{
|
||||
@@ -165,6 +165,8 @@ class ICal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($this->cal);
|
||||
return $this->cal;
|
||||
}
|
||||
|
||||
@@ -236,6 +238,7 @@ class ICal
|
||||
*/
|
||||
function retun_key_value($text)
|
||||
{
|
||||
/*
|
||||
preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches);
|
||||
|
||||
if (empty($matches))
|
||||
@@ -246,8 +249,8 @@ class ICal
|
||||
{
|
||||
$matches = array_splice($matches, 1, 2);
|
||||
return $matches;
|
||||
}
|
||||
|
||||
}*/
|
||||
return explode(':',$text,2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -261,7 +261,7 @@ if ($object->id > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnkownError");
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -538,7 +538,7 @@ if ($action == 'create')
|
||||
|
||||
// Busy
|
||||
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
|
||||
print '<input id="transparency" type="checkbox" name="transparency" value="'.$actioncomm->transparency.'">';
|
||||
print '<input id="transparency" type="checkbox" name="transparency"'.($actioncomm->transparency?' checked="checked"':'').'>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Realised by
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', true);
|
||||
ini_set('html_errors', false);
|
||||
|
||||
/**
|
||||
* \file htdocs/comm/action/index.php
|
||||
@@ -149,9 +146,11 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0
|
||||
$source='AGENDA_EXT_SRC'.$i;
|
||||
$name='AGENDA_EXT_NAME'.$i;
|
||||
$color='AGENDA_EXT_COLOR'.$i;
|
||||
$buggedfile='AGENDA_EXT_BUGGEDFILE'.$i;
|
||||
if (! empty($conf->global->$source) && ! empty($conf->global->$name))
|
||||
{
|
||||
$listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color);
|
||||
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
|
||||
$listofextcals[]=array('src'=>$conf->global->$source,'name'=>$conf->global->$name,'color'=>$conf->global->$color,'buggedfile'=>(isset($conf->global->buggedfile)?$conf->global->buggedfile:0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +314,7 @@ $sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,';
|
||||
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql.= ' WHERE a.fk_action = ca.id';
|
||||
$sql.= ' AND a.entity IN ('.getEntity().')';
|
||||
$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
||||
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
|
||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
|
||||
@@ -530,9 +529,11 @@ if (count($listofextcals))
|
||||
$url=$extcal['src']; // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics
|
||||
$namecal = $extcal['name'];
|
||||
$colorcal = $extcal['color'];
|
||||
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal;
|
||||
$buggedfile = $extcal['buggedfile'];
|
||||
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile;
|
||||
$ical=new ICal();
|
||||
$ical->parse($url);
|
||||
|
||||
// After this $ical->cal['VEVENT'] contains array of events, $ical->cal['DAYLIGHT'] contains daylight info, $ical->cal['STANDARD'] contains non daylight info, ...
|
||||
//var_dump($ical->cal); exit;
|
||||
$icalevents=array();
|
||||
@@ -646,6 +647,8 @@ if (count($listofextcals))
|
||||
// Loop on each entry into cal file to know if entry is qualified and add an ActionComm into $eventarray
|
||||
foreach($icalevents as $icalevent)
|
||||
{
|
||||
//var_dump($icalevent);
|
||||
|
||||
//print $icalevent['SUMMARY'].'->'.var_dump($icalevent).'<br>';exit;
|
||||
if (! empty($icalevent['RRULE'])) continue; // We found a repeatable event. It was already split into unitary events, so we discard general rule.
|
||||
|
||||
@@ -662,12 +665,36 @@ if (count($listofextcals))
|
||||
$event->fulldayevent=true;
|
||||
$addevent=true;
|
||||
}
|
||||
elseif (!is_array($icalevent['DTSTART'])) // not fullday event (DTSTART is not array)
|
||||
elseif (!is_array($icalevent['DTSTART'])) // not fullday event (DTSTART is not array. It is a value like '19700101T000000Z' for 00:00 in greenwitch)
|
||||
{
|
||||
$datestart=$icalevent['DTSTART'];
|
||||
$dateend=$icalevent['DTEND'];
|
||||
$addevent=true;
|
||||
}
|
||||
elseif (isset($icalevent['DTSTART']['unixtime'])) // File contains a local timezone + a TZ (for example when using bluemind)
|
||||
{
|
||||
$datestart=$icalevent['DTSTART']['unixtime'];
|
||||
$dateend=$icalevent['DTEND']['unixtime'];
|
||||
// $buggedfile is set to uselocalandtznodaylight if conf->global->AGENDA_EXT_BUGGEDFILEx = 'uselocalandtznodaylight'
|
||||
if ($buggedfile === 'uselocalandtznodaylight') // unixtime is a local date that does not take daylight into account, TZID is +1 for example for 'Europe/Paris' in summer instead of 2
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
// $buggedfile is set to uselocalandtzdaylight if conf->global->AGENDA_EXT_BUGGEDFILEx = 'uselocalandtzdaylight' (for example with bluemind)
|
||||
if ($buggedfile === 'uselocalandtzdaylight') // unixtime is a local date that does take daylight into account, TZID is +2 for example for 'Europe/Paris' in summer
|
||||
{
|
||||
$localtzs = new DateTimeZone(preg_replace('/"/','',$icalevent['DTSTART']['TZID']));
|
||||
$localtze = new DateTimeZone(preg_replace('/"/','',$icalevent['DTEND']['TZID']));
|
||||
$localdts = new DateTime(dol_print_date($datestart,'dayrfc','gmt'), $localtzs);
|
||||
$localdte = new DateTime(dol_print_date($dateend,'dayrfc','gmt'), $localtze);
|
||||
$tmps=-1*$localtzs->getOffset($localdts);
|
||||
$tmpe=-1*$localtze->getOffset($localdte);
|
||||
$datestart+=$tmps;
|
||||
$dateend+=$tmpe;
|
||||
//var_dump($datestart);
|
||||
}
|
||||
$addevent=true;
|
||||
}
|
||||
|
||||
if ($addevent)
|
||||
{
|
||||
|
||||
@@ -381,7 +381,7 @@ if ($id > 0)
|
||||
print '<td colspan="3">';
|
||||
$amount_discount=$object->getAvailableDiscounts();
|
||||
if ($amount_discount < 0) dol_print_error($db,$object->error);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount).'</a> '.$langs->trans("Currency".$conf->currency);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
|
||||
else print $langs->trans("DiscountNone");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 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
|
||||
@@ -1368,7 +1368,7 @@ if ($action == 'create')
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
||||
$form->select_date('','','','','',"addprop");
|
||||
$form->select_date('','','','','',"addprop",1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Validaty duration
|
||||
@@ -1407,8 +1407,7 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
$datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||
$form->select_date($datepropal,'liv_','','','',"addprop");
|
||||
$form->select_date(-1,'liv_','','','',"addprop",1,1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -1462,7 +1461,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="createmode" value="empty">';
|
||||
}
|
||||
|
||||
print '<table>';
|
||||
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '<table>';
|
||||
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE))
|
||||
{
|
||||
// For backward compatibility
|
||||
@@ -1533,14 +1532,11 @@ if ($action == 'create')
|
||||
print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_percent.'">%</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '</table><br>';
|
||||
|
||||
$langs->load("bills");
|
||||
print '<center>';
|
||||
@@ -1681,28 +1677,22 @@ else
|
||||
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
print '. ';
|
||||
$absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
|
||||
$absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
|
||||
$absolute_discount=price2num($absolute_discount,'MT');
|
||||
$absolute_creditnote=price2num($absolute_creditnote,'MT');
|
||||
if ($absolute_discount)
|
||||
{
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$absolute_discount = $soc->getAvailableDiscounts('', 'fk_facture_source IS NULL');
|
||||
$absolute_creditnote = $soc->getAvailableDiscounts('', 'fk_facture_source IS NOT NULL');
|
||||
$absolute_discount = price2num($absolute_discount, 'MT');
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
if ($absolute_discount) {
|
||||
if ($object->statut > 0) {
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount, 0, $langs, 0, 0, -1, $conf->currency));
|
||||
} else {
|
||||
// Remise dispo de type non avoir
|
||||
$filter='fk_facture_source IS NULL';
|
||||
print '<br>';
|
||||
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter);
|
||||
}
|
||||
}
|
||||
if ($absolute_creditnote)
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. ';
|
||||
if ($absolute_creditnote) {
|
||||
print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote, 0, $langs, 0, 0, -1, $conf->currency)) . '. ';
|
||||
}
|
||||
if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -1702,7 +1702,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture=".$this->db->idate($now).", fk_user_cloture=".$user->id;
|
||||
$sql.= " SET fk_statut = ".$statut.", note_private = '".$this->db->escape($note)."', date_cloture='".$this->db->idate($now)."', fk_user_cloture=".$user->id;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@@ -137,7 +137,7 @@ if ($object->id > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnkownError");
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -210,6 +210,15 @@ if ($search_user > 0)
|
||||
|
||||
|
||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder.', p.ref DESC';
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
$result=$db->query($sql);
|
||||
|
||||
@@ -236,7 +245,7 @@ if ($result)
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_author) $param.='&search_author='.$search_author;
|
||||
if ($search_town) $param.='&search_town='.$search_town;
|
||||
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@@ -1362,7 +1362,7 @@ class Commande extends CommonOrder
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||
$this->fetch_optionals($this->id,$extralabels);
|
||||
|
||||
$this->db->free();
|
||||
$this->db->free($result);
|
||||
|
||||
/*
|
||||
* Lines
|
||||
@@ -2516,7 +2516,7 @@ class Commande extends CommonOrder
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut";
|
||||
$sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
@@ -2535,7 +2535,9 @@ class Commande extends CommonOrder
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
|
||||
|
||||
$date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date;
|
||||
if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ else if ($action == 'setnote_private' && $user->rights->commande->creer)
|
||||
else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
{
|
||||
$langs->load('errors');
|
||||
$error = false;
|
||||
$error = 0;
|
||||
|
||||
// Set if we used free entry or predefined product
|
||||
if (GETPOST('addline_libre')
|
||||
@@ -581,9 +581,9 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
$price_ht = GETPOST('price_ht');
|
||||
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
||||
}
|
||||
if (GETPOST('addline_predefined')
|
||||
if (GETPOST('addline_predefined')
|
||||
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||
)
|
||||
)
|
||||
{
|
||||
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
|
||||
$idprod=GETPOST('idprod', 'int');
|
||||
@@ -643,8 +643,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod)))
|
||||
{
|
||||
// Clean parameters
|
||||
$date_start=dol_mktime(0, 0, 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
||||
$date_end=dol_mktime(0, 0, 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), 0, GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
||||
$date_end=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), 0, GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||
$price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT');
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
@@ -863,8 +863,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
|
||||
// Clean parameters
|
||||
$date_start='';
|
||||
$date_end='';
|
||||
$date_start=dol_mktime(0, 0, 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end=dol_mktime(0, 0, 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
$description=dol_htmlcleanlastbr(GETPOST('product_desc'));
|
||||
$pu_ht=GETPOST('price_ht');
|
||||
$vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
||||
@@ -1882,7 +1882,7 @@ else
|
||||
//'text' => $langs->trans("ConfirmClone"),
|
||||
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1)));
|
||||
}
|
||||
|
||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
|
||||
@@ -1902,7 +1902,7 @@ else
|
||||
//'text' => $langs->trans("ConfirmClone"),
|
||||
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1)));
|
||||
}
|
||||
|
||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
|
||||
@@ -1933,7 +1933,7 @@ else
|
||||
//'text' => $langs->trans("ConfirmClone"),
|
||||
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1)));
|
||||
}
|
||||
|
||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1);
|
||||
|
||||
@@ -200,6 +200,15 @@ if ($search_user > 0)
|
||||
}
|
||||
|
||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
//print $sql;
|
||||
@@ -245,7 +254,7 @@ if ($resql)
|
||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
$i = 0;
|
||||
|
||||
// Lignes des champs de filtre
|
||||
|
||||
@@ -413,7 +413,7 @@ if ($action == 'create' && empty($mesgs))
|
||||
|
||||
// Date invoice
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
||||
$html->select_date(0,'','','','',"add",1,1);
|
||||
$html->select_date('','','','','',"add",1,1);
|
||||
print '</td></tr>';
|
||||
// Payment term
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
|
||||
|
||||
@@ -50,7 +50,7 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' :'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
|
||||
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype);
|
||||
|
||||
$paiementtype=GETPOST('paiementtype','alpha',3);
|
||||
$req_nb=GETPOST("req_nb",'',3);
|
||||
|
||||
@@ -43,7 +43,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
}
|
||||
$fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -44,7 +44,7 @@ if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
}
|
||||
$fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
|
||||
|
||||
|
||||
/*
|
||||
@@ -325,7 +325,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$form->select_date(time(), 're', 0, 0, 0, 'formsoc');
|
||||
$form->select_date('', 're', 0, 0, 0, 'formsoc');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
|
||||
@@ -41,7 +41,7 @@ if (isset($_GET["account"]) || isset($_GET["ref"]))
|
||||
}
|
||||
$fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
|
||||
|
||||
$account=$_GET["account"];
|
||||
$mode='standard';
|
||||
|
||||
@@ -42,7 +42,7 @@ if (isset($_GET["account"]) || isset($_GET["ref"]))
|
||||
}
|
||||
$fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
|
||||
|
||||
|
||||
$vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"];
|
||||
|
||||
@@ -128,7 +128,7 @@ if ($object->id)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnkownError");
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -60,7 +60,6 @@ llxHeader('',$langs->trans("ListOfFees"),$help_url);
|
||||
|
||||
|
||||
|
||||
|
||||
$totalnb=0;
|
||||
$sql = "SELECT count(d.rowid) as nb, sum(d.km) as km, d.type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d";
|
||||
@@ -90,13 +89,11 @@ if ($result)
|
||||
|
||||
print_fiche_titre($langs->trans("ExpensesArea"));
|
||||
|
||||
print '<table width="100%" class="notopnoleftnoright">';
|
||||
|
||||
// Left area
|
||||
print '<tr><td class="notopnoleft" width="30%" valign="top">';
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
// Statistics
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">'.$langs->trans("Statistics").'</td>';
|
||||
@@ -124,8 +121,8 @@ print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Right area
|
||||
print '</td><td valign="top">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
$max=10;
|
||||
|
||||
@@ -191,6 +188,9 @@ if ($result)
|
||||
else dol_print_error($db);
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -51,6 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('companies');
|
||||
$langs->load('compta');
|
||||
$langs->load('products');
|
||||
$langs->load('banks');
|
||||
$langs->load('main');
|
||||
@@ -578,14 +579,21 @@ else if ($action == 'confirm_canceled' && $confirm == 'yes')
|
||||
// Convertir en reduc
|
||||
else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
$object->fetch_lines();
|
||||
|
||||
if (! $object->paye) // protection against multiple submit
|
||||
// Check if there is already a discount (protection to avoid duplicate creation when resubmit post)
|
||||
$discountcheck=new DiscountAbsolute($db);
|
||||
$result=$discountcheck->fetch(0,$object->id);
|
||||
|
||||
$canconvert=0;
|
||||
if ($object->type == 3 && $object->paye == 1 && empty($discountcheck->id)) $canconvert=1; // we can convert deposit into discount if deposit is payed completely and not already converted (see real condition into condition used to show button converttoreduc)
|
||||
if ($object->type == 2 && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and amount of payment is 0 (see real condition into condition used to show button converttoreduc)
|
||||
if ($canconvert)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
// Boucle sur chaque taux de tva
|
||||
$i=0;
|
||||
foreach($object->lines as $line)
|
||||
@@ -601,8 +609,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
|
||||
if ($object->type == 2) $discount->description='(CREDIT_NOTE)';
|
||||
elseif ($object->type == 3) $discount->description='(DEPOSIT)';
|
||||
else {
|
||||
$this->error="CantConvertToReducAnInvoiceOfThisType";
|
||||
return -1;
|
||||
setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors');
|
||||
}
|
||||
$discount->tva_tx=abs($object->total_ttc);
|
||||
$discount->fk_soc=$object->socid;
|
||||
@@ -617,6 +624,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
|
||||
$discount->tva_tx=abs($tva_tx);
|
||||
|
||||
$result=$discount->create($user);
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
@@ -624,24 +632,24 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
if (empty($error))
|
||||
{
|
||||
// Classe facture
|
||||
$result=$object->set_paid($user);
|
||||
if ($result > 0)
|
||||
if ($result >= 0)
|
||||
{
|
||||
//$mesgs[]='OK'.$discount->id;
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesgs[]='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error,'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesgs[]='<div class="error">'.$discount->error.'</div>';
|
||||
setEventMessage($discount->error,'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@@ -1132,7 +1140,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$error = 0;
|
||||
|
||||
// Set if we used free entry or predefined product
|
||||
if (GETPOST('addline_libre'))
|
||||
if (GETPOST('addline_libre')
|
||||
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||
)
|
||||
{
|
||||
$predef='';
|
||||
$idprod=0;
|
||||
@@ -1140,7 +1150,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$price_ht = GETPOST('price_ht');
|
||||
$tva_tx=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
||||
}
|
||||
if (GETPOST('addline_predefined'))
|
||||
if (GETPOST('addline_predefined')
|
||||
|| (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field
|
||||
)
|
||||
{
|
||||
$predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : '');
|
||||
$idprod=GETPOST('idprod', 'int');
|
||||
@@ -1843,21 +1855,25 @@ else if ($action == 'builddoc') // En get ou en post
|
||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
||||
if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank');
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
// object->modelpdf can be empty when we are using odt template by default and builddoc is called by POS module (invoice was just created and no template ODT template was selected).
|
||||
if (! empty($object->modelpdf))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1980,9 +1996,10 @@ if ($action == 'update_extras')
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
@@ -2185,6 +2202,7 @@ if ($action == 'create')
|
||||
$options.='</option>';
|
||||
}
|
||||
|
||||
// Show link for credit note
|
||||
$facids=$facturestatic->list_qualified_avoir_invoices($soc->id);
|
||||
if ($facids < 0)
|
||||
{
|
||||
@@ -2613,7 +2631,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
//'text' => $langs->trans("ConfirmClone"),
|
||||
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1,0,0,$langs->trans("NoStockAction"))));
|
||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1,0,0,$langs->trans("NoStockAction"))));
|
||||
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('DeleteBill'),$text,'confirm_delete',$formquestion,"yes",1);
|
||||
}else {
|
||||
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id,$langs->trans('DeleteBill'),$text,'confirm_delete','','',1);
|
||||
@@ -2674,7 +2692,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
|
||||
} else {
|
||||
$label = $object->type==2?$langs->trans("SelectWarehouseForStockIncrease"):$langs->trans("SelectWarehouseForStockDecrease");
|
||||
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1);
|
||||
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1);
|
||||
}
|
||||
$formquestion=array(
|
||||
//'text' => $langs->trans("ConfirmClone"),
|
||||
@@ -2717,7 +2735,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
|
||||
} else {
|
||||
$label=$object->type==2?$langs->trans("SelectWarehouseForStockDecrease"):$langs->trans("SelectWarehouseForStockIncrease");
|
||||
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1);
|
||||
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone','idwarehouse','',1);
|
||||
}
|
||||
$formquestion=array(
|
||||
//'text' => $langs->trans("ConfirmClone"),
|
||||
@@ -3592,7 +3610,10 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Reopen a standard paid invoice
|
||||
if (($object->type == 0 || $object->type == 1) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
|
||||
if ((($object->type == 0 || $object->type == 1)
|
||||
|| ($object->type == 2 && empty($discount->id))
|
||||
|| ($object->type == 3 && empty($discount->id)))
|
||||
&& ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
|
||||
{
|
||||
if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice
|
||||
{
|
||||
@@ -3679,23 +3700,32 @@ else if ($id > 0 || ! empty($ref))
|
||||
// For credit note only
|
||||
if ($object->type == 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create">'.$langs->trans('DoPaymentBack').'</a></div>';
|
||||
if ($resteapayer == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPaymentBack').'</span></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create">'.$langs->trans('DoPaymentBack').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// For credit note
|
||||
if ($object->type == 2 && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
|
||||
}
|
||||
// For deposit invoice
|
||||
if ($object->type == 3 && $object->statut == 1 && $resteapayer == 0 && $user->rights->facture->creer)
|
||||
if ($object->type == 3 && $object->paye == 1 && $resteapayer == 0 && $user->rights->facture->creer && empty($discount->id))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Classify paid (if not deposit and not credit note. Such invoice are "converted")
|
||||
if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement &&
|
||||
(($object->type != 2 && $object->type != 3 && $resteapayer <= 0) || ($object->type == 2 && $resteapayer >= 0)) )
|
||||
// Classify paid
|
||||
if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && (($object->type != 2 && $object->type != 3 && $resteapayer <= 0) || ($object->type == 2 && $resteapayer >= 0))
|
||||
|| ($object->type == 3 && $object->paye == 0 && $resteapayer == 0 && $user->rights->facture->paiement && empty($discount->id))
|
||||
)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a></div>';
|
||||
}
|
||||
|
||||
@@ -1252,6 +1252,16 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
// Removed extrafields
|
||||
if (! $error) {
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@@ -1471,6 +1481,7 @@ class Facture extends CommonInvoice
|
||||
if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'";
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -1486,8 +1497,7 @@ class Facture extends CommonInvoice
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$this->error=$this->db->error();
|
||||
dol_print_error($this->db);
|
||||
$this->error=$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
||||
@@ -160,7 +160,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnkownError");
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -231,6 +231,15 @@ $sql.= ' ORDER BY ';
|
||||
$listfield=explode(',',$sortfield);
|
||||
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
||||
$sql.= ' f.rowid DESC ';
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
//print $sql;
|
||||
|
||||
@@ -255,7 +264,7 @@ if ($resql)
|
||||
if ($search_user > 0) $param.='&search_user=' .$search_user;
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc;
|
||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
|
||||
$i = 0;
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@@ -428,7 +428,7 @@ if ($object->id > 0)
|
||||
|
||||
/*
|
||||
* Withdrawal request
|
||||
*/
|
||||
*/
|
||||
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
|
||||
$sql .= " , pfd.date_traite as date_traite";
|
||||
@@ -462,12 +462,13 @@ if ($object->id > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
if ($num == 0) print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AlreadyPayed")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("RequestAlreadyDone")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
|
||||
}
|
||||
|
||||
print "</div><br>\n";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -28,7 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
|
||||
$chid=GETPOST("id");
|
||||
$action=GETPOST('action');
|
||||
$amounts = array();
|
||||
|
||||
// Security check
|
||||
@@ -43,7 +44,7 @@ if ($user->societe_id > 0)
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'add_payment')
|
||||
if ($action == 'add_payment')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
@@ -171,7 +172,8 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print '<form name="add_payment" action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="id" value="'.$charge->id.'">';
|
||||
print '<input type="hidden" name="id" value="'.$chid.'">';
|
||||
print '<input type="hidden" name="chid" value="'.$chid.'">';
|
||||
print '<input type="hidden" name="action" value="add_payment">';
|
||||
|
||||
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
|
||||
@@ -184,7 +186,6 @@ if ($_GET["action"] == 'create')
|
||||
print '<tr><td>'.$langs->trans("Period")."</td><td colspan=\"2\">".dol_print_date($charge->periode,'day')."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
$sql = "SELECT sum(p.amount) as total";
|
||||
@@ -198,43 +199,50 @@ if ($_GET["action"] == 'create')
|
||||
$db->free();
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay").'</td><td colspan="2"><b>'.price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("Payment").'</td>';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print "<input type=\"hidden\" name=\"chid\" value=\"$chid\">";
|
||||
print "<td colspan=\"3\">".$langs->trans("Payment").'</td>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
|
||||
$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0;
|
||||
$form->select_date($datepayment,'','','','',"add_payment",1,1);
|
||||
print "</td>";
|
||||
print '<td>'.$langs->trans("Comments").'</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
|
||||
$form->select_types_paiements(isset($_POST["paiementtype"])?$_POST["paiementtype"]:$charge->paiementtype, "paiementtype");
|
||||
print "</td>\n";
|
||||
|
||||
print '<td rowspan="3" valign="top"><textarea name="comment" wrap="soft" cols="40" rows="'.ROWS_3.'"></textarea></td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
|
||||
print '<td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes(isset($_POST["accountid"])?$_POST["accountid"]:$charge->accountid, "accountid", 0, '',1); // Show opend bank account list
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Numero');
|
||||
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
|
||||
print "<td><input name=\"num_paiement\" type=\"text\"></td></tr>\n";
|
||||
print '<td colspan="2"><input name="num_paiement" type="text"></td></tr>'."\n";
|
||||
|
||||
print '<tr>';
|
||||
print '<td valign="top">'.$langs->trans("Comments").'</td>';
|
||||
print '<td valign="top" colspan="2"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Autres charges impayees
|
||||
*/
|
||||
$num = 1;
|
||||
$i = 0;
|
||||
print '<tr><td colspan="3">';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td>'.$langs->trans("SocialContribution").'</td>';
|
||||
print '<td align="left">'.$langs->trans("DateDue").'</td>';
|
||||
@@ -303,17 +311,6 @@ if ($_GET["action"] == 'create')
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table></td></tr>\n";
|
||||
// }
|
||||
// $db->free();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// print $sql ."<br>".$db->error();
|
||||
// }
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -671,9 +671,10 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
/**
|
||||
* Get number of invoices to withdrawal
|
||||
* TODO delete params banque and agence when not necesary
|
||||
*
|
||||
* @param int $banque bank
|
||||
* @param int $agence agence
|
||||
* @param int $banque dolibarr mysoc bank
|
||||
* @param int $agence dolibarr mysoc agence
|
||||
* @return int <O if KO, number of invoices if OK
|
||||
*/
|
||||
function NbFactureAPrelever($banque=0,$agence=0)
|
||||
@@ -683,16 +684,16 @@ class BonPrelevement extends CommonObject
|
||||
$sql = "SELECT count(f.rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
if ($banque || $agence) $sql.=", ".MAIN_DB_PREFIX."societe_rib as sr";
|
||||
//if ($banque || $agence) $sql.=", ".MAIN_DB_PREFIX."societe_rib as sr";
|
||||
$sql.= " WHERE f.fk_statut = 1";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " AND f.rowid = pfd.fk_facture";
|
||||
$sql.= " AND f.paye = 0";
|
||||
$sql.= " AND pfd.traite = 0";
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
if ($banque || $agence) $sql.= " AND f.fk_soc = sr.rowid";
|
||||
if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
|
||||
if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";
|
||||
//if ($banque || $agence) $sql.= " AND f.fk_soc = sr.rowid";
|
||||
//if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
|
||||
//if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@@ -715,9 +716,10 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
/**
|
||||
* Create a withdraw
|
||||
* TODO delete params banque and agence when not necesary
|
||||
*
|
||||
* @param int $banque code of bank (to withdraw a specific bankof a specific customer. By default '')
|
||||
* @param int $agence code of bank office (guichet) (to withdraw a specific bankof a specific customer. By default '')
|
||||
* @param int $banque dolibarr mysoc bank
|
||||
* @param int $agence dolibarr mysoc bank office (guichet)
|
||||
* @param string $mode real=do action, simu=test only
|
||||
* @return int <0 if KO, nbre of invoice withdrawed if OK
|
||||
*/
|
||||
@@ -755,17 +757,17 @@ class BonPrelevement extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
if ($banque || $agence) $sql.= ", ".MAIN_DB_PREFIX."societe_rib as sr";
|
||||
//if ($banque || $agence) $sql.= ", ".MAIN_DB_PREFIX."societe_rib as sr";
|
||||
$sql.= " WHERE f.rowid = pfd.fk_facture";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " AND s.rowid = f.fk_soc";
|
||||
if ($banque || $agence) $sql.= " AND s.rowid = sr.fk_soc";
|
||||
//if ($banque || $agence) $sql.= " AND s.rowid = sr.fk_soc";
|
||||
$sql.= " AND f.fk_statut = 1";
|
||||
$sql.= " AND f.paye = 0";
|
||||
$sql.= " AND pfd.traite = 0";
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
|
||||
if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";
|
||||
//if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
|
||||
//if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";
|
||||
|
||||
dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@@ -187,7 +187,7 @@ else
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY s.nom, s.rowid";
|
||||
$sql.= " ORDER BY s.nom";
|
||||
$sql.= " ORDER BY s.nom, s.rowid";
|
||||
|
||||
dol_syslog("get customer invoices sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
@@ -281,11 +281,11 @@ print '</tr>';
|
||||
|
||||
|
||||
/*
|
||||
* Frais, factures fournisseurs.
|
||||
* Suppliers invoices
|
||||
*/
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, date_format(f.datef,'%Y-%m') as dm, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
@@ -299,7 +299,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, sum(pf.amount) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
@@ -312,7 +312,7 @@ else
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql .= " GROUP BY s.nom, s.rowid, dm";
|
||||
$sql .= " GROUP BY s.nom, s.rowid";
|
||||
$sql .= " ORDER BY s.nom, s.rowid";
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SuppliersInvoices").'</td></tr>';
|
||||
@@ -372,11 +372,11 @@ print '</tr>';
|
||||
* Charges sociales non deductibles
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 0)</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
@@ -386,7 +386,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -397,8 +397,8 @@ else
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
|
||||
dol_syslog("get social contributions deductible=0 sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
@@ -446,11 +446,11 @@ print '</tr>';
|
||||
* Charges sociales deductibles
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").'</td></tr>';
|
||||
print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 1)</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
@@ -458,12 +458,12 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -473,8 +473,8 @@ else
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle";
|
||||
$sql.= " ORDER BY c.libelle";
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
|
||||
dol_syslog("get social contributions deductible=1 sql=".$sql);
|
||||
@@ -541,6 +541,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
||||
/*
|
||||
* VAT
|
||||
*/
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("VAT").'</td></tr>';
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
@@ -564,12 +565,15 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
dol_syslog("get vat to pay sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=false;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$amount -= $obj->amount;
|
||||
@@ -606,12 +610,15 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
dol_syslog("get vat received back sql=".$sql);
|
||||
$result=$db->query($sql);
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$amount += $obj->amount;
|
||||
@@ -634,7 +641,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
}
|
||||
else
|
||||
{
|
||||
// TVA reellement deja payee
|
||||
// VAT really already paid
|
||||
$amount=0;
|
||||
$sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
@@ -675,7 +682,7 @@ else
|
||||
print "<td align=\"right\">".price($amount)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
// TVA recuperee
|
||||
// VAT really received
|
||||
$amount=0;
|
||||
$sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -256,7 +256,7 @@ if ($id > 0)
|
||||
|
||||
$head=tax_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
||||
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
||||
|
||||
// Confirmation de la suppression de la charge
|
||||
if ($action == 'paid')
|
||||
@@ -303,8 +303,8 @@ if ($id > 0)
|
||||
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||
|
||||
/*
|
||||
* Paiements
|
||||
*/
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
||||
$sql.= "c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@@ -324,8 +324,12 @@ if ($id > 0)
|
||||
$i = 0; $total = 0;
|
||||
echo '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Payments").'</td><td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td><td> </td></tr>';
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@@ -333,15 +337,15 @@ if ($id > 0)
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").'</a> ';
|
||||
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
@@ -363,7 +367,7 @@ if ($id > 0)
|
||||
|
||||
print "</tr>";
|
||||
|
||||
// Period end date
|
||||
// Period end date
|
||||
print "<tr><td>".$langs->trans("PeriodEndDate")."</td>";
|
||||
print "<td>";
|
||||
if ($action == 'edit')
|
||||
@@ -375,7 +379,7 @@ if ($id > 0)
|
||||
print dol_print_date($object->periode,"day");
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
// Due date
|
||||
if ($action == 'edit')
|
||||
{
|
||||
@@ -406,7 +410,7 @@ if ($id > 0)
|
||||
|
||||
if ($action == 'edit') print "</form>\n";
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -167,7 +167,7 @@ if ($object->id)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnkownError");
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1151,11 +1151,11 @@ class Contrat extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
// Calcul du total TTC et de la TVA pour la ligne a partir de
|
||||
// qty, pu, remise_percent et txtva
|
||||
// qty, pu, remise_percent et tvatx
|
||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc);
|
||||
$localtaxes_type=getLocalTaxesFromRate($tvatx,0,$mysoc);
|
||||
|
||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type);
|
||||
$total_ht = $tabprice[0];
|
||||
|
||||
@@ -130,7 +130,7 @@ if ($object->id)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnkownError");
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,7 +118,10 @@ abstract class CommonDocGenerator
|
||||
'mycompany_idprof5'=>$mysoc->idprof5,
|
||||
'mycompany_idprof6'=>$mysoc->idprof6,
|
||||
'mycompany_vatnumber'=>$mysoc->tva_intra,
|
||||
'mycompany_note'=>$mysoc->note
|
||||
// Only private not exists for "mysoc"
|
||||
'mycompany_note'=>$mysoc->note_private
|
||||
//'mycompany_note_private'=>$mysoc->note_private,
|
||||
//'mycompany_note_public'=>$mysoc->note_public,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ abstract class CommonObject
|
||||
|
||||
public $array_options=array();
|
||||
|
||||
public $linkedObjectsIds;
|
||||
public $linkedObjects;
|
||||
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
|
||||
public $linkedObjects; // Loaded by ->fetchObjectLinked
|
||||
|
||||
// No constructor as it is an abstract class
|
||||
|
||||
@@ -1691,7 +1691,7 @@ abstract class CommonObject
|
||||
* @param string $sourcetype Object source type
|
||||
* @param int $targetid Object target id
|
||||
* @param string $targettype Object target type
|
||||
* @param string $clause OR, AND clause
|
||||
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
|
||||
* @return void
|
||||
*/
|
||||
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
|
||||
@@ -2359,7 +2359,8 @@ abstract class CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Function to check if an object is used by others
|
||||
* Function to check if an object is used by others.
|
||||
* Check is done into this->childtables. There is no check into llx_element_element.
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return int <0 if KO, 0 if not used, >0 if already used
|
||||
|
||||
@@ -201,6 +201,20 @@ class Conf
|
||||
//var_dump($this->modules);
|
||||
//var_dump($this->modules_parts['theme']);
|
||||
|
||||
// If you can't set timezone of your PHP, set this constant. Better is to set it to UTC.
|
||||
// In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore.
|
||||
//$this->global->MAIN_SERVER_TZ='Europe/Paris';
|
||||
if (! empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ != 'auto')
|
||||
{
|
||||
try {
|
||||
date_default_timezone_set($this->global->MAIN_SERVER_TZ);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog("Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Object $mc
|
||||
if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ class DiscountAbsolute
|
||||
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
|
||||
$sql.= " fk_facture_source";
|
||||
$sql.= ")";
|
||||
$sql.= " VALUES (".$this->db->idate($this->datec!=''?$this->datec:dol_now()).", ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
|
||||
$sql.= " VALUES ('".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
|
||||
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
|
||||
$sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null");
|
||||
$sql.= ")";
|
||||
|
||||
@@ -776,6 +776,7 @@ class ExtraFields
|
||||
$labeltoshow=dol_trunc($obj->$field_toshow,18).' ';
|
||||
}
|
||||
}
|
||||
$out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2915,16 +2915,17 @@ class Form
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a form to select a date
|
||||
* Show a form + html select a date
|
||||
*
|
||||
* @param string $page Page
|
||||
* @param string $selected Date preselected
|
||||
* @param string $htmlname Name of input html field
|
||||
* @param string $htmlname Html name of date input fields or 'none'
|
||||
* @param int $displayhour Display hour selector
|
||||
* @param int $displaymin Display minutes selector
|
||||
* @return void
|
||||
* @see select_date
|
||||
*/
|
||||
function form_date($page, $selected, $htmlname,$displayhour=0,$displaymin=0)
|
||||
function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -3057,13 +3058,13 @@ class Form
|
||||
print '<tr><td class="nowrap">';
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
|
||||
{
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
|
||||
}
|
||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||
if ($filter) $newfilter.=' AND ('.$filter.')';
|
||||
@@ -3437,13 +3438,13 @@ class Form
|
||||
|
||||
|
||||
/**
|
||||
* Show a HTML widget to input a date or combo list for day, month, years and optionnaly hours and minutes
|
||||
* Show a HTML widget to input a date or combo list for day, month, years and optionnaly hours and minutes.
|
||||
* Fields are preselected with :
|
||||
* - set_time date (Local PHP server timestamps or date format YYYY-MM-DD or YYYY-MM-DD HH:MM)
|
||||
* - local date of PHP server if set_time is ''
|
||||
* - Empty (fields empty) if set_time is -1 (in this case, parameter empty must also have value 1)
|
||||
* - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM')
|
||||
* - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location)
|
||||
* - Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1)
|
||||
*
|
||||
* @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp)
|
||||
* @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date.
|
||||
* @param string $prefix Prefix for fields name
|
||||
* @param int $h 1=Show also hours
|
||||
* @param int $m 1=Show also minutes
|
||||
@@ -3455,6 +3456,7 @@ class Form
|
||||
* @param int $disabled Disable input fields
|
||||
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
|
||||
* @return mixed Nothing or string if nooutput is 1
|
||||
* @see form_date
|
||||
*/
|
||||
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='')
|
||||
{
|
||||
@@ -3467,7 +3469,11 @@ class Form
|
||||
if($m == '') $m=0;
|
||||
if($empty == '') $empty=0;
|
||||
|
||||
if (! $set_time && $empty == 0) $set_time = dol_now('tzuser');
|
||||
if ($set_time === '' && $empty == 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
$set_time = dol_now('tzuser')-(getServerTimeZoneInt('now')*3600); // set_time must be relative to PHP server timezone
|
||||
}
|
||||
|
||||
// Analysis of the pre-selection date
|
||||
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/',$set_time,$reg))
|
||||
|
||||
@@ -764,8 +764,9 @@ class FormFile
|
||||
if (empty($relativepath))
|
||||
{
|
||||
$relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/';
|
||||
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath;
|
||||
if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath;
|
||||
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
@@ -1052,9 +1053,10 @@ class FormFile
|
||||
* @param int $permtodelete Deletion is allowed
|
||||
* @param string $action Action
|
||||
* @param string $selected ???
|
||||
* @param string $param More param to add into URL
|
||||
* @return int Number of links
|
||||
*/
|
||||
public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null)
|
||||
public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='')
|
||||
{
|
||||
global $user, $conf, $langs, $user;
|
||||
global $bc;
|
||||
@@ -1071,17 +1073,17 @@ class FormFile
|
||||
$sortfield = null;
|
||||
}
|
||||
$res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder);
|
||||
$param = (isset($object->id)?'&id=' . $object->id : '');
|
||||
$param .= (isset($object->id)?'&id=' . $object->id : '');
|
||||
|
||||
// Show list of associated links
|
||||
print_titre($langs->trans("LinkedFiles"));
|
||||
|
||||
print '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
|
||||
print '<form action="' . $_SERVER['PHP_SELF'] . ($param?'?'.$param:'') . '" method="POST">';
|
||||
|
||||
print '<table width="100%" class="liste">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Documents2"),
|
||||
$langs->trans("Links"),
|
||||
$_SERVER['PHP_SELF'],
|
||||
"name",
|
||||
"",
|
||||
@@ -1135,34 +1137,34 @@ class FormFile
|
||||
print '<input type="hidden" name="action" value="confirm_updateline">';
|
||||
print $langs->trans('Link') . ': <input type="text" name="link" size="50" value="' . $link->url . '">';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<td>';
|
||||
print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">';
|
||||
print '</td>';
|
||||
print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>';
|
||||
print '<td align="right"></td>';
|
||||
print '<td align="right" colspan="2"><input type="submit" name="save" class="button" value="' . $langs->trans('Save') . '">';
|
||||
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans('Cancel') . '">';
|
||||
print '<td align="right" colspan="2">';
|
||||
print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">';
|
||||
print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">';
|
||||
print '</td>';
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print '<a data-ajax="false" href="'. $link->url . '" target="_blank">';
|
||||
print '<a data-ajax="false" href="' . $link->url . '" target="_blank">';
|
||||
print $link->label;
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
print '</td>'."\n";
|
||||
print '<td align="right"></td>';
|
||||
print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>';
|
||||
print '<td align="center"></td>';
|
||||
print '<td align="right" colspan="2">';
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id
|
||||
. '&id=' . $object->id . '" class="editfilelink" >' . img_edit().'</a>';
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param
|
||||
if ($permtodelete) {
|
||||
print ' <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id
|
||||
. '&id=' . $object->id . '" class="deletefilelink" >' . img_delete() . '</a>';
|
||||
print ' <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print "</td>";
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@@ -424,16 +424,17 @@ class FormOther
|
||||
/**
|
||||
* Return list of project and tasks
|
||||
*
|
||||
* @param int $selectedtask Pre-selected task
|
||||
* @param int $projectid Project id
|
||||
* @param string $htmlname Name of html select
|
||||
* @param int $modeproject 1 to restrict on projects owned by user
|
||||
* @param int $modetask 1 to restrict on tasks associated to user
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param int $useempty 0=Allow empty values
|
||||
* @param int $selectedtask Pre-selected task
|
||||
* @param int $projectid Project id
|
||||
* @param string $htmlname Name of html select
|
||||
* @param int $modeproject 1 to restrict on projects owned by user
|
||||
* @param int $modetask 1 to restrict on tasks associated to user
|
||||
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
|
||||
* @param int $useempty 0=Allow empty values
|
||||
* @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
|
||||
* @return void
|
||||
*/
|
||||
function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0)
|
||||
function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
@@ -448,7 +449,7 @@ class FormOther
|
||||
if ($useempty) print '<option value="0"> </option>';
|
||||
$j=0;
|
||||
$level=0;
|
||||
$this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid);
|
||||
$this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid, $disablechildoftaskid);
|
||||
print '</select>';
|
||||
}
|
||||
else
|
||||
@@ -458,17 +459,18 @@ class FormOther
|
||||
}
|
||||
|
||||
/**
|
||||
* Write all lines of a project (if parent = 0)
|
||||
* Write lines of a project (all lines of a project if parent = 0)
|
||||
*
|
||||
* @param int &$inc Cursor counter
|
||||
* @param int $parent Id parent
|
||||
* @param Object $lines Line object
|
||||
* @param int $parent Id of parent task we want to see
|
||||
* @param array $lines Array of task lines
|
||||
* @param int $level Level
|
||||
* @param int $selectedtask Id selected task
|
||||
* @param int $selectedproject Id selected project
|
||||
* @param int $disablechildoftaskid 1=Disable task that are child of the provided task id
|
||||
* @return void
|
||||
*/
|
||||
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
|
||||
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0)
|
||||
{
|
||||
global $langs, $user, $conf;
|
||||
|
||||
@@ -477,14 +479,16 @@ class FormOther
|
||||
$numlines=count($lines);
|
||||
for ($i = 0 ; $i < $numlines ; $i++)
|
||||
{
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0)
|
||||
if ($parent == 0) // We are on a task at first level
|
||||
{
|
||||
if ($lines[$i]->fk_project != $lastprojectid)
|
||||
if ($lines[$i]->fk_project != $lastprojectid) // Break found on project
|
||||
{
|
||||
if ($i > 0 && $conf->browser->firefox) print '<option value="0" disabled="disabled">----------</option>';
|
||||
print '<option value="'.$lines[$i]->fk_project.'_0"';
|
||||
@@ -507,11 +511,22 @@ class FormOther
|
||||
}
|
||||
}
|
||||
|
||||
$newdisablechildoftaskid=$disablechildoftaskid;
|
||||
|
||||
// Print task
|
||||
if ($lines[$i]->id > 0)
|
||||
if (isset($lines[$i]->id)) // We use isset because $lines[$i]->id may be null if project has no task and are on root project (tasks may be caught by a left join). We enter here only if '0' or >0
|
||||
{
|
||||
// Check if we must disable entry
|
||||
$disabled=0;
|
||||
if ($disablechildoftaskid && (($lines[$i]->id == $disablechildoftaskid || $lines[$i]->fk_parent == $disablechildoftaskid)))
|
||||
{
|
||||
$disabled++;
|
||||
if ($lines[$i]->fk_parent == $disablechildoftaskid) $newdisablechildoftaskid=$lines[$i]->id; // If task is child of a disabled parent, we will propagate id to disable next child too
|
||||
}
|
||||
|
||||
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
|
||||
if ($lines[$i]->id == $selectedtask) print ' selected="selected"';
|
||||
if (($lines[$i]->id == $selectedtask) || ($lines[$i]->fk_project.'_'.$lines[$i]->id == $selectedtask)) print ' selected="selected"';
|
||||
if ($disabled) print ' disabled="disabled"';
|
||||
print '>';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public))
|
||||
@@ -532,7 +547,7 @@ class FormOther
|
||||
}
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject);
|
||||
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject, $newdisablechildoftaskid);
|
||||
$level--;
|
||||
}
|
||||
}
|
||||
@@ -1040,7 +1055,7 @@ class FormOther
|
||||
$emptybox->showBox(array(),array());
|
||||
}
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box left container -->\n";
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
@@ -1071,7 +1086,7 @@ class FormOther
|
||||
$emptybox->showBox(array(),array());
|
||||
}
|
||||
print "</div>\n";
|
||||
print "<!-- End box container -->\n";
|
||||
print "<!-- End box right container -->\n";
|
||||
|
||||
print '</div></div>';
|
||||
print "\n";
|
||||
|
||||
@@ -194,6 +194,7 @@ class FormProjets
|
||||
if (!empty($this->societe->id)) {
|
||||
$sql.= " AND fk_soc=".$this->societe->id;
|
||||
}
|
||||
$sql.= ' AND entity='.$conf->entity;
|
||||
$sql.= " ORDER BY ref DESC";
|
||||
|
||||
dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG);
|
||||
|
||||
@@ -133,7 +133,7 @@ class Notify
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file");
|
||||
dol_syslog(get_class($this)."::send action=".$action.", socid=".$socid.", texte=".$texte.", objet_type=".$objet_type.", objet_id=".$objet_id.", file=".$file);
|
||||
|
||||
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname,";
|
||||
$sql.= " a.rowid as adid, a.label, a.code, n.rowid";
|
||||
@@ -185,10 +185,10 @@ class Notify
|
||||
$link='/compta/facture.php?facid='.$objet_id;
|
||||
break;
|
||||
case 'order':
|
||||
$link='/commande/fiche.php?facid='.$objet_id;
|
||||
$link='/commande/fiche.php?id='.$objet_id;
|
||||
break;
|
||||
case 'order_supplier':
|
||||
$link='/fourn/commande/fiche.php?facid='.$objet_id;
|
||||
$link='/fourn/commande/fiche.php?id='.$objet_id;
|
||||
break;
|
||||
}
|
||||
// Define $urlwithroot
|
||||
|
||||
@@ -257,7 +257,7 @@ class DoliDBMysql extends DoliDB
|
||||
{
|
||||
return explode('.',$this->getVersion());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return version of database client driver
|
||||
*
|
||||
@@ -267,7 +267,7 @@ class DoliDBMysql extends DoliDB
|
||||
{
|
||||
return mysqli_get_client_info();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Close database connexion
|
||||
@@ -651,6 +651,7 @@ class DoliDBMysql extends DoliDB
|
||||
1006 => 'DB_ERROR_CANNOT_CREATE',
|
||||
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
||||
1008 => 'DB_ERROR_CANNOT_DROP',
|
||||
1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
|
||||
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||
1044 => 'DB_ERROR_ACCESSDENIED',
|
||||
1046 => 'DB_ERROR_NODBSELECTED',
|
||||
@@ -985,7 +986,7 @@ class DoliDBMysql extends DoliDB
|
||||
{
|
||||
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
$sql= "ALTER TABLE ".$table." ADD `".$field_name."` ";
|
||||
$sql.= $field_desc['type'];
|
||||
if(preg_match("/^[^\s]/i",$field_desc['value']))
|
||||
if (! in_array($field_desc['type'],array('date','datetime')))
|
||||
@@ -1078,8 +1079,16 @@ class DoliDBMysql extends DoliDB
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If user already exists, we continue to set permissions
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||
}
|
||||
}
|
||||
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||
|
||||
@@ -262,7 +262,7 @@ class DoliDBMysqli extends DoliDB
|
||||
{
|
||||
return mysqli_get_client_info($this->db);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Close database connexion
|
||||
@@ -650,6 +650,7 @@ class DoliDBMysqli extends DoliDB
|
||||
1006 => 'DB_ERROR_CANNOT_CREATE',
|
||||
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
||||
1008 => 'DB_ERROR_CANNOT_DROP',
|
||||
1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
|
||||
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||
1044 => 'DB_ERROR_ACCESSDENIED',
|
||||
1046 => 'DB_ERROR_NODBSELECTED',
|
||||
@@ -979,7 +980,7 @@ class DoliDBMysqli extends DoliDB
|
||||
{
|
||||
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
$sql= "ALTER TABLE ".$table." ADD `".$field_name."` ";
|
||||
$sql.= $field_desc['type'];
|
||||
if(preg_match("/^[^\s]/i",$field_desc['value']))
|
||||
if (! in_array($field_desc['type'],array('date','datetime')))
|
||||
@@ -1072,8 +1073,16 @@ class DoliDBMysqli extends DoliDB
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If user already exists, we continue to set permissions
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||
}
|
||||
}
|
||||
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||
|
||||
@@ -214,7 +214,8 @@ class DoliDBPgsql extends DoliDB
|
||||
|
||||
// nuke unsigned
|
||||
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
||||
|
||||
$line=preg_replace('/as signed/i','as integer',$line);
|
||||
|
||||
// blob -> text
|
||||
$line=preg_replace('/\w*blob/i','text',$line);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
* @param string $filterd Filter of done by user
|
||||
* @param int $pid Product id
|
||||
* @param int $socid Third party id
|
||||
* @param array $showextcals Array with list of external calendars, or -1 to show no legend
|
||||
* @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
|
||||
* @param string $actioncode Preselected value of actioncode for filter on type
|
||||
* @return void
|
||||
*/
|
||||
@@ -136,7 +136,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
print '});' . "\n";
|
||||
print '</script>' . "\n";
|
||||
print '<table>';
|
||||
if (! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
if (count($showextcals) > 0)
|
||||
{
|
||||
@@ -147,7 +147,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
print '<tr><td>';
|
||||
print '<script type="text/javascript">' . "\n";
|
||||
print 'jQuery(document).ready(function () {' . "\n";
|
||||
print 'jQuery("#check_' . $htmlname . '").click(function() { jQuery(".family_' . $htmlname . '").toggle(); });' . "\n";
|
||||
print ' jQuery("#check_' . $htmlname . '").click(function() {';
|
||||
print ' /* alert("'.$htmlname.'"); */';
|
||||
print ' jQuery(".family_' . $htmlname . '").toggle();';
|
||||
print ' });' . "\n";
|
||||
print '});' . "\n";
|
||||
print '</script>' . "\n";
|
||||
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'];
|
||||
@@ -434,9 +437,9 @@ function actions_prepare_head($object)
|
||||
$head[$h][1] = $langs->trans('Info');
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'action');
|
||||
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'action','remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@@ -383,7 +383,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
|
||||
|
||||
$out= "\n<!-- Ajax code to switch constant ".$code." -->".'
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$(document).ready(function() {
|
||||
var input = '.json_encode($input).';
|
||||
var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\';
|
||||
var code = \''.$code.'\';
|
||||
|
||||
@@ -641,7 +641,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||
if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status);
|
||||
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape(strtolower($search_name))."%' OR p.firstname LIKE '%".$db->escape(strtolower($search_name))."%')";
|
||||
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')";
|
||||
$sql.= " ORDER BY $sortfield $sortorder";
|
||||
|
||||
dol_syslog('core/lib/company.lib.php :: show_contacts sql='.$sql,LOG_DEBUG);
|
||||
@@ -726,7 +726,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
$coords .= "<br />".addslashes($object->country);
|
||||
}
|
||||
|
||||
print '<td align="center"><a href="#" onclick="return copyToClipboard(\''.$coords.'\');">';
|
||||
print '<td align="center">'; // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile
|
||||
print '<a href="#" class="hideonsmartphone" onclick="return copyToClipboard(\''.$coords.'\');">';
|
||||
print img_picto($langs->trans("Address"), 'object_address.png');
|
||||
print '</a></td>';
|
||||
|
||||
@@ -736,7 +737,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '<td align="center">';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
print '<a class="hideonsmartphone" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
print img_object($langs->trans("Rendez-Vous"),"action_rdv");
|
||||
print '</a> ';
|
||||
}
|
||||
@@ -771,18 +772,17 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
|
||||
print "<br>\n";
|
||||
?>
|
||||
<div id="dialog" title="<?php echo dol_escape_htmltag($langs->trans('Address')); ?>" style="display: none;">
|
||||
</div>
|
||||
<div id="dialog" title="<?php echo dol_escape_htmltag($langs->trans('Address')); ?>" style="display: none;"></div>
|
||||
<?php
|
||||
print '<script type="text/javascript">
|
||||
function copyToClipboard (text) {
|
||||
function copyToClipboard (text) {
|
||||
text = text.replace(/<br \/>/g,"\n");
|
||||
var newElem = "<textarea id=\"coords\" style=\"border: none; width: 90%; height: 120px;\">"+text+"</textarea><br/><br/>'.$langs->trans('HelpCopyToClipboard').'";
|
||||
$("#dialog").html(newElem);
|
||||
$( "#dialog" ).dialog();
|
||||
$("#dialog").dialog();
|
||||
$("#coords").select();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
return $i;
|
||||
|
||||
@@ -69,8 +69,6 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
// Description long of product line
|
||||
if ($desc && ($desc != $label))
|
||||
{
|
||||
if ( $libelleproduitservice && empty($hidedesc) ) $libelleproduitservice.="\n";
|
||||
|
||||
if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except)
|
||||
{
|
||||
$discount=new DiscountAbsolute($db);
|
||||
@@ -83,18 +81,17 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
$discount->fetch($line->fk_remise_except);
|
||||
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit",$discount->ref_facture_source);
|
||||
// Add date of deposit
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.=' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($idprod)
|
||||
{
|
||||
if (empty($hidedesc))
|
||||
$libelleproduitservice.=$desc;
|
||||
if (empty($hidedesc)) $libelleproduitservice=dol_concatdesc($libelleproduitservice, $desc);
|
||||
}
|
||||
else
|
||||
{
|
||||
$libelleproduitservice.=$desc;
|
||||
$libelleproduitservice=dol_concatdesc($libelleproduitservice, $desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,7 +145,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($line->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
//print '>'.$outputlangs->charset_output.','.$period;
|
||||
$libelleproduitservice.="\n".$period;
|
||||
$libelleproduitservice=dol_concatdesc($libelleproduitservice, $period);
|
||||
//print $libelleproduitservice;
|
||||
}
|
||||
|
||||
|
||||
@@ -510,6 +510,12 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
||||
return -3;
|
||||
}
|
||||
if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
|
||||
if (empty($newmask)) // This should no happen
|
||||
{
|
||||
dol_syslog("Warning: dol_copy called with empty value for newmask and no default value defined", LOG_WARNING);
|
||||
$newmask='0664';
|
||||
}
|
||||
|
||||
@chmod($newpathofdestfile, octdec($newmask));
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -987,9 +987,9 @@ function dol_getdate($timestamp,$fast=false)
|
||||
* @param int $month Month (1 to 12)
|
||||
* @param int $day Day (1 to 31)
|
||||
* @param int $year Year
|
||||
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
|
||||
* @param int $gm true or 1=Input informations are GMT values, false or 0 or 'server' = local to server TZ, 'user' = local to user TZ
|
||||
* @param int $check 0=No check on parameters (Can use day 32, etc...)
|
||||
* @return int Date as a timestamp, '' if error
|
||||
* @return int Date as a timestamp, '' if error
|
||||
* @see dol_print_date, dol_stringtotime, dol_getdate
|
||||
*/
|
||||
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
@@ -1015,7 +1015,23 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
|
||||
if (method_exists('DateTime','getTimestamp') && empty($conf->global->MAIN_OLD_DATE))
|
||||
{
|
||||
if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get());
|
||||
if (empty($gm) || $gm === 'server')
|
||||
{
|
||||
// If you can't set timezone of your PHP, set this constant. Better is to set it to UTC.
|
||||
// In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore.
|
||||
if (! empty($conf->global->MAIN_SERVER_TZ))
|
||||
{
|
||||
if ($conf->global->MAIN_SERVER_TZ != 'auto') $default_timezone=$conf->global->MAIN_SERVER_TZ;
|
||||
else $default_timezone=@date_default_timezone_get();
|
||||
}
|
||||
else $default_timezone=@date_default_timezone_get();
|
||||
$localtz = new DateTimeZone($default_timezone);
|
||||
}
|
||||
else if ($gm === 'user')
|
||||
{
|
||||
$default_timezone=(empty($_SESSION["dol_tz_string"])?'UTC':$_SESSION["dol_tz_string"]);
|
||||
$localtz = new DateTimeZone($default_timezone);
|
||||
}
|
||||
else $localtz = new DateTimeZone('UTC');
|
||||
$dt = new DateTime(null,$localtz);
|
||||
$dt->setDate($year,$month,$day);
|
||||
@@ -1042,7 +1058,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
|
||||
|
||||
/**
|
||||
* Return date for now. We should always use this function without parameters (that means GMT time)
|
||||
* Return date for now. In mot cases, we use this function without parameters (that means GMT time).
|
||||
*
|
||||
* @param string $mode 'gmt' => we return GMT timestamp,
|
||||
* 'tzserver' => we add the PHP server timezone
|
||||
@@ -1052,7 +1068,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
*/
|
||||
function dol_now($mode='gmt')
|
||||
{
|
||||
// Note that gmmktime and mktime return same value (GMT) whithout parameters
|
||||
// Note that gmmktime and mktime return same value (GMT) when used without parameters
|
||||
//if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead
|
||||
if ($mode == 'gmt') $ret=time(); // Time for now at greenwich.
|
||||
else if ($mode == 'tzserver') // Time for now with PHP server timezone added
|
||||
@@ -1067,7 +1083,7 @@ function dol_now($mode='gmt')
|
||||
$tzsecond=getParentCompanyTimeZoneInt(); // Contains tz+dayling saving time
|
||||
$ret=dol_now('gmt')+($tzsecond*3600);
|
||||
}*/
|
||||
else if ($mode == 'tzuser') // Time for now with user timezone is added
|
||||
else if ($mode == 'tzuser') // Time for now with user timezone added
|
||||
{
|
||||
//print 'eeee'.time().'-'.mktime().'-'.gmmktime();
|
||||
$offsettz=(empty($_SESSION['dol_tz'])?0:$_SESSION['dol_tz'])*60*60;
|
||||
@@ -2531,7 +2547,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
if ($picto == 'setup') $picto='title.png';
|
||||
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif';
|
||||
|
||||
if ($num > $conf->liste_limit or $num == -1)
|
||||
if (($num > $conf->liste_limit) || ($num == -1))
|
||||
{
|
||||
$nextpage = 1;
|
||||
}
|
||||
@@ -3398,13 +3414,13 @@ function picto_required()
|
||||
* Clean a string from all HTML tags and entities
|
||||
*
|
||||
* @param string $StringHtml String to clean
|
||||
* @param string $removelinefeed Replace also all lines feeds by a space
|
||||
* @param string $removelinefeed Replace also all lines feeds by a space, otherwise only last one are removed
|
||||
* @param string $pagecodeto Encoding of input/output string
|
||||
* @return string String cleaned
|
||||
*/
|
||||
function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
|
||||
{
|
||||
$pattern = "/<[^>]+>/";
|
||||
$pattern = "/<[^<>]+>/";
|
||||
$temp = dol_html_entity_decode($StringHtml,ENT_COMPAT,$pagecodeto);
|
||||
$temp = preg_replace($pattern,"",$temp);
|
||||
|
||||
@@ -3470,7 +3486,6 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8')
|
||||
$newstring=strtr($newstring,array('&'=>'__and__','<'=>'__lt__','>'=>'__gt__','"'=>'__dquot__'));
|
||||
$newstring=dol_htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding
|
||||
$newstring=strtr($newstring,array('__and__'=>'&','__lt__'=>'<','__gt__'=>'>','__dquot__'=>'"'));
|
||||
//$newstring=strtr($newstring,array('__li__'=>"<li>\n")); // Restore <li>\n
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3514,7 +3529,7 @@ function dol_htmlcleanlastbr($stringtodecode)
|
||||
* Replace html_entity_decode functions to manage errors
|
||||
*
|
||||
* @param string $a Operand a
|
||||
* @param string $b Operand b
|
||||
* @param string $b Operand b (ENT_QUOTES=convert simple and double quotes)
|
||||
* @param string $c Operand c
|
||||
* @return string String decoded
|
||||
*/
|
||||
@@ -3654,17 +3669,11 @@ function dol_textishtml($msg,$option=0)
|
||||
{
|
||||
if (preg_match('/<html/i',$msg)) return true;
|
||||
elseif (preg_match('/<body/i',$msg)) return true;
|
||||
elseif (preg_match('/<b>/i',$msg)) return true;
|
||||
elseif (preg_match('/<br/i',$msg)) return true;
|
||||
elseif (preg_match('/<div/i',$msg)) return true;
|
||||
elseif (preg_match('/<em>/i',$msg)) return true;
|
||||
elseif (preg_match('/<font/i',$msg)) return true;
|
||||
elseif (preg_match('/<img/i',$msg)) return true;
|
||||
elseif (preg_match('/<i>/i',$msg)) return true;
|
||||
elseif (preg_match('/<li/i',$msg)) return true;
|
||||
elseif (preg_match('/<span/i',$msg)) return true;
|
||||
elseif (preg_match('/<strong/i',$msg)) return true;
|
||||
elseif (preg_match('/<table/i',$msg)) return true;
|
||||
elseif (preg_match('/<(b|em|i)>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
|
||||
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
|
||||
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
|
||||
elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
|
||||
elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
|
||||
return false;
|
||||
@@ -3672,7 +3681,7 @@ function dol_textishtml($msg,$option=0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Concat 2 descriptions (second one after first one)
|
||||
* Concat 2 descriptions (second one after first one with a new line separator if required)
|
||||
* text1 html + text2 html => text1 + '<br>' + text2
|
||||
* text1 html + text2 txt => text1 + '<br>' + dol_nl2br(text2)
|
||||
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
|
||||
@@ -4524,4 +4533,4 @@ function natural_search($fields, $value)
|
||||
return " AND " . ($end > 1? '(' : '') . $res;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -536,7 +536,7 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
|
||||
* @param Societe $objsoc The company that own the object we need a counter for
|
||||
* @param string $date Date to use for the {y},{m},{d} tags.
|
||||
* @param string $mode 'next' for next value or 'last' for last value
|
||||
* @return string New value
|
||||
* @return string New value (numeric) or error message
|
||||
*/
|
||||
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next')
|
||||
{
|
||||
@@ -798,6 +798,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
{
|
||||
$counter++;
|
||||
|
||||
// If value for $counter has a length higher than $maskcounter chars
|
||||
if ($counter >= pow(10, dol_strlen($maskcounter)))
|
||||
{
|
||||
$counter='ErrorMaxNumberReachForThisMask';
|
||||
}
|
||||
|
||||
if (! empty($maskrefclient_maskcounter))
|
||||
{
|
||||
//print "maskrefclient_maskcounter=".$maskrefclient_maskcounter." maskwithnocode=".$maskwithnocode." maskrefclient=".$maskrefclient."\n<br>";
|
||||
@@ -839,6 +845,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
$maskrefclient_counter = $maskrefclient_obj->val;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
if (empty($maskrefclient_counter) || preg_match('/[^0-9]/i',$maskrefclient_counter)) $maskrefclient_counter=$maskrefclient_maskoffset;
|
||||
$maskrefclient_counter++;
|
||||
}
|
||||
@@ -1286,6 +1293,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
|
||||
|
||||
dol_syslog('/core/lib/function2.lib.php::getListOfModels sql='.$sql, LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -1532,3 +1540,126 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clean corrupted tree (orphelins linked to a not existing parent), record linked to themself and child-parent loop
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $tabletocleantree Table to clean
|
||||
* @param string $fieldfkparent Field name that contains id of parent
|
||||
* @return int Nb of records fixed/deleted
|
||||
*/
|
||||
function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
|
||||
{
|
||||
$totalnb=0;
|
||||
$listofid=array();
|
||||
$listofparentid=array();
|
||||
|
||||
// Get list of all id in array listofid and all parents in array listofparentid
|
||||
$sql='SELECT rowid, '.$fieldfkparent.' as parent_id FROM '.MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$listofid[]=$obj->rowid;
|
||||
if ($obj->parent_id > 0) $listofparentid[$obj->rowid]=$obj->parent_id;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (count($listofid))
|
||||
{
|
||||
print 'Code requested to clean tree (may be to solve data corruption), so we check/clean orphelins and loops.'."<br>\n";
|
||||
|
||||
// Check loops on each other
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree." SET ".$fieldfkparent." = 0 WHERE ".$fieldfkparent." = rowid"; // So we update only records linked to themself
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
print '<br>Some record that were parent of themself were cleaned.';
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
// Check other loops
|
||||
$listofidtoclean=array();
|
||||
foreach($listofparentid as $id => $pid)
|
||||
{
|
||||
// Check depth
|
||||
//print 'Analyse record id='.$id.' with parent '.$pid.'<br>';
|
||||
|
||||
$cursor=$id; $arrayidparsed=array(); // We start from child $id
|
||||
while ($cursor > 0)
|
||||
{
|
||||
$arrayidparsed[$cursor]=1;
|
||||
if ($arrayidparsed[$listofparentid[$cursor]]) // We detect a loop. A record with a parent that was already into child
|
||||
{
|
||||
print 'Found a loop between id '.$id.' - '.$cursor.'<br>';
|
||||
unset($arrayidparsed);
|
||||
$listofidtoclean[$cursor]=$id;
|
||||
break;
|
||||
}
|
||||
$cursor=$listofparentid[$cursor];
|
||||
}
|
||||
|
||||
if (count($listofidtoclean)) break;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$sql.= " SET ".$fieldfkparent." = 0";
|
||||
$sql.= " WHERE rowid IN (".join(',',$listofidtoclean).")"; // So we update only records detected wrong
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print '<br>Some records were detected to have parent that is a child, we set them as root record for id: ';
|
||||
print join(',',$listofidtoclean);
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
// Check and clean orphelins
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree;
|
||||
$sql.= " SET ".$fieldfkparent." = 0";
|
||||
$sql.= " WHERE ".$fieldfkparent." NOT IN (".join(',',$listofid).")"; // So we update only records linked to a non existing parent
|
||||
dol_syslog("sql=".$sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nb=$db->affected_rows($sql);
|
||||
if ($nb > 0)
|
||||
{
|
||||
// Removed orphelins records
|
||||
print '<br>Some orphelins were found and modified to be parent so records are visible again for id: ';
|
||||
print join(',',$listofid);
|
||||
}
|
||||
|
||||
$totalnb+=$nb;
|
||||
}
|
||||
//else dol_print_error($db);
|
||||
|
||||
print '<br>We fixed '.$totalnb.' record(s). Some records may still be corrupted. New check may be required.';
|
||||
return $totalnb;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,9 +81,14 @@ function member_prepare_head($object)
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'member');
|
||||
|
||||
$nbNote = 0;
|
||||
if(!empty($object->note)) $nbNote++;
|
||||
if(!empty($object->note_private)) $nbNote++;
|
||||
if(!empty($object->note_public)) $nbNote++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Note");
|
||||
$head[$h][2] = 'note';
|
||||
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id;
|
||||
@@ -130,7 +135,7 @@ function member_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsMember");
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_type_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsMemberType");
|
||||
$head[$h][2] = 'attributes_type';
|
||||
|
||||
@@ -128,9 +128,9 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
|
||||
|
||||
// Protection and encryption of pdf
|
||||
if (empty($conf->global->MAIN_USE_FPDF) && ! empty($conf->global->PDF_SECURITY_ENCRYPTION))
|
||||
{
|
||||
{
|
||||
/* Permission supported by TCPDF
|
||||
- print : Print the document;
|
||||
- print : Print the document;
|
||||
- modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
|
||||
- copy : Copy or otherwise extract text and graphics from the document;
|
||||
- annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
|
||||
@@ -145,8 +145,8 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
|
||||
// For TCPDF, we specify permission we want to block
|
||||
$pdfrights = array('modify','copy');
|
||||
|
||||
$pdfuserpass = ''; // Mot de passe pour l'utilisateur final
|
||||
$pdfownerpass = NULL; // Mot de passe du proprietaire, cree aleatoirement si pas defini
|
||||
$pdfuserpass = ''; // Password for the end user
|
||||
$pdfownerpass = NULL; // Password of the owner, created randomly if not defined
|
||||
$pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass);
|
||||
}
|
||||
else
|
||||
@@ -160,8 +160,8 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
|
||||
{
|
||||
// Declare here a class to overwrite FPDI to add method writeHTMLCell
|
||||
/**
|
||||
* This class if a enhanced FPDI class that support method writeHTMLCell
|
||||
*/
|
||||
* This class if a enhanced FPDI class that support method writeHTMLCell
|
||||
*/
|
||||
class FPDI_DolExtended extends FPDI
|
||||
{
|
||||
/**
|
||||
@@ -258,7 +258,7 @@ function pdf_getPDFFontSize($outputlangs)
|
||||
|
||||
|
||||
/**
|
||||
* Return height to use for Logo onot PDF
|
||||
* Return height to use for Logo onto PDF
|
||||
*
|
||||
* @param string $logo Full path to logo file to use
|
||||
* @param bool $url Image with url (true or false)
|
||||
@@ -311,7 +311,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
|
||||
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
|
||||
{
|
||||
// Tel
|
||||
// Phone
|
||||
if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
|
||||
// Fax
|
||||
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
|
||||
@@ -344,7 +344,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
||||
{
|
||||
// Tel
|
||||
// Phone
|
||||
if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro);
|
||||
// Fax
|
||||
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
|
||||
@@ -362,7 +362,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
|
||||
{
|
||||
// Tel
|
||||
// Phone
|
||||
if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone);
|
||||
// Fax
|
||||
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
|
||||
@@ -410,7 +410,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($deliverycompany))."\n";
|
||||
|
||||
// Tel
|
||||
// Phone
|
||||
if ($deliverycompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($deliverycompany->phone);
|
||||
// Fax
|
||||
if ($deliverycompany->fax) $stringaddress .= ($stringaddress ? ($deliverycompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($deliverycompany->fax);
|
||||
@@ -446,7 +446,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
|
||||
* @param Translate $outputlangs Object lang
|
||||
* @param int $h Height of PDF
|
||||
* @param int $w Width of PDF
|
||||
* @param string $unit Unit of height (mmn, pt, ...)
|
||||
* @param string $unit Unit of height (mm, pt, ...)
|
||||
* @param string $text Text to show
|
||||
* @return void
|
||||
*/
|
||||
@@ -782,7 +782,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
$pdf->SetFont('','',7);
|
||||
$pdf->SetDrawColor(224,224,224);
|
||||
|
||||
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
|
||||
// The start of the bottom of this page footer is positioned according to # of lines
|
||||
$freetextheight=0;
|
||||
if ($line) // Free text
|
||||
{
|
||||
@@ -843,8 +843,8 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
{
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
|
||||
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
else $pdf->MultiCell(11, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(13, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
else $pdf->MultiCell(13, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
}
|
||||
|
||||
return $marginwithfooter;
|
||||
@@ -900,7 +900,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
|
||||
* @param int $posx Pos x
|
||||
* @param int $posy Pos y
|
||||
* @param int $hideref Hide reference
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $issupplierline Is it a line for a supplier object ?
|
||||
* @return void
|
||||
*/
|
||||
@@ -1013,7 +1013,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
// If line linked to a product
|
||||
if ($idprod)
|
||||
{
|
||||
// On ajoute la ref
|
||||
// We add ref
|
||||
if ($prodser->ref)
|
||||
{
|
||||
$prefix_prodserv = "";
|
||||
|
||||
@@ -142,18 +142,24 @@ function task_prepare_head($object)
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
/*$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'task_document';
|
||||
$h++;
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||
{
|
||||
$nbNote = 0;
|
||||
if(!empty($object->note_private)) $nbNote++;
|
||||
if(!empty($object->note_public)) $nbNote++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
|
||||
$head[$h][2] = 'task_notes';
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
$head[$h][2] = 'task_notes';
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs');
|
||||
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));
|
||||
$head[$h][2] = 'task_document';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
|
||||
@@ -268,8 +274,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
{
|
||||
// Note that having a user assigned to a task into a project user has no permission on, should not be possible
|
||||
// because assignement on task can be done only on contact of project.
|
||||
// If assignement was done and after, was removed from contact of project, then we can hide the line.
|
||||
$showline=0;
|
||||
// If assignement was done and after, was removed from contact of project, then we can hide the line.
|
||||
$showline=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,7 +291,6 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
|
||||
print '<tr '.$bc[$var].' id="row-'.$lines[$i]->id.'">'."\n";
|
||||
|
||||
// Project
|
||||
if ($showproject)
|
||||
{
|
||||
print "<td>";
|
||||
@@ -383,7 +388,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
if (! $showlineingray) $inc++;
|
||||
|
||||
$level++;
|
||||
if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, 0, $showalsopublicproj);
|
||||
if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick);
|
||||
$level--;
|
||||
$total += $lines[$i]->duration;
|
||||
}
|
||||
@@ -394,7 +399,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
}
|
||||
|
||||
if ($total>0)
|
||||
if ($total>0 && $level==0)
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
@@ -404,9 +409,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
if ($addordertick) print '<td class="hideonsmartphone"></td>';
|
||||
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print '<td></td>';
|
||||
if ($addordertick) print '<td class="hideonsmartphone"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -501,7 +506,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
|
||||
|
||||
// Time spent
|
||||
print '<td align="right">';
|
||||
if ($lines[$i]->duration)
|
||||
if ($lines[$i]->duration)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
||||
print convertSecondToTime($lines[$i]->duration,'allhourmin');
|
||||
|
||||
@@ -133,7 +133,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
||||
// More parameters
|
||||
$params = explode('&', $dbtablename);
|
||||
$dbtablename=(! empty($params[0]) ? $params[0] : '');
|
||||
$sharedelement=(! empty($params[1]) ? $params[1] : '');
|
||||
$sharedelement=(! empty($params[1]) ? $params[1] : $dbtablename);
|
||||
|
||||
$listofmodules=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||
|
||||
|
||||
@@ -110,16 +110,15 @@ function delivery_prepare_head($object)
|
||||
$head[$h][2] = 'delivery';
|
||||
$h++;
|
||||
|
||||
/* We are on id of delivery, no shipment
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->origin_id;
|
||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->origin_id;
|
||||
$head[$h][1] = $langs->trans("Notes");
|
||||
$head[$h][2] = 'note';
|
||||
$h++;*/
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
|
||||
@@ -758,16 +758,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Suppliers
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("Unpaid"),1,$user->rights->fournisseur->facture->lire);
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("Unpaid"),1,$user->rights->fournisseur->facture->lire);
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
|
||||
|
||||
$newmenu->add("/compta/facture/stats/index.php?leftmenu=suppliers_bills&mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
$newmenu->add("/compta/facture/stats/index.php?leftmenu=suppliers_bills&mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
|
||||
// Orders
|
||||
|
||||
@@ -114,7 +114,7 @@ abstract class DolibarrModules
|
||||
$sql=str_replace('__ENTITY__', $conf->entity, $sql);
|
||||
|
||||
dol_syslog(get_class($this)."::_init ignoreerror=".$ignoreerror." sql=".$sql, LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
$result=$this->db->query($sql, $ignoreerror);
|
||||
if (! $result)
|
||||
{
|
||||
if (! $ignoreerror)
|
||||
|
||||
@@ -218,7 +218,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
|
||||
else
|
||||
{
|
||||
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt');
|
||||
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)');
|
||||
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
||||
}
|
||||
}
|
||||
@@ -228,34 +228,24 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
$texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
|
||||
|
||||
$texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1);
|
||||
$texte.= '<table><tr><td>';
|
||||
$texte.= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
|
||||
$texte.= '<textarea class="flat" cols="60" name="value1">';
|
||||
$texte.=$conf->global->COMMANDE_ADDON_PDF_ODT_PATH;
|
||||
$texte.= '</textarea>';
|
||||
$texte.= '</td>';
|
||||
$texte.= '<td align="center"> ';
|
||||
$texte.= '</div><div style="display: inline-block; vertical-align: middle;">';
|
||||
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
|
||||
$texte.= '</td>';
|
||||
$texte.= '</tr>';
|
||||
$texte.= '</table>';
|
||||
|
||||
$texte.= '<br></div></div>';
|
||||
|
||||
// Scan directories
|
||||
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
|
||||
|
||||
$texte.= '</td>';
|
||||
|
||||
|
||||
$texte.= '<td valign="top" rowspan="2">';
|
||||
$texte.= '<td valign="top" rowspan="2" class="hideonsmartphone">';
|
||||
$texte.= $langs->trans("ExampleOfDirectoriesForModelGen");
|
||||
$texte.= '</td>';
|
||||
$texte.= '</tr>';
|
||||
|
||||
/*$texte.= '<tr>';
|
||||
$texte.= '<td align="center">';
|
||||
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
|
||||
$texte.= '</td>';
|
||||
$texte.= '</tr>';*/
|
||||
|
||||
$texte.= '</table>';
|
||||
$texte.= '</form>';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -109,7 +109,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=174;
|
||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
|
||||
$this->posxpicture=$this->posxtva - 16; // width of images
|
||||
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxpicture-=20;
|
||||
@@ -153,7 +153,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("orders");
|
||||
$outputlangs->load("deliveries");
|
||||
|
||||
|
||||
if ($conf->commande->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
@@ -228,6 +228,15 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->atleastonediscount++;
|
||||
}
|
||||
}
|
||||
if (empty($this->atleastonediscount))
|
||||
{
|
||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
||||
//$this->postotalht;
|
||||
}
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
@@ -304,7 +313,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->AddPage('','',true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pagenb+1);
|
||||
$pdf->setPage($pageposafter+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -400,6 +409,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
@@ -583,20 +593,6 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$posy=$pdf->GetY()+1;
|
||||
}
|
||||
*/
|
||||
if (! empty($object->date_livraison))
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$text=$outputlangs->transnoentities("DeliveryDate").':';
|
||||
$pdf->MultiCell(80, 3, $text, 0, 'L', 0);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posxval, $posy);
|
||||
$text=dol_print_date($object->date_livraison,'day','',$outputlangs);
|
||||
$pdf->MultiCell(80, 3, $text, 0, 'L', 0);
|
||||
|
||||
$posy=$pdf->GetY()+1;
|
||||
}
|
||||
/* TODO
|
||||
else if (! empty($object->availability_code))
|
||||
{
|
||||
@@ -609,7 +605,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$posy=$pdf->GetY()+1;
|
||||
}*/
|
||||
|
||||
// Show shipping date
|
||||
// Show planed date of delivery
|
||||
if ($object->date_livraison)
|
||||
{
|
||||
$outputlangs->load("sendings");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -109,7 +109,7 @@ class pdf_proforma extends ModelePDFCommandes
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=174;
|
||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup;
|
||||
$this->posxpicture=$this->posxtva - 16; // width of images
|
||||
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxpicture-=20;
|
||||
@@ -227,6 +227,15 @@ class pdf_proforma extends ModelePDFCommandes
|
||||
$this->atleastonediscount++;
|
||||
}
|
||||
}
|
||||
if (empty($this->atleastonediscount))
|
||||
{
|
||||
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxtva+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxup+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxqty+=($this->postotalht - $this->posxdiscount);
|
||||
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
|
||||
//$this->postotalht;
|
||||
}
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
@@ -303,7 +312,7 @@ class pdf_proforma extends ModelePDFCommandes
|
||||
$pdf->AddPage('','',true);
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pagenb+1);
|
||||
$pdf->setPage($pageposafter+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -399,6 +408,7 @@ class pdf_proforma extends ModelePDFCommandes
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
|
||||
@@ -71,7 +71,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -105,7 +105,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -126,7 +126,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
//$date=time();
|
||||
$date=$object->date;
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -116,15 +116,24 @@ class pdf_strato extends ModelePDFContract
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("contracts");
|
||||
$outputlangs->load("interventions");
|
||||
|
||||
if ($conf->contrat->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir = $conf->contrat->dir_output;
|
||||
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
||||
$file = $dir . "/" . $objectref . ".pdf";
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen)
|
||||
{
|
||||
$dir = $conf->contrat->dir_output;
|
||||
$file = $dir . "/SPECIMEN.pdf";
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$dir = $conf->contrat->dir_output . "/" . $objectref;
|
||||
$file = $dir . "/" . $objectref . ".pdf";
|
||||
}
|
||||
|
||||
if (! file_exists($dir))
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -102,7 +102,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
global $db,$conf;
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -122,7 +122,9 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
|
||||
$date=$contract->date_contrat;
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -208,7 +208,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
|
||||
else
|
||||
{
|
||||
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt');
|
||||
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)');
|
||||
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
||||
}
|
||||
}
|
||||
@@ -218,34 +218,24 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
$texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
|
||||
|
||||
$texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1);
|
||||
$texte.= '<table><tr><td>';
|
||||
$texte.= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
|
||||
$texte.= '<textarea class="flat" cols="60" name="value1">';
|
||||
$texte.=$conf->global->EXPEDITION_ADDON_PDF_ODT_PATH;
|
||||
$texte.= '</textarea>';
|
||||
$texte.= '</td>';
|
||||
$texte.= '<td align="center"> ';
|
||||
$texte.= '</div><div style="display: inline-block; vertical-align: middle;">';
|
||||
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
|
||||
$texte.= '</td>';
|
||||
$texte.= '</tr>';
|
||||
$texte.= '</table>';
|
||||
|
||||
$texte.= '<br></div></div>';
|
||||
|
||||
// Scan directories
|
||||
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
|
||||
|
||||
$texte.= '</td>';
|
||||
|
||||
|
||||
$texte.= '<td valign="top" rowspan="2">';
|
||||
$texte.= '<td valign="top" rowspan="2" class="hideonsmartphone">';
|
||||
$texte.= $langs->trans("ExampleOfDirectoriesForModelGen");
|
||||
$texte.= '</td>';
|
||||
$texte.= '</tr>';
|
||||
|
||||
/*$texte.= '<tr>';
|
||||
$texte.= '<td align="center">';
|
||||
$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
|
||||
$texte.= '</td>';
|
||||
$texte.= '</tr>';*/
|
||||
|
||||
$texte.= '</table>';
|
||||
$texte.= '</form>';
|
||||
|
||||
|
||||
@@ -267,6 +267,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
@@ -474,7 +475,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
else
|
||||
{
|
||||
$text=$this->emetteur->name;
|
||||
$pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
$pdf->MultiCell(70, 3, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
|
||||
//*********************Entete****************************
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-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
|
||||
@@ -179,9 +180,10 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$tab_height = 130;
|
||||
$tab_height_newpage = 150;
|
||||
|
||||
if (! empty($object->note_public) || ! empty($object->tracking_number))
|
||||
if (! empty($object->note_public) || (! empty($object->tracking_number) && ! empty($object->shipping_method_id)))
|
||||
{
|
||||
$tab_top = 88;
|
||||
$tab_top_alt = $tab_top;
|
||||
|
||||
// Tracking number
|
||||
if (! empty($object->tracking_number))
|
||||
@@ -196,7 +198,9 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
||||
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
|
||||
$pdf->SetFont('','B', $default_font_size - 2);
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
||||
$pdf->writeHTMLCell(60, 7, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
|
||||
|
||||
$tab_top_alt += 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,7 +209,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
if (! empty($object->note_public))
|
||||
{
|
||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top_alt, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
}
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
@@ -240,7 +244,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
// Description de la ligne produit
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY,0,1);
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxqtyordered-10,3,$this->posxdesc,$curY,0,1);
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pageposafter=$pdf->getPage();
|
||||
@@ -264,6 +268,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
// Add line
|
||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||
{
|
||||
$pdf->setPage($pageposafter);
|
||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210)));
|
||||
//$pdf->SetDrawColor(190,190,200);
|
||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||
|
||||
@@ -69,7 +69,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -102,7 +102,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
global $db,$conf;
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@@ -122,7 +122,9 @@ class mod_expedition_safor extends ModelNumRefExpedition
|
||||
|
||||
$date=time();
|
||||
$yymm = strftime("%y%m",$date);
|
||||
$num = sprintf("%04s",$max+1);
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
|
||||
dol_syslog("mod_expedition_safor::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
|
||||
@@ -68,6 +68,8 @@ class ExportExcel extends ModeleExports
|
||||
$this->label_lib='PhpExcel';
|
||||
$this->version_lib='1.7.2';
|
||||
|
||||
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
|
||||
$this->row=0;
|
||||
}
|
||||
|
||||
@@ -181,14 +183,14 @@ class ExportExcel extends ModeleExports
|
||||
|
||||
if ($this->id == 'excel2007')
|
||||
{
|
||||
if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive
|
||||
if (! class_exists('ZipArchive')) // For Excel2007, PHPExcel need ZipArchive
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorPHPNeedModule','zip');
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->workbook = new PHPExcel();
|
||||
$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION);
|
||||
//$this->workbook->getProperties()->setLastModifiedBy('Dolibarr '.DOL_VERSION);
|
||||
|
||||
@@ -47,7 +47,6 @@ class ExportExcel2007 extends ExportExcel
|
||||
var $col;
|
||||
var $file; // To save filename
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -69,6 +68,8 @@ class ExportExcel2007 extends ExportExcel
|
||||
$this->label_lib='PhpExcel';
|
||||
$this->version_lib='1.7.2';
|
||||
|
||||
$this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages)
|
||||
|
||||
$this->row=0;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user