Compare commits

...

391 Commits

Author SHA1 Message Date
Laurent Destailleur
a51e18a5a7 Fix: $error var must use type int and be increased when error found.
Using $error as boolean at some place was source of error.
2014-05-24 15:20:26 +02:00
Laurent Destailleur
872e764c94 Fix: html detection was not working with hx tags. 2014-05-24 14:57:41 +02:00
Laurent Destailleur
2a6b2a4540 Fix: Stat page show no cache when there is, if user was using apc. 2014-05-24 14:00:58 +02:00
Laurent Destailleur
b11ef37c58 Fix: Bad balance of table 2014-05-24 12:59:44 +02:00
Laurent Destailleur
1df758320d Fix: the delivery date must not be set with date of proposal. 2014-05-24 12:55:39 +02:00
Laurent Destailleur
f34aadef3d Fix: css 2014-05-23 21:06:53 +02:00
Laurent Destailleur
23e951ff2a Fix: select_date accepts -1 or '' but not 0 2014-05-23 20:54:23 +02:00
Laurent Destailleur
a63d085181 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-23 20:22:40 +02:00
Laurent Destailleur
8840e28bc0 Merge branch 'marcosgdf-bug-1405' into 3.5 2014-05-23 20:21:59 +02:00
Laurent Destailleur
07bc933110 Merge branch 'bug-1405' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1405

Conflicts:
	ChangeLog
2014-05-23 20:21:41 +02:00
Laurent Destailleur
649fdd72dc Merge pull request #1622 from marcosgdf/bug-1410
Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line
2014-05-23 20:20:22 +02:00
Laurent Destailleur
df35b4d2ea Merge branch 'marcosgdf-bug-1407' into 3.5 2014-05-23 20:18:38 +02:00
Laurent Destailleur
2771c506e9 Merge branch 'bug-1407' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1407

Conflicts:
	ChangeLog
2014-05-23 20:17:41 +02:00
Laurent Destailleur
31ea7117f0 Merge branch 'marcosgdf-bug-1411' into 3.5 2014-05-23 20:12:42 +02:00
Laurent Destailleur
d1ee20dd42 Merge branch 'bug-1411' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1411

Conflicts:
	ChangeLog
2014-05-23 20:11:13 +02:00
Laurent Destailleur
dc94b6e1bf Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-23 20:08:43 +02:00
Laurent Destailleur
1d01377dab Merge branch 'marcosgdf-bug-1397' into 3.5 2014-05-23 20:08:08 +02:00
Laurent Destailleur
9c398b14c5 Merge branch 'bug-1397' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1397

Conflicts:
	ChangeLog
2014-05-23 20:06:40 +02:00
Laurent Destailleur
20ec1e6ac8 Fix: Suppliers invoices must be visible if module supplier is on. 2014-05-23 19:55:40 +02:00
Laurent Destailleur
300e430024 Fix: If user already exists but permissions not set, it was not possible
to install Dolibarr.
2014-05-23 16:13:00 +02:00
Laurent Destailleur
95d8161dc1 Merge pull request #1623 from grandoc/3.5
avoid warning in commande.class.php if extrafields is used
2014-05-23 13:21:39 +02:00
Marcos García de La Fuente
fa733c8ba4 Fix: [ bug #1405 ] Rouget PDF expedition incorrect when two expeditions under the same commande 2014-05-23 11:42:14 +02:00
Philippe Grand
7acecadc79 avoid warning in commande.class.php if extrafields is used
avoid warning in commande.class.php if extrafields is used
2014-05-23 11:37:57 +02:00
Laurent Destailleur
2c05146778 Merge pull request #1621 from marcosgdf/bug-1388
Fix: [ bug #1388 ] Wrong date when invoicing several orders
2014-05-23 11:34:41 +02:00
Laurent Destailleur
43bf9ba890 Fix: Import of ical files was broken
Fix: Can import of ical files from BlueMind.
2014-05-23 04:28:57 +02:00
Marcos García de La Fuente
a705d4e333 Fix: [ bug #1410 ] Add customer order line asks for required Unit Price but doesn't interrupt the creation of the line 2014-05-23 03:00:46 +02:00
Marcos García de La Fuente
0d121de1a6 Fix: [ bug #1388 ] Wrong date when invoicing several orders 2014-05-23 02:48:24 +02:00
Marcos García de La Fuente
9cc74c36d2 Missing copyright info 2014-05-23 02:45:15 +02:00
Marcos García de La Fuente
77c09d887a Fix: [ bug #1407 ] Rouget pdf overlapped when using tracking number and public notes 2014-05-23 02:44:02 +02:00
Marcos García de La Fuente
b2f299f5e4 Fix: [ bug #1411 ] Unable to set an expedition note if invoices module is not enabled 2014-05-23 02:22:38 +02:00
Marcos García de La Fuente
603c28dcdd [ bug #1397 ] Filter by supplier orders with status Draft does not filter 2014-05-23 02:04:02 +02:00
Laurent Destailleur
3481884731 Fix: A project is linked to a thirdparty (may be a customer, a supplier
or a prospect).
2014-05-22 13:20:03 +02:00
Laurent Destailleur
13da9c368e Merge pull request #1615 from FHenry/3.5
3.5
2014-05-22 13:16:04 +02:00
Florian HENRY
2a16a562d9 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Conflicts:
	ChangeLog
2014-05-22 12:51:55 +02:00
Florian HENRY
87b9d0412c Fix element page on project 2014-05-22 12:51:00 +02:00
Laurent Destailleur
4a7e9e4d0b Fix: CRLF 2014-05-21 19:54:40 +02:00
Laurent Destailleur
c82ff0a146 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5
Conflicts:
	ChangeLog
2014-05-21 19:51:05 +02:00
Laurent Destailleur
4a89446162 Fix: When number reach 9999 with default numbering module, next number
will be 10000 instead of 0000 and error.
2014-05-21 19:47:41 +02:00
Laurent Destailleur
b146dcad31 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-21 19:45:28 +02:00
Laurent Destailleur
366bd64c4f Fix: When number reach 9999 with default numbering module, next number
will be 10000 instead of 0000 and error.
2014-05-21 19:44:53 +02:00
Laurent Destailleur
753ef28168 Fix: Data are clean once registered into dictionnaries. 2014-05-20 16:08:05 +02:00
Florian HENRY
ff1eb983c8 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-19 16:22:19 +02:00
Florian HENRY
5a5c858578 [ bug #1399 ] [pgsql] Silent warning when setting a propal as
"facturée" in propal.php
2014-05-19 16:21:59 +02:00
Laurent Destailleur
56415400eb Merge pull request #1606 from FHenry/3.5
escape for insert SQL expedition module
2014-05-19 16:03:36 +02:00
Laurent Destailleur
5709179cf0 Fix: Box was not added on correct side 2014-05-19 00:05:49 +02:00
Laurent Destailleur
0e13ded641 Merge remote-tracking branch 'origin/3.4' into 3.5
Conflicts:
	test/phpunit/CoreTest.php
	test/phpunit/Functions2Test.php
	test/phpunit/FunctionsTest.php
2014-05-18 11:57:18 +02:00
Florian HENRY
c2370f352b escape for insert SQL expedition module 2014-05-16 15:03:28 +02:00
Laurent Destailleur
ab337c7485 Merge pull request #1602 from atm-alexis/3.5
FIX alert for customer order wasn't on delivery_date if exist
2014-05-16 09:58:56 +02:00
Laurent Destailleur
6bfff8b2b8 Merge pull request #1603 from marcosgdf/bug-1393
Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice.
2014-05-16 09:58:26 +02:00
Marcos García de La Fuente
39b0ed7fc2 Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice. 2014-05-14 22:47:19 +02:00
Alexis Algoud
fa212438c6 FIX alert for customer order wasn't on delivery_date if exist 2014-05-14 18:51:02 +02:00
Laurent Destailleur
9ae9f062ac Checkstyle 2014-05-14 12:25:30 +02:00
guerinaxel
4fc818d329 Correcting var name
Correcting var name for contrat updateline
2014-05-14 11:56:30 +02:00
Laurent Destailleur
6cebccf1b4 Merge pull request #1596 from marcosgdf/lang-35
Corrected untranslated string when creating invoice linked to a supplier order
2014-05-14 11:47:35 +02:00
Laurent Destailleur
d7d8eba6b1 Merge pull request #1592 from atm-alexis/3.5_adding_page_to_list_product_as_other_list
Fix page numerotation for product, invoice and others as in company list
2014-05-14 11:26:22 +02:00
Laurent Destailleur
8ab09d63a2 Fix: Rss features 2014-05-14 11:16:12 +02:00
Marcos García de La Fuente
98bd78a277 Corrected untranslated string when creating invoice linked to a supplier order 2014-05-14 01:07:07 +02:00
Laurent Destailleur
bd061f4245 Fix: [ bug #1380 ] Customer invoices are not grouped in company results
report
2014-05-13 01:29:01 +02:00
Alexis Algoud
f13c146908 Fix page numerotation as in company list 2014-05-12 11:00:58 +02:00
Laurent Destailleur
5f0c4dbe48 Fix: TCPDF error file not found in member card generation 2014-05-12 10:07:57 +02:00
Laurent Destailleur
3f08664eee Merge pull request #1590 from marcosgdf/language-typo
Corrected strings not translated and typos in English language
2014-05-12 01:56:06 +02:00
Laurent Destailleur
6f4a390780 Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error 2014-05-11 19:06:17 +02:00
Laurent Destailleur
bafc53ad95 Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error 2014-05-11 19:05:51 +02:00
Laurent Destailleur
bcfc9f8aa1 Fix: [ bug #1381 ] PHP Warning when listing stock transactions page 2014-05-11 18:06:30 +02:00
Laurent Destailleur
09b5971b7d Fix: [ bug #1381 ] PHP Warning when listing stock transactions page 2014-05-11 18:05:59 +02:00
Laurent Destailleur
847fa3827b Fix: use wrong css 2014-05-11 17:56:29 +02:00
Marcos García de La Fuente
7b05944530 Corrected strings not translated and typos in English language 2014-05-11 13:14:45 +02:00
Laurent Destailleur
7bb24969d8 Fix: [ bug #1372 ] Margin calculation does not work in proposals 2014-05-10 19:52:24 +02:00
Laurent Destailleur
3fd7e18c08 Fix: Bad translation into title of action buttons 2014-05-10 17:00:55 +02:00
Laurent Destailleur
1724fd2f89 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-10 16:44:12 +02:00
Laurent Destailleur
4e41b721fb Fix: Nb of notes and doc not visible onto tasks. 2014-05-10 16:43:47 +02:00
Laurent Destailleur
f855709cf4 Merge pull request #1585 from FHenry/3.5
"or" into if instead of ||
2014-05-10 15:44:25 +02:00
Laurent Destailleur
a627dd9ae8 Fix: Duplicate line when project has no tasks. 2014-05-09 17:14:40 +02:00
Laurent Destailleur
62537cf5a4 Fix: translation 2014-05-09 13:39:10 +02:00
Florian HENRY
2aa2f896c6 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-09 13:28:45 +02:00
Florian HENRY
02e0fac79f "or" into if instead of || 2014-05-09 13:28:29 +02:00
Laurent Destailleur
c0af0c3b52 Fix: translation 2014-05-08 20:29:16 +02:00
Laurent Destailleur
1b25fdc323 Fix: Param at wrong place.
Fix: Add warning if phpunit are runned with external module on.
2014-05-08 18:09:39 +02:00
Laurent Destailleur
70cccc907a Fix: Check env before test to be sure module ecotax is not enabled
(this change result).
2014-05-08 15:30:31 +02:00
Laurent Destailleur
4bf86508a5 Merge pull request #1583 from FHenry/3.5
Fix error return project deletion
2014-05-07 19:25:02 +02:00
Laurent Destailleur
ef2a8a0b09 Merge pull request #1582 from marcosgdf/changelog
Changelog
2014-05-07 19:18:41 +02:00
Laurent Destailleur
ac27884b88 Fix: [ bug #1366 ] Special characters are HTML encoded with WYSIWYG
module.
2014-05-07 19:13:02 +02:00
Laurent Destailleur
16b3ec8923 Fix: concat of string must use dol_concat. 2014-05-07 19:06:47 +02:00
Laurent Destailleur
1bc3558307 Fix: Better html detection 2014-05-07 19:06:15 +02:00
Florian HENRY
0e2497e710 [ bug #1377 ] Warning: get_class() called without object from outside a
class
2014-05-07 18:19:46 +02:00
Florian HENRY
e35008b534 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-07 15:13:47 +02:00
Florian HENRY
3f22bc7009 Better error management in delete project method 2014-05-07 15:08:44 +02:00
Florian HENRY
e6708a5072 Fix error return project deletion 2014-05-07 15:05:40 +02:00
Marcos García de La Fuente
fb7f08b33a Corrected changelog message 2014-05-07 10:43:19 +02:00
Marcos García de La Fuente
8681079fa7 Fixed CR 2014-05-07 10:42:13 +02:00
Marcos García de La Fuente
7fe5389adf Updated changelog 2014-05-07 10:41:43 +02:00
Laurent Destailleur
182dd774b6 Fix: phpunit regression 2014-05-07 09:54:36 +02:00
Laurent Destailleur
fe43d10c79 Fix: [ bug #1360 ] note indicator for member tab. 2014-05-06 23:42:19 +02:00
Laurent Destailleur
3abede630b Fix: [ bug #1365 ] ODT template tag {company_note} does not get
replaced.
2014-05-06 23:36:01 +02:00
Laurent Destailleur
5a6ad1ef5f Fix: [ bug #1362 ] Note is not saved
Fix: tr/td balance.
2014-05-06 23:19:48 +02:00
Laurent Destailleur
5e12459ad1 Fix: Ref and date for social contributions payments were merged into on
field making not possible to click on ref.
2014-05-06 22:54:33 +02:00
Laurent Destailleur
460b5296ba Fix: [ bug #1353 ] Email notifications, wrong URL 2014-05-06 22:21:34 +02:00
Laurent Destailleur
7a452519e7 Try to fix [ bug #1363 ] Unable to update from 3.5.1 to 3.5.2 2014-05-06 22:00:54 +02:00
Laurent Destailleur
503924fbbc Fix: Missing cleaning orphelins for contact categories. 2014-05-06 21:56:31 +02:00
Laurent Destailleur
53a1e7d09a Fix: Script can be ran from non root user, even from a directory with no
write permissions.
2014-05-06 16:26:58 +02:00
Laurent Destailleur
1c6c79811d Prepare version 3.5.3 2014-05-06 16:09:13 +02:00
Laurent Destailleur
215ff25ddd Fix: navigation on tab notes for shipment was not working. 2014-05-06 13:51:22 +02:00
Laurent Destailleur
647d431857 Fix: contact of delivery of order not visible into typhon pdf. 2014-05-06 13:43:41 +02:00
Laurent Destailleur
4da918ce01 Update doc 2014-05-06 13:32:37 +02:00
Laurent Destailleur
959b104b78 Fix: the pdf template name for typhon as not correctly set when enabling
module.
2014-05-06 13:31:30 +02:00
Laurent Destailleur
c4291c228e Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-05-06 13:16:06 +02:00
Laurent Destailleur
948e0bf753 Fix: When on delivery receipt, ref of shipment was not visible. Also
some tabs were missing.
Fix: After deletion of delivery receipt, we must go back to shipment of
delivery receipt.
2014-05-06 13:15:37 +02:00
Laurent Destailleur
5740c22a41 Merge pull request #1576 from grandoc/3.5
fix : no room when number of pages sup than 9
2014-05-06 10:21:19 +02:00
Juanjo Menent
011fe254a6 Fix: Suppliers invoice mask fails using {tttt} in numbering 2014-05-06 09:59:10 +02:00
philippe
a04cd99090 fix : no room when number of pages sup than 9 2014-05-05 19:03:25 +02:00
Laurent Destailleur
c9ebe7729f Merge branch 'bug-1371' of github.com:marcosgdf/dolibarr into
marcosgdf-bug-1371

Conflicts:
	ChangeLog
2014-05-04 17:56:24 +02:00
Laurent Destailleur
e8308e795d Merge branch 'FHenry-3.5' into 3.5 2014-05-04 17:44:08 +02:00
Laurent Destailleur
697f68c9a9 Merge branch '3.5' of github.com:FHenry/dolibarr into FHenry-3.5
Conflicts:
	ChangeLog
2014-05-04 17:43:47 +02:00
Laurent Destailleur
03f9f0bada Fix: Pb of records not correctly cleaned when module marge is
uninstalled (conflict between 'margin' and 'margins').
2014-05-03 20:21:35 +02:00
Marcos García de La Fuente
08301e3478 Corrected little bug when no state_id was defined 2014-05-03 17:16:37 +02:00
Laurent Destailleur
f34a9983bd Fix: Can disable features with PHPEXCEL (no DLSF compatible).
Fix: Can disable features with CKEDITOR.
2014-05-03 02:22:37 +02:00
Laurent Destailleur
50c10d3d1e Fix: Can disable features with PHPEXCEL (no DLSF compatible).
Fix: Can disable features with CKEDITOR.
2014-05-03 02:20:26 +02:00
Marcos García de La Fuente
4599b22cb5 Fix: [ bug #1357 ] Invoice creator state not printed in generated invoice documents 2014-05-02 17:15:56 +02:00
Laurent Destailleur
7216b2a843 Fix phpunit to be compatible with new version of phpunit 2014-05-02 00:08:27 +02:00
Laurent Destailleur
876a35d1a1 Fix phpunit to be compatible with new version of phpunit 2014-05-02 00:08:19 +02:00
Florian HENRY
2637305065 same 2014-05-01 18:15:32 +02:00
Florian HENRY
a4126fae66 [ bug #1341 ] Lastname not added by file or direct input in mass
e-mailing
2014-05-01 18:13:01 +02:00
Laurent Destailleur
4fa472518e Fix: doxygen 2014-04-26 22:23:46 +02:00
Laurent Destailleur
bd8cdd337a Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. 2014-04-26 22:17:11 +02:00
Laurent Destailleur
537ada96a8 Fix: [ bug #1354 ] Tasks disapear in same sub-task
Conflicts:
	htdocs/install/mysql/migration/repair.sql
	htdocs/projet/class/project.class.php
2014-04-26 21:47:15 +02:00
Laurent Destailleur
4ecfa1d6e0 Clean corrupted data for categories
Conflicts:
	htdocs/install/mysql/migration/repair.sql
2014-04-26 21:40:57 +02:00
Laurent Destailleur
6968304641 Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. 2014-04-26 17:27:59 +02:00
Laurent Destailleur
c54d9d9171 Fix: [ bug #1351 ] VIES verification link broken 2014-04-26 16:27:06 +02:00
Laurent Destailleur
0b1bfa56e2 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-04-24 01:26:53 +02:00
Laurent Destailleur
889ed4a49c Fix: div was opened and not close or the oposite. 2014-04-24 01:26:28 +02:00
Laurent Destailleur
31d56d6c38 Merge pull request #1548 from atm-alexis/3.5
Add somes dol_escape_htmltag on product cards inputs
2014-04-23 21:14:42 +02:00
Alexis Algoud
34948ef2d6 Add somes dol_escape_htmltag on product cards inputs 2014-04-23 14:53:23 +02:00
Laurent Destailleur
78ce40f23b Merge pull request #1540 from grandoc/3.5
Fix some misspelling
2014-04-23 00:02:30 +02:00
philippe
8564691896 Fix some misspelling 2014-04-21 09:46:03 +02:00
Laurent Destailleur
b1fd8cf503 Merge pull request #1537 from grandoc/3.5
style enhancement
2014-04-20 00:13:50 +02:00
Laurent Destailleur
2213128531 Fix: invert label for accountancy_code_sell 2014-04-18 12:08:12 +02:00
Laurent Destailleur
ee3592c976 Fix: invert label for accountancy_code_sell 2014-04-18 11:21:15 +02:00
philippe
2ffe4f589e style enhancement 2014-04-18 10:54:21 +02:00
Laurent Destailleur
cb2393e663 Fix: Solve problem of _source directory. 2014-04-13 01:28:44 +02:00
Laurent Destailleur
81ff0a8643 Fix: Missing initialized value 2014-04-12 01:45:18 +02:00
Laurent Destailleur
80f1100bf9 Fix: Removed warning 2014-04-12 01:32:46 +02:00
Juanjo Menent
75e76dc232 Fix: Can not make withdrawals 2014-04-11 12:07:01 +02:00
Laurent Destailleur
7fcf57ca5a Fix: SQL request for export. Extra field missing. 2014-04-10 18:36:34 +02:00
Laurent Destailleur
5d4b861156 Fix: Try/catch
Conflicts:
	htdocs/core/class/conf.class.php
2014-04-09 17:09:38 +02:00
Laurent Destailleur
351ab9788b Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-04-09 01:38:54 +02:00
Laurent Destailleur
e061c442a6 Fix: hour:min not saved 2014-04-09 01:18:42 +02:00
Laurent Destailleur
6f40825270 Merge pull request #1527 from grandoc/3.5
translation and cleaning
2014-04-09 00:31:57 +02:00
Laurent Destailleur
13659b1528 Fix: [ bug #1334 ] filter lost when sorting into list of memebers. 2014-04-09 00:12:07 +02:00
Laurent Destailleur
60b37dffe1 Fix: [ bug #1323 ] generation of odt files for tasks. 2014-04-09 00:07:32 +02:00
Laurent Destailleur
4e619c42fa Fix: [ bug #1340 ] Erreur de langage dans les projets 2014-04-08 23:56:10 +02:00
Laurent Destailleur
e0e64af18c Fix: Hierarchical user not saved. 2014-04-08 23:51:50 +02:00
Grand Philippe
9a056ab497 anglicizing 2014-04-08 14:05:10 +02:00
Grand Philippe
9dd499b133 Merge branch '3.5' of https://github.com/Dolibarr/dolibarr into 3.5 2014-04-08 13:47:17 +02:00
Laurent Destailleur
eb0d98d406 Comment 2014-04-07 20:41:33 +02:00
Grand Philippe
fe49f55a48 fix from forum 2014-04-07 11:01:11 +02:00
Grand Philippe
f25ddfbc9c Merge branch '3.5' of https://github.com/Dolibarr/dolibarr into 3.5 2014-04-07 10:03:01 +02:00
Grand Philippe
42b6628b76 translation and cleaning 2014-04-07 09:54:24 +02:00
Laurent Destailleur
6f47e2e154 Ignore file 2014-04-06 21:25:53 +02:00
Laurent Destailleur
3bc63c43dc Fix: [ bug #1322 ] notification d'erreur en insérant ou supprimer un
tiers dans une catégorie
2014-04-06 21:25:26 +02:00
Laurent Destailleur
41a2ce1a74 Fix: [ bug #1319 ] Erreur d'affichage des remises dans les propales
Conflicts:
	htdocs/comm/propal.php
2014-04-06 21:21:08 +02:00
Laurent Destailleur
90f5f0823f Prepare 3.5.2 2014-04-05 16:32:25 +02:00
Laurent Destailleur
c57c3aef84 Fix: Missing return 2014-04-05 16:28:09 +02:00
Laurent Destailleur
174d4f6ff2 Prepare 3.5.2 2014-04-05 16:15:04 +02:00
Laurent Destailleur
da0aebb2e9 Fix: Can't add user 2014-04-05 12:40:24 +02:00
Laurent Destailleur
63729ab508 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-04-02 19:35:04 +02:00
Laurent Destailleur
ebb9016ad5 Fix: missing 'ifone' into param 2014-04-02 19:34:42 +02:00
Laurent Destailleur
d5448f9ca4 Merge pull request #1521 from FHenry/3.5
Extrafield select form table do not display selected value on edit mode
2014-04-02 14:57:00 +02:00
Laurent Destailleur
cf8ff97855 Fix: Install of odt templates for project and tasks failed. 2014-04-02 13:17:20 +02:00
Laurent Destailleur
d5986caed2 Fix: [ bug #1318 ] Problem with enter key when adding an existing
product to a customer invoice.
2014-04-02 12:00:01 +02:00
Laurent Destailleur
918fe5dbb5 Fix: [ bug #1318 ] Problem with enter key when adding an existing
product to a customer invoice
2014-04-02 11:58:59 +02:00
Laurent Destailleur
f3bbf54447 Fix: [ bug #1307 ] Quotes get removed from several inputs 2014-04-02 11:52:09 +02:00
Florian Henry
a2a46f9300 Extrafield select form table do not display selected value on edit mode 2014-04-02 11:34:15 +02:00
Laurent Destailleur
46e46507ec Merge remote-tracking branch 'origin/3.4' into 3.5
Conflicts:
	htdocs/comm/action/index.php
	htdocs/compta/bank/class/account.class.php
	htdocs/compta/bank/index.php
2014-04-02 11:33:47 +02:00
Laurent Destailleur
8cb06cac08 FIX : [ bug #1317 ] Removing a category does not remove all child
categories
2014-04-02 11:27:11 +02:00
Cedric
a4797a0e4a FIX : [ bug #1317 ] Removing a category does not remove all child categories 2014-04-02 11:25:17 +02:00
Laurent Destailleur
663a3bd45c Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-04-02 11:21:11 +02:00
Laurent Destailleur
c421613da9 Merge pull request #1520 from KreizIT/fix_1317
FIX : [ bug #1317 ] Removing a category does not remove all child categories
2014-04-02 11:20:47 +02:00
Laurent Destailleur
ab6a67054a Merge pull request #1516 from marcosgdf/multicompany-fixes
Fixed a problem with bank accounts sharing across entities
2014-04-02 11:16:48 +02:00
Laurent Destailleur
48c77d2ceb Fix: [ bug #1312 ] Call to undefined function _() 2014-04-02 10:48:20 +02:00
Laurent Destailleur
6dab09e07a Fix: Bad dialog position 2014-04-02 00:04:13 +02:00
Cedric
df5a009aa2 FIX : [ bug #1317 ] Removing a category does not remove all child categories 2014-04-01 16:21:20 +02:00
Laurent Destailleur
c969bc3e93 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-04-01 09:13:34 +02:00
Laurent Destailleur
f1466e64af Fix: Build for obs 2014-04-01 09:12:49 +02:00
Laurent Destailleur
1fad693867 Fix: Removed useless strtolower 2014-03-31 02:25:35 +02:00
Laurent Destailleur
ed49f88446 Fix: deleting files into backup system tools.
Fix: Dump using php not not include lock on tables that are deleted.
2014-03-31 00:19:31 +02:00
Marcos García de La Fuente
e6bd3921f1 Fixed a problem with bank accounts sharing across entities 2014-03-30 23:00:35 +02:00
Laurent Destailleur
95793a5475 Fix: fields into group by of sql requests for module margins must be
same than fields into select.
2014-03-30 16:08:30 +02:00
Laurent Destailleur
c506e59d8c Look: Minor fix to not have calendar picto to glue to input 2014-03-30 15:58:41 +02:00
Laurent Destailleur
a5c2b78565 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-03-29 17:38:06 +01:00
Laurent Destailleur
61f649e1ae 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().
New: Add a page for tests.
2014-03-29 04:26:44 +01:00
Juanjo Menent
acb752c5f2 Fix: Margin tabs bad data show 2014-03-28 18:22:44 +01:00
Laurent Destailleur
832ebb1cfe Merge pull request #1512 from atm-alexis/3.5
fix can't add line with product in supplier order
2014-03-27 16:05:38 +01:00
Laurent Destailleur
f282ffc549 Merge pull request #1508 from KreizIT/3.5
FIX :[bug #1309]
2014-03-27 15:58:13 +01:00
Laurent Destailleur
ae728645d6 Merge pull request #1504 from marcosgdf/multicompany-fixes
Fix: Agenda and Banks module were not working with multicompany module
2014-03-27 15:31:54 +01:00
Laurent Destailleur
c6b700d449 Merge pull request #1502 from FHenry/3.5
Fix restrictedearea bug & delete extrafield on delete invoice
2014-03-27 15:30:15 +01:00
Alexis Algoud
f97c8feb54 fix can't add line with product in supplier order 2014-03-26 11:28:41 +01:00
Florian Henry
3d12979b3f remove debug string 2014-03-26 09:53:48 +01:00
Cedric
57cf384617 Keep value on validtions failure 2014-03-25 13:05:29 +01:00
Cedric
e16385b496 FIX :[bug #1309] 2014-03-25 11:48:44 +01:00
Florian Henry
bb07d7f814 Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5 2014-03-24 13:25:35 +01:00
Laurent Destailleur
f115501ddf Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-03-24 00:16:47 +01:00
Laurent Destailleur
3f78fe8c93 Fix: Avoid to get duplicate field 2014-03-23 21:01:05 +01:00
Laurent Destailleur
6039c81845 Fix: copy to clipboard does not work with jmobile
Fix: Bad translation
2014-03-23 20:56:41 +01:00
Laurent Destailleur
57bd043f59 Fix: Missing lang loading 2014-03-23 20:30:54 +01:00
Laurent Destailleur
466de67b5b Fix: Solve pb of too many embedded tables 2014-03-23 20:18:07 +01:00
Marcos García de La Fuente
09e02f807f Even better improvement 2014-03-22 19:01:19 +01:00
Marcos García de La Fuente
e2f51d0df2 Removed duplicate line 2014-03-22 19:00:37 +01:00
Marcos García de La Fuente
c8c77dbdcf Fix: Agenda and Banks module were not working with multicompany module 2014-03-22 18:59:48 +01:00
Juanjo Menent
e0b4bd9b0d Fix: [ bug #1306 ] Fatal error when adding an external calendar 2014-03-22 13:00:23 +01:00
Laurent Destailleur
a1e778c146 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-03-21 21:12:02 +01:00
Laurent Destailleur
1061a650d2 Fix: duplicate info 2014-03-21 21:11:51 +01:00
Laurent Destailleur
4bd6f11112 Backport fix to solve warning problems. 2014-03-21 18:35:50 +01:00
Florian Henry
c8c4a10a06 Fix restrictedearea bug 2014-03-21 16:18:17 +01:00
Florian Henry
10fda1956f Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5 2014-03-21 14:41:18 +01:00
Laurent Destailleur
a884673637 Fix: A better to fix to manage automatic creation of code for import. 2014-03-21 13:29:13 +01:00
Laurent Destailleur
c1411e65b7 Fix: Try to add code to provide easy way to fix warning on timezone not
defined.
2014-03-21 10:13:29 +01:00
Laurent Destailleur
aabd923248 Try to remove warning 2014-03-21 09:49:10 +01:00
Laurent Destailleur
4afb85bd1d Fix: Several fix into workflow/condition for invoice payments or convert
into discount.
2014-03-19 22:30:25 +01:00
Laurent Destailleur
d3e951e1ec Merge remote-tracking branch 'origin/3.4' into 3.5 2014-03-19 20:22:04 +01:00
Laurent Destailleur
9cd7f68ae8 Merge branch '3.4' of git@github.com:Dolibarr/dolibarr.git into 3.4 2014-03-19 20:03:17 +01:00
Laurent Destailleur
062c150bc1 Fix: import of fields with value "auto" 2014-03-19 19:33:43 +01:00
Laurent Destailleur
212deb9e1c Fix: fails to import when value is 'AUTO' because compare was case
sensitive.
2014-03-19 17:15:18 +01:00
Laurent Destailleur
2f10198064 Fix: Option MAIN_PDF_DASH_BETWEEN_LINES was not working when tcpdf was
making a pagebreak higher than 2 pages.
2014-03-19 16:36:12 +01:00
Laurent Destailleur
89f0a1bbff Merge remote-tracking branch 'origin/3.4' into 3.5 2014-03-19 15:22:08 +01:00
Laurent Destailleur
bf735cacbe Fix PDF: Page break was ko when breaking 2 pages or more.
Fix PDF: pdf_canelle was missing code to manage pagebreak.
Fix PDF: The width of picture was hardcoded into some templates.
Fix PDF: The atleastonediscount was not used into some templates.
2014-03-19 13:32:54 +01:00
Laurent Destailleur
5d14322679 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-03-19 11:46:44 +01:00
Laurent Destailleur
dbaea6fa42 Add clean sql requests into repair.sql 2014-03-19 11:40:23 +01:00
Laurent Destailleur
a05ea58181 Fix: form to add images should not show link form 2014-03-18 22:26:46 +01:00
Laurent Destailleur
ada22837a5 Fix: form to add images should not show link form 2014-03-18 22:26:09 +01:00
Laurent Destailleur
6ac7e22521 Merge pull request #1494 from atm-gauthier/3.5
Correction when adding line with price as '0'
2014-03-17 20:31:53 +01:00
Gauthier
eb43bc4982 Correction when adding line with price as '0' 2014-03-17 15:38:12 +01:00
Laurent Destailleur
ed4f7fd083 Fix: error 2014-03-16 20:05:07 +01:00
Florian Henry
b7bfadd660 Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5 2014-03-15 22:11:51 +01:00
Laurent Destailleur
de59f3aafe Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-03-15 21:48:14 +01:00
Florian Henry
649f535d56 delete extrafield on delete invoice 2014-03-15 19:49:21 +01:00
Laurent Destailleur
9172beb282 Merge pull request #1483 from FHenry/3.5
3.5
2014-03-15 17:30:31 +01:00
Drosis Nikos
997e16fec7 Update user.class.php
String translated twice
2014-03-15 17:22:34 +01:00
Florian Henry
7625629491 Fix [ bug #1294 ] Expedition model Merou having problems with long names 2014-03-15 16:40:29 +01:00
Florian Henry
ee70f21f58 Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5 2014-03-15 16:33:24 +01:00
Florian Henry
18c4d890dd Fix [ bug #1283 ] ROUGET Shipment PDF 2014-03-15 16:32:46 +01:00
Laurent Destailleur
4db8af8a53 Fix: sql syntax error with pgsql 2014-03-15 15:11:58 +01:00
Laurent Destailleur
5025d11a16 Merge pull request #1476 from tbasilici/3.5
3.5
2014-03-15 13:32:30 +01:00
kaos
f55bdc64bd fixes #1300 2014-03-15 11:10:20 +01:00
kaos
1cb71674d7 fixes #1300 2014-03-15 11:06:50 +01:00
Laurent Destailleur
c0f41c84cb Merge pull request #1471 from FHenry/3.5
Fix deposit invoice
2014-03-15 00:43:48 +01:00
Laurent Destailleur
90cf1ba3a5 Merge pull request #1468 from bouna/patch-1
Update list.php
2014-03-15 00:34:56 +01:00
Florian Henry
3f6b319d41 Fix deposit invoice 2014-03-14 23:42:45 +01:00
bouna
e7791a3ade Update list.php
to save the town filtre on prospect list, just i replace: 
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_ville ='.urlencode($search_ville );

search_ville by search_town
2014-03-14 19:46:36 +01:00
Laurent Destailleur
317134c29d Merge pull request #1467 from grandoc/3.5
fix : display specimen
2014-03-14 19:29:21 +01:00
philippe grand
f9c48be2a9 fix : display specimen 2014-03-14 18:23:37 +01:00
Laurent Destailleur
561a1a1aac Fix: Miscellaneous problems on task tabs (withproject parameter lost and
download fails).
2014-03-14 02:07:54 +01:00
Laurent Destailleur
c8f63d6160 Fix: Prepare for 3.5.2 2014-03-14 00:17:39 +01:00
Laurent Destailleur
da5610bf3f Merge branch 'es_CL-language' of https://github.com/marcosgdf/dolibarr
into marcosgdf-es_CL-language

Conflicts:
	ChangeLog
2014-03-13 23:40:43 +01:00
Laurent Destailleur
dd7970b549 Fix: Regression, so introduce option to restore old behaviour. 2014-03-12 12:57:26 +01:00
Laurent Destailleur
e76f2170b3 Fix: Avoid home project page to hung when too many tasks opened. 2014-03-12 02:49:11 +01:00
Laurent Destailleur
4a983811d0 Fix: Avoid home project page to hung when too many tasks opened. 2014-03-12 02:43:31 +01:00
Laurent Destailleur
7684e9e4f7 Fix: Add PHPUnit test to check main.lang files does not contains rubish
values for keys SeparatorXXX
Fix: Add PHPUnit test to check main.lang files does not contains rubish
values for keys FormatDateShortJaxaXXX
2014-03-11 23:39:26 +01:00
Laurent Destailleur
241ae7a4d1 Fix: Miscellaneous bugs on tasks management
Conflicts:
	htdocs/core/lib/project.lib.php
2014-03-11 20:53:47 +01:00
Laurent Destailleur
8d081525ae Merge pull request #1464 from marcosgdf/changelog
Updated changelog
2014-03-11 11:55:08 +01:00
Laurent Destailleur
86ad05c22e Merge pull request #1461 from marcosgdf/unknown-error
Corrected Unknown error message typo
2014-03-11 11:54:08 +01:00
Laurent Destailleur
5ee17a2f14 Merge pull request #1460 from atm-gauthier/3.5
error on ajax_constantonoff function
2014-03-11 11:53:44 +01:00
Laurent Destailleur
324402be0d Merge pull request #1465 from marcosgdf/bug-1295
Fixed bug 1295: Error when creating an agenda extrafield with a number as reference
2014-03-11 11:45:50 +01:00
Laurent Destailleur
67de6699d6 Fix: Translation of number for pt_PT 2014-03-11 01:37:37 +01:00
Marcos García de La Fuente
20262a0164 Fix bug #1295: Error when creating an agenda extrafield with a number as reference 2014-03-10 23:58:16 +01:00
Laurent Destailleur
be97066a74 Fix: Bug into sql request because of incomplete group by 2014-03-10 23:57:19 +01:00
Marcos García de La Fuente
78ec0054d9 Added bug number for agenda extrafield problems 2014-03-10 23:33:09 +01:00
Marcos García de La Fuente
4209ad740c Updated changelog 2014-03-10 23:20:48 +01:00
Marcos García de La Fuente
89a4c51153 Added es_CL language 2014-03-10 21:13:16 +01:00
Marcos García de La Fuente
fa56fe4e8b Corrected Unknown error message typo 2014-03-10 19:36:32 +01:00
Laurent Destailleur
ccc40362e7 Fix: Must use div for columns of index pages. Not table. 2014-03-10 17:19:02 +01:00
Laurent Destailleur
21bf279248 Fix: css 2014-03-10 16:17:55 +01:00
Gauthier
92e8f54e9a error on ajax_constantonoff function 2014-03-10 10:53:20 +01:00
Laurent Destailleur
97677f08a9 Fix: Add protection to avoid memory hung 2014-03-10 01:49:44 +01:00
Laurent Destailleur
b8d816b208 Merge remote-tracking branch 'origin/3.4' into 3.5
Conflicts:
	build/debian/dolibarr.install
	build/makepack-dolibarr.pl
2014-03-09 02:48:37 +01:00
Laurent Destailleur
7a741e0691 Merge remote-tracking branch 'origin/3.3' into 3.4
Conflicts:
	build/makepack-dolibarr.pl
2014-03-09 02:14:00 +01:00
Laurent Destailleur
f652a4d807 Script to prepare 3.3.5 2014-03-09 02:08:13 +01:00
Laurent Destailleur
b2116c37d8 Enhance packager:
- No need to be root to run script
- create git tag of version
- debian package do not use the deprecated dpatch command
- debian package is a quilt package (not native)
- debian package was missing file watch
- clean exclusion for zip and tgz package (exclusion must be done into
makepack-dolibarr.pl, not into specific package code)
- can publish files to sourceforge
2014-03-09 01:37:08 +01:00
Laurent Destailleur
c082d7c82e Merge remote-tracking branch 'origin/3.4' into 3.5
Conflicts:
	htdocs/main.inc.php
2014-03-08 14:17:49 +01:00
Laurent Destailleur
2e2f86b968 Merge remote-tracking branch 'origin/3.3' into 3.4
Conflicts:
	htdocs/core/class/doleditor.class.php
	htdocs/main.inc.php
2014-03-08 14:14:23 +01:00
Laurent Destailleur
a6bb785b5f Fix: Compatibility with v4 of ckeditor (for debian) 2014-03-08 14:06:01 +01:00
Laurent Destailleur
0a2a635755 Fix: td balance.
Fix: New price was not used when editing a line when margin module was
on.
2014-03-07 11:58:30 +01:00
Laurent Destailleur
06b2c646c3 Fix: Add a space after (int) for travis succes ;) 2014-03-06 18:31:02 +01:00
Laurent Destailleur
884530098f Merge pull request #1453 from atm-alexis/3.5
bug on update service with service created in 3.4
2014-03-06 18:29:23 +01:00
Alexis Algoud
d139009ef5 bug on update service with service created in 3.4 2014-03-05 15:29:28 +01:00
Laurent Destailleur
bea6887f9c Merge pull request #1444 from atm-alexis/3.5
debug planned_workload loosing value on error
2014-03-04 23:39:51 +01:00
Laurent Destailleur
ba90565982 Removed hard coded value of version from makepack-dolibarr.pl script. 2014-03-03 19:08:13 +01:00
Laurent Destailleur
df829177bc Fix: Submit form of graph box was reseting params of others. 2014-03-02 17:45:40 +01:00
Alexis Algoud
9de372d4b1 debug planned_workload loosing value on error 2014-03-02 17:33:51 +01:00
Laurent Destailleur
d9dc8de4e6 Fix: Badd error message 2014-03-02 15:58:02 +01:00
Laurent Destailleur
748d769140 Fix: [ bug #1280 ] service with not end of date was tagged as expired. 2014-03-02 15:50:26 +01:00
Laurent Destailleur
8bd72cc21f Fix: wrapping into combo 2014-03-01 20:05:08 +01:00
Laurent Destailleur
c6fb7996ba Fix: [ bug #1238 ] When creating accompte with a %, free product are
used for calculation.
2014-03-01 19:11:13 +01:00
Laurent Destailleur
7db903e671 Fix: special code was lost during update 2014-03-01 16:58:10 +01:00
Laurent Destailleur
b6cefee45a Fix: [ bug #1240 ] traduction 2014-03-01 15:21:11 +01:00
Laurent Destailleur
0b83f1a670 Merge remote-tracking branch 'origin/3.4' into 3.5 2014-03-01 15:06:25 +01:00
Laurent Destailleur
6f4de6e6d0 Fix: [ bug #520 ] Product statistics and detailed lists are wrong 2014-03-01 15:05:00 +01:00
Laurent Destailleur
8d28087e69 Fix: [ bug #1206 ] PMP price is bad calculated 2014-03-01 14:58:33 +01:00
Laurent Destailleur
dfb4117bb5 Fix: Invalid image link 2014-03-01 14:58:06 +01:00
Laurent Destailleur
ea773531b5 Fix: [ bug #1206 ] PMP price is bad calculated 2014-03-01 14:49:30 +01:00
Laurent Destailleur
a084887442 Merge branch 'project-translations' of
https://github.com/marcosgdf/dolibarr into
marcosgdf-project-translations

Conflicts:
	ChangeLog
2014-03-01 13:38:50 +01:00
Laurent Destailleur
19b68e87e9 Merge branch 'bug-1123' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1123

Conflicts:
	ChangeLog
2014-03-01 13:29:34 +01:00
Laurent Destailleur
45898a989c Fix: Translation done twice 2014-03-01 10:16:03 +01:00
Laurent Destailleur
072bb709ff Fix: dead code 2014-02-28 22:09:40 +01:00
Laurent Destailleur
6662f8b5a3 Fix: Bad picto for project setup page 2014-02-28 21:54:50 +01:00
Laurent Destailleur
68a508a0d1 Fix: sql error on numbering module for tasks 2014-02-28 21:40:08 +01:00
Laurent Destailleur
74404749c6 Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a 2014-02-28 16:00:57 +01:00
Laurent Destailleur
de159d569a Fix: Missing transactions 2014-02-27 16:40:25 +01:00
BENKE Charles
303c459777 Update modProjet.class.php
bad incrementation
2014-02-27 11:29:08 +01:00
Laurent Destailleur
06b1c8b64a Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5
Conflicts:
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
2014-02-27 10:47:15 +01:00
Laurent Destailleur
2b019575cc Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-02-26 17:25:48 +01:00
Laurent Destailleur
4be679a7b2 Second try for Fix: The delivery date was missing. 2014-02-26 17:25:32 +01:00
Laurent Destailleur
0c2ca119d7 Fix: Add a test to avoid the non stable and experimental fuc...
feature "MAIN_MENU_USE_JQUERY_LAYOUT" to make application hang.
2014-02-26 16:51:38 +01:00
simnandez
8ffa11fe16 Fix: Loading actions extrafields fails. 2014-02-26 16:50:38 +01:00
Laurent Destailleur
df2eb95882 Fix: Right to left support 2014-02-26 15:42:32 +01:00
Laurent Destailleur
9505f9e47c Fix: The delivery date was missing. 2014-02-26 15:41:56 +01:00
Laurent Destailleur
855dac45ea Fix: select_comptes was always making a filter on field clos making
other filter field not working in some case.
2014-02-26 15:29:40 +01:00
Laurent Destailleur
0918fd21b0 Fix: Css errors 2014-02-26 14:48:53 +01:00
Laurent Destailleur
e8e8879e9e Fix: Right to left support 2014-02-25 19:26:18 +01:00
Laurent Destailleur
a822bc0736 Fix: The delivery date was missing. 2014-02-25 19:22:00 +01:00
Laurent Destailleur
3f05651b94 Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5 2014-02-25 16:14:51 +01:00
Laurent Destailleur
63a2aa3365 Fix: sql error with postgres when creating extrafield with an upper cas
character. code for new fields must be always lowercase.
2014-02-25 15:48:13 +01:00
Laurent Destailleur
7241714551 Merge pull request #1435 from marcosgdf/export-translations
Corrected export translations
2014-02-25 14:11:40 +01:00
Laurent Destailleur
bd6d9b9dad Merge pull request #1431 from Pfontaine/fix/state_id_on_contact
Add state_id in contact for individual third party
2014-02-25 14:05:56 +01:00
Marcos García de La Fuente
f7eb4c5b14 Updated user export labels 2014-02-25 04:39:41 +01:00
Marcos García de La Fuente
4411908b23 Fixed translations of project export wizard 2014-02-25 04:18:13 +01:00
Marcos García de La Fuente
4157452c6d Translated export filters 2014-02-25 03:23:08 +01:00
Marcos García de La Fuente
7ac405e067 Added SpecialCode translation key 2014-02-25 03:20:37 +01:00
Marcos García de La Fuente
968b5771db Corrected project contact types translation 2014-02-25 02:42:10 +01:00
Marcos García de La Fuente
f464528dd9 Corrected indentation to tabs 2014-02-25 01:18:29 +01:00
Marcos García de La Fuente
e83e2bbbd7 Fixed bug #1123: Paid deposit invoices are always shown as partially paid when fully paid 2014-02-25 01:17:38 +01:00
Peter Fontaine
8ec10f8efa Add state_id in contact for individual third party 2014-02-24 21:20:06 +01:00
Laurent Destailleur
b1eef7cd42 Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a
product
2014-02-24 17:37:35 +01:00
Laurent Destailleur
e5136487bd Fix: The customer code was set to uppercase when using numbering module
leopard. We must keep data safe of any change.
2014-02-20 16:51:37 +01:00
simnandez
7511f626b3 Fix: Action event SHIPPING_VALIDATE is not implemented 2014-02-19 17:32:20 +01:00
Laurent Destailleur
4915ec8916 Fix: Bad space in predefined messages.
Fix: Signature was not added for email sent from thirdparty page.
2014-02-19 15:33:04 +01:00
Laurent Destailleur
d7c9ebd5ee Fix: sort on supplier ref. 2014-02-19 03:04:56 +01:00
Laurent Destailleur
3a4161fdf7 Fix: css 2014-02-18 19:49:36 +01:00
Laurent Destailleur
342ee2e6f6 Qual: Add a TODO to warn to remove this bug. 2014-02-17 18:22:15 +01:00
Laurent Destailleur
1cfcda702e Fix: [ bug #1250 ] "Supplier Ref. product" sidebar search box does not
work.
2014-02-17 17:32:25 +01:00
Laurent Destailleur
e1efd88155 Merge remote-tracking branch 'origin/3.4' into 3.5 2014-02-17 15:22:02 +01:00
Laurent Destailleur
8839ae38d3 Fix: [ bug #1241 ] error in request in select_paper file
/core/class/html.formadmin.class.php
2014-02-17 15:21:19 +01:00
Laurent Destailleur
fa7e7c75bf Fix: Add a protection if user has no option to edit stock 2014-02-17 11:48:57 +01:00
Laurent Destailleur
de64ce5b2a Fix: user right on Holiday for month report nor working 2014-02-17 00:09:48 +01:00
Laurent Destailleur
abc96b51fa Enable extrafields for customer order, proposal and invoice lines. This
feature was developed for 3.5 but was disabled (hidden) because of
a bug not possible to fix enough quickly for 3.5.0 release.
2014-02-16 23:51:29 +01:00
Laurent Destailleur
935b30470d Fix: Missing nowrap 2014-02-16 20:09:25 +01:00
Laurent Destailleur
85e93872b3 Fix: javascript calculation of unit price from margin rate was broken. 2014-02-16 19:42:43 +01:00
Laurent Destailleur
3aba53a9ae Fix: javascript calculation of unit price from margin rate was broken. 2014-02-16 19:26:41 +01:00
Laurent Destailleur
b081083a1a Fix: Bad management of date.
Fix: Submit button was not visible making not possible to filter on
date.
Fix: Use standard css style instead of hardcoded css.
2014-02-16 17:07:17 +01:00
Laurent Destailleur
46d1181aed Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-02-15 15:23:42 +01:00
Laurent Destailleur
295f0fd9e7 Makepack is for version 3.5 2014-02-15 15:23:21 +01:00
Laurent Destailleur
7e2027ec39 Fix: Can not set delay to zero. 2014-02-14 13:05:49 +01:00
Laurent Destailleur
4b8d39af9d Fix: Do not report trigger errors twice.
Fix: Error when creating event was not reported.

Conflicts:
	htdocs/comm/action/fiche.php
2014-02-14 13:05:04 +01:00
Laurent Destailleur
b499efeccf Merge remote-tracking branch 'origin/3.4' into 3.5
Conflicts:
	htdocs/compta/sociales/index.php
	htdocs/compta/tva/index.php
2014-02-12 22:29:56 +01:00
Laurent Destailleur
7d74d0d3bd CFix: The order field for prospect level was not visible making
dictionnary useless.
2014-02-12 22:28:16 +01:00
Laurent Destailleur
ccab2b7af4 Fix: Must use "null" for value when finished is not defined but not when
finished is "0".
2014-02-12 19:00:06 +01:00
Laurent Destailleur
5501809844 Fix: sql compare on int must not contains quotes. 2014-02-12 18:47:16 +01:00
Laurent Destailleur
cd44548867 Merge pull request #1414 from atm-alexis/3.5
In certain case, holiday_users won't be update (1 delete, 1 add for ex)
2014-02-12 18:39:56 +01:00
Laurent Destailleur
191ff05873 Fix: W3C. 2014-02-12 18:36:49 +01:00
Laurent Destailleur
2e7631fa78 Fix: translation 2014-02-12 15:17:33 +01:00
Laurent Destailleur
266b413139 Fix: colspan for extrafields 2014-02-12 00:23:15 +01:00
Laurent Destailleur
2d6b5e377c Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-02-12 00:02:16 +01:00
Laurent Destailleur
4869b95601 Fix: Default size too long making screen hang. 2014-02-12 00:01:22 +01:00
Laurent Destailleur
e62b6c1cc4 Fix: Not using correct vars names 2014-02-11 15:43:05 +01:00
Alexis Algoud
d8e5fd20d2 In certain case, holiday_users won't be update (1 delete, 1 add for ex)
Add a fonction for count the real number of user without CP
2014-02-10 09:39:26 +01:00
Laurent Destailleur
213a64edcc Fix for missing param. 2014-02-10 01:36:15 +01:00
Laurent Destailleur
94be4ec897 Fix: Avoid error in migration from 3.1 version.
Fix: Suggested migration choice was ko from x.y.z to x.y.z+1
2014-02-08 14:55:27 +01:00
Laurent Destailleur
6a84a7f935 Prepare version 3.5.1 2014-02-08 13:56:28 +01:00
Laurent Destailleur
b94f7a6a6d Fix some amount were missing local version. 2014-02-08 03:51:30 +01:00
Laurent Destailleur
fdfb7f1a8a Fix: Be sure there is no duplicate default rib. 2014-02-08 03:24:48 +01:00
Laurent Destailleur
5b89bc18f5 [ bug #1231 ] PDF always generated in interventions 2014-02-08 02:46:05 +01:00
Laurent Destailleur
aad7885bca Fix: [bug #1226 ] page ne se charge pas quand beaucoup de prospect en
base
2014-02-08 02:35:59 +01:00
Laurent Destailleur
b750e98d40 Fix: Pb of file upload and download. 2014-02-08 02:02:01 +01:00
Laurent Destailleur
abc8649e02 Fix: Bug of import of agenda when using https link 2014-02-08 01:16:20 +01:00
Laurent Destailleur
319b13dafb Fix: Field nature is not correctly filled. 2014-02-08 01:02:09 +01:00
Laurent Destailleur
b714347b6b Fix: Substition of extra field was ko for order. 2014-02-08 01:01:31 +01:00
Laurent Destailleur
fb789b8197 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2014-02-08 00:40:51 +01:00
Laurent Destailleur
56a36ba9c4 Fix: bad translation of date format for pt_BR 2014-02-08 00:36:38 +01:00
Laurent Destailleur
9e06f185c5 Fix: Fix problem of invalid paypal link with \n. 2014-02-06 18:19:49 +01:00
Laurent Destailleur
c9b1c562cc Merge branch '3.5' of https://github.com/Dolibarr/dolibarr.git into 3.5 2014-02-06 16:58:53 +01:00
Laurent Destailleur
9166dc2d8c Fix: priority is a field smallint. 2014-02-06 16:57:45 +01:00
Laurent Destailleur
255a1f6497 Fix: String translated twice 2014-02-05 20:57:43 +01:00
Laurent Destailleur
db006dcdf8 Fix: Missing lang->load 2014-02-05 12:52:00 +01:00
Laurent Destailleur
e3ac9db9ec Fix: Data was encode twice making bad translation for language with
special chars.
2014-02-05 12:11:39 +01:00
unknown
a6a26ec313 Fixed: Write note into field "note_private" in llx_facture ("note" deprecated) 2014-02-05 02:03:09 +01:00
Laurent Destailleur
e8dc517cba Merge pull request #1410 from aternatik/fix_ws_user
Fix user webservice
2014-02-04 16:49:17 -08:00
Laurent Destailleur
f8a68b0449 Fix: Missing translation 2014-02-04 20:57:22 +01:00
Laurent Destailleur
0da1a64335 Fix: Missing vars and bar id. 2014-02-04 20:41:23 +01:00
jfefe
1ae87887fb Fix into user webservices : better error management and country detection
- Avoid errors when creating an user with thirdparty
- Add country detection in webservices when country_code is filled
2014-02-04 18:03:22 +01:00
Laurent Destailleur
408a028320 Fix: Must return a string 2014-02-03 20:07:25 +01:00
Laurent Destailleur
2b2d764180 Fix: ref and date of supplier invoice.
Fix: Check on bank account
2014-02-03 17:30:35 +01:00
Laurent Destailleur
9aaafde6d5 Fix: Pb with cache files for graphical boxes:
Missing year into cache id.
User with restrcited permission on thirdparty must not share same cache
files that "see all" users.
2014-01-31 18:48:57 +01:00
405 changed files with 5119 additions and 2614 deletions

125
ChangeLog
View File

@@ -2,6 +2,129 @@
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: 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.
Fix: Write note in invoice when using pos module.
Fix: Link to paypal was invalid into email text.
Fix: ref and date of supplier invoice.
Fix: Check on bank account.
Fix: Problem with file upload and download.
Fix: Page load not ending when large number of thirdparies. We
added option MAIN_DISABLE_AJAX_COMBOX to disable javascript
combo feature that is root cause of problem.
Fix: [ bug #1231 ] PDF always generated in interventions
Fix: Be sure there is no duplicate default rib.
Fix: Enable extrafields for customer order, proposal and invoice lines. This feature
was developed for 3.5 but was disabled (hidden) because of a bug not possible to
fix enough quickly for 3.5.0 release.
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: [ 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: [ 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.
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:
- New: Add hidden option BANK_DISABLE_DIRECT_INPUT.
@@ -146,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).

View File

@@ -1,3 +1,24 @@
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) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 7 Feb 2014 12:00:00 +0100
dolibarr (3.5.0-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]

View File

@@ -2,11 +2,11 @@ Source: dolibarr
Section: web
Priority: optional
Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
# Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net> # Only if differs from Maintainer
Standards-Version: 3.9.4
Homepage: http://www.dolibarr.org
Build-Depends: debhelper (>= 9), po-debconf, dpatch
Comments: This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
Build-Depends: debhelper (>= 9), po-debconf
# 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,
@@ -30,7 +30,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
${perl:Depends}
Recommends: mysql-client, apache2 | lighttpd | httpd
Suggests: www-browser
Description: Web based software to manage a small company or foundation
Description: Web based software to manage a company or foundation
Dolibarr ERP & CRM is an easy to use open source/free software for small
and medium companies, foundations or freelances. It includes different
features for Enterprise Resource Planning (ERP) and Customer Relationship

View File

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

View File

@@ -1 +0,0 @@
install.dpatch

View File

@@ -0,0 +1 @@
use-etc-dolibarr-conf.patch

View File

@@ -1,17 +1,17 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## install.patch by <eldy@users.sourceforge.net>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Updates htdocs/filefunc.inc.php
## DP: Updates htdocs/install/inc.php
## DP: Updates htdocs/support/inc.php
@DPATCH@
--- old/htdocs/filefunc.inc.php 2011-09-03 02:32:48.666952000 +0200
+++ new/htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200
@@ -63,8 +63,8 @@
Description: Enable /etc/dolibarr/conf.php so that we use packaged libraries
Update some PHP include files to refer to /etc/dolibarr/conf.php
instead of the in-tree conf/conf.php.
.
/etc/dolibarr/conf.php configures Dolibarr to use packaged libraries
instead of the embedded ones.
Author: Laurent Destailleur <eldy@users.sourceforge.net>
Forwarded: not-needed
Last-Update: 2013-07-29
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -63,8 +63,8 @@ $conffiletoshowshort = "conf.php";
$conffile = "conf/conf.php";
$conffiletoshow = "htdocs/conf/conf.php";
// For debian/redhat like systems
@@ -22,9 +22,9 @@
// Include configuration
--- old/htdocs/install/inc.php 2011-09-03 02:33:26.450952000 +0200
+++ new/htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200
@@ -71,8 +71,8 @@
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -73,8 +73,8 @@ $conffiletoshowshort = "conf.php";
$conffile = "../conf/conf.php";
$conffiletoshow = "htdocs/conf/conf.php";
// For debian/redhat like systems
@@ -35,9 +35,9 @@
if (! defined('DONOTLOADCONF') && file_exists($conffile))
--- old/htdocs/support/inc.php 2011-09-03 02:34:39.606952000 +0200
+++ new/htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200
@@ -69,8 +69,8 @@
--- a/htdocs/support/inc.php
+++ b/htdocs/support/inc.php
@@ -69,8 +69,8 @@ $conffiletoshowshort = "conf.php";
$conffile = "../conf/conf.php";
$conffiletoshow = "htdocs/conf/conf.php";
// For debian/redhat like systems

View File

@@ -7,29 +7,11 @@ export DH_OPTIONS=-v
#export DH_COMPAT=7 # This is the debhelper compatability version to use, now defined into compat file
# use dpatch
include /usr/share/dpatch/dpatch.make
configure:
dh $@
build: patch
dh $@
build-arch: patch
dh $@
build-indep: patch
dh $@
binary:
dh $@
binary-indep:
%:
dh $@
clean:
override_dh_install:
dh_install
# Delete files
rm -f .buildpath
rm -fr .cache
@@ -119,7 +101,16 @@ clean:
rm -f htdocs/includes/phpexcel/license.txt
rm -f htdocs/includes/tcpdf/LICENSE.TXT
dh $@
# Drop unwanted executable permissions
find debian/dolibarr/usr/share/dolibarr/htdocs -type f -print0 | \
xargs -0 chmod 644
# Add missing executable permissions
find debian/dolibarr/usr/share/dolibarr/scripts -type f -name '*.php' -print0 | \
xargs -0 chmod 755
binary-arch:
override_dh_fixperms:
dh_fixperms
# Give rights to the webserver on the upload directory
chown www-data:www-data debian/dolibarr/var/lib/dolibarr/documents
chmod 2775 debian/dolibarr/var/lib/dolibarr/documents

View File

@@ -1 +1 @@
3.0 (native)
3.0 (quilt)

View File

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

View File

@@ -17,9 +17,9 @@
; ----- Change this -----
AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
AppVerName=DoliWamp-3.5.0
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.0
OutputBaseFilename=DoliWamp-3.5.3
; ----- End of change
;OutputManifestFile=build\doliwampbuild.log
; Define full path from which all relative path are defined

View File

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

View File

@@ -16,14 +16,13 @@
use Cwd;
$PROJECT="dolibarr";
$MAJOR="3";
$MINOR="5";
$BUILD="0"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$RPMSUBVERSION="auto"; # auto use value found into BUILD
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=(
"SF"=>"git ssh rsync"
);
%REQUIREMENTTARGET=( # Tool requirement for each package
"SNAPSHOT"=>"tar",
"TGZ"=>"tar",
"ZIP"=>"7z",
"XZ"=>"xz",
@@ -31,24 +30,16 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD
"RPM_FEDORA"=>"rpmbuild",
"RPM_MANDRIVA"=>"rpmbuild",
"RPM_OPENSUSE"=>"rpmbuild",
"DEB"=>"dpkg dpatch",
"DEB"=>"dpkg",
"APS"=>"zip",
"EXEDOLIWAMP"=>"ISCC.exe"
"EXEDOLIWAMP"=>"ISCC.exe",
"SNAPSHOT"=>"tar"
);
%ALTERNATEPATH=(
"7z"=>"7-ZIP",
"makensis.exe"=>"NSIS"
);
$FILENAME="$PROJECT";
$FILENAMESNAPSHOT="$PROJECT-snapshot";
$FILENAMETGZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEXZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION";
$FILENAMEDEB="see later";
$FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app";
$FILENAMEEXEDOLIWAMP="DoliWamp-$MAJOR.$MINOR.$BUILD";
if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse
if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
@@ -67,6 +58,7 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
$SOURCE="$DIR/..";
$DESTI="$SOURCE/build";
$PUBLISH="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
{
print "Error: Missing environment variables.\n";
@@ -120,7 +112,57 @@ if (! $TEMP || ! -d $TEMP) {
$BUILDROOT="$TEMP/buildroot";
my $copyalreadydone=0; # Use "-" before number of choice to avoid copy
# Get version $MAJOR, $MINOR and $BUILD
$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
while (<IN>) {
if ( $_ =~ /define\('DOL_VERSION','([\d\.]+)'\)/ ) { $PROJVERSION = $1; break; }
}
close IN;
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/filefunc.inc.php"; }
# Set vars for packaging
$FILENAME = "$PROJECT";
$FILENAMESNAPSHOT = "$PROJECT-snapshot";
$FILENAMETGZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEZIP = "$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEXZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEDEB = "see later";
$FILENAMEAPS = "$PROJECT-$MAJOR.$MINOR.$BUILD.app";
$FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD";
# For RPM
$ARCH='noarch';
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev (fedora)
$newbuild =~ s/beta/0.2.beta1/gi; # beta (fedora)
$newbuild =~ s/rc./0.3.rc1/gi; # rc (fedora)
if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale (fedora)
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
#$newbuild =~ s/beta/1/gi; # beta
#$newbuild =~ s/rc./2/gi; # rc
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
$FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm";
# For Deb
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/1/gi; # dev
$newbuild =~ s/beta/2/gi; # beta
$newbuild =~ s/rc./3/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc.
# now newbuild is 0-1 or 0-3 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
$build = $newbuild;
$build =~ s/-.*$//g;
# now build is 0 for example
# $build .= '+nmu1';
# now build is 0+nmu1 for example
$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
my $copyalreadydone=0;
my $batch=0;
for (0..@ARGV-1) {
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
@@ -130,41 +172,47 @@ for (0..@ARGV-1) {
$FILENAMESNAPSHOT.="-".$PREFIX;
}
}
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTISTABLE is defined
if ($ENV{"PUBLISHBETARC"} && $BUILD =~ /[a-z]/i) { $PUBLISH = $ENV{"PUBLISHBETARC"}; } # Force target site for publishing if env PUBLISHBETARC is defined
if ($ENV{"PUBLISHSTABLE"} && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $ENV{"PUBLISHSTABLE"}; } # Force target site for publishing if env PUBLISHSTABLE is defined
print "Makepack version $VERSION\n";
print "Building package name: $PROJECT\n";
print "Building package version: $MAJOR.$MINOR.$BUILD\n";
print "Building/publishing package name: $PROJECT\n";
print "Building/publishing package version: $MAJOR.$MINOR.$BUILD\n";
print "Source directory (SOURCE): $SOURCE\n";
print "Target directory (DESTI) : $DESTI\n";
print "Publishing target (PUBLISH): $PUBLISH\n";
# Choose package targets
#-----------------------
if ($target) {
$CHOOSEDTARGET{uc($target)}=1;
if ($target eq "ALL") {
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
}
}
if ($target ne "ALL" && $target ne "SF") { $CHOOSEDTARGET{uc($target)}=1; }
if ($target eq "SF") { $CHOOSEDPUBLISH{"SF"}=1; }
}
else {
my $found=0;
my $NUM_SCRIPT;
my $cpt=0;
while (! $found) {
my $cpt=0;
printf(" %2d - %-12s (%s)\n",$cpt,"All (Except SNAPSHOT)","Need ".join(",",values %REQUIREMENTTARGET));
printf(" %2d - %-12s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET));
foreach my $target (@LISTETARGET) {
$cpt++;
printf(" %2d - %-12s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
}
$cpt=99;
printf(" %2d - %-12s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
# On demande de choisir le fichier à passer
# Ask which target to build
print "Choose one package number or several separated with space (0 - ".$cpt."): ";
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
if ($NUM_SCRIPT =~ s/-//g) {
# Do not do copy
$copyalreadydone=1;
}
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
{
print "This is not a valid package number list.\n";
@@ -176,15 +224,20 @@ else {
}
}
print "\n";
if ($NUM_SCRIPT) {
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
}
if ($NUM_SCRIPT eq "99") {
$CHOOSEDPUBLISH{"SF"}=1;
}
else {
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT') { $CHOOSEDTARGET{$key}=1; }
}
if ($NUM_SCRIPT eq "0") {
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
}
}
else {
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
}
}
}
}
@@ -201,7 +254,8 @@ foreach my $target (keys %CHOOSEDTARGET) {
}
$atleastonerpm=1;
}
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
{
# Test
print "Test requirement for target $target: Search '$req'... ";
$newreq=$req; $newparam='';
@@ -236,16 +290,20 @@ print "\n";
#----------------------------------------------
$nboftargetok=0;
$nboftargetneedbuildroot=0;
$nboftargetneedcvs=0;
$nbofpublishneedtag=0;
foreach my $target (keys %CHOOSEDTARGET) {
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
{
$nboftargetneedbuildroot++;
}
if ($target eq 'SNAPSHOT')
$nboftargetok++;
}
foreach my $target (keys %CHOOSEDPUBLISH) {
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
if ($target eq 'SF')
{
$nboftargetneedcvs++;
$nbofpublishneedtag++;
}
$nboftargetok++;
}
@@ -254,13 +312,26 @@ if ($nboftargetok) {
# Update CVS if required
#-----------------------
if ($nboftargetneedcvs)
if ($nbofpublishneedtag)
{
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
print "Run cvs update -P -d\n";
$ret=`cvs update -P -d 2>&1`;
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /already exists/)
{
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
$QUESTIONOVERWRITETAG=<STDIN>;
chomp($QUESTIONOVERWRITETAG);
if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
{
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
}
}
print 'Run git push --tags'."\n";
$ret=`git push --tags`;
chdir("$olddir");
}
@@ -278,17 +349,20 @@ 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"`;
}
print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.git`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitmodules`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`;
@@ -319,6 +393,8 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`;
@@ -357,6 +433,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
@@ -365,11 +442,12 @@ 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`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
@@ -379,7 +457,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
}
# Build package for each target
#------------------------------
foreach my $target (keys %CHOOSEDTARGET)
@@ -402,7 +480,6 @@ if ($nboftargetok) {
$ret=`$cmd`;
print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
#$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
$cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.xz --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
print $cmd."\n";
$ret=`$cmd`;
@@ -428,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;
}
@@ -455,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";
@@ -486,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";
@@ -512,30 +597,15 @@ if ($nboftargetok) {
mkdir($DESTI.'/'.$subdir);
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
$ARCH='noarch';
if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
$newbuild = $BUILD;
# For fedora
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev
$newbuild =~ s/beta/0.2.beta1/gi; # beta
$newbuild =~ s/rc./0.3.rc1/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
#$newbuild =~ s/beta/1/gi; # beta
#$newbuild =~ s/rc./2/gi; # rc
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
#print "newbuild=".$newbuild."\n";exit;
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
#print "Create directory $RPMDIR\n";
#$ret=`mkdir -p "$RPMDIR"`;
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n";
unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm");
print "Remove target ".$FILENAMERPM."...\n";
unlink("$NEWDESTI/".$FILENAMERPM);
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm");
@@ -546,8 +616,8 @@ if ($nboftargetok) {
$ret=`$cmd`;
# Set owners
print "Set owners on files/dir\n";
$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
#print "Set owners on files/dir\n";
#$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
print "Set permissions on files/dir\n";
$ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
@@ -590,11 +660,9 @@ if ($nboftargetok) {
# Move to final dir
print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm\n";
#$cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\"";
$cmd="mv $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm \"$NEWDESTI/\"";
$ret=`$cmd`;
print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm\n";
#$cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\"";
$cmd="mv $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm \"$NEWDESTI/\"";
$ret=`$cmd`;
print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n";
@@ -611,21 +679,6 @@ if ($nboftargetok) {
$olddir=getcwd();
$newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/1/gi; # dev
$newbuild =~ s/beta/2/gi; # beta
$newbuild =~ s/rc./3/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc
# now newbuild is 0-1 or 0-3 for example
print "Version is $MAJOR.$MINOR.$newbuild\n";
$build = $newbuild;
$build =~ s/-.*$//g;
# now build is 0 for example
# $build .= '+nmu1';
# now build is 0+nmu1 for example
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
print "Remove target ${FILENAMEDEB}_all.deb...\n";
unlink("$NEWDESTI/${FILENAMEDEB}_all.deb");
print "Remove target ${FILENAMEDEB}.dsc...\n";
@@ -634,6 +687,8 @@ if ($nboftargetok) {
unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz");
print "Remove target ${FILENAMEDEB}.changes...\n";
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
$ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`;
@@ -670,7 +725,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/wash`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/watch`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`;
@@ -679,12 +734,6 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`;
# We remove embedded libraries or fonts (this is also inside rules file, target clean)
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`;
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`,
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`;
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`;
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`;
# Rename upstream changelog to match debian rules
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
@@ -704,6 +753,7 @@ if ($nboftargetok) {
$ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/README.source" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/watch" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -fr "$SOURCE/build/debian/source" "$BUILDROOT/$PROJECT.tmp/debian"`;
@@ -718,8 +768,9 @@ if ($nboftargetok) {
$ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
# Set owners and permissions
print "Set owners on files/dir\n";
$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
#print "Set owners on files/dir\n";
#$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
print "Set permissions on files/dir\n";
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`;
$cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
@@ -748,6 +799,16 @@ if ($nboftargetok) {
$cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
$ret=`$cmd`;
print "Go into directory $BUILDROOT\n";
chdir("$BUILDROOT");
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
print $cmd."\n";
$ret=`$cmd`;
# Creation of source package
print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
@@ -759,13 +820,14 @@ if ($nboftargetok) {
chdir("$olddir");
print "You can check package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
# Move to final dir
print "Move *_all.deb to $NEWDESTI\n";
print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n";
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
next;
}
@@ -880,6 +942,81 @@ if ($nboftargetok) {
next;
}
}
# Build package for each target
#------------------------------
foreach my $target (keys %CHOOSEDPUBLISH)
{
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
print "\nList of files to publish\n";
%filestoscan=(
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
);
foreach my $file (sort keys %filestoscan)
{
$found=0;
my $filesize = -s $file;
print $file." ".($filesize?"(found)":"(not found)");
print ($filesize?" - ".$filesize:"");
print "\n";
}
if ($target eq 'SF')
{
print "\n";
$NEWPUBLISH=$PUBLISH;
print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
# Ask which target to build
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
$ret=`mkdir -p "/tmp/emptydir/"`;
foreach my $file (sort keys %filestoscan)
{
$found=0;
my $filesize = -s $file;
if (! $filesize) { next; }
print "\n";
print "Publish file ".$file." to ".$filestoscan{$file}."\n";
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
# mkdir
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
#$ssh->login("$user","$pass");
#use String::ShellQuote qw( shell_quote );
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
#use Net::SFTP::Foreign;
#my $sftp = Net::SFTP::Foreign->new($ip, user => $user, password => $pass, autodie => 1);
#$sftp->mkdir($destFolder)
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
#print "$command\n";
#my $ret=`$command 2>&1`;
$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
print "$command\n";
my $ret=`$command 2>&1`;
$command="rsync -s $OPTIONUPDATEDIST -e 'ssh' \"$file\" \"".$destFolder."\"";
print "$command\n";
my $ret=`$command 2>&1`;
print "$ret\n";
}
}
}
}
print "\n----- Summary -----\n";

View File

@@ -2,7 +2,7 @@
#----------------------------------------------------------------------------
# \file build/makepack-dolibarrmodule.pl
# \brief Package builder (tgz, zip, rpm, deb, exe)
# \author (c)2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
# \author (c)2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
#----------------------------------------------------------------------------
use Cwd;
@@ -20,8 +20,8 @@ $GROUP="ldestailleur";
use vars qw/ $REVISION $VERSION /;
$REVISION='1.20';
$VERSION="1.0 (build $REVISION)";
$REVISION='1.0';
$VERSION="3.5 (build $REVISION)";
@@ -245,18 +245,30 @@ foreach my $PROJECT (@PROJECTLIST) {
if (! $result) { die "Error: Can't open conf file makepack-".$PROJECT.".conf for reading.\n"; }
while(<IN>)
{
if ($_ =~ /^#/) { next; } # Do not process comments
$entry=$_;
if ($entry =~ /^#/) { next; } # Do not process comments
$_ =~ s/\n//;
$_ =~ /^(.*)\/[^\/]+/;
$entry =~ s/\n//;
if ($entry =~ /^!(.*)$/) # Exclude so remove file/dir
{
print "Remove $BUILDROOT/$PROJECTLC/$1\n";
$ret=`rm -fr "$BUILDROOT/$PROJECTLC/"$1`;
if ($? != 0) { die "Failed to delete a file to exclude declared into makepack-".$PROJECT.".conf file (Fails on line ".$entry.")\n"; }
next;
}
$entry =~ /^(.*)\/[^\/]+/;
print "Create directory $BUILDROOT/$PROJECTLC/$1\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECTLC/$1"`;
if ($_ !~ /version\-/)
if ($entry !~ /version\-/)
{
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECTLC/$_\n";
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECTLC/$_"`;
if ($? != 0) { die "Failed to make copy of a file declared into makepack-".$PROJECT.".conf file (Fails on line ".$_.")\n"; }
print "Copy $SOURCE/$entry into $BUILDROOT/$PROJECTLC/$entry\n";
$ret=`cp -pr "$SOURCE/$entry" "$BUILDROOT/$PROJECTLC/$entry"`;
if ($? != 0) { die "Failed to make copy of a file declared into makepack-".$PROJECT.".conf file (Fails on line ".$entry.")\n"; }
}
}
close IN;

View File

@@ -10,7 +10,6 @@ beta version of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in /ChangeLog
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
- Update version number with x.y.z-w in build/makepack-dolibarr.pl
- Update version number with x.y.z-w in build/debian/changelog
- Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z-w in build/rpm/*.spec
@@ -21,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
@@ -34,21 +34,20 @@ complete release of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in ChangeLog
- Update version number with x.y.z in htdocs/filefunc.inc.php
- Update version number with x.y.z in build/makepack-dolibarr.pl
- 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)

View File

@@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
return ( "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

View File

@@ -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,5 +331,14 @@ 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
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)

View File

@@ -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,5 +567,14 @@ 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
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)

View File

@@ -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,5 +336,14 @@ 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
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)

View File

@@ -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,5 +347,14 @@ 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
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
- Initial version (#723326)

View File

@@ -1,3 +1,6 @@
*~
.#*
Thumbs.db
build/exe
build/html
dev/dbmodel
@@ -7,58 +10,10 @@ dev/initdata
dev/iso-normes
dev/licence
dev/load
dev/skeletons/*socpeople*
dev/spec
dev/test
dev/uml
dev/xdebug
doc/dev/dolibarr-phpdoc
doc/dev/barcode
doc/dev/compta
doc/dev/dbmodel
doc/dev/normes
doc/dev/html
doc/dev/iso-normes
doc/flyer
doc/font
doc/rollup
doc/tshirts
doc/wiki
document
documents
htdocs/conf/conf.php
htdocs/conf/conf.php.mysql
htdocs/conf/conf.php.old
htdocs/conf/conf.php.postgres
htdocs/avoir
htdocs/custom
htdocs/custom2
htdocs/customleave
htdocs/customgoogle
htdocs/document
htdocs/documents
htdocs/includes/fckeditor/_samples
htdocs/includes/fckeditor/_testcases
htdocs/includes/nusoap/samples
htdocs/includes/tcpdf/fonts/utils
htdocs/includes/tcpdf/fonts/free*.ctg.z
htdocs/includes/tcpdf/fonts/free*.z
mssql
test
CVS
*~
.#*
.buildpath
.cache
.cvsignore
.gitignore
.externalToolBuilders
.htaccess
.settings
.project
.travis.yml
Thumbs.db
data_dev.sql
doli*.tar.gz
doli*.tgz
doli*.exe
@@ -66,5 +21,4 @@ doli*.rpm
doli*.deb
doli*.zip
cvschangelogbuilder_dolibarr*
doxygen_warnings.log
dolibarr_install.log
dolibarr_install.log

View File

@@ -1,65 +1,19 @@
*/build
*~
*.#*
Thumbs.db
*/build/exe
*/build/html
*/dev/dbmodel/*
*/dev/fpdf/*
*/dev/initdemo/*
*/dev/initdata/*
*/dev/iso-normes/*
*/dev/licence/*
*/dev/load/*
*/dev/test/*
*/dev/uml/*
*/dev/xdebug/*
*/doc/dev/dolibarr-phpdoc/*
*/doc/dev/barcode/*
*/doc/dev/compta/*
*/doc/dev/dbmodel/*
*/doc/dev/normes/*
*/doc/dev/html/*
*/doc/dev/iso-normes/*
*/doc/flyer/*
*/doc/font/*
*/doc/rollup/*
*/doc/tshirt/*
*/doc/wiki/*
*/document/*
*/documents/*
*/htdocs/avoir/*
*/htdocs/conf/conf.php
*/htdocs/conf/conf.php.mysql
*/htdocs/conf/conf.php.old
*/htdocs/conf/conf.php.postgres
*/htdocs/custom/*
*/htdocs/custom2/*
*/htdocs/document/*
*/htdocs/documents/*
*/htdocs/includes/ckeditor/_source
*/htdocs/includes/ckeditor/*_source.js
*/htdocs/includes/fckeditor/_samples/*
*/htdocs/includes/fckeditor/_testcases/*
*/htdocs/includes/nusoap/samples/*
*/htdocs/includes/phplot5/doc/*
*/htdocs/includes/phplot5/examples/*
*/htdocs/includes/scriptaculous/test/*
*/htdocs/includes/treemenu/docs/*
*/htdocs/includes/treemenu/images/*
*/htdocs/includes/treemenu/imagesAlt/*
*/htdocs/includes/treemenu/imagesAlt2/*
*/htdocs/includes/tcpdf/fonts/utils/*
*/htdocs/includes/tcpdf/fonts/free*.ctg.z
*/htdocs/includes/tcpdf/fonts/free*.z
*/test
*/CVS/*
*~
*.#*
*.buildpath*
*.cache*
*.cvsignore*
*.gitignore*
*.htaccess*
*.settings*
*.project*
*.travis.yml*
Thumbs.db
data_dev.sql
dolibarr*.tar.gz
dolibarr*.tgz
dolibarr*.exe
@@ -67,5 +21,4 @@ dolibarr*.rpm
dolibarr*.deb
dolibarr*.zip
cvschangelogbuilder_dolibarr*
doxygen_warnings.log
dolibarr_install.log
dolibarr_install.log

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

View File

@@ -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,12 +63,12 @@ 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='';
if (! empty($src) && ! preg_match('/^(http\s*|ftp\s*):/', $src))
if (! empty($src) && ! dol_is_url($src))
{
setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors');
$error++;
@@ -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);

View File

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

View File

@@ -107,7 +107,7 @@ if ($action == 'update')
{
foreach($delays as $delay)
{
if (GETPOST($delay['code']))
if (GETPOST($delay['code']) != '')
{
dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity);
}

View File

@@ -145,7 +145,7 @@ $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_fac
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
$tabsql[18]= "SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
@@ -201,7 +201,7 @@ $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfield[13]= "code,libelle,type";
$tabfield[14]= "code,libelle,price,organization,country_id,country";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle";
$tabfield[16]= "code,libelle,sortorder";
$tabfield[17]= "code,libelle";
$tabfield[18]= "code,libelle,tracking";
$tabfield[19]= "code,libelle";
@@ -229,7 +229,7 @@ $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldvalue[13]= "code,libelle,type";
$tabfieldvalue[14]= "code,libelle,price,organization,country";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle";
$tabfieldvalue[16]= "code,libelle,sortorder";
$tabfieldvalue[17]= "code,libelle";
$tabfieldvalue[18]= "code,libelle,tracking";
$tabfieldvalue[19]= "code,libelle";
@@ -257,7 +257,7 @@ $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldinsert[13]= "code,libelle,type";
$tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label";
$tabfieldinsert[16]= "code,label,sortorder";
$tabfieldinsert[17]= "code,libelle";
$tabfieldinsert[18]= "code,libelle,tracking";
$tabfieldinsert[19]= "code,libelle";
@@ -440,6 +440,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors');
}
@@ -521,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
{
@@ -767,6 +766,7 @@ if ($id)
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
if ($valuetoshow != '')
{
print '<td align="'.$align.'">';
@@ -881,10 +881,11 @@ if ($id)
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
// Affiche nom du champ
if ($showfield)
{

View File

@@ -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.'&amp;action=reset&amp;value=' . $modName . '&amp;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.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Disabled"),'switch_off');
print "</a></td>\n <td>&nbsp;</td>\n";
else if (! empty($objMod->disabled))
{
print $langs->trans("Disabled");
}
else
{
// Module non actif
print '<a href="modules.php?id='.$objMod->numero.'&amp;action=set&amp;value=' . $modName . '&amp;mode=' . $mode . '">';
print img_picto($langs->trans("Disabled"),'switch_off');
print "</a>\n";
}
print "</td>\n <td>&nbsp;</td>";
}
print "</tr>\n";

View File

@@ -165,12 +165,16 @@ print '<center><input type="submit" class="button" value="'.$langs->trans("Save"
print '</form>';
dol_fiche_end();
print '<br>';
/*
* Notifications
*/
/* Disable this, there is no trigger with elementtype 'withdraw'
if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
{
$langs->load("mails");
@@ -242,41 +246,43 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
print '</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
// List of current notifications for objet_type='withdraw'
$sql = "SELECT u.lastname, u.firstname,";
$sql.= " nd.rowid, ad.code, ad.label";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad";
$sql.= " WHERE u.rowid = nd.fk_user";
$sql.= " AND nd.fk_action = ad.rowid";
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var = false;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.dolGetFirstLastname($obj->firstname,$obj->lastname).'</td>';
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
print '<td>'.$label.'</td>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&amp;notif='.$obj->rowid.'">'.img_delete().'</a></td>';
print '</tr>';
$i++;
}
$db->free($resql);
}
print '</table>';
print '</form>';
}
// List of current notifications for objet_type='withdraw'
$sql = "SELECT u.lastname, u.firstname,";
$sql.= " nd.rowid, ad.code, ad.label";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad";
$sql.= " WHERE u.rowid = nd.fk_user";
$sql.= " AND nd.fk_action = ad.rowid";
$sql.= " AND u.entity IN (0,".$conf->entity.")";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var = false;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.dolGetFirstLastname($obj->firstname,$obj->lastname).'</td>';
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
print '<td>'.$label.'</td>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&amp;notif='.$obj->rowid.'">'.img_delete().'</a></td>';
print '</tr>';
$i++;
}
$db->free($resql);
}
print '</table>';
print '</form>';
*/
$db->close();

View File

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

View File

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

View File

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

View File

@@ -65,6 +65,21 @@ if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL &&
exit;
}
// If stock decrease on bill validation, check user has stock edit permissions
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! empty($username))
{
$testuser=new User($db);
$testuser->fetch(0,$username);
$testuser->getrights('stock');
if (empty($testuser->rights->stock->creer))
{
$retour=$langs->trans("UserNeedPermissionToEditStockToUsePos");
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid.'&bankid_cash='.$bankid_cash.'&bankid_cheque='.$bankid_cheque.'&bankid_cb='.$bankid_cb);
exit;
}
}
/*
if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) && empty($conf_fkaccount_cheque) && empty($conf_fkaccount_cb)))
{

View File

@@ -207,7 +207,7 @@ switch ($action)
$invoice->total_ht=$obj_facturation->prixTotalHt();
$invoice->total_tva=$obj_facturation->montantTva();
$invoice->total_ttc=$obj_facturation->prixTotalTtc();
$invoice->note=$note;
$invoice->note_private=$note;
$invoice->cond_reglement_id=$cond_reglement_id;
$invoice->mode_reglement_id=$mode_reglement_id;
//print "c=".$invoice->cond_reglement_id." m=".$invoice->mode_reglement_id; exit;

View File

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

View File

@@ -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.'&amp;type='.$type,$langs->trans("AddPhoto"),1);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;type='.$type, $langs->trans("AddPhoto"), 1, '', $user->rights->categorie->creer, 50, $object, '', false, '', 0);
}
// Affiche photos

View File

@@ -58,7 +58,7 @@ class ActionComm extends CommonObject
var $percentage; // Percentage
var $location; // Location
var $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events)
var $priority; // Free text ('' By default)
var $priority; // Small int (0 By default)
var $note; // Description
var $usertodo; // Object user that must do action
@@ -116,7 +116,7 @@ class ActionComm extends CommonObject
$this->location=dol_trunc(trim($this->location),128);
$this->note=dol_htmlcleanlastbr(trim($this->note));
if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority)) $this->priority = 0;
if (empty($this->priority) || ! is_numeric($this->priority)) $this->priority = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
if (empty($this->punctual)) $this->punctual = 0;
if (empty($this->transparency)) $this->transparency = 0;
@@ -438,7 +438,7 @@ class ActionComm extends CommonObject
$this->label=trim($this->label);
$this->note=trim($this->note);
if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority)) $this->priority = 0;
if (empty($this->priority) || ! is_numeric($this->priority)) $this->priority = 0;
if (empty($this->transparency)) $this->transparency = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
if ($this->percentage > 100) $this->percentage = 100;
@@ -1064,7 +1064,7 @@ class ActionComm extends CommonObject
$this->percentage=0;
$this->location='Location';
$this->transparency=0;
$this->priority='Priority X';
$this->priority=1;
$this->note = 'Note';
}

View File

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

View File

@@ -55,16 +55,16 @@ if ($user->societe_id > 0)
}
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
$act = new ActionComm($db);
$object = new ActionComm($db);
if ($objectid > 0)
{
$ret = $act->fetch($objectid);
$ret = $object->fetch($objectid);
if ($ret > 0) {
$company=new Societe($db);
$company->fetch($act->societe->id);
$act->societe=$company; // For backward compatibility
$act->thirdparty=$company;
$company->fetch($object->societe->id);
$object->societe=$company; // For backward compatibility
$object->thirdparty=$company;
}
}
@@ -79,6 +79,9 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart='contract';
/*
* Actions
@@ -96,17 +99,15 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url);
if ($act->id > 0)
if ($object->id > 0)
{
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
$author=new User($db);
$author->fetch($act->author->id);
$act->author=$author;
$author->fetch($object->author->id);
$object->author=$author;
if ($act->contact->id) $act->fetch_contact($act->contact->id);
if ($object->contact->id) $object->fetch_contact($object->contact->id);
$head=actions_prepare_head($act);
$head=actions_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu
@@ -116,53 +117,53 @@ if ($act->id > 0)
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';
// Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>';
// Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
else print dol_print_date($act->datep,'day');
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour');
else print dol_print_date($object->datep,'day');
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
@@ -170,43 +171,43 @@ if ($act->id > 0)
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
else print dol_print_date($act->datef,'day');
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour');
else print dol_print_date($object->datef,'day');
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
print $act->getLibStatut(4);
print $object->getLibStatut(4);
print '</td></tr>';
// Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->societe->id?$object->societe->getNomUrl(1):$langs->trans("None"));
if ($object->societe->id && $object->type_code == 'AC_TEL')
{
if ($act->societe->fetch($act->societe->id))
if ($object->societe->fetch($object->societe->id))
{
print "<br>".dol_print_phone($act->societe->phone);
print "<br>".dol_print_phone($object->societe->phone);
}
}
print '</td>';
print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
if ($act->contact->id > 0)
if ($object->contact->id > 0)
{
print $act->contact->getNomUrl(1);
if ($act->contact->id && $act->type_code == 'AC_TEL')
print $object->contact->getNomUrl(1);
if ($object->contact->id && $object->type_code == 'AC_TEL')
{
if ($act->contact->fetch($act->contact->id))
if ($object->contact->fetch($object->contact->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
print "<br>".dol_print_phone($object->contact->phone_pro);
}
}
}
@@ -221,10 +222,10 @@ if ($act->id > 0)
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)
if ($object->fk_project)
{
$project=new Project($db);
$project->fetch($act->fk_project);
$project->fetch($object->fk_project);
print $project->getNomUrl(1);
}
print '</td></tr>';
@@ -232,7 +233,7 @@ if ($act->id > 0)
// Priority
print '<tr><td class="nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
print ($act->priority?$act->priority:'');
print ($object->priority?$object->priority:'');
print '</td></tr>';
@@ -255,12 +256,12 @@ if ($act->id > 0)
$modulepart = 'actions';
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
$param = '&id=' . $act->id;
$param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
{
print $langs->trans("UnkownError");
print $langs->trans("ErrorUnknown");
}
$db->close();

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
@@ -116,14 +116,14 @@ if ($action == 'add_action')
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'</div>';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'</div>';
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label'))
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")).'</div>';
}
// Initialisation objet cactioncomm
@@ -131,7 +131,7 @@ if ($action == 'add_action')
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Type")).'</div>';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
}
else
{
@@ -167,8 +167,7 @@ if ($action == 'add_action')
$actioncomm->datep = $datep;
$actioncomm->datef = $datef;
$actioncomm->percentage = $percentage;
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
60;
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$usertodo=new User($db);
if ($_POST["affectedto"] > 0)
@@ -262,8 +261,8 @@ if ($action == 'add_action')
{
$db->rollback();
$langs->load("errors");
$error=$langs->trans($actioncomm->error);
setEventMessage($error,'errors');
if (! empty($actioncomm->error)) setEventMessage($langs->trans($actioncomm->error), 'errors');
if (count($actioncomm->errors)) setEventMessage($actioncomm->errors, 'errors');
$action = 'create';
}
}
@@ -539,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
@@ -864,7 +863,7 @@ if ($id > 0)
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $actioncomm->showOptionals($extrafields,'edit');
print $act->showOptionals($extrafields,'edit');
}

View File

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

View File

@@ -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>&nbsp;'.$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>';

View File

@@ -475,7 +475,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1">('.$num.')</td></tr>';
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD));
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);

View File

@@ -196,8 +196,8 @@ if ($result)
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre" width="1%">&nbsp;</td>';
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook

View File

@@ -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
@@ -637,7 +637,9 @@ else if ($action == "setabsolutediscount" && $user->rights->propal->creer)
else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->propal->creer)
{
// 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;
@@ -645,7 +647,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');
@@ -665,7 +669,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
//Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline,$predef);
//Unset extrafield
if (is_array($extralabelsline))
{
@@ -949,7 +953,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
}
// Define special_code for special lines
$special_code=0;
$special_code=GETPOST('special_code');
if (! GETPOST('qty')) $special_code=3;
// Check minimum price
@@ -1364,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
@@ -1403,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>';
@@ -1458,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
@@ -1529,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>';
@@ -1677,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>';

View File

@@ -1629,7 +1629,7 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <0 if KO, >0 if OK
*/
function reopen($user, $statut, $note, $notrigger=0)
function reopen($user, $statut, $note='', $notrigger=0)
{
global $langs,$conf;
@@ -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);
@@ -2732,10 +2732,10 @@ class PropaleLigne extends CommonObject
var $marge_tx;
var $marque_tx;
var $special_code; // Liste d'options non cumulabels:
var $special_code; // Tag for special lines (exlusive tags)
// 1: frais de port
// 2: ecotaxe
// 3: ??
// 3: option line (when qty = 0)
var $info_bits = 0; // Liste d'options cumulables:
// Bit 0: 0 si TVA normal - 1 si TVA NPR

View File

@@ -137,7 +137,7 @@ if ($object->id > 0)
}
else
{
print $langs->trans("UnkownError");
print $langs->trans("ErrorUnknown");
}
llxFooter();

View File

@@ -315,7 +315,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1">('.$num.')</a></td></tr>';
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD));
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);

View File

@@ -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"].'">';

View File

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

View File

@@ -568,10 +568,12 @@ 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'))
if (GETPOST('addline_libre')
|| (GETPOST('dp_desc') && ! GETPOST('addline_libre') && ! GETPOST('idprod', 'int')>0) // we push enter onto qty field
)
{
$predef='';
$idprod=0;
@@ -579,7 +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');
@@ -599,7 +603,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
//Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline,$predef);
//Unset extrafield
if (is_array($extralabelsline))
{
@@ -613,12 +617,12 @@ else if ($action == 'addline' && $user->rights->commande->creer)
if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && ($qty < 0))
{
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true;
$error++;
}
if (empty($idprod) && GETPOST('type') < 0)
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
$error = true;
$error++;
}
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
{
@@ -628,19 +632,19 @@ else if ($action == 'addline' && $user->rights->commande->creer)
if ($qty == '')
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
$error = true;
$error++;
}
if (empty($idprod) && empty($product_desc))
{
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
$error = true;
$error++;
}
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
@@ -859,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);
@@ -1878,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);
@@ -1898,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);
@@ -1929,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);
@@ -2484,7 +2488,7 @@ else
}
// Create bill and Classify billed
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
if ($object->statut > 0 && ! $object->billed)
{
if (! empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))

View File

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

View File

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

View File

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

View File

@@ -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);
/*

View File

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

View File

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

View File

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

View File

@@ -128,7 +128,7 @@ if ($object->id)
}
else
{
print $langs->trans("UnkownError");
print $langs->trans("ErrorUnknown");
}
llxFooter();

View File

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

View File

@@ -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();
}
}
@@ -900,10 +908,14 @@ else if ($action == 'add' && $user->rights->facture->creer)
{
$totalamount=0;
$lines = $srcobject->lines;
$numlines=count($lines);
for ($i=0; $i<$numlines; $i++)
{
$totalamount += $lines[$i]->total_ht;
$qualified=1;
if (empty($lines[$i]->qty)) $qualified=0; // We discard qty=0, it is an option
if (! empty($lines[$i]->special_code)) $qualified=0; // We discard special_code (frais port, ecotaxe, option, ...)
if ($qualified) $totalamount += $lines[$i]->total_ht;
}
if ($totalamount!=0)
@@ -963,7 +975,6 @@ else if ($action == 'add' && $user->rights->facture->creer)
$fk_parent_line=0;
$num=count($lines);
for ($i=0;$i<$num;$i++)
{
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
@@ -1129,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;
@@ -1137,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');
@@ -1145,7 +1160,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$price_ht = '';
$tva_tx = '';
}
if (GETPOST('usenewaddlineform')) {
if (GETPOST('usenewaddlineform')) { // TODO Remove this
$idprod=GETPOST('idprod', 'int');
$product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):'')));
$price_ht = GETPOST('price_ht');
@@ -1157,13 +1172,13 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
//Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline =$extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_option = $extrafieldsline->getOptionalsFromPost($extralabelsline,$predef);
//Unset extrafield
if (is_array($extralabelsline))
{
// Get extra fields
foreach ($extralabelsline as $key => $value) {
unset($_POST["options_".$key]);
unset($_POST["options_".$key.$predef]);
}
}
@@ -1324,8 +1339,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
}
// Margin
$fournprice=(GETPOST('fournprice'.$predef)?GETPOST('fournprice'.$predef):'');
$buyingprice=(GETPOST('buying_price'.$predef)?GETPOST('buying_price'.$predef):'');
$fournprice=price2num(GETPOST('fournprice'.$predef)?GETPOST('fournprice'.$predef):'');
$buyingprice=price2num(GETPOST('buying_price'.$predef)?GETPOST('buying_price'.$predef):'');
// Local Taxes
$localtax1_tx= get_localtax($tva_tx, 1, $object->client);
@@ -1446,8 +1461,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
$localtax2_rate=get_localtax($vat_rate,2,$object->client);
// Add buying price
$fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):'');
$fournprice=price2num(GETPOST('fournprice')?GETPOST('fournprice'):'');
$buyingprice=price2num(GETPOST('buying_price')?GETPOST('buying_price'):'');
//Extrafields
$extrafieldsline = new ExtraFields($db);
@@ -1840,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;
}
}
}
@@ -1977,9 +1996,10 @@ if ($action == 'update_extras')
}
/*
* View
*/
*/
$form = new Form($db);
$formother=new FormOther($db);
@@ -2182,6 +2202,7 @@ if ($action == 'create')
$options.='</option>';
}
// Show link for credit note
$facids=$facturestatic->list_qualified_avoir_invoices($soc->id);
if ($facids < 0)
{
@@ -2610,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);
@@ -2671,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"),
@@ -2714,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"),
@@ -3589,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
{
@@ -3676,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.'&amp;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.'&amp;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.'&amp;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.'&amp;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.'&amp;action=paid">'.$langs->trans('ClassifyPaid').'</a></div>';
}
@@ -3917,7 +3950,10 @@ else if ($id > 0 || ! empty($ref))
$formmail->frommail = $user->email;
$formmail->withfrom=1;
$liste=array();
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value)
{
$liste[$key]=$value;
}
$formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
$formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;

View File

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

View File

@@ -160,7 +160,7 @@ if ($id > 0 || ! empty($ref))
}
else
{
print $langs->trans("UnkownError");
print $langs->trans("ErrorUnknown");
}
$db->close();

View File

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

View File

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

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.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
@@ -209,7 +210,15 @@ class Paiement extends CommonObject
}
}
if ($invoice->type != 0 && $invoice->type != 1 && $invoice->type != 2) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note. We do nothing more.");
//Invoice types that are eligible for changing status to paid
$affected_types = array(
0,
1,
2,
3
);
if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice. We do nothing more.");
else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more.");
else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more.");
else $result=$invoice->set_paid($user,'','');

View File

@@ -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">&nbsp;</td>';
print "</tr>\n";
}
print "</table></td></tr>\n";
// }
// $db->free();
// }
// else
// {
// print $sql ."<br>".$db->error();
// }
/*
*
*/
print "</table>";

View File

@@ -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 == 1 || $agence == 1) $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 == 1 || $agence == 1) $sql.= " AND f.fk_soc = sr.rowid";
if ($banque == 1) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
if ($agence == 1) $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
* @param int $agence code of bank office (guichet)
* @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 == 1 || $agence ==1) $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 == 1 || $agence ==1) $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 == 1) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
if ($agence == 1) $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);
@@ -777,7 +779,7 @@ class BonPrelevement extends CommonObject
while ($i < $num)
{
$row = $this->db->fetch_row($resql);
$factures[$i] = $row;
$factures[$i] = $row; // All fields
$i++;
}
$this->db->free($resql);
@@ -802,10 +804,10 @@ class BonPrelevement extends CommonObject
if (count($factures) > 0)
{
foreach ($factures as $fac)
foreach ($factures as $key => $fac)
{
$fact = new Facture($this->db);
if ($fact->fetch($fac[0]) >= 0)
if ($fact->fetch($fac[0]) >= 0) // Field 0 of $fac is rowid of invoice
{
if ($soc->fetch($fact->socid) >= 0)
{
@@ -820,8 +822,8 @@ class BonPrelevement extends CommonObject
}
else
{
dol_syslog("Error on third party bank number RIB/IBAN ".$fact->socid." ".$soc->nom, LOG_ERR);
$facture_errors[$fac[0]]="Error on third party bank number RIB/IBAN ".$fact->socid." ".$soc->nom;
dol_syslog("Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->nom, LOG_ERR);
$facture_errors[$fac[0]]="Error on default bank number RIB/IBAN for thirdparty reported by function verif() ".$fact->socid." ".$soc->nom;
}
}
else

View File

@@ -58,9 +58,9 @@ if ($action == 'modify')
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"),'chaine',0,'',$conf->entity);
}
}
if ($action == 'create')
{
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
$bprev = new BonPrelevement($db);
$result=$bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET);
if ($result < 0)

View File

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

View File

@@ -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>&nbsp;</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>&nbsp;</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>&nbsp;".$langs->trans("Currency".$conf->currency)."</td>\n";
print '<td align="right">'.price($objp->amount)."</td><td>&nbsp;".$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>&nbsp;".$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();
/*

View File

@@ -167,7 +167,7 @@ if ($object->id)
}
else
{
print $langs->trans("UnkownError");
print $langs->trans("ErrorUnknown");
}

View File

@@ -27,12 +27,15 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
$langs->load("compta");
$langs->load("banks");
$langs->load("bills");
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');

View File

@@ -30,6 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("other");
$langs->load("compta");
$langs->load("banks");
$langs->load("bills");
$year=GETPOST("year","int");
if ($year == 0)

View File

@@ -569,7 +569,7 @@ class Contrat extends CommonObject
if ($line->statut == 0) $this->nbofserviceswait++;
if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
if ($line->statut == 4 && $line->date_fin_prevue < $now) $this->nbofservicesexpired++;
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
if ($line->statut == 5) $this->nbofservicesclosed++;
$total_ttc+=$objp->total_ttc; // TODO Not saved into database
@@ -654,7 +654,7 @@ class Contrat extends CommonObject
if ($line->statut == 0) $this->nbofserviceswait++;
if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
if ($line->statut == 4 && $line->date_fin_prevue < $now) $this->nbofservicesexpired++;
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
if ($line->statut == 5) $this->nbofservicesclosed++;
$this->lines[] = $line;
@@ -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];
@@ -1799,7 +1799,7 @@ class ContratLigne
*/
function getLibStatut($mode)
{
return $this->LibStatut($this->statut,$mode,(isset($this->date_fin_validite)?($this->date_fin_validite < dol_now()?1:0):-1));
return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1));
}
/**

View File

@@ -130,7 +130,7 @@ if ($object->id)
}
else
{
print $langs->trans("UnkownError");
print $langs->trans("ErrorUnknown");
}

View File

@@ -88,17 +88,24 @@ if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->
else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer)
{
$object->fetch($id);
$result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
$mesg=$object->error;
}
if (! GETPOST('dateend'))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors');
}
if (! $error)
{
$object->fetch($id);
$result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
$mesg=$object->error;
}
}
}
// Si ajout champ produit predefini
@@ -241,7 +248,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
for ($i=0;$i<$num;$i++)
{
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
if ($product_type == 1) { //only services // TODO Exclude also deee
// service prédéfini
if ($lines[$i]->fk_product > 0)
@@ -929,7 +936,7 @@ else
{
$result=$object->fetch($id,$ref);
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_lines();
$result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_thirdparty();
if ($result < 0) dol_print_error($db,$object->error);
@@ -1514,7 +1521,7 @@ else
if ($objp->statut == 4)
{
print $langs->trans("DateEndReal").' ';
$form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline");
$form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1);
}
}
print '</td>';

View File

@@ -117,8 +117,8 @@ if ($action == 'add')
if (! $error)
{
// Type et taille non encore pris en compte => varchar(255)
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
// attrname must be alphabetical and lower case only
if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname']))
{
// Construct array for parameter (value of select list)
$default_value = GETPOST('default_value');
@@ -159,7 +159,7 @@ if ($action == 'add')
{
$error++;
$langs->load("errors");
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode"));
$mesg=$langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters",$langs->transnoentities("AttributeCode"));
setEventMessage($mesg,'errors');
$action = 'create';
}

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-204 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
@@ -73,7 +73,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'";
$sql.= " ORDER BY z.zip, z.town";
$sql.= $db->plimit(50); // Avoid pb with bad criteria
$sql.= $db->plimit(100); // Avoid pb with bad criteria
}
else // Use table of third parties
{
@@ -87,7 +87,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
$sql.= " ORDER BY s.fk_pays, s.zip, s.town";
$sql.= $db->plimit(50); // Avoid pb with bad criteria
$sql.= $db->plimit(100); // Avoid pb with bad criteria
}
//print $sql;
@@ -97,8 +97,8 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
{
while ($row = $db->fetch_array($resql))
{
$country = $row['fk_country']?($langs->trans('Country'.$row['country_code'])!='Country'.$row['country_code']?$langs->trans('Country'.$row['country_code']):$row['country']):'';
$county = $row['fk_county']?($langs->trans($row['county_code'])!=$row['county_code']?$langs->trans($row['county_code']):($row['county']!='-'?$row['county']:'')):'';
$country = $row['fk_country']?($langs->transnoentitiesnoconv('Country'.$row['country_code'])!='Country'.$row['country_code']?$langs->transnoentitiesnoconv('Country'.$row['country_code']):$row['country']):'';
$county = $row['fk_county']?($langs->transnoentitiesnoconv($row['county_code'])!=$row['county_code']?$langs->transnoentitiesnoconv($row['county_code']):($row['county']!='-'?$row['county']:'')):'';
$row_array['label'] = $row['zip'].' '.$row['town'];
$row_array['label'] .= ($county || $country)?' (':'';

View File

@@ -81,6 +81,12 @@ class box_graph_invoices_permonth extends ModeleBoxes
'target'=>'none' // Set '' to get target="_blank"
);
$dir=''; // We don't need a path because image file will not be saved into disk
$prefix='';
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
if ($user->rights->facture->lire)
{
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
@@ -89,7 +95,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
if (GETPOST('DOL_AUTOSET_COOKIE'))
$autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray))
{
$endyear=GETPOST($param_year,'int');
$shownb=GETPOST($param_shownb,'alpha');
@@ -119,9 +126,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/invoicesnbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();
@@ -157,9 +164,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/invoicesamountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
$mesg = $px2->isGraphKo();

View File

@@ -80,6 +80,12 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
'target'=>'none' // Set '' to get target="_blank"
);
$dir=''; // We don't need a path because image file will not be saved into disk
$prefix='';
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
if ($user->rights->fournisseur->facture->lire)
{
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
@@ -88,7 +94,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
if (GETPOST('DOL_AUTOSET_COOKIE'))
$autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray))
{
$endyear=GETPOST($param_year,'int');
$shownb=GETPOST($param_shownb,'alpha');
@@ -118,7 +125,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/invoicessuppliernbinyear-".$year.".png";
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-'.$year.'.png';
@@ -156,7 +163,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/invoicessupplieramountinyear-".$year.".png";
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-'.$year.'.png';

View File

@@ -81,6 +81,12 @@ class box_graph_orders_permonth extends ModeleBoxes
'target'=>'none' // Set '' to get target="_blank"
);
$dir=''; // We don't need a path because image file will not be saved into disk
$prefix='';
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
if ($user->rights->commande->lire)
{
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
@@ -89,7 +95,8 @@ class box_graph_orders_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
if (GETPOST('DOL_AUTOSET_COOKIE'))
$autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray))
{
$endyear=GETPOST($param_year,'int');
$shownb=GETPOST($param_shownb,'alpha');
@@ -119,9 +126,9 @@ class box_graph_orders_permonth extends ModeleBoxes
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/ordersnbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersnbinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersnbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();
@@ -157,9 +164,9 @@ class box_graph_orders_permonth extends ModeleBoxes
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/ordersamountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersamountinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=ordersamountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
$mesg = $px2->isGraphKo();

View File

@@ -80,6 +80,12 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
'target'=>'none' // Set '' to get target="_blank"
);
$dir=''; // We don't need a path because image file will not be saved into disk
$prefix='';
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
if ($user->rights->fournisseur->commande->lire)
{
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
@@ -88,7 +94,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
if (GETPOST('DOL_AUTOSET_COOKIE'))
$autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray))
{
$endyear=GETPOST($param_year,'int');
$shownb=GETPOST($param_shownb,'alpha');
@@ -118,9 +125,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/orderssuppliernbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssuppliernbinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssuppliernbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();
@@ -156,9 +163,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$filenamenb = $dir."/orderssupplieramountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&amp;file=ordersamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&amp;file=orderssupplieramountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
$mesg = $px2->isGraphKo();

View File

@@ -86,7 +86,8 @@ class box_graph_product_distribution extends ModeleBoxes
$param_showinvoicenb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showinvoicenb';
$param_showpropalnb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showpropalnb';
$param_showordernb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showordernb';
if (GETPOST('DOL_AUTOSET_COOKIE'))
$autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray))
{
$year=GETPOST($param_year,'int');
$showinvoicenb=GETPOST($param_showinvoicenb,'alpha');
@@ -115,9 +116,9 @@ class box_graph_product_distribution extends ModeleBoxes
if ($showpropalnb) $nbofgraph++;
if ($showordernb) $nbofgraph++;
$paramtitle=$langs->trans("Products").'/'.$langs->trans("Services");
if (empty($conf->produit->enabled)) $paramtitle=$langs->trans("Services");
if (empty($conf->service->enabled)) $paramtitle=$langs->trans("Products");
$paramtitle=$langs->transnoentitiesnoconv("Products").'/'.$langs->transnoentitiesnoconv("Services");
if (empty($conf->produit->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Services");
if (empty($conf->service->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Products");
$socid=empty($user->societe_id)?0:$user->societe_id;
$userid=0; // No filter on user creation

View File

@@ -81,6 +81,12 @@ class box_graph_propales_permonth extends ModeleBoxes
'target'=>'none' // Set '' to get target="_blank"
);
$dir=''; // We don't need a path because image file will not be saved into disk
$prefix='';
$socid=0;
if ($user->societe_id) $socid=$user->societe_id;
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
if ($user->rights->propal->lire)
{
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
@@ -89,7 +95,8 @@ class box_graph_propales_permonth extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
if (GETPOST('DOL_AUTOSET_COOKIE'))
$autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE'));
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray))
{
$endyear=GETPOST($param_year,'int');
$shownb=GETPOST($param_shownb,'alpha');
@@ -120,9 +127,9 @@ class box_graph_propales_permonth extends ModeleBoxes
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action')==$refreshaction?-1:(3600*24)));
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
$filenamenb = $dir."/propalsnbinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsnbinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsnbinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsnbinyear-'.$endyear.'.png';
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();
@@ -161,9 +168,9 @@ class box_graph_propales_permonth extends ModeleBoxes
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
//$datatype2 = array('lines','bars');
$filenamenb = $dir."/propalsamountinyear-".$year.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsamountinyear-'.$year.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsamountinyear-'.$year.'.png';
$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsamountinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsamountinyear-'.$endyear.'.png';
$px2 = new DolGraph();
$mesg = $px2->isGraphKo();

View File

@@ -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,
);
}
@@ -260,7 +263,7 @@ abstract class CommonDocGenerator
$array_key.'_total_localtax2'=>price2num($object->total_localtax2),
$array_key.'_total_ttc'=>price2num($object->total_ttc),
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
$array_key.'_vatrate'=>vatrate($object->tva),
$array_key.'_note_private'=>$object->note,
$array_key.'_note'=>$object->note_public,
@@ -314,7 +317,7 @@ abstract class CommonDocGenerator
'line_date_end'=>$line->date_end
);
}
/**
* Define array with couple substitution key => substitution value
*

View File

@@ -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')
@@ -2144,7 +2144,7 @@ abstract class CommonObject
$error=0;
if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
if (! empty($this->array_options))
{
// Check parameters
@@ -2236,13 +2236,14 @@ abstract class CommonObject
/**
* Function to show lines of extrafields with output datas
*
* @param object $extrafields extrafield Object
* @param object $extrafields Extrafield Object
* @param string $mode Show output (view) or input (edit) for extrafield
* @param array $params optionnal parameters
* @param array $params Optionnal parameters
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
*
* @return string
*/
function showOptionals($extrafields,$mode='view',$params=0)
function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='')
{
global $_POST;
@@ -2303,14 +2304,14 @@ abstract class CommonObject
$label = '<span class="fieldrequired">'.$label.'</span>';
$out .= '<td>'.$label.'</td>';
$out .='<td colspan="'.$colspan.'">';
$out .='<td'.($colspan?' colspan="'.$colspan.'"':'').'>';
switch($mode) {
case "view":
$out .= $extrafields->showOutputField($key,$value);
break;
case "edit":
$out .= $extrafields->showInputField($key,$value);
$out .= $extrafields->showInputField($key,$value,'',$keyprefix);
break;
}
@@ -2358,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
@@ -2862,16 +2864,21 @@ abstract class CommonObject
$text=$product_static->getNomUrl(1);
// Define output language (TODO Does this works ?)
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
if (! empty($conf->global->MAIN_MULTILANGS))
{
$this->fetch_thirdparty();
if (! is_object($this->client))
{
// TODO Remove this
$this->fetch_thirdparty(); // The fetch_thirdparty should be done before calling $object->printObjectLines, not into function called for each line
}
$prod = new Product($this->db);
$prod->fetch($line->fk_product);
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$this->client->default_lang;
if (! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && empty($newlang)) $newlang=$this->client->default_lang; // For language to language of customer
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);

View File

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

View File

@@ -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.= ")";

View File

@@ -172,6 +172,7 @@ class DolEditor
//$skin='office2003';
//$skin='v2';
$skin='kama';
if (constant('JS_CKEDITOR')) $skin='moono'; // To use external ckeditor 4 js lib
$htmlencode_force=preg_match('/_encoded$/',$this->toolbarname)?'true':'false';

View File

@@ -516,7 +516,7 @@ class ExtraFields
/**
* Load array this->attribute_label
*
* @param string $elementtype Type of element
* @param string $elementtype Type of element ('adherent', 'commande', societe', 'facture', 'propal', 'product', ...)
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
* @return array Array of attributes for all extra fields
*/
@@ -571,14 +571,15 @@ class ExtraFields
/**
* Return HTML string to put an input field into a page
* Return HTML string to put an input field into a page
*
* @param string $key Key of attribute
* @param string $value Value to show (for date type it must be in timestamp format)
* @param string $moreparam To add more parametes on html input tag
* @return void
* @param string $key Key of attribute
* @param string $value Value to show (for date type it must be in timestamp format)
* @param string $moreparam To add more parametes on html input tag
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @return void
*/
function showInputField($key,$value,$moreparam='')
function showInputField($key,$value,$moreparam='',$keyprefix='')
{
global $conf,$langs;
@@ -620,23 +621,23 @@ class ExtraFields
if(!$required && $value == '')
$value = '-1';
$out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
//$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
$out = $formstat->select_date($value, 'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
// TODO Missing to add $moreparam
}
elseif (in_array($type,array('int')))
{
$tmp=explode(',',$size);
$newsize=$tmp[0];
$out='<input type="text" class="flat" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'varchar')
{
$out='<input type="text" class="flat" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="'.$showsize.'" maxlength="'.$size.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'text')
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
$doleditor=new DolEditor('options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100);
$out=$doleditor->Create(1);
}
elseif ($type == 'boolean')
@@ -647,30 +648,30 @@ class ExtraFields
} else {
$checked=' value="1" ';
}
$out='<input type="checkbox" class="flat" name="options_'.$key.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
$out='<input type="checkbox" class="flat" name="options_'.$key.$keyprefix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'mail')
{
$out='<input type="text" class="flat" name="options_'.$key.'" size="32" value="'.$value.'">';
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="32" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'phone')
{
$out='<input type="text" class="flat" name="options_'.$key.'" size="20" value="'.$value.'">';
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'price')
{
$out='<input type="text" class="flat" name="options_'.$key.'" size="6" value="'.price($value).'"> '.$langs->getCurrencySymbol($conf->currency);
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="6" value="'.price($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
}
elseif ($type == 'double')
{
if (!empty($value)) {
$value=price($value);
}
$out='<input type="text" class="flat" name="options_'.$key.'" size="6" value="'.$value.'"> ';
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="6" value="'.$value.'" '.($moreparam?$moreparam:'').'> ';
}
elseif ($type == 'select')
{
$out='<select class="flat" name="options_'.$key.'">';
$out='<select class="flat" name="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
foreach ($param['options'] as $key=>$val )
{
list($val, $parent) = explode('|', $val);
@@ -683,7 +684,7 @@ class ExtraFields
}
elseif ($type == 'sellist')
{
$out='<select class="flat" name="options_'.$key.'">';
$out='<select class="flat" name="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
if (is_array($param['options']))
{
$param_list=array_keys($param['options']);
@@ -775,6 +776,7 @@ class ExtraFields
$labeltoshow=dol_trunc($obj->$field_toshow,18).' ';
}
}
$out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
}
else
{
@@ -820,7 +822,7 @@ class ExtraFields
foreach ($param['options'] as $keyopt=>$val )
{
$out.='<input class="flat" type="checkbox" name="options_'.$key.'[]"';
$out.='<input class="flat" type="checkbox" name="options_'.$key.$keyprefix.'[]" '.($moreparam?$moreparam:'');
$out.=' value="'.$keyopt.'"';
if ((is_array($value_arr)) && in_array($keyopt,$value_arr)) {
@@ -837,7 +839,7 @@ class ExtraFields
$out='';
foreach ($param['options'] as $keyopt=>$val )
{
$out.='<input class="flat" type="radio" name="options_'.$key.'"';
$out.='<input class="flat" type="radio" name="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'');
$out.=' value="'.$keyopt.'"';
$out.= ($value==$keyopt?'checked="checked"':'');
$out.='/>'.$val.'<br>';
@@ -941,18 +943,18 @@ class ExtraFields
}
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
//$sql.= ' AND entity = '.$conf->entity;
dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql);
$resql = $this->db->query($sql);
if ($resql)
{
$value=''; // value was used, so now we reste it to use it to build final output
$obj = $this->db->fetch_object($resql);
// Several field into label (eq table:code|libelle:rowid)
$fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label))
{
foreach ($fields_label as $field_toshow)
@@ -1085,9 +1087,10 @@ class ExtraFields
* return array_options array for object by extrafields value (using for data send by forms)
*
* @param array $extralabels $array of extrafields
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @return int 1 if array_options set / 0 if no value
*/
function getOptionalsFromPost($extralabels)
function getOptionalsFromPost($extralabels,$keyprefix='')
{
global $_POST;
@@ -1102,23 +1105,24 @@ class ExtraFields
if (in_array($key_type,array('date','datetime')))
{
// Clean parameters
$value_key=dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
$value_key=dol_mktime($_POST["options_".$key.$keyprefix."hour"], $_POST["options_".$key.$keyprefix."min"], 0, $_POST["options_".$key.$keyprefix."month"], $_POST["options_".$key.$keyprefix."day"], $_POST["options_".$key.$keyprefix."year"]);
}
else if (in_array($key_type,array('checkbox')))
{
$value_arr=GETPOST("options_".$key);
$value_arr=GETPOST("options_".$key.$keyprefix);
$value_key=implode($value_arr,',');
}
else if (in_array($key_type,array('price','double')))
{
$value_arr=GETPOST("options_".$key);
$value_arr=GETPOST("options_".$key.$keyprefix);
$value_key=price2num($value_arr);
}
else
{
$value_key=GETPOST("options_".$key);
$value_key=GETPOST("options_".$key.$keyprefix);
}
$array_options["options_".$key]=$value_key;
$array_options["options_".$key]=$value_key; // No keyprefix here. keyprefix is used only for read.
}
return $array_options;

View File

@@ -705,7 +705,7 @@ class Form
}
else
{*/
print $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit);
return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0,$limit);
//}
}
@@ -2364,7 +2364,7 @@ class Form
*
* @param string $selected Id account pre-selected
* @param string $htmlname Name of select zone
* @param int $statut Status of searched accounts (0=open, 1=closed)
* @param int $statut Status of searched accounts (0=open, 1=closed, 2=both)
* @param string $filtre To filter list
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
@@ -2376,10 +2376,10 @@ class Form
$langs->load("admin");
$sql = "SELECT rowid, label, bank";
$sql = "SELECT rowid, label, bank, clos as status";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE clos = '".$statut."'";
$sql.= " AND entity IN (".getEntity('bank_account', 1).")";
$sql.= " WHERE entity IN (".getEntity('bank_account', 1).")";
if ($statut != 2) $sql.= " AND clos = '".$statut."'";
if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY label";
@@ -2409,6 +2409,7 @@ class Form
print '<option value="'.$obj->rowid.'">';
}
print $obj->label;
if ($statut == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')';
print '</option>';
$i++;
}
@@ -2914,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;
@@ -3056,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.')';
@@ -3436,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
@@ -3454,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='')
{
@@ -3466,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))

View File

@@ -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-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
*
@@ -146,7 +146,7 @@ class FormAdmin
if (preg_match('/eldy_(backoffice|frontoffice)\.php$/i',$file)) continue; // We exclude all menu manager files
if (preg_match('/auguria_(backoffice|frontoffice)\.php$/i',$file)) continue; // We exclude all menu manager files
if (preg_match('/smartphone_(backoffice|frontoffice)\.php$/i',$file)) continue; // We exclude all menu manager files
$filelib=preg_replace('/\.php$/i','',$file);
$prefix='';
// 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other
@@ -324,7 +324,7 @@ class FormAdmin
*
* @param string $selected Paper format pre-selected
* @param string $htmlname Name of HTML select field
* @param string $filter Key to filter
* @param string $filter Value to filter on code
* @param int $showempty Add empty value
* @return string Return HTML output
*/
@@ -332,8 +332,12 @@ class FormAdmin
{
global $langs;
$sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format where active=1";
if ($filter) $sql.=" WHERE code LIKE '%".$filter."%'";
$langs->load("dict");
$sql = "SELECT code, label, width, height, unit";
$sql.= " FROM ".MAIN_DB_PREFIX."c_paper_format";
$sql.= " WHERE active=1";
if ($filter) $sql.=" AND code LIKE '%".$this->db->escape($filter)."%'";
$resql=$this->db->query($sql);
if ($resql)
@@ -350,7 +354,11 @@ class FormAdmin
$i++;
}
}
else dol_print_error($this->db);
else
{
dol_print_error($this->db);
return '';
}
$out='';
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';

View File

@@ -764,7 +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 == '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;
@@ -1051,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;
@@ -1070,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",
"",
@@ -1134,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 ' &nbsp; <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id
. '&id=' . $object->id . '" class="deletefilelink" >' . img_delete() . '</a>';
print ' &nbsp; <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param
} else {
print '&nbsp;';
}
print "</td>";
print '</td>';
}
print "</tr>\n";
}

View File

@@ -76,7 +76,7 @@ class FormMail
* @param DoliDB $db Database handler
*/
function __construct($db)
{
{
$this->db = $db;
$this->withform=1;
@@ -554,7 +554,8 @@ class FormMail
elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; }
elseif ($this->param["models"]=='thirdparty') { $defaultmessage=$langs->transnoentities("PredefinedMailContentThirdparty"); }
elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; }
// Complete substitution array
if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL))
@@ -566,24 +567,24 @@ class FormMail
if ($this->param["models"]=='order_send')
{
$url=getPaypalPaymentUrl(0,'order',$this->substit['__ORDERREF__']);
$this->substit['__PERSONALIZED__']=$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url);
$this->substit['__PERSONALIZED__']=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url));
}
if ($this->param["models"]=='facture_send')
{
$url=getPaypalPaymentUrl(0,'invoice',$this->substit['__FACREF__']);
$this->substit['__PERSONALIZED__']=$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url);
$this->substit['__PERSONALIZED__']=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url));
}
}
$defaultmessage=str_replace('\n',"\n",$defaultmessage);
// Deal with format differences between message and signature (text / HTML)
if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
$this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
} else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
$defaultmessage=make_substitutions($defaultmessage,$this->substit);
if (isset($_POST["message"])) $defaultmessage=$_POST["message"];

View File

@@ -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">&nbsp;</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";

View File

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

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