Compare commits

...

373 Commits
3.2.0 ... 3.2.3

Author SHA1 Message Date
Laurent Destailleur
d8aa8051dc Fix: Personalizing css fails when multicompany is on. Cache must differ
between each environment.
2012-12-08 18:42:29 +01:00
Laurent Destailleur
a7e1a45571 Fix: Use different css cache file for each user. This fix problem when
using personalised constants that change style.
2012-12-08 18:40:41 +01:00
Laurent Destailleur
60486417c3 Test. Try to create a backport branch. 2012-12-02 19:55:42 +01:00
Laurent Destailleur
c9ee9c7a38 Fix: pdf_getPDFFontSize must be after pdf_getInstance
Conflicts:
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
2012-11-28 19:26:08 +01:00
Laurent Destailleur
8f3f28c28f Fix: language translation for araby saudia 2012-11-27 14:19:04 +01:00
Laurent Destailleur
ac8a21a3d9 Added english (arabi saudia) 2012-11-27 11:34:15 +01:00
Laurent Destailleur
769c30de9d Fix: [ bug #607 ] Nom de société avec guillemets 2012-11-26 16:12:30 +01:00
Laurent Destailleur
2b926978ae Fix: Correct vat 2012-11-14 20:50:00 +01:00
Laurent Destailleur
6540451078 Fix: firstname was missing 2012-11-14 19:04:34 +01:00
Laurent Destailleur
3ea1345a5b Fix: Option MAIN_MAIL_SENDMAIL_FORCE_BA and MAIN_FIX_BUGGED_MTA was not
complete.
2012-11-14 01:22:48 +01:00
Laurent Destailleur
0d35892003 Fix: typo error 2012-11-13 11:14:44 +01:00
Regis Houssin
8a8c2170cc Fix: remove unused code 2012-11-12 09:44:41 +01:00
Laurent Destailleur
599300dfec Fix: Regression 2012-11-11 15:44:23 +01:00
Regis Houssin
1e6e7af9f7 Fix: wrong access rights 2012-11-10 08:21:56 +01:00
Laurent Destailleur
56cd154258 Fix: New vat for switzerland 2012-11-08 12:14:44 +01:00
Regis Houssin
2f476aa0a0 Fix: compatibility with multicompany 2012-11-06 14:54:17 +01:00
Laurent Destailleur
47d7ea1813 Removed tables of module 2012-11-06 12:29:45 +01:00
Laurent Destailleur
47d5c5baad Fix: Bad label when validating/paying an invoice from POS module 2012-11-03 17:01:05 +01:00
Laurent Destailleur
91fdb6a569 Fix: Not enought space for free text. To avoid to edit again and again
value for all templates, I added an option to be able to fix template
onto production when space is not enough.

Conflicts:
	htdocs/core/modules/action/rapport.pdf.php
	htdocs/core/modules/cheque/pdf/pdf_blochet.class.php
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
	htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
	htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
	htdocs/core/modules/project/pdf/pdf_baleine.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
	htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
2012-11-03 13:41:33 +01:00
Laurent Destailleur
1997b029c7 Fix: [ bug #592 ] stock sold value is wrong 2012-11-03 12:38:16 +01:00
Laurent Destailleur
753400ccf5 Fix: Label for payment by cheque using the wrong translation key
Fix: Option to overwrite translation did not work as expected
Fix: Bad translation for greece
2012-11-02 15:46:46 +01:00
Laurent Destailleur
b83a4d4815 Fix: crazy pagebreak when warterwark is higher than free space. 2012-11-02 15:44:34 +01:00
Laurent Destailleur
8127ced19b Fix: Trick to solve easily problem of font for some foreign users. 2012-10-31 19:42:16 +01:00
Laurent Destailleur
8bd2f9cfb5 Fix: Fix pagebreak. Fix also position for non A4 format. 2012-10-31 17:14:11 +01:00
Laurent Destailleur
0b3a2b744e Fix: Preview of delivery receipts 2012-10-31 16:57:48 +01:00
Laurent Destailleur
cd992d553e Fix: The bottom margin is already included into heightforfooter
This provide 1cm more for product description.
Fix: Some code was not merged from previous fix (must not show free text
on all pages)

Conflicts:
	htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
	htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
2012-10-30 18:52:55 +01:00
Laurent Destailleur
db00ca9dd7 Fix: Free text overlap data when not on last page.
Conflicts:
	htdocs/core/lib/pdf.lib.php
	htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
	htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
	htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
	htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
	htdocs/core/modules/project/pdf/pdf_baleine.modules.php
2012-10-30 14:15:35 +01:00
Laurent Destailleur
542dc8f98f Fix: Bad code for specimen 2012-10-30 11:58:38 +01:00
Laurent Destailleur
497aa9c453 Fix: Using a more precise function to calculate free texts height avoid
having few pixels offset on free texts.
2012-10-30 11:15:37 +01:00
Laurent Destailleur
c80badafe0 Fix: Revert direction of option (this information is a legal issue for
most countries). Also, i removed the mandatory test, this is required
for invoices, not proposals.
So now, there is no need to hide by default because test on invoice
setup has been removed, so we can show by default (if defined) and use
option to force to hide if we want.
2012-10-29 11:38:58 +01:00
Regis Houssin
3aebd50d39 Fix: better for show signature 2012-10-29 10:10:05 +01:00
Regis Houssin
85f03913fe Merge pull request #460 from FHenry/3.2
3.2
2012-10-24 13:57:36 -07:00
fhenry
a3260f3e14 Correct bug 583 2012-10-24 22:45:28 +02:00
Laurent Destailleur
825130d633 Fix: ldap errors 2012-10-24 16:30:10 +02:00
fhenry
1d66d97032 Task 581 : Implement DDLInfoTable for postgreSQL 2012-10-24 11:20:40 +02:00
Laurent Destailleur
df4bfc77a4 Fix: Line at bottom of PDF was too long 2012-10-21 16:11:46 +02:00
Laurent Destailleur
8fe8a1a6fd Fix: Bad alignement of fields with some page format. 2012-10-21 15:58:01 +02:00
Regis Houssin
6fe9a8ee0d Fix: wrong method 2012-10-20 11:13:22 +02:00
Regis Houssin
7e94d8ae52 Fix: minor vulnerabilities 2012-10-20 09:05:24 +02:00
Laurent Destailleur
878d5612a1 Fix: [ bug #260 ] Page breaks on PDF export of supplier order when you
have a service with 40 lines
2012-10-18 12:36:20 +02:00
Laurent Destailleur
377d6dc290 Fix: Bad date format 2012-10-17 20:12:45 +02:00
Laurent Destailleur
2b9f4fed8d Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-10-16 19:49:11 +02:00
Laurent Destailleur
890579d13d Fix: [ bug #565 ] Display error bills have suppliers. 2012-10-16 19:14:47 +02:00
Laurent Destailleur
3dab78afb7 [ bug #552 ] l'option "Adhérents non à jour" ne fonctionne pas 2012-10-16 18:34:07 +02:00
Regis Houssin
d9ebc43cb6 Fix: compatibility with multicompany sharings 2012-10-16 17:53:37 +02:00
Regis Houssin
6d85629495 Fix: possibility to disable ajax 2012-10-16 16:15:00 +02:00
Laurent Destailleur
0e12931d0f Fix: error management 2012-10-15 21:43:42 +02:00
Laurent Destailleur
9690a0bc69 Fix: special_code=3 2012-10-12 22:18:02 +02:00
Laurent Destailleur
8b02d9e912 Fix: Can edit qty of an option 2012-10-12 21:37:06 +02:00
Laurent Destailleur
399aaf1459 Fix: warning 2012-10-05 09:33:01 +02:00
Laurent Destailleur
e707f73067 Fix: getTrad 2012-10-04 10:04:08 +02:00
Laurent Destailleur
8506df28d7 Fix: Try another fix on getTrad bug. 2012-10-04 09:44:55 +02:00
Laurent Destailleur
2868961661 Fix: TZ 2012-10-03 18:36:22 +02:00
Laurent Destailleur
ae945732be Fix: getTradFromKey 2012-10-03 17:48:56 +02:00
Laurent Destailleur
10e72d70ae Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-10-01 20:52:50 +02:00
Laurent Destailleur
fa1d8a3f34 Fi: Uninstall not complete 2012-10-01 20:50:07 +02:00
Laurent Destailleur
6600993796 Prepare 3.3 2012-10-01 20:49:19 +02:00
Laurent Destailleur
bcc92dbd62 Fix: Correct request with data structure 2012-10-01 20:48:51 +02:00
Regis Houssin
ad3fd83478 Merge pull request #427 from simnandez/3.2
Fix: [ bug #553 ] Pagination dans liste des interventions
2012-10-01 02:26:55 -07:00
simnandez
2763374ff1 Fix: [ bug #553 ] Pagination dans liste des interventions 2012-10-01 11:23:16 +02:00
Regis Houssin
a2fecc2616 Fix: remove errors in php 5.4 2012-09-30 14:10:12 +02:00
Laurent Destailleur
4ecf7d9493 Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-09-27 18:33:29 +02:00
Laurent Destailleur
f9dfe1bcfb Fix: No error when hour not provided
Conflicts:
	htdocs/core/lib/functions.lib.php
2012-09-27 18:31:47 +02:00
Regis Houssin
a119cd3f36 Fix: remove warning 2012-09-27 15:20:23 +02:00
Laurent Destailleur
c019857bda Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-09-26 13:38:10 +02:00
Laurent Destailleur
b020dbf96f Prepare 3.3.3 2012-09-26 13:35:18 +02:00
Regis Houssin
1185e0f731 Fix: multicompany transverse mode compatibility 2012-09-26 12:14:08 +02:00
Regis Houssin
d6243a33af Fix: hide menu if empty 2012-09-26 12:12:01 +02:00
Regis Houssin
e9128db1aa Fix: add todo for free tag treatment 2012-09-25 18:37:37 +02:00
Regis Houssin
e8c9a9c87d Merge pull request #416 from cbattarel/3.2
add ability to remove a product tab if it's defined in a module description
2012-09-25 07:04:13 -07:00
Christophe Battarel
80c6716581 add ability to remove a product tab if it's defined in a module description 2012-09-25 14:46:40 +02:00
Laurent Destailleur
9de912ba12 Fix: doxygen 2012-09-24 21:40:26 +02:00
Regis Houssin
930f492a14 Fix: use company name if lastname and firstname not exists 2012-09-24 12:05:12 +02:00
Regis Houssin
665526a6e7 Fix: dol_trunk is too restrictive !!! change the resolution of your
screen !
2012-09-24 11:32:29 +02:00
Regis Houssin
0ac5f38e02 Fix: increase length, is too restrictive
Fix: show company name if lastname and firstname not exists
2012-09-24 10:53:35 +02:00
Spangaro Alexandre
4a9bf30bd1 Minor fix
Conflicts:
	htdocs/install/mysql/data/llx_accounting.sql
2012-09-23 16:34:30 +02:00
Laurent Destailleur
89908052c0 Add PHPUnit to help to detect bugs. 2012-09-23 16:21:37 +02:00
Laurent Destailleur
53c1672b9f Fix: Blank page when renaming product ref 2012-09-19 14:16:39 +02:00
Laurent Destailleur
8b13f2ab81 Fix: no way to change the payment term date 2012-09-18 12:11:16 +02:00
Laurent Destailleur
f1870ae37d Fix: syntax error with postgresql 2012-09-18 11:24:54 +02:00
Laurent Destailleur
592d70d4ea Fix: use https if https is used 2012-09-18 11:15:40 +02:00
Laurent Destailleur
218ae3dbd5 Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-09-15 15:13:10 +02:00
Laurent Destailleur
b7163bea5d Fix: avoid syntax error 2012-09-15 15:12:43 +02:00
Regis Houssin
01b361a98b Fix: bad element 2012-09-15 09:07:06 +02:00
Laurent Destailleur
fd0cd7257c Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-09-11 01:17:05 +02:00
Laurent Destailleur
b36b56b7a1 Add PHPUnit test to validate calcul_price function for spain. 2012-09-11 01:00:40 +02:00
Laurent Destailleur
4a111234a0 Fix: removed warning 2012-09-10 15:43:58 +02:00
Laurent Destailleur
e2d71b3215 Doc 2012-09-10 10:24:56 +02:00
simnandez
0fbd626822 Fix: use $ldap instead $this 2012-09-10 09:52:44 +02:00
Laurent Destailleur
a79d440a9b Fix: Var not used 2012-09-10 09:52:35 +02:00
Laurent Destailleur
78deb405b2 Fix: Use bad param name 2012-09-09 15:28:43 +02:00
Laurent Destailleur
5046c20b81 Fix: Bad name of var 2012-09-09 15:11:02 +02:00
Regis Houssin
8b28893fbe Fix: GET and POST treatment in dol_loginfunction() 2012-09-08 15:17:24 +02:00
Regis Houssin
c4f3e872ca Fix: GETPOST is already in method 2012-09-08 13:26:25 +02:00
Laurent Destailleur
f0cfbb8b0d Sec: XSS hole
Conflicts:
	htdocs/core/tpl/login.tpl.php
2012-09-08 13:22:02 +02:00
Regis Houssin
0511ba87f4 Fix: [ bug #533 ] 2012-09-06 15:15:47 +02:00
Regis Houssin
04d5a41e9c Fix: [ bug #533 ] Using quotes in intervention sheet description leads
to empty description
2012-09-06 12:53:29 +02:00
Regis Houssin
62c3f04392 Fix: broken feature, enable source details by default 2012-09-06 12:39:27 +02:00
Regis Houssin
feaf5266e9 New: add possibility to force entity in login page 2012-09-05 19:23:46 +02:00
Laurent Destailleur
2b75c81af9 Merge pull request #368 from simnandez/3.2
Fix: Localtaxes unit prices precision
2012-09-05 01:36:12 -07:00
Laurent Destailleur
d3986b4936 Fix: PHP 5.2 compatibility
Conflicts:
	htdocs/filefunc.inc.php
2012-09-05 10:16:23 +02:00
simnandez
9c08abb52c Fix: Localtaxes unit prices precision 2012-09-05 09:51:44 +02:00
Laurent Destailleur
185c03eea5 Fix: We must use shipping address and not the invoice address 2012-09-04 23:10:10 +02:00
Regis Houssin
9614881bed Fix: for use with command line 2012-09-04 12:30:38 +02:00
Regis Houssin
dbb62f010d Fix: add distinct for avoid double record 2012-09-04 11:53:00 +02:00
Regis Houssin
8de657a215 Fix: comaptibility with multicompany and transverse mode 2012-09-04 11:11:48 +02:00
Regis Houssin
e20b0b2e7b Fix: missing upgrade with minor version 2012-09-03 16:27:16 +02:00
Laurent Destailleur
21ad42afab Fix: Parameters at wrong place. 2012-09-03 10:19:21 +02:00
Laurent Destailleur
99b33a70a3 For 3.2.2 2012-09-02 15:28:53 +02:00
Laurent Destailleur
dfda863b7e Update files for 3.2.2 2012-09-02 15:21:43 +02:00
Laurent Destailleur
37f866c31f Update changelog 2012-09-02 15:17:59 +02:00
Laurent Destailleur
7a3f6b9acc Fix: error report when duplicate product 2012-09-02 15:10:37 +02:00
Laurent Destailleur
de7b060e12 Works on larger screens 2012-09-02 14:44:28 +02:00
Laurent Destailleur
f25802520a Fix: Avoid repeat of img 2012-09-02 14:33:22 +02:00
Laurent Destailleur
a7d6289d4b Fix: edit of percentage
Conflicts:
	htdocs/comm/action/fiche.php
2012-09-02 14:27:00 +02:00
Regis Houssin
d12700aeab Fix: for compatibility and avoid error if external module use
$conf->module_parts
2012-09-02 12:28:36 +02:00
Regis Houssin
77688cf988 Fix: comptibility between bureau2crea theme and multicompany module 2012-09-02 11:52:10 +02:00
Regis Houssin
b66aeabb88 Fix: broken features and uniformize code 2012-09-02 09:25:40 +02:00
Regis Houssin
49ae52c708 Merge pull request #366 from simnandez/3.2
Fix: Modify spanish VAT to new rates
2012-09-01 09:31:18 -07:00
simnandez
9fbd6f0b58 Fix: Modify spanish VAT to new rates 2012-09-01 18:25:46 +02:00
simnandez
433ca88c43 Merge branch '3.2' of git://github.com/Dolibarr/dolibarr.git into 3.2 2012-09-01 18:24:11 +02:00
Regis Houssin
aa65ebe136 Fix: this field is for 3.3 2012-09-01 18:07:50 +02:00
Regis Houssin
43a8b9176f Fix: missing query 2012-09-01 17:55:50 +02:00
simnandez
6e12d84f14 Fix: Modify spanish VAT to new rates 2012-09-01 16:39:47 +02:00
Laurent Destailleur
1eac98dc43 Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-08-31 12:47:24 +02:00
Laurent Destailleur
6691bef701 Fix: Start and end date not saved at project creation 2012-08-31 12:44:55 +02:00
Regis Houssin
24cc745ae8 Fix: update virtualmin script 2012-08-31 11:52:33 +02:00
Laurent Destailleur
7a42514833 Fix: bug for default vat definition 2012-08-30 21:14:30 +02:00
Laurent Destailleur
749f371d4e Merge pull request #360 from GPCsolutions/3.2-lang
FIXED: Spelling mistakes in the french translation of product/admin/prod...
2012-08-30 10:41:30 -07:00
Laurent Destailleur
bee6b92a7b Fix: Bad test 2012-08-30 16:55:59 +02:00
Laurent Destailleur
36ff4abe3c Fix: enhance cleaning of database 2012-08-30 16:52:20 +02:00
Cédric Salvador
6012dff11e FIXED: Spelling mistakes in the french translation of product/admin/product_extrafields.php 2012-08-29 18:58:27 +02:00
Laurent Destailleur
5f197cb1bb Fix: Packaging for 3.2.1 of zip 2012-08-29 12:39:40 +02:00
Laurent Destailleur
6c62b64b7c Fix: Test on ref and ref_ext into webservice 2012-08-29 10:21:25 +02:00
Laurent Destailleur
d4ac506d66 Missing translation key 2012-08-28 22:33:40 +02:00
Laurent Destailleur
e5c2d07c53 Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-08-28 18:42:39 +02:00
Laurent Destailleur
05de9c19c3 Fix: permission for a user to view its own card using webservice 2012-08-28 18:39:34 +02:00
Regis Houssin
5c2ce8a301 Merge pull request #354 from marcosgdf/missing-licensing
Added me to the COPYRIGHT file
2012-08-27 22:55:51 -07:00
Marcos García
849dc8c836 Added me to the COPYRIGHT file 2012-08-28 07:08:10 +02:00
Laurent Destailleur
bdc330ad6a Merge pull request #351 from simnandez/3.2
Fix: Bad assignation of const for pdf delivery module name
2012-08-27 03:36:03 -07:00
simnandez
85eedfa6e7 Fix: Bad assignation of const for pdf delivery module name 2012-08-27 08:52:10 +02:00
Laurent Destailleur
e121ab8c86 [ bug #512 ] Filter system not working in banks > account > transactions
Conflicts:
	htdocs/compta/bank/account.php
2012-08-26 19:33:32 +02:00
Laurent Destailleur
fe76902342 Fix: Bad field 2012-08-26 13:15:51 +02:00
Laurent Destailleur
9142e3400b Fix: [ bug #254 ] Database backup not working with complex passwords 2012-08-26 00:52:10 +02:00
Regis Houssin
87cc60d647 Revert "Fix: remove obsolete code"
This reverts commit c5728843a5.
2012-08-25 10:59:58 +02:00
Regis Houssin
c5728843a5 Fix: remove obsolete code
Conflicts:
	htdocs/admin/expedition.php
2012-08-25 10:59:41 +02:00
Regis Houssin
e260997e0b Merge pull request #345 from simnandez/3.2
Fix: Bad assignation of const for pdf delivery module name
2012-08-25 01:32:39 -07:00
simnandez
fef04f6921 Fix: Bad assignation of const for pdf delivery module name 2012-08-24 18:03:03 +02:00
simnandez
bc2411098c Fix: Bad assignation of const for pdf delivery module name 2012-08-24 17:45:44 +02:00
simnandez
0dafeb8e44 Fix: Bad assignation of const for pdf delivery module name 2012-08-24 17:30:22 +02:00
simnandez
084efd03a3 Fix: Bad assignation of const for pdf delivery module name 2012-08-24 17:26:36 +02:00
Regis Houssin
61372f4650 Fix: rename for security raison 2012-08-23 18:14:02 +02:00
Regis Houssin
049e588341 Fix: move barcode type entries in module descriptor for best
compatibility with multicompany
2012-08-22 17:46:11 +02:00
Regis Houssin
2d15b64f24 Fix: wrong ereg 2012-08-21 11:46:50 +02:00
Laurent Destailleur
6bab2e0bd8 Fix: The backto use bad url. 2012-08-20 14:17:29 +02:00
Regis Houssin
f425762e9d Fix: missing show field if "in progress" is chosen first 2012-08-20 08:21:05 +02:00
Regis Houssin
81970b8dd0 Fix: avoid warning "is not a legal ECMA-262 octal constant" 2012-08-20 08:12:51 +02:00
Regis Houssin
6e3404a231 Merge pull request #333 from marcosgdf/changelog
Added missing changelog entry
2012-08-19 22:48:27 -07:00
Marcos García
2b0e420618 Added missing changelog entry 2012-08-20 02:50:34 +02:00
Laurent Destailleur
cb96735f50 Fix: [ bug #506 ] Can't set percentage of a started event 2012-08-20 02:16:53 +02:00
Laurent Destailleur
fb2fd71ff4 Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-08-20 02:16:26 +02:00
Regis Houssin
6c2d9baeb5 Fix: remove old accountancy code, can cause blank screen 2012-08-20 00:34:06 +02:00
Laurent Destailleur
cef55097ea Fix: Default value was not defined 2012-08-20 00:29:13 +02:00
Marcos García
552c82a032 Fixed bug #504
https://doliforge.org/tracker/?func=detail&aid=504&atid=246&group_id=144
2012-08-19 07:51:51 +02:00
Regis Houssin
2355f83295 Merge pull request #326 from marcosgdf/changelog
Added missing changelog entries
2012-08-18 09:56:26 -07:00
Marcos García
b2fa4b3f49 Added missing changelog entries 2012-08-18 18:05:53 +02:00
Regis Houssin
d6f1f870a2 Fix: bad rights 2012-08-18 10:51:13 +02:00
Regis Houssin
2e38300ec4 Fix: [ bug #501 ] Error while trying to modify an user 2012-08-18 10:16:25 +02:00
Regis Houssin
5f8530d0c0 Fix: [ bug #503 ] Unable to delete linked file to a deposit
Conflicts:
	htdocs/compta/paiement/cheque/fiche.php
2012-08-18 09:01:17 +02:00
Marcos García
2bd7dc68d3 Project::setClose wasn't setting the new status 2012-08-18 07:35:55 +02:00
Marcos García
173ff4f92a Fixed a bug where files were not being uploaded to a project's task
Reported by Jose Antonio Garcia in dolibarr.es' forum
http://www.dolibarr.es/index.php/foro/7-bugs-versiones-estables/1250-error-subir-archivo-en-una-tarea-de-un-proyecto

Conflicts:
	htdocs/projet/tasks/document.php
2012-08-18 07:35:39 +02:00
Marcos García
1f9e0d3e00 Translated message was generating an incomplete string 2012-08-17 20:19:10 +02:00
Laurent Destailleur
594d5ee216 Merge pull request #311 from marcosgdf/changelog
Missing changelog entry
2012-08-15 13:00:28 -07:00
Marcos García
2130b9715c Missing changelog entry 2012-08-15 15:58:36 +02:00
Regis Houssin
b2ff7b5ea1 Fix: limit to products and services 2012-08-15 10:35:15 +02:00
Marcos García
f03e0965e2 Forgot to rename the variable 2012-08-15 07:32:10 +02:00
Marcos García
acb9380f1c Fixed a problem with supplier's orders stats
They were showing orders even if they were not approved or ordered

Conflicts:
	htdocs/commande/class/commandestats.class.php
2012-08-15 07:31:55 +02:00
Marcos García
40660482d4 Fixed more average amount graph stats. They include:
* Customer's orders
* Supplier's orders
* Customer's invoices
* Trips and expense

Conflicts:
	htdocs/commande/stats/index.php
2012-08-15 07:30:28 +02:00
Regis Houssin
f1cbb10edc Fix: wrong user count 2012-08-14 19:52:51 +02:00
Marcos García
640f001bba Propal stats weren't showing average total for more than 1 year
Conflicts:
	htdocs/comm/propal/stats/index.php
	htdocs/core/class/stats.class.php
2012-08-14 16:30:16 +02:00
Regis Houssin
7b671815e0 Merge pull request #305 from marcosgdf/missing-changelog-entry
Missing changelog entry
2012-08-14 02:22:19 -07:00
Marcos García
cb1e1be0d3 Missing changelog entry 2012-08-14 11:06:16 +02:00
Marcos García
78a26d61ad Fixed bug #485
Merged patch from J. Fernando Lagrange (lowmemory)
https://doliforge.org/tracker/?func=detail&aid=485&atid=246&group_id=144
2012-08-14 10:23:38 +02:00
Laurent Destailleur
ff2dc246eb Update pad files 2012-08-11 13:02:44 +02:00
Laurent Destailleur
7e0b500d75 Update doc 2012-08-11 03:57:55 +02:00
Laurent Destailleur
3670cfd966 Fix: Broken feautres after migration from old versions 2012-08-10 19:16:53 +02:00
Laurent Destailleur
d090788caa Fix: Do not run request if param is empty 2012-08-08 14:08:37 +02:00
Laurent Destailleur
db4240afad Fix: Do not overwrite global $user information 2012-08-08 09:23:57 +02:00
Raphaël Doursenaud
34673e220d Fix: Display correct user in project tasks' time spent list
Use a local object rather than modifying the global $user object (sic!)
2012-08-08 09:21:29 +02:00
Laurent Destailleur
7f7fa693f3 Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-08-08 04:09:25 +02:00
Laurent Destailleur
4786ab9268 Fix: Specimen generation fails 2012-08-08 04:06:19 +02:00
Laurent Destailleur
0db0ab34b4 [ bug #480 ] Can't receive to stock with strict mode 2012-08-07 19:36:34 +02:00
Laurent Destailleur
69b65de41b Fix: Missing desc field 2012-08-07 19:11:26 +02:00
Laurent Destailleur
0f2a1a854b Fix: autoselect when it should not 2012-08-07 18:59:07 +02:00
Laurent Destailleur
32a7747440 Fix: Delete all files (PROV* when validating. 2012-08-07 16:05:00 +02:00
Regis Houssin
0a8ae2934d Fix: remove unused file and missing print 2012-08-06 20:41:17 +02:00
Regis Houssin
afeabd44f0 Fix: update jquery fileupload 2012-08-06 19:06:11 +02:00
Regis Houssin
99e234d703 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2 2012-08-06 17:41:06 +02:00
Regis Houssin
117cd337dd Fix: missing object 2012-08-06 17:39:56 +02:00
Regis Houssin
4f5432160d Fix: remove draft status if invoice is validated 2012-08-06 09:14:44 +02:00
Laurent Destailleur
92624d650f Fix into categorie functions 2012-08-05 23:59:13 +02:00
Laurent Destailleur
8b2f1eee13 Fix: W3C 2012-08-05 22:01:26 +02:00
Regis Houssin
96726c1c9b Fix: function setEventMessage() not in 3.2 2012-08-05 21:18:36 +02:00
Regis Houssin
bbe270d4bf Fix: missing delete shipping and delivery files
(minimum for possibility to merge with 3.2)

Conflicts:
	htdocs/core/modules/livraison/modules_livraison.php
	htdocs/livraison/class/livraison.class.php
2012-08-05 20:42:06 +02:00
Regis Houssin
bb74a63d59 Fix: delete pdf if supplier invoice is deleted
Fix: compatibility with external modules
(minimum for 3.2)
2012-08-05 18:37:48 +02:00
Regis Houssin
b1f3dbd45e Fix: indentation 2012-08-05 18:37:34 +02:00
Regis Houssin
da8bc79c6d Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2 2012-08-05 18:37:17 +02:00
Regis Houssin
54134e3d19 Fix: compatibility with jquery fileupload 2012-08-05 18:36:59 +02:00
Laurent Destailleur
fa4c69c52f Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-08-05 14:55:21 +02:00
Laurent Destailleur
e1f57b60e3 Qual: Removed bad herit 2012-08-05 14:46:24 +02:00
Regis Houssin
da29ea89a7 Fix: avoid warning with php 5.4 2012-08-05 14:34:37 +02:00
Laurent Destailleur
fe672e1e4b Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-08-05 00:46:39 +02:00
Laurent Destailleur
be4960cfbb Fix: exit code when upgrade is ran from command line 2012-08-05 00:46:10 +02:00
Regis Houssin
e4f7df25b0 Fix: remove unused code for avoid warning with IE9 2012-08-04 13:52:02 +02:00
Laurent Destailleur
17c45208d3 Fix: Prepare 3.2.1 version 2012-08-03 23:57:17 +02:00
Laurent Destailleur
6a4f03eab3 Prepare 3.2.1 2012-08-03 19:27:50 +02:00
Laurent Destailleur
3778d206ac Fix: project validation 2012-08-03 19:05:49 +02:00
Laurent Destailleur
f4c9da5e9f Fix: Bad object 2012-08-03 18:53:31 +02:00
Laurent Destailleur
a2641b89e7 Fix: Bad fix 2012-08-03 18:43:30 +02:00
Laurent Destailleur
983c38a33d Fix: tr_TR 2012-08-03 17:10:59 +02:00
Regis Houssin
899f4df9ed Fix: [bug #478] Can access pages belonging to disabled modules 2012-08-03 11:58:33 +02:00
Regis Houssin
ae0a746510 Fix: bad document path with multicompany 2012-08-01 19:35:55 +02:00
Regis Houssin
f6afc75d96 Fix: avoid errors if install directory is deleted before module
activation
2012-08-01 14:43:28 +02:00
Regis Houssin
a2db2c5012 Fix: regression (multicompany) 2012-08-01 13:04:32 +02:00
Laurent Destailleur
ae6e3ad5c4 [ bug #464 ] Payment form should allow to add transmitter for bank transfers 2012-07-31 13:44:58 +02:00
Laurent Destailleur
e15834dae2 Fix: Removing chekstyle warning helps me to find real bugs 2012-07-29 15:27:37 +02:00
Laurent Destailleur
8a77ffe58f Fix: Removing chekstyle warning helps me to find real bugs 2012-07-29 15:08:03 +02:00
Marcos García
498ac04ad1 Typo in es_ES translation 2012-07-28 18:39:27 +02:00
Regis Houssin
c77ecc15c9 Fix: reorder include 2012-07-28 09:59:30 +02:00
Regis Houssin
2a1c6422ac Merge pull request #263 from marcosgdf/minor
Duplicated code
2012-07-28 00:32:08 -07:00
Marcos García
4ff5f1bf1c Duplicated code 2012-07-27 23:50:36 +02:00
Regis Houssin
a37035c862 Fix: uniformize code 2012-07-27 14:14:26 +02:00
Regis Houssin
cbb5ca229a Merge pull request #259 from FHenry/3.2
Correct bug 472
2012-07-27 05:12:16 -07:00
Raphaël Doursenaud
954f46ec62 Fix: Allows to use a comma decimal separator in supplier invoices
payments
2012-07-27 13:55:25 +02:00
FHenry
9798ddad80 Correct bug 472 2012-07-27 10:41:26 +02:00
Regis Houssin
c92bd58278 Fix: changelog 2012-07-26 21:07:37 +02:00
Regis Houssin
c429c421da Fix: Bug #460 - Wrong entity assignment when creating a warehouse 2012-07-26 20:50:24 +02:00
Regis Houssin
51ccb33964 Fix: carriage return 2012-07-26 18:12:02 +02:00
Regis Houssin
c55eabeaff Fix: external user confidentiality 2012-07-26 18:11:50 +02:00
Regis Houssin
a92bb8373a Fix: bad path 2012-07-26 17:04:50 +02:00
Regis Houssin
46304c8d98 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2 2012-07-26 14:37:21 +02:00
Regis Houssin
5c93da8a72 Fix: problem with double quote 2012-07-26 14:37:10 +02:00
Laurent Destailleur
087644a861 Update translation for tr_TR
Conflicts:
	htdocs/langs/tr_TR/admin.lang
	htdocs/langs/tr_TR/agenda.lang
	htdocs/langs/tr_TR/bills.lang
	htdocs/langs/tr_TR/bookmarks.lang
	htdocs/langs/tr_TR/boxes.lang
	htdocs/langs/tr_TR/cashdesk.lang
	htdocs/langs/tr_TR/categories.lang
	htdocs/langs/tr_TR/commercial.lang
	htdocs/langs/tr_TR/companies.lang
	htdocs/langs/tr_TR/compta.lang
	htdocs/langs/tr_TR/dict.lang
	htdocs/langs/tr_TR/install.lang
	htdocs/langs/tr_TR/main.lang
	htdocs/langs/tr_TR/propal.lang
	htdocs/langs/tr_TR/sendings.lang
2012-07-25 17:59:35 +02:00
Regis Houssin
1b5f540d93 Fix: can't read permissions with an external module in root directory
instead "custom" directory
2012-07-25 13:32:25 +02:00
Regis Houssin
a0f78aad4a Fix: for compatibility 2012-07-25 12:57:59 +02:00
Laurent Destailleur
70cf8227a2 Fix: Products with no prices not visible
Conflicts:
	htdocs/core/class/html.form.class.php
2012-07-25 12:47:50 +02:00
Regis Houssin
67fd6356aa Merge pull request #257 from FHenry/3.2
Correction mail unsubcribe translation
2012-07-24 09:15:04 -07:00
FHenry
58e61781e1 Remove useless paramater 2012-07-24 17:31:30 +02:00
FHenry
8a2e5b5962 Fix style 2012-07-24 14:34:23 +02:00
FHenry
1891e7364a Fix nb mass mailling receive according other status than read 2012-07-24 14:32:03 +02:00
FHenry
ba9861f856 Add __MAILTOEMAIL__ to mailing-send.php 2012-07-24 10:15:58 +02:00
FHenry
bc9d85b03f Unsubscribe tag spelling correction 2012-07-24 09:28:16 +02:00
FHenry
3e2e3b2bcb Correction mail unsubcribe translation 2012-07-23 18:58:40 +02:00
Laurent Destailleur
ab71e4f891 Better fix 2012-07-23 11:02:53 +02:00
Regis Houssin
a4ec4224b0 Fix: bug #467 2012-07-23 10:31:58 +02:00
Laurent Destailleur
0b77cb3a5d Fix: Translation missing 2012-07-22 23:07:56 +02:00
Laurent Destailleur
b4aa076a82 Fix: escape for create command 2012-07-22 21:53:50 +02:00
Laurent Destailleur
dc532cc2d4 Fix: escape for create command 2012-07-22 21:48:43 +02:00
Laurent Destailleur
3efa77a70f Merge branch '3.2' of git@github.com:Dolibarr/dolibarr.git into 3.2 2012-07-22 17:15:39 +02:00
Laurent Destailleur
a8d32b71bf Merge pull request #254 from marcosgdf/minor-fixes
Minor fixes
2012-07-22 08:15:18 -07:00
Laurent Destailleur
8074022e8f Fix: dol_syslog at wrong place. 2012-07-22 16:58:03 +02:00
Laurent Destailleur
bcde526db1 Fix: sql injection for create database 2012-07-22 16:57:57 +02:00
Laurent Destailleur
23c4f78df0 Merge pull request #255 from marcosgdf/fix-bug-452
Fixed bug #452
2012-07-22 07:32:10 -07:00
Marcos García
148e40e07c Moved bookmark translations from other.lang to bookmarks.lang, also removed unused translations 2012-07-22 16:17:49 +02:00
Laurent Destailleur
1eae596f98 Prepare 3.2.1 2012-07-22 14:33:22 +02:00
Laurent Destailleur
2a9456cb83 Fix: Brazilian translation 2012-07-22 14:23:13 +02:00
Laurent Destailleur
f1f9c842f8 Fix: The missing feature to close proposal on order close was fixed
differently.
2012-07-22 13:13:38 +02:00
Marcos García
7f243d92e5 Removed unnecesary code 2012-07-22 03:30:21 +02:00
Marcos García
10384e3856 Another mini typo 2012-07-22 02:40:49 +02:00
Marcos García
8bc3608717 Allowed MailmanTitle to be translated, also SPIP should be upper-cased 2012-07-22 02:22:01 +02:00
Marcos García
4b62eaeed2 Typos in es_ES and added missing translations 2012-07-22 01:45:46 +02:00
Marcos García
c5e1b367de Merge branch 'fix-spanish-translation-typo' into minor-fixes 2012-07-22 00:43:45 +02:00
Marcos García
06b6c38379 There's no "Código de barra" 2012-07-22 00:39:06 +02:00
Marcos García
ee0f92f6aa Add missing es_ES translations 2012-07-22 00:08:48 +02:00
Marcos García
49d943e57f Removed duplicated code 2012-07-21 23:54:23 +02:00
Marcos García
3d10d6a559 It was showing Products Area instead of Products and Services Area 2012-07-21 01:08:02 +02:00
Marcos García
ccdaf2ffb4 When viewing a product/service, if we don't know the type of the item, then we use a generic page title. Also fixed typo in es_ES 2012-07-21 00:08:43 +02:00
Marcos García
c0c481a746 Translation Typo in es_ES 2012-07-20 22:46:39 +02:00
Marcos García
c2f465a98a Added some missing translations in es_ES and fixed a typo too 2012-07-20 21:45:13 +02:00
Marcos García
f6fc21f5fb Fixed a minor bug with the BackToList link in a budget detail view reported in Dolibarr.es
You'll see a lot of lines changed because of incorrect line endings
2012-07-20 21:25:29 +02:00
Marcos García
c3b18a1e38 Spanish translation typo 2012-07-20 21:19:08 +02:00
Marcos García
11430cd555 Php should be upper-cased. Also removed the string from the lang files as it should not be translated. I even think that in China they call it PHP 2012-07-20 20:38:57 +02:00
Marcos García
fa8fad3b04 SMS should be upper-cased 2012-07-20 20:33:12 +02:00
Marcos García
3ed1795096 Added missing translation 2012-07-20 19:53:43 +02:00
Marcos García
5f0491bc6f There's no disec input... 2012-07-20 19:46:37 +02:00
Marcos García
0ff5a7bc9c Fixed little typo 2012-07-20 18:24:23 +02:00
Regis Houssin
34f790b85e Merge pull request #250 from marcosgdf/fix-some-translations
Fix some typos on translations
2012-07-19 14:36:24 -07:00
Marcos García
af9c8abe9c Fixed Catalan typos too 2012-07-19 20:06:08 +02:00
Marcos García
50129ec945 Contracts box name wasn't being translated 2012-07-19 19:40:56 +02:00
Raphaël Doursenaud
2160e86928 French wording
Réception -> Traitement en cours
2012-07-19 19:34:15 +02:00
Raphaël Doursenaud
0b2e07964f French spelling
Chiffre d'affaire -> Chiffre d'affaires
2012-07-19 19:34:06 +02:00
Regis Houssin
5386f00b0e Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2 2012-07-19 19:33:55 +02:00
Raphaël Doursenaud
78b0f14b1a Text: Chiffrer 2012-07-19 19:33:37 +02:00
Regis Houssin
467bf090dd Merge pull request #246 from simnandez/3.2
Trad: Better translation
2012-07-19 10:25:31 -07:00
Regis Houssin
4fcbe39fd9 Merge pull request #248 from marcosgdf/fix-contract-translation
The tab Documents of the Contracts module wasn't being translated
2012-07-19 10:25:02 -07:00
Regis Houssin
7ad2de61d1 Merge pull request #249 from marcosgdf/fix-security-seconds-translation
Replaced "Seconds" for "seconds"
2012-07-19 10:24:15 -07:00
Marcos García
d5c95b76a5 Added missing translation and fixed some typos 2012-07-19 19:06:23 +02:00
Marcos García
e7d117c920 Fixed some spanish & catalan translations 2012-07-19 18:41:36 +02:00
Marcos García
9b21aa0a60 Replaced "Seconds" for "seconds" 2012-07-19 18:05:09 +02:00
Laurent Destailleur
f5a4f32b0f [ bug #445 ] Hex escaping in descriptions 2012-07-19 18:04:56 +02:00
Laurent Destailleur
674aa0cf12 Fix: Duplicate begin 2012-07-19 17:28:13 +02:00
Marcos García
d1646e245a The tab Documents of the Contracts module wasn't being translated 2012-07-19 17:18:41 +02:00
Laurent Destailleur
03f85bef83 [ bug #444 ] Regression on auto-closing for proposals and orders 2012-07-19 16:57:10 +02:00
Laurent Destailleur
d68a2cb0d8 Fix: Removed warning 2012-07-19 16:27:03 +02:00
simnandez
5a1e29cc08 Trad: Better translation 2012-07-19 12:28:47 +02:00
Regis Houssin
45b24fff0d Merge pull request #244 from simnandez/3.2
Trad: Add missing translation
2012-07-18 23:44:12 -07:00
Regis Houssin
29256aba8b Merge pull request #245 from marcosgdf/fix-bug-456
Fixed bug #465
2012-07-18 23:43:19 -07:00
Marcos García
4f2a47c4fc Fixed bug https://doliforge.org/tracker/?func=detail&aid=456&atid=246&group_id=144 2012-07-19 02:26:41 +02:00
Laurent Destailleur
f4f2db33f0 Better translation
Conflicts:
	htdocs/langs/en_US/workflow.lang
	htdocs/langs/fr_FR/workflow.lang
2012-07-17 15:30:52 +02:00
Laurent Destailleur
b73014c044 Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2 2012-07-17 01:27:08 +02:00
Laurent Destailleur
53cc1667d5 Fix: error when validating shipment for non predefined products with a
selected warehouse.
2012-07-17 01:26:31 +02:00
simnandez
af9b03e7c7 Trad: Add missing translation 2012-07-14 22:25:14 +02:00
Regis Houssin
dd7c3ed2f8 Merge pull request #243 from simnandez/3.2
Trad: Add missing translations
2012-07-13 07:28:46 -07:00
Regis Houssin
7e25172f03 Fix: missing entity filter 2012-07-13 16:24:12 +02:00
simnandez
a83c118a8f Trad: Add missing translations 2012-07-13 15:56:55 +02:00
Regis Houssin
fd9574a2f8 Merge pull request #241 from simnandez/3.2
3.2
2012-07-13 06:07:52 -07:00
simnandez
8014713795 Fix: Bad local taxes if price base type is TTC 2012-07-13 15:02:02 +02:00
simnandez
10e632375f Fix: Bad local taxes if price base type is TTC 2012-07-13 14:40:51 +02:00
Laurent Destailleur
9327858bee Fix: Bad merge 2012-07-13 12:23:17 +02:00
Laurent Destailleur
b801a391a4 Fix: Phone not saved when using web service 2012-07-13 12:15:16 +02:00
Regis Houssin
20704d6a5c New: classify billed order if invoice billed (workflow
manager)

Conflicts:
	htdocs/core/class/commonobject.class.php
	htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
	htdocs/langs/en_US/workflow.lang
	htdocs/langs/fr_FR/workflow.lang
2012-07-13 12:14:41 +02:00
Regis Houssin
1af4834f10 Fix: for multicompany transverse mode 2012-07-10 13:43:38 +02:00
Regis Houssin
02f30aeee2 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-10 13:40:17 +02:00
Regis Houssin
2f9f7d401f Merge branch '3.2' of git+ssh://github.com/Dolibarr/dolibarr into 3.2.1 2012-07-08 18:37:43 +02:00
Regis Houssin
3686fad393 Fix: compatibility with multicompany and transverse mode 2012-07-07 15:25:21 +02:00
Regis Houssin
8b832f475f Fix: getpost error 2012-07-07 12:53:27 +02:00
Regis Houssin
925bded6d9 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-07 12:29:04 +02:00
Regis Houssin
293e0ac831 Change-Id: I5f8bcf59cf2fc0d902edb4d61f8c20a2880765a2 2012-07-07 12:21:40 +02:00
Regis Houssin
250e3555c3 Fix: more bugs with multicompany 2012-07-07 11:03:16 +02:00
Regis Houssin
8ee06f02b1 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-07 11:02:59 +02:00
Regis Houssin
41dcd9370a Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-07 08:01:48 +02:00
Regis Houssin
c8eb666826 Fix: compatibility with multicompany 2012-07-06 20:53:18 +02:00
Regis Houssin
6f919da5d9 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-06 10:24:24 +02:00
Regis Houssin
ff048175f7 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-06 09:54:54 +02:00
Regis Houssin
ce7f45ab1f Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-05 15:51:42 +02:00
Regis Houssin
8befcb9477 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-05 15:41:22 +02:00
Regis Houssin
bf9fd6a2da Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-03 21:15:02 +02:00
Regis Houssin
ab6129a1cc Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-03 16:43:42 +02:00
Regis Houssin
b0ab71db5f Fix: merge problem 2012-07-02 22:47:19 +02:00
Regis Houssin
7f021ad5d9 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-02 22:43:00 +02:00
Regis Houssin
3e30cde02e Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-02 20:07:44 +02:00
Regis Houssin
92858a7b47 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-02 17:13:39 +02:00
Regis Houssin
067a9b0820 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git
into 3.2.1

Conflicts:
	htdocs/product/class/product.class.php
2012-07-02 15:49:04 +02:00
Regis Houssin
cd3df1d6e1 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-07-02 10:39:40 +02:00
Regis Houssin
b632c2233b Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git
into 3.2.1
2012-07-02 10:17:42 +02:00
Regis Houssin
123b45aa4b Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-29 10:10:18 +02:00
Regis Houssin
87f2ec663d Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-29 09:37:46 +02:00
Regis Houssin
11f78c1913 Fix: add ckeditor create div option with dolibarr_mailings toolbar 2012-06-27 16:39:39 +02:00
Regis Houssin
3164b5615c Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-27 16:37:47 +02:00
Regis Houssin
56f7d31d11 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-21 09:03:14 +02:00
Regis Houssin
d941d1efee Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git
into 3.2.1

Conflicts:
	build/makepack-dolibarr.pl
	htdocs/filefunc.inc.php
	htdocs/install/inc.php
2012-06-20 22:29:28 +02:00
Regis Houssin
9b1047eea7 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git
into 3.2.1
2012-06-16 08:26:26 +02:00
Regis Houssin
707bffd181 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-13 21:54:27 +02:00
Regis Houssin
c4fbdbbce4 Fix: mutualize ckeditor parameters 2012-06-12 23:13:59 +02:00
Regis Houssin
548266d607 Fix: uniformize code 2012-06-11 21:46:37 +02:00
Regis Houssin
fb15ea20c6 Fix: update jquery-cookie plugin 2012-06-11 17:27:20 +02:00
Regis Houssin
c9be1cbb8b Fix: missing remove_file action
Fix: use object instead id and store odt filename in object for use in
triggers
2012-06-10 17:09:44 +02:00
Regis Houssin
eef50058b1 Fix: bad parameters, use global 2012-06-10 10:30:45 +02:00
Regis Houssin
c9c4ba2a72 Fix: problem with external modules and uniformize code
Conflicts:
	htdocs/comm/propal/document.php
	htdocs/core/class/fileupload.class.php
	htdocs/projet/fiche.php

Change-Id: Ib36cd4d6ad5eb1e9ad2a188ef276f37c098cfef4
2012-06-09 18:47:16 +02:00
Regis Houssin
db148c4233 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-09 07:51:38 +02:00
Regis Houssin
c512585670 Fix: delete or rename a document product dir 2012-06-08 21:41:37 +02:00
Regis Houssin
1b19fddbc6 Fix: missing oldcopy during update 2012-06-08 21:41:21 +02:00
Regis Houssin
1c3bf3bb22 Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1 2012-06-08 18:21:22 +02:00
Regis Houssin
176c6013ec Fix: bad option name 2012-06-08 11:48:07 +02:00
Regis Houssin
6f28b69804 Fix: add iframe transport for compatibility with all browser 2012-06-08 11:36:46 +02:00
Regis Houssin
92bb9c99f5 Release 3.2.1-alpha 2012-06-08 07:43:42 +02:00
Regis Houssin
aee1c3b069 Fix: more clean code for new version of jQuery fileupload 2012-06-08 07:25:55 +02:00
Regis Houssin
1f4be4cfed Fix: stock message in session and reload the page for avoid url problem
with jQuery fileupload
2012-06-08 07:25:43 +02:00
Regis Houssin
a04ca9449a New: update jQuery and jQuery UI 2012-06-08 07:25:31 +02:00
Regis Houssin
1649a9a1b1 Fix: reload page after file upload completed 2012-06-08 07:25:20 +02:00
Regis Houssin
8c4ddb99be Fix: add max file size 2012-06-08 07:25:07 +02:00
Regis Houssin
bef5b66dab Fix: replace Bootstrap version by jQueryUI version 2012-06-08 07:24:52 +02:00
Regis Houssin
c43b5f99ac Works on jQuery fileupload upgrade (Todo: css problem) 2012-06-08 07:24:22 +02:00
484 changed files with 18514 additions and 15969 deletions

View File

@@ -21,8 +21,8 @@ PHPExcel 1.7.6 LGPL 2.1 Yes Read/Write XLS files, read ODS files
TCPDF 5.9.098 LGPL 3.0 Yes PDF generation
JS libraries:
jQuery 1.7.1 GPL and MIT Licence Yes JS library
jQuery UI 1.8.17 GPL and MIT Licence Yes JS library plugin UI
jQuery 1.7.2 GPL and MIT Licence Yes JS library
jQuery UI 1.8.20 GPL and MIT Licence Yes JS library plugin UI
jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors
jQuery DataTable 1.8.1 BSD Yes JS library for tables output
jQuery Flot 0.7 MIT Licence Yes JS library to build graph
@@ -51,6 +51,7 @@ Copyright (C) 2012
- Juanjo Menent <jmenent@2byte.es>
- Philippe Grand <philippe.grand@atoo-net.com>
- Jean Heimburger <jean@tiaris.info>
- Marcos García <marcosgdf@gmail.com>
Copyright (C) 2011
- Laurent Destailleur <eldy@users.sourceforge.net>

View File

@@ -2,7 +2,50 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 3.2.0 compared to 3.1.2 *****
***** ChangeLog for 3.2.2 compared to 3.2.1 *****
- Fix: Modify spanish VAT to new rates.
- Fix: Add error message when creating already existing product.
- Fix: Edition of percentage of an event.
- Fix: Minor look fix for theme bureau2crea.
- Fix: Start and end date not saved at project creation
- Fix: Default vat is zero for customer invoices if company does not use vat
- Fix: Localtaxes unit prices precision
***** ChangeLog for 3.2.1 compared to 3.2.0 *****
- Fix: Edit of projects.
- Fix: Activation of modules does not fails if directory install was removed.
- Fix: [ bug #444 ] Regression on auto-closing for proposals and orders.
- Fix: Update translations (catalan, french, spanish, brazilian).
- Fix: [ bug #445 ] Hex escaping in descriptions.
- Fix: error when validating shipment for non predefined products with a
selected warehouse.
- Fix: Bad local taxes if price base type is TTC for spanish local taxes.
- Fix: Phone not saved when using web service.
- Fix: [ bug #464 ] Payment form should allow to add transmitter for bank transfers.
- Fix: Allows to use a comma decimal separator in supplier invoices payments.
- Fix: Translation for tr_TR, es_ES, pt_BR.
- Fix: Products with no prices not visible.
- Fix: Access to product card created with very old version of Dolibarr.
- Fix: Delete temporary files after validating an invoice.
- Fix: preview of supplier order and invoice template.
- Fix: [ bug #485 ] Configurated amount for public auto-subscription form is not taken into account
- Fix: Average amount graphs weren't comparing the previous year stats
- Fix: Closed project didn't show the new status unless the page was refreshed
- Fix: Files were not being uploaded to a project's task
- Fix: [ bug #503 ] Unable to delete linked file to a deposit
- Fix: [ bug #501 ] Error while trying to modify an user
- Fix: [ bug #506 ] Can't set percentage of a started event
- Fix: Bad assignation of const for pdf delivery module name
***** ChangeLog for 3.2.0 compared to 3.1.3 *****
WARNING: PHP lower than 5.x are no more supported.
WARNING: Because of a major datastructure change onto supplier prices tables, be aware
to make a backup of your database before making upgrade.
@@ -99,6 +142,15 @@ WARNING: To reduce technic debt, all functions dolibarr_xxx were renamed int dol
***** ChangeLog for 3.1.3 compared to 3.1.2 *****
Fix: PgSQL - property must be set if success
Fix: Provide a solution for backup when mysqldump is not available
Fix: Bug #460 - Wrong entity assignment when creating a warehouse
Fix: bug #405 - Late icon always displayed on comm/propal.php
***** ChangeLog for 3.1.2 compared to 3.1.1 *****
- Fix: Can clone a proposal
@@ -132,6 +184,7 @@ WARNING: To reduce technic debt, all functions dolibarr_xxx were renamed int dol
***** ChangeLog for 3.1 compared to 3.0 *****
WARNING: IE6 browser is no more supported in this version.
For users:
- New: War against number of clicks:

View File

@@ -1,4 +1,4 @@
dolibarr (3.2.0+nmu1) unstable; urgency=low
dolibarr (3.2.3+nmu1) unstable; urgency=low
* Non-maintainer upload.
* New upstream release.

View File

@@ -180,11 +180,17 @@ case "$1" in
# Now run the drop user
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then
echo postrm Database login $dbuser removed
echo postrm Database login $dbuser@localhost removed
else
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\""
echo postrm $error
fi
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'%';\"" ; then
echo postrm Database login $dbuser@% removed
else
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'%';\""
echo postrm $error
fi
# Now run the drop commands
if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then

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.2.0
PROJECT_NUMBER = 3.2.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.2.0
AppVerName=DoliWamp-3.2.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.2.0
OutputBaseFilename=DoliWamp-3.2.3
; Define full path from wich all relative path are defined
; You must modify this to put here your dolibarr root directory
;SourceDir=C:\Documents and Settings\ldestail\git\dolibarr_old

4
build/makepack-dolibarr.pl Normal file → Executable file
View File

@@ -10,7 +10,7 @@ use Cwd;
$PROJECT="dolibarr";
$MAJOR="3";
$MINOR="2";
$BUILD="0"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$BUILD="3"; # 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
@@ -412,7 +412,7 @@ if ($nboftargetok) {
print "Go to directory $BUILDROOT\n";
$olddir=getcwd();
chdir("$BUILDROOT");
$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\\*";
$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\/*";
print $cmd."\n";
$ret= `$cmd`;
chdir("$olddir");

0
build/makepack-dolibarrmodule.pl Normal file → Executable file
View File

0
build/makepack-dolibarrtheme.pl Normal file → Executable file
View File

View File

@@ -34,7 +34,7 @@ This files describe steps made by Dolibarr packaging team to make a
complete release of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in /ChangeLog and /filefunc.inc.php
- Update version/info in /ChangeLog
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
- Update version number with x.x.x-y in htdocs/filefunc.inc.php

View File

@@ -4,8 +4,8 @@
<CompanyName />
<Program_Info>
<Program_Name>DoliWamp</Program_Name>
<Program_Version>3.2..0</Program_Version>
<Program_Release_Month>05</Program_Release_Month>
<Program_Version>3.2.2</Program_Version>
<Program_Release_Month>09</Program_Release_Month>
<Program_Release_Day>10</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars />

View File

@@ -4,8 +4,8 @@
<CompanyName />
<Program_Info>
<Program_Name>Dolibarr</Program_Name>
<Program_Version>3.2.0</Program_Version>
<Program_Release_Month>05</Program_Release_Month>
<Program_Version>3.2.2</Program_Version>
<Program_Release_Month>09</Program_Release_Month>
<Program_Release_Day>10</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars />

View File

@@ -34,9 +34,9 @@
</Company_Info>
<Program_Info>
<Program_Name>Dolibarr</Program_Name>
<Program_Version>3.2.0</Program_Version>
<Program_Release_Month>06</Program_Release_Month>
<Program_Release_Day>18</Program_Release_Day>
<Program_Version>3.2.3</Program_Version>
<Program_Release_Month>09</Program_Release_Month>
<Program_Release_Day>24</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars />
<Program_Cost_Other_Code />

View File

@@ -34,9 +34,9 @@
</Company_Info>
<Program_Info>
<Program_Name>DoliWamp</Program_Name>
<Program_Version>3.2.0</Program_Version>
<Program_Release_Month>06</Program_Release_Month>
<Program_Release_Day>18</Program_Release_Day>
<Program_Version>3.2.3</Program_Version>
<Program_Release_Month>09</Program_Release_Month>
<Program_Release_Day>24</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars />
<Program_Cost_Other_Code />

View File

@@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
return ( "3.2.0", "3.1.1", "3.0.1", "2.9.0" );
return ( "3.2.1", "3.1.1", "3.0.1", "2.9.0" );
}
sub script_dolibarr_category
@@ -362,7 +362,9 @@ sub script_dolibarr_check_latest
{
local ($ver) = @_;
local @vers = &osdn_package_versions("dolibarr",
$ver >= 3 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.2 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.1 ? "dolibarr\\-(3\\.1\\.[0-9\\.]+)\\.tgz" :
$ver >= 3 ? "dolibarr\\-(3\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 2.9 ? "dolibarr\\-(2\\.9\\.[0-9\\.]+)\\.tgz" :
"dolibarr\\-(2\\.8\\.[0-9\\.]+)\\.tgz");
return "Failed to find versions" if (!@vers);

View File

@@ -312,5 +312,5 @@ fi
%changelog
* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
- Initial version (#723326)

View File

@@ -368,5 +368,5 @@ fi
%changelog
* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
- Initial version (#723326)

View File

@@ -301,5 +301,5 @@ fi
%changelog
* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
- Initial version (#723326)

View File

@@ -306,5 +306,5 @@ fi
%changelog
* Mon Jun 18 2012 Laurent Destailleur 3.2.0-0.3
* Mon Sep 24 2012 Laurent Destailleur 3.2.3-0.3
- Initial version (#723326)

View File

@@ -1763,290 +1763,6 @@ LOCK TABLES `llx_c_ziptown` WRITE;
/*!40000 ALTER TABLE `llx_c_ziptown` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_c_banques`
--
DROP TABLE IF EXISTS `llx_cabinetmed_c_banques`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_c_banques` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(8) NOT NULL,
`label` varchar(64) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_c_banques`
--
LOCK TABLES `llx_cabinetmed_c_banques` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_c_banques` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_c_banques` (`rowid`, `code`, `label`, `active`) VALUES (1,'HSBC','HSBC',1);
/*!40000 ALTER TABLE `llx_cabinetmed_c_banques` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_c_examconclusion`
--
DROP TABLE IF EXISTS `llx_cabinetmed_c_examconclusion`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_c_examconclusion` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(8) NOT NULL,
`label` varchar(64) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_c_examconclusion`
--
LOCK TABLES `llx_cabinetmed_c_examconclusion` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_c_examconclusion` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_c_examconclusion` (`rowid`, `code`, `label`, `active`) VALUES (1,'AUTRE','Autre',1);
/*!40000 ALTER TABLE `llx_cabinetmed_c_examconclusion` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_cons`
--
DROP TABLE IF EXISTS `llx_cabinetmed_cons`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_cons` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_soc` int(11) DEFAULT NULL,
`fk_user_creation` int(11) NOT NULL,
`datecons` date NOT NULL,
`typepriseencharge` varchar(8) DEFAULT NULL,
`motifconsprinc` varchar(64) DEFAULT NULL,
`diaglesprinc` varchar(64) DEFAULT NULL,
`motifconssec` text,
`diaglessec` text,
`hdm` text,
`examenclinique` text,
`examenprescrit` text,
`traitementprescrit` text,
`comment` text,
`typevisit` varchar(8) NOT NULL,
`infiltration` varchar(256) DEFAULT NULL,
`codageccam` varchar(16) DEFAULT NULL,
`montant_cheque` double(24,8) DEFAULT NULL,
`montant_espece` double(24,8) DEFAULT NULL,
`montant_carte` double(24,8) DEFAULT NULL,
`montant_tiers` double(24,8) DEFAULT NULL,
`banque` varchar(128) DEFAULT NULL,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`rowid`),
KEY `idx_cabinetmed_cons_fk_soc` (`fk_soc`),
KEY `idx_cabinetmed_cons_datecons` (`datecons`),
CONSTRAINT `fk_cabinetmed_cons_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_cons`
--
LOCK TABLES `llx_cabinetmed_cons` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_cons` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_cons` (`rowid`, `fk_soc`, `fk_user_creation`, `datecons`, `typepriseencharge`, `motifconsprinc`, `diaglesprinc`, `motifconssec`, `diaglessec`, `hdm`, `examenclinique`, `examenprescrit`, `traitementprescrit`, `comment`, `typevisit`, `infiltration`, `codageccam`, `montant_cheque`, `montant_espece`, `montant_carte`, `montant_tiers`, `banque`, `tms`) VALUES (2,2,1,'2011-04-17',NULL,'Cervicalgies Inflammatoires','Arthrite Microcristalline','','','','rrrr','','','','CS','','',NULL,55.00000000,NULL,NULL,'','2011-05-25 13:59:03'),(3,2,1,'2011-05-01',NULL,'Cervicalgies Mécaniques','Arthrite Goutteuse','yyyykk\r\nDorsalgie\r\nDorsalgies Inflammatoires\r\nDouleur Chevillep\r\nDouleur Genou\r\nDouleur Genou','','lll','','','','','CS','','',NULL,NULL,NULL,50.00000000,'','2011-05-25 13:59:03'),(4,4,1,'2011-05-02',NULL,'Autre','Arthrite Goutteuse','','','','','','','','CCAM','inf','ccam',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-25 13:59:03'),(5,5,1,'2011-05-02',NULL,'Cervicalgies Inflammatoires','Arthrite Microcristalline','','dgdfg','','','','','','CCAM','ingg','pp',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-28 15:22:22'),(6,5,1,'2011-05-02',NULL,'Cervicalgies Inflammatoires','Arthrose FémoroPatellaire','','','','','','kk','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-25 13:59:03'),(7,4,1,'2011-05-03',NULL,'Cervicalgies Mécaniques','Arthrite Goutteuse','Douleur Cheville','Arthrite Microcristalline','fd','fd','Bilan Phosphocalcique','fdf','fdfd','CCAM','lllll','kkk',NULL,NULL,NULL,0.00000000,'','2011-06-14 23:13:42'),(8,5,1,'2011-05-03',NULL,'Cervicalgies Mécaniques','gggg','','','pppljklj','','','','','CS','kmlkmlkml mlmlkmkm mk ml mlk','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-28 15:00:27'),(10,3,1,'2011-05-07',NULL,'dfgdf','gfdgd','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-25 13:59:03'),(11,9,1,'2011-05-25',NULL,'Dérobement Membres Inférieurs','Arthrite Goutteuse','Dorsalgie\r\nDorsalgies Mécaniques','Lomboradiculalgie Discale\r\nLombosciatique L5 gauche','','','ArthroScanner Genou\r\nIRM Genou\r\nIRM Rachis Lombaire','1\r\n2\r\n3\r\n4\r\n5\r\n6','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-05-28 15:58:29'),(12,32,1,'2011-06-08',NULL,'Cervicalgies Inflammatoires','Arthrite Goutteuse','','','','','','','','CS','','',NULL,NULL,NULL,50.00000000,'','2011-06-08 14:38:10'),(13,26,1,'2011-06-13',NULL,'Cervicalgies Mécaniques','Arthrite Microcristalline','','','','','ArthroScanner Hanche','Traitement prescrit.','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-06-13 15:25:39'),(14,26,1,'2011-06-13',NULL,'Douleur Membre inférieur Gauche','Lombosciatique L5 gauche','','Lombalgie Discale','','','','AINS (biprohénide), murolaxan\r\ndoliprane\r\n+ rééduction','','CCAM','infiltr épidurale','AHLB001',90.00000000,NULL,NULL,NULL,'HSBC','2011-06-13 16:16:43'),(15,1,1,'2011-06-13',NULL,'Cervicalgies Mécaniques','Arthrite Microcristalline','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-06-13 18:07:26'),(16,36,1,'2011-06-15',NULL,'gdfgfd','gdfgdfgdf','','','','','ArthroScanner Epaule','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-06-15 00:28:43'),(17,36,1,'2011-06-15',NULL,'hfghfg','hgfhfghf','','','','','','','','CS','','',NULL,10.00000000,NULL,NULL,'','2011-06-15 00:31:57'),(18,65,1,'2011-07-06',NULL,'Cervicalgies Inflammatoires','aaaaa','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-07-06 20:17:20'),(19,67,1,'2011-07-11',NULL,'Cervicalgies Inflammatoires','Canal Carpien','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-07-10 21:23:30'),(20,68,1,'2011-07-13',NULL,'Cervicalgies Mécaniques','Autre','','','','','','','','CS','','',50.00000000,NULL,NULL,NULL,'HSBC','2011-07-13 16:26:21'),(21,68,1,'2011-07-13',NULL,'aaaa','bbbb','','','','','','','','CS','','',NULL,NULL,50.00000000,NULL,'','2011-07-13 18:18:29'),(22,68,1,'2011-07-13',NULL,'lll','llll','','','','','','','','CS','','',NULL,NULL,10.00000000,NULL,'','2011-07-13 18:21:57'),(23,68,1,'2011-07-13',NULL,'oo','oo','','','','','','','','CS','','',NULL,NULL,NULL,5.00000000,'','2011-07-13 18:26:18');
/*!40000 ALTER TABLE `llx_cabinetmed_cons` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_diaglec`
--
DROP TABLE IF EXISTS `llx_cabinetmed_diaglec`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_diaglec` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(8) NOT NULL,
`label` varchar(64) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_diaglec`
--
LOCK TABLES `llx_cabinetmed_diaglec` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_diaglec` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_diaglec` (`rowid`, `code`, `label`, `active`) VALUES (1,'AUTRE','Autre',1),(2,'LOMBL5D','Lombosciatique L5 droite',1),(3,'LOMBL5G','Lombosciatique L5 gauche',1),(4,'LOMBS1D','Lombosciatique S1 droite',1),(5,'LOMBS1G','Lombosciatique S1 gauche',1),(6,'NCB','Névralgie cervico-brachiale',1),(7,'PR','Polyarthrite rhumatoide',1),(8,'SA','Spondylarthrite ankylosante',1),(9,'GFTI','Gonarthrose fémoro-tibaile interne',1),(10,'GFTE','Gonarthrose fémoro-tibiale externe',1),(11,'COX','Coxarthrose',1),(12,'CC','Canal Carpien',1),(16,'CLER','Canal Lombaire Etroit et/ou Rétréci',1),(22,'RH PSO','Rhumatisme Psoriasique',1),(23,'LEAD','Lupus',1),(24,'LBDISC','Lombalgie Discale',1),(25,'LBRADD','Lomboradiculalgie Discale',1),(26,'LBRADND','Lomboradiculalgie Non Discale',1),(27,'CH ROT','Chondropathie Rotulienne',1),(28,'AFP','Arthrose FémoroPatellaire',1),(29,'PPR','Pseudo Polyarthrite Rhizomélique',1),(30,'SHARP','Maladie de Sharp',1),(31,'SAPHO','SAPHO',1),(32,'OMARTHC','Omarthrose Centrée',1),(33,'RH CCA','Rhumatisme Chondro Calcinosique',1),(34,'GOUTTE','Arthrite Goutteuse',1),(35,'CCA','Arthrite Chondro Calcinosique',1),(36,'ARTH MCR','Arthrite Microcristalline',1),(37,'CSA','Conflit Sous Acromial',1),(38,'TDCALCE','Tendinopathie Calcifiante d\'Epaule',1),(39,'TDCALCH','Tendinopathie Calcifiante de Hanche',1),(40,'TBT','TendinoBursite Trochantérienne',1),(41,'OMARTHE','Omarthrose Excentrée',1);
/*!40000 ALTER TABLE `llx_cabinetmed_diaglec` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_examaut`
--
DROP TABLE IF EXISTS `llx_cabinetmed_examaut`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_examaut` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_soc` int(11) DEFAULT NULL,
`dateexam` date NOT NULL,
`examprinc` varchar(64) DEFAULT NULL,
`examsec` text,
`concprinc` varchar(64) DEFAULT NULL,
`concsec` text,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_examaut`
--
LOCK TABLES `llx_cabinetmed_examaut` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_examaut` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_examaut` (`rowid`, `fk_soc`, `dateexam`, `examprinc`, `examsec`, `concprinc`, `concsec`, `tms`) VALUES (1,2,'2011-05-08','ArthroScanner Genou','ArthroScanner EpauleeeeArthroScanner HancheIRM EpauleggggBilan Radio ScolioseuuuuqqqqlIRM Rachis Cervical','Autre','','2011-05-01 14:47:57'),(2,2,'2011-05-02','dd','ArthroScanner Hanche\r\nBilan Radio Scoliose\r\neeee\r\nElectromiogramme','dd','','2011-05-01 23:49:59'),(3,32,'2011-06-08','ArthroScanner Genou','gdfgdfgdfgdfgdfgdfgd','Autre','','2011-06-08 14:54:45'),(4,32,'2011-06-08','IRM SacroIliaques','','fsdfsdfsdfsd','','2011-06-08 14:57:01'),(5,26,'2011-06-13','Bilan Radio Rhumatisme Inflammatoire','','Autre','','2011-06-13 15:27:39'),(6,26,'2011-06-13','ArthroScanner Genou','Autre','Autre','','2011-06-13 15:29:31'),(7,26,'2011-06-13','Scanner Lombaire','','Hernie discale L4-L5 gauche','','2011-06-13 16:20:47'),(8,65,'2011-07-06','ArthroScanner Hanche','','Autre','','2011-07-06 20:17:54');
/*!40000 ALTER TABLE `llx_cabinetmed_examaut` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_exambio`
--
DROP TABLE IF EXISTS `llx_cabinetmed_exambio`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_exambio` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`fk_soc` int(11) DEFAULT NULL,
`dateexam` date NOT NULL,
`resultat` text,
`conclusion` text,
`comment` text,
`suivipr_ad` int(11) DEFAULT NULL,
`suivipr_ag` int(11) DEFAULT NULL,
`suivipr_vs` int(11) DEFAULT NULL,
`suivipr_eva` int(11) DEFAULT NULL,
`suivipr_err` int(11) DEFAULT NULL,
`suivisa_fat` int(11) DEFAULT NULL,
`suivisa_dax` int(11) DEFAULT NULL,
`suivisa_dpe` int(11) DEFAULT NULL,
`suivisa_dpa` int(11) DEFAULT NULL,
`suivisa_rno` int(11) DEFAULT NULL,
`suivisa_dma` int(11) DEFAULT NULL,
`suivisa_basdai` double DEFAULT NULL,
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`suivisa_das28` double DEFAULT NULL,
`suivipr_das28` double DEFAULT NULL,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_exambio`
--
LOCK TABLES `llx_cabinetmed_exambio` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_exambio` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_exambio` (`rowid`, `fk_soc`, `dateexam`, `resultat`, `conclusion`, `comment`, `suivipr_ad`, `suivipr_ag`, `suivipr_vs`, `suivipr_eva`, `suivipr_err`, `suivisa_fat`, `suivisa_dax`, `suivisa_dpe`, `suivisa_dpa`, `suivisa_rno`, `suivisa_dma`, `suivisa_basdai`, `tms`, `suivisa_das28`, `suivipr_das28`) VALUES (1,2,'2011-05-01','aaajhkh','bbb','ccc',NULL,NULL,NULL,NULL,NULL,1,2,3,4,5,6,NULL,'2011-05-01 14:45:54',NULL,NULL),(3,2,'2011-05-01','dd','hfghfg','',1,2,6,9,NULL,2,2,2,2,2,2,NULL,'2011-05-01 15:24:06',NULL,NULL),(4,2,'2011-05-01','gdfgdf','1111','',NULL,NULL,NULL,NULL,NULL,1,7,8,9,10,11,NULL,'2011-05-01 15:25:17',NULL,NULL),(5,2,'2011-05-01','fdsfsdfsdfsd','ccccc','fsdfsdfs',1,2,4,3,NULL,1,2,3,4,5,6,NULL,'2011-05-01 16:37:51',NULL,NULL),(6,2,'2011-05-01','gfdgdfgdf','gdfgdf','',5,NULL,NULL,NULL,NULL,1,NULL,1,1,NULL,NULL,NULL,'2011-05-01 16:43:49',NULL,NULL),(8,1,'2011-05-01','lkjljkl','','',1,2,4,3,NULL,5,10,5,6,5,5,6.2,'2011-05-01 16:46:00',NULL,1.97),(9,32,'2011-06-08','retert','trete','',1,2,4,1,NULL,2,5,2,5,4,6,NULL,'2011-06-08 14:47:30',NULL,NULL),(10,32,'2011-06-08','fgdfgdfg','gfgdfgdf','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-08 14:54:23',NULL,NULL),(11,26,'2011-06-13','result bio 1','conclusion bio 1','',1,2,4,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-13 15:27:15',NULL,NULL),(12,26,'2011-06-13','result bio 2','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-13 15:27:25',NULL,NULL),(13,26,'2011-06-13','VS8\r\nCRP inférieur ) 5','Pas de syndrome inflammatoire.','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-13 16:19:08',NULL,NULL),(14,26,'2011-06-13','','','',NULL,NULL,NULL,NULL,NULL,1,2,2,4,5,6,NULL,'2011-06-13 16:19:38',NULL,NULL),(15,26,'2011-06-13','','','',1,2,4,3,NULL,1,2,3,4,5,6,0.31,'2011-06-13 17:50:25',NULL,1.97),(16,36,'2011-06-15','gdfgddfhghghhfghf','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-06-15 08:02:03',NULL,NULL),(17,65,'2011-07-06','hfghfghgf','Zob','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-07-06 20:17:33',NULL,NULL),(18,67,'2011-07-11','gfdg','gfdg','gfd',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-07-10 22:23:21',NULL,NULL),(19,62,'2011-07-13','dfgdf','gdfd','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2011-07-13 15:56:27',NULL,NULL);
/*!40000 ALTER TABLE `llx_cabinetmed_exambio` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_examenprescrit`
--
DROP TABLE IF EXISTS `llx_cabinetmed_examenprescrit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_examenprescrit` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(8) NOT NULL,
`label` varchar(64) NOT NULL,
`biorad` varchar(8) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_examenprescrit`
--
LOCK TABLES `llx_cabinetmed_examenprescrit` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_examenprescrit` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_examenprescrit` (`rowid`, `code`, `label`, `biorad`, `active`) VALUES (1,'AUTRE','Autre','AUTRE',1),(2,'IRMLOMB','IRM lombaire','RADIO',1),(5,'TDMLOMB','TDM lombaires','RADIO',1),(6,'RX BRL','Radios Bassin-Rachis Lombaire','RADIO',1),(7,'RX RL','Radios Rachis Lombaire','RADIO',1),(8,'RX BASS','Radios Bassin','RADIO',1),(9,'RX BH','Radios Bassin et Hanches','RADIO',1),(10,'RX GEN','Radios Genoux','RADIO',1),(11,'RX CHEV','Radios Chevilles','RADIO',1),(12,'RX AVPD','Radios Avants-Pieds','RADIO',1),(13,'RX EP','Radio Epaule','RADIO',1),(14,'RX MAINS','Radios Mains','RADIO',1),(15,'RX COUDE','Radios Coude','RADIO',1),(16,'RX RC','Radios Rachis Cervical','RADIO',1),(17,'RX RD','Radios Rachis Dorsal','RADIO',1),(18,'RX RCD','Radios Rachis CervicoDorsal','RADIO',1),(19,'RX RDL','Radios DorsoLombaire','RADIO',1),(20,'RX SCO','Bilan Radio Scoliose','RADIO',1),(21,'RX RIC','Bilan Radio Rhumatisme Inflammatoire','RADIO',1),(22,'TDM LOMB','Scanner Lombaire','RADIO',1),(23,'TDM DORS','Scanner Dorsal','RADIO',1),(24,'TDM CERV','Scanner Cervical','RADIO',1),(25,'TDM HANC','Scanner Hanche','RADIO',1),(26,'TDM GEN','Scanner Genou','RADIO',1),(27,'RX RDL','Radios Rachis DorsoLombaire','RADIO',1),(28,'ARTTDMG','ArthroScanner Genou','RADIO',1),(29,'ARTTDME','ArthroScanner Epaule','RADIO',1),(30,'ARTTDMH','ArthroScanner Hanche','RADIO',1),(31,'IRM GEN','IRM Genou','RADIO',1),(32,'IRM HANC','IRM Hanche','RADIO',1),(33,'IRM EP','IRM Epaule','RADIO',1),(34,'IRM SIL','IRM SacroIliaques','RADIO',1),(35,'IRM RL','IRM Rachis Lombaire','RADIO',1),(36,'IRM RD','IRM Rachis Dorsal','RADIO',1),(37,'IRM RC','IRM Rachis Cervical','RADIO',1),(38,'ELECMI','Electromiogramme','RADIO',1),(39,'NFS','NFS','BIO',1),(40,'BILPHO','Bilan Phosphocalcique','BIO',1),(41,'VSCRP','VS/CRP','BIO',1),(42,'EPP','Electrophorèse Protéine Plasmatique','BIO',1);
/*!40000 ALTER TABLE `llx_cabinetmed_examenprescrit` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_motifcons`
--
DROP TABLE IF EXISTS `llx_cabinetmed_motifcons`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_motifcons` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(8) NOT NULL,
`label` varchar(64) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_motifcons`
--
LOCK TABLES `llx_cabinetmed_motifcons` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_motifcons` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_motifcons` (`rowid`, `code`, `label`, `active`) VALUES (5,'AUTRE','Autre',1),(6,'DORS','Dorsalgie',1),(7,'DOLMSD','Douleur Membre supérieur Droit',1),(8,'DOLMSG','Douleur Membre supérieur Gauche',1),(9,'DOLMID','Douleur Membre inférieur Droit',1),(10,'DOLMIG','Douleur Membre inférieur Gauche',1),(11,'PARESM','Paresthésie des mains',1),(12,'DOLEPG','Douleur épaule gauche',1),(13,'DOLEPD','Douleur épaule droite',1),(14,'GONAD','Gonaglie droite',1),(15,'GONAG','Gonalgie gauche',1),(16,'DOLPD','Douleur Pied Droit',1),(17,'DOUL MIN','Douleur Membre Inférieur',1),(18,'POLYAR','Polyarthralgie',1),(19,'SUIVIPR','Suivi PR',1),(20,'SUIVISPA','Suivi SPA',1),(21,'SUIVIRIC','Suivi RI',1),(22,'SUIVIPPR','Suivi PPR',1),(23,'DOLINGD','Douleur inguinale Droit',1),(24,'DOLINGG','Douleur inguinale Gauche',1),(25,'DOLCOUDD','Douleur coude Droit',1),(26,'DOLCOUDG','Douleur coude Gauche',1),(27,'TALAL','Talalgie',1),(28,'DOLTENDC','Douleur tandous Calcanien',1),(29,'DEROB','Dérobement Membres Inférieurs',1),(30,'LOMB MEC','Lombalgies Mécaniques',1),(31,'LOMB INF','Lombalgies Inflammatoires',1),(32,'DORS MEC','Dorsalgies Mécaniques',1),(33,'DORS INF','Dorsalgies Inflammatoires',1),(34,'CERV MEC','Cervicalgies Mécaniques',1),(35,'SCIAT','LomboSciatique ',1),(36,'CRUR','LomboCruralgie',1),(37,'DOUL SUP','Douleur Membre Supérieur',1),(38,'INGUINAL','Inguinalgie',1),(39,'CERV INF','Cervicalgies Inflammatoires',1),(40,'DOUL EP','Douleur Epaule',1),(41,'DOUL POI','Douleur Poignet',1),(42,'DOUL GEN','Douleur Genou',1),(43,'DOUL COU','Douleur Coude',1),(44,'DOUL HAN','Douleur Hanche',1),(45,'PAR MBRS','Paresthésies Membres Inférieurs',1),(46,'PAR MBRI','Paresthésies Membres Supérieurs',1),(47,'TR RACHI','Traumatisme Rachis',1),(48,'TR MBRS','Traumatisme Membres Supérieurs',1),(49,'TR MBRI','Traumatisme Membres Inférieurs',1),(50,'FAT MBRI','Fatiguabilité Membres Inférieurs',1),(51,'DOUL CHE','Douleur Cheville',1),(52,'DOUL PD','Douleur Pied',1),(53,'DOUL MA','Douleur Main',1);
/*!40000 ALTER TABLE `llx_cabinetmed_motifcons` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_cabinetmed_patient`
--
DROP TABLE IF EXISTS `llx_cabinetmed_patient`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_cabinetmed_patient` (
`rowid` int(11) NOT NULL AUTO_INCREMENT,
`note_antemed` text,
`note_antechirgen` text,
`note_antechirortho` text,
`note_anterhum` text,
`note_other` text,
`note_traitclass` text,
`note_traitallergie` text,
`note_traitintol` text,
`note_traitspec` text,
PRIMARY KEY (`rowid`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `llx_cabinetmed_patient`
--
LOCK TABLES `llx_cabinetmed_patient` WRITE;
/*!40000 ALTER TABLE `llx_cabinetmed_patient` DISABLE KEYS */;
INSERT INTO `llx_cabinetmed_patient` (`rowid`, `note_antemed`, `note_antechirgen`, `note_antechirortho`, `note_anterhum`, `note_other`, `note_traitclass`, `note_traitallergie`, `note_traitintol`, `note_traitspec`) VALUES (2,'fffgfgfgf','','','','jjj','aaaagggggggg','','',''),(5,'a','b','c','d','','','','i','u'),(8,NULL,NULL,NULL,NULL,NULL,'','','','tr<span style=\"color: rgb(178, 34, 34);\"><strong>e tre tert</strong></span>er<br />\r\nt<br />\r\nter tert'),(26,NULL,NULL,NULL,NULL,NULL,'','','intol','spec pharma'),(46,'hfhf','dddd','','hfghfg','',NULL,'',NULL,NULL);
/*!40000 ALTER TABLE `llx_cabinetmed_patient` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `llx_categorie`
--

View File

@@ -135,7 +135,7 @@ if ($conf->global->ADHERENT_USE_MAILMAN)
'ADHERENT_MAILMAN_LISTS'
);
print_fiche_titre("Mailman mailing list system",$lien,'');
print_fiche_titre($langs->trans('MailmanTitle'),$lien,'');
// JQuery activity
print '<script type="text/javascript">

View File

@@ -400,12 +400,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
if (! $error)
{
$bank_line_id=$paiement->addPaymentToBank($user,'payment','(SubscriptionPayment)',$accountid,$emetteur_nom,$emetteur_banque);
if (! $bank_line_id > 0)
if (! ($bank_line_id > 0))
{
$errmsg=$paiement->error;
$errmsgs=$paiement->errors;
$error++;
}
}
if (! $error)
{
// Update fk_bank for subscriptions
$sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id;
$sql.= ' WHERE rowid='.$crowid;

View File

@@ -708,36 +708,43 @@ class Adherent extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->affected_rows($resql))
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
$this->db->commit();
return 1;
}
else
{
// Rien a effacer
$this->db->rollback();
return 0;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -3;
}
// Remove linked user
$ret=$this->setUserId(0);
if ($ret > 0)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->affected_rows($resql))
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
$this->db->commit();
return 1;
}
else
{
// Rien a effacer
$this->db->rollback();
return 0;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -3;
}
}
}
else
{

View File

@@ -39,7 +39,13 @@ $langs->load('other');
$id=GETPOST('id','int');
$action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$mesg = "";
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id > 0)
@@ -114,7 +120,9 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$langs->load("other");
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}

View File

@@ -213,7 +213,7 @@ $var=true;
*/
$max=5;
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,";
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
$sql.= " a.tms as datem, datefin as date_end_subscription,";
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
@@ -242,12 +242,19 @@ if ($resql)
$staticmember->id=$obj->rowid;
$staticmember->lastname=$obj->lastname;
$staticmember->firstname=$obj->firstname;
if (! empty($obj->fk_soc)) {
$staticmember->socid = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name=$staticmember->thirdparty->name;
} else {
$staticmember->name=$obj->company;
}
$staticmember->ref=$staticmember->getFullName($langs);
$statictype->id=$obj->typeid;
$statictype->libelle=$obj->libelle;
print '<td>'.$staticmember->getNomUrl(1,24).'</td>';
print '<td>'.$statictype->getNomUrl(1,16).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->date_end),'dayhour').'</td>';
print '<td>'.$staticmember->getNomUrl(1,32).'</td>';
print '<td>'.$statictype->getNomUrl(1,32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem),'dayhour').'</td>';
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
print '</tr>';
$i++;
@@ -266,7 +273,7 @@ else
*/
$max=5;
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,";
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
$sql.= " datefin as date_end_subscription,";
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c";
@@ -297,9 +304,16 @@ if ($resql)
$staticmember->id=$obj->rowid;
$staticmember->lastname=$obj->lastname;
$staticmember->firstname=$obj->firstname;
if (! empty($obj->fk_soc)) {
$staticmember->socid = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name=$staticmember->thirdparty->name;
} else {
$staticmember->name=$obj->company;
}
$staticmember->ref=$staticmember->getFullName($langs);
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td>'.$staticmember->getNomUrl(1,24,'subscription').'</td>';
print '<td>'.$staticmember->getNomUrl(1,32,'subscription').'</td>';
print '<td>'.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).'</td>';
print '<td align="right">'.price($obj->cotisation).'</td>';
//print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
@@ -330,7 +344,7 @@ foreach ($AdherentType as $key => $adhtype)
{
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="type.php?rowid='.$adhtype->id.'">'.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(16)).'</a></td>';
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
print '<td align="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>';

View File

@@ -82,7 +82,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adh&eacute
$now=dol_now();
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe, ";
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe as company, d.fk_soc,";
$sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
@@ -130,7 +130,7 @@ if ($filter == 'uptodate')
}
if ($filter == 'outofdate')
{
$sql.=" AND datefin < '".$db->idate($now)."'";
$sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')";
}
// Insert categ filter
if ($search_categ)
@@ -237,7 +237,7 @@ if ($resql)
print '<td class="liste_titre">';
$listetype=$membertypestatic->liste_array();
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 12);
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 32);
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
@@ -267,6 +267,14 @@ if ($resql)
$memberstatic->lastname=$objp->lastname;
$memberstatic->firstname=$objp->firstname;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$companyname=$memberstatic->thirdparty->name;
} else {
$companyname=$objp->company;
}
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -276,14 +284,11 @@ if ($resql)
print "</td>\n";
// Lastname
if ($objp->societe != '')
{
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
}
else
{
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
}
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">";
print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : '');
print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : '');
print (! empty($companyname) ? dol_trunc($companyname, 32) : '');
print "</a></td>\n";
// Login
print "<td>".$objp->login."</td>\n";
@@ -292,7 +297,7 @@ if ($resql)
$membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type;
print '<td nowrap="nowrap">';
print $membertypestatic->getNomUrl(1,12);
print $membertypestatic->getNomUrl(1,32);
print '</td>';
// Moral/Physique

View File

@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -112,7 +112,7 @@ $dirbarcode=array_merge(array("/core/modules/barcode/"),$conf->barcode_modules);
foreach($dirbarcode as $reldir)
{
$dir=dol_buildpath($reldir,0);
$dir=dol_buildpath($reldir);
$newdir=dol_osencode($dir);
// Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
@@ -334,4 +334,4 @@ dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();
?>
?>

View File

@@ -759,7 +759,7 @@ else
// Forme juridique
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("JuridicalStatus").'</td><td>';
print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE,1);
print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
print '</td></tr>';
// ProfId1

View File

@@ -54,7 +54,7 @@ if ($action == 'updateMask')
{
$maskconstorder=GETPOST('maskconstorder','alpha');
$maskorder=GETPOST('maskorder','alpha');
if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -76,7 +76,7 @@ if ($action == 'specimen') // For orders
$commande = new CommandeFournisseur($db);
$commande->initAsSpecimen();
$commande->thirdparty=$specimenthirdparty;
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
@@ -90,13 +90,13 @@ if ($action == 'specimen') // For orders
break;
}
}
if ($filefound)
{
require_once($file);
$module = new $classname($db);
$module = new $classname($db,$commande);
if ($module->write_file($commande,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
@@ -122,7 +122,7 @@ if ($action == 'specimenfacture') // For invoices
$facture = new FactureFournisseur($db);
$facture->initAsSpecimen();
$facture->thirdparty=$specimenthirdparty; // Define who should has build the invoice (so the supplier)
// Search template files
$file=''; $classname=''; $filefound=0;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
@@ -136,13 +136,13 @@ if ($action == 'specimenfacture') // For invoices
break;
}
}
if ($filefound)
{
require_once($file);
$module = new $classname($db);
$module = new $classname($db,$facture);
if ($module->write_file($facture,$langs) > 0)
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
@@ -165,7 +165,7 @@ if ($action == 'set')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
@@ -197,7 +197,7 @@ if ($action == 'setdoc')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$db->begin();
if ($type == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))

View File

@@ -101,6 +101,9 @@ print "<br>\n";
if ($action == 'edit') // Edit
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
@@ -132,12 +135,10 @@ if ($action == 'edit') // Edit
print '</table><br>'."\n";
// Themes
show_theme('',1);
print '<br>';
// Liste des zone de recherche permanantes supportees
print '<table summary="search" class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td colspan="2">'.$langs->trans("Activated").'</td></tr>';
@@ -227,18 +228,19 @@ if ($action == 'edit') // Edit
// Message on login page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
$doleditor = new DolEditor('main_home', $conf->global->MAIN_HOME, '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, 90);
$doleditor->Create();
print '</td></tr>'."\n";
// Message of the day on home page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
$doleditor = new DolEditor('main_motd', $conf->global->MAIN_MOTD, '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, 90);
$doleditor->Create();
print '</td></tr>'."\n";
/*

View File

@@ -211,7 +211,7 @@ if (($action == 'send' || $action == 'sendhtml') && ! $_POST['addfile'] && ! $_P
$body=make_substitutions($body,$substitutionarrayfortest);
require_once(DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
$mailfile = new CMailFile(
$mailfile = new CMailFile(
$subject,
$sendto,
$email_from,
@@ -224,7 +224,7 @@ if (($action == 'send' || $action == 'sendhtml') && ! $_POST['addfile'] && ! $_P
$deliveryreceipt,
$msgishtml,
$errors_to
);
);
$result=$mailfile->sendfile();

View File

@@ -31,9 +31,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
$langs->load("errors");
$langs->load("admin");
$mode=isset($_GET["mode"])?GETPOST("mode"):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
$mode=GETPOST('mode', 'alpha');
if (!isset($mode)) {
if (isset($_SESSION['mode'])) { $mode=$_SESSION['mode'];}
else {$mode=0;}
}
$mesg=GETPOST("mesg");
$action=GETPOST('action');
$action=GETPOST('action', 'alpha');
$value=GETPOST('value', 'alpha');
if (!$user->admin) accessforbidden();
@@ -44,7 +49,7 @@ if (!$user->admin) accessforbidden();
if ($action == 'set' && $user->admin)
{
$result=activateModule($_GET["value"]);
$result=activateModule($value);
$mesg='';
if ($result) $mesg=$result;
Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg));
@@ -53,7 +58,7 @@ if ($action == 'set' && $user->admin)
if ($action == 'reset' && $user->admin)
{
$result=unActivateModule($_GET["value"]);
$result=unActivateModule($value);
$mesg='';
if ($result) $mesg=$result;
Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg));
@@ -128,9 +133,9 @@ foreach ($modulesdir as $dir)
{
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
dol_syslog($mesg, LOG_ERR);
continue;
continue;
}
try
{
$res=include_once($dir.$file);

View File

@@ -26,6 +26,7 @@
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
$langs->load("admin");
$langs->load("users");
@@ -79,37 +80,13 @@ $db->begin();
// Charge les modules soumis a permissions
$modules = array();
$modulesdir = array();
foreach ($conf->file->dol_document_root as $type => $dirroot)
{
$modulesdir[] = $dirroot . "/core/modules/";
if ($type == 'alt')
{
$handle=@opendir($dirroot);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes')
{
if (is_dir($dirroot . '/' . $file . '/core/modules/'))
{
$modulesdir[] = $dirroot . '/' . $file . '/core/modules/';
}
}
}
closedir($handle);
}
}
}
$modulesdir = dolGetModulesDirs();
foreach ($modulesdir as $dir)
{
// Load modules attributes in arrays (name, numero, orders) from dir directory
//print $dir."\n<br>";
$handle=@opendir($dir);
$handle=@opendir(dol_osencode($dir));
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
@@ -135,7 +112,6 @@ foreach ($modulesdir as $dir)
if ($objMod->rights_class)
{
$ret=$objMod->insert_permissions(0);
$modules[$objMod->rights_class]=$objMod;
//print "modules[".$objMod->rights_class."]=$objMod;";
}
@@ -151,7 +127,7 @@ $db->commit();
$sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r";
$sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
$sql.= " AND entity in (".(!empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
$sql.= " AND entity IN (".(! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
$sql.= " ORDER BY r.module, r.id";

View File

@@ -123,7 +123,7 @@ print '<td>'.$langs->trans("ConnectionTimeout").'</td><td align="right">';
print '</td>';
print '<td nowrap="nowrap">';
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.$conf->global->MAIN_USE_CONNECT_TIMEOUT.'">';
print ' '.$langs->trans("seconds");
print ' '.strtolower($langs->trans("Seconds"));
print '</td>';
print '</tr>';
@@ -134,7 +134,7 @@ print '<td>'.$langs->trans("ResponseTimeout").'</td><td align="right">';
print '</td>';
print '<td nowrap="nowrap">';
print '<input class="flat" name="MAIN_USE_RESPONSE_TIMEOUT" type="text" size="4" value="'.$conf->global->MAIN_USE_RESPONSE_TIMEOUT.'">';
print ' '.$langs->trans("seconds");
print ' '.strtolower($langs->trans("Seconds"));
print '</td>';
print '</tr>';

View File

@@ -171,7 +171,7 @@ print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print '</td>';
print '<td nowrap="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.$langs->trans("seconds");
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';

View File

@@ -75,7 +75,7 @@ print "<br>\n";
// Php
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Php")."</td></tr>\n";
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("PHP")."</td></tr>\n";
$phpversion=version_php();
print "<tr $bc[0]><td width=\"280\">".$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
print "<tr $bc[1]><td>".$langs->trans("PhpWebLink")."</td><td>".php_sapi_name()."</td></tr>\n";

View File

@@ -158,7 +158,7 @@ if ($what == 'mysql')
if (! empty($dolibarr_main_db_pass))
{
$paramcrypted.=' -p"'.preg_replace('/./i','*',$dolibarr_main_db_pass).'"';
$paramclear.=' -p"'.str_replace('"','\"',$dolibarr_main_db_pass).'"';
$paramclear.=' -p"'.str_replace(array('"','`'),array('\"','\`'),$dolibarr_main_db_pass).'"';
}
print '<b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";

View File

@@ -80,6 +80,7 @@ $workflowcodes=array();
$workflow=array(
'order' => array(
'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_ORDER')
//,'invoice' => array('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')
),
'invoice' => array (
'order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')

View File

@@ -39,9 +39,9 @@ print '<tr><td valign="top" width="40%" class="notopnoleft">';
/*
/* Chiffre d'affaire
/* Chiffre d'affaires
*/
//print_barre_liste("Chiffre d'affaire", $page, "ca.php");
//print_barre_liste("Chiffre d'affaires", $page, "ca.php");
print_titre($langs->trans('SalesTurnover'));

View File

@@ -61,6 +61,7 @@ if ($id || $ref)
$elementtype = 'fournisseur';
$objecttype = 'societe&categorie';
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
$dbtablename = '&societe';
$fieldid = 'rowid';
}
if ($type == 2) {

View File

@@ -889,17 +889,14 @@ class Categorie
}
else // mother_id undefined (so it's root)
{
/* We have to select any rowid from llx_categorie which which category's type and label
* are equals to those of the calling category, AND which doesn't exist in categorie association
* as children (rowid != fk_categorie_fille)
*/
$sql = "SELECT c.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c ";
$sql.= " JOIN ".MAIN_DB_PREFIX."categorie_association as ca";
$sql.= " ON c.rowid!=ca.fk_categorie_fille";
$sql.= " WHERE c.type=".$this->type;
$sql.= " AND c.label='".$this->db->escape($this->label)."'";
$sql.= " AND c.entity IN (".getEntity('category',1).")";
/* We have to select any rowid from llx_categorie that is not at root level
*/
$sql = "SELECT c.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c ";
$sql.= " WHERE c.type=".$this->type;
$sql.= " AND c.label='".$this->db->escape($this->label)."'";
$sql.= " AND c.entity IN (".getEntity('category',1).")";
$sql.= " AND c.rowid NOT IN (SELECT ca.fk_categorie_fille FROM ".MAIN_DB_PREFIX."categorie_association as ca)";
}
dol_syslog(get_class($this)."::already_exists sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@@ -85,13 +85,14 @@ if ($action == 'add_action')
}
$fulldayevent=$_POST["fullday"];
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
$datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
// Check parameters
if (! $datef && $_POST["percentage"] == 100)
if (! $datef && $percentage == 100)
{
$error++;
$action = 'create';
@@ -135,7 +136,7 @@ if ($action == 'add_action')
$actioncomm->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
$actioncomm->datep = $datep;
$actioncomm->datef = $datef;
$actioncomm->percentage = isset($_POST["percentage"])?$_POST["percentage"]:0;
$actioncomm->percentage = $percentage;
$actioncomm->duree=(($_POST["dureehour"] * 60) + $_POST["dureemin"]) * 60;
$usertodo=new User($db);
@@ -257,21 +258,20 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
}
/*
* Action mise a jour de l'action
* Action update event
*/
if ($action == 'update')
{
if (! $_POST["cancel"])
{
$fulldayevent=$_POST["fullday"];
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
if ($_POST["aphour"] == -1) $_POST["aphour"]='0';
if ($_POST["apmin"] == -1) $_POST["apmin"]='0';
if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0';
if ($_POST["p2min"] == -1) $_POST["p2min"]='0';
//if ($_POST["adhour"] == -1) $_POST["adhour"]='0';
//if ($_POST["admin"] == -1) $_POST["admin"]='0';
$actioncomm = new Actioncomm($db);
$actioncomm->fetch($id);
@@ -282,9 +282,7 @@ if ($action == 'update')
$actioncomm->label = $_POST["label"];
$actioncomm->datep = $datep;
$actioncomm->datef = $datef;
//$actioncomm->date = $datea;
//$actioncomm->dateend = $datea2;
$actioncomm->percentage = $_POST["percentage"];
$actioncomm->percentage = $percentage;
$actioncomm->priority = $_POST["priority"];
$actioncomm->fulldayevent= $_POST["fullday"]?1:0;
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
@@ -294,7 +292,7 @@ if ($action == 'update')
$actioncomm->note = $_POST["note"];
$actioncomm->pnote = $_POST["note"];
if (! $datef && $_POST["percentage"] == 100)
if (! $datef && $percentage == 100)
{
$error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd"));
$action = 'edit';
@@ -447,7 +445,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
// Date start
$datep=$actioncomm->datep;
@@ -687,7 +685,7 @@ if ($id)
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
// Date start
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">';

View File

@@ -744,11 +744,13 @@ if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), arr
if (empty($action) || $action == 'show_month') // View by month
{
$newparam=$param; // newparam is for birthday links
$newparam=preg_replace('/showbirthday=/i','showbirthday_=',$newparam); // To avoid replacement when replace day= is done
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
$newparam=preg_replace('/day=[0-9][0-9]&?/i','',$newparam);
$newparam=preg_replace('/month=[0-9][0-9]&?/i','',$newparam);
$newparam=preg_replace('/day=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/month=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
echo '<table width="100%" class="nocellnopadd">';
echo ' <tr class="liste_titre">';
$i=0;
@@ -810,11 +812,13 @@ if (empty($action) || $action == 'show_month') // View by month
elseif ($action == 'show_week') // View by week
{
$newparam=$param; // newparam is for birthday links
$newparam=preg_replace('/showbirthday=/i','showbirthday_=',$newparam); // To avoid replacement when replace day= is done
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
$newparam=preg_replace('/day=[0-9][0-9]&?/i','',$newparam);
$newparam=preg_replace('/month=[0-9][0-9]&?/i','',$newparam);
$newparam=preg_replace('/day=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/month=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
echo '<table width="100%" class="nocellnopadd">';
echo ' <tr class="liste_titre">';
$i=0;
@@ -866,9 +870,6 @@ else // View by day
$newparam=$param; // newparam is for birthday links
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
$newparam=preg_replace('/day=[0-9][0-9]&?/i','',$newparam);
$newparam=preg_replace('/month=[0-9][0-9]&?/i','',$newparam);
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
// Code to show just one day
$style='cal_current_month';
$today=0;

View File

@@ -51,11 +51,11 @@ $object = new Address($db);
* Actions
*/
// Cancel
if (GETPOST("cancel") && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
// Cancel
if (GETPOST("cancel") && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
if ($action == 'add' || $action == 'update')
@@ -80,7 +80,7 @@ if ($action == 'add' || $action == 'update')
{
if (! empty($backtopage))
{
Header("Location: ".$backtopage);
Header("Location: ".$backtopage);
exit;
}
else if ($origin == 'commande')
@@ -93,10 +93,10 @@ if ($action == 'add' || $action == 'update')
Header("Location: ../comm/propal/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid);
exit;
}
elseif ($origin == 'shipment')
{
Header("Location: ../expedition/fiche.php?id=".$originid);
exit;
elseif ($origin == 'shipment')
{
Header("Location: ../expedition/fiche.php?id=".$originid);
exit;
}
else
{
@@ -118,10 +118,10 @@ if ($action == 'add' || $action == 'update')
if ($result >= 0)
{
if (! empty($backtopage))
{
Header("Location: ".$backtopage);
exit;
if (! empty($backtopage))
{
Header("Location: ".$backtopage);
exit;
}
else if ($origin == 'commande')
{
@@ -286,10 +286,10 @@ if ($action == 'create')
print '<br><center>';
print '<input type="submit" class="button" value="'.$langs->trans('Add').'">';
if (! empty($backtopage))
{
print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
if (! empty($backtopage))
{
print ' &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
}
print '</center>'."\n";
@@ -384,10 +384,10 @@ elseif ($action == 'edit')
print '</table><br>';
print '<center>';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '<center>';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
print '</form>';

View File

@@ -87,14 +87,14 @@ if ($action == 'setcustomeraccountancycode')
if ($action == 'setconditions' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// mode de reglement
if ($action == 'setmode' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
$result=$object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// assujetissement a la TVA
@@ -796,10 +796,10 @@ if ($id > 0)
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
// Addresses list
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB))
{
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
}
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))

View File

@@ -60,11 +60,11 @@ $substitutionarray=array(
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE)
{
$substitutionarray=array_merge(
$substitutionarray,
array(
'__CHECK_READ__' => 'CheckMail',
'__UNSUSCRIBE__' => 'Unsuscribe'
)
$substitutionarray,
array(
'__CHECK_READ__' => 'CheckMail',
'__UNSUBSCRIBE__' => 'Unsubscribe'
)
);
}
@@ -83,13 +83,13 @@ $substitutionarrayfortest=array(
);
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE)
{
$substitutionarrayfortest=array_merge(
$substitutionarrayfortest,
array(
'__CHECK_READ__' => 'TESTCheckMail',
'__UNSUSCRIBE__' => 'TESTCheckMail'
)
);
$substitutionarrayfortest=array_merge(
$substitutionarrayfortest,
array(
'__CHECK_READ__' => 'TESTCheckMail',
'__UNSUBSCRIBE__' => 'TESTUnsubscribe'
)
);
}
// Action clone object
@@ -209,7 +209,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
'__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
'__LASTNAME__' => $obj->nom,
'__FIRSTNAME__' => $obj->prenom,
'__OTHER1__' => $other1,
@@ -547,60 +547,60 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
// Action confirmation validation
if ($action == 'confirm_valid' && $confirm == 'yes')
{
if ($object->fetch($id) >= 0)
{
$object->valid($user);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
dol_print_error($db);
{
if ($object->fetch($id) >= 0)
{
$object->valid($user);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
dol_print_error($db);
}
}
// Resend
if ($action == 'confirm_reset' && $confirm == 'yes')
{
if ($object->fetch($id) >= 0)
{
$db->begin();
$result=$object->valid($user);
if ($result > 0)
{
$result=$object->reset_targets_status($user);
}
if ($result > 0)
{
$db->commit();
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
$mesg=$object->error;
$db->rollback();
}
}
else
{
dol_print_error($db);
{
if ($object->fetch($id) >= 0)
{
$db->begin();
$result=$object->valid($user);
if ($result > 0)
{
$result=$object->reset_targets_status($user);
}
if ($result > 0)
{
$db->commit();
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
$mesg=$object->error;
$db->rollback();
}
}
else
{
dol_print_error($db);
}
}
// Action confirmation suppression
if ($action == 'confirm_delete' && $confirm == 'yes')
{
$object->fetch($id);
if ($object->delete($object->id))
{
Header("Location: liste.php");
exit;
{
$object->fetch($id);
if ($object->delete($object->id))
{
Header("Location: liste.php");
exit;
}
}
@@ -1049,7 +1049,7 @@ else
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE)
{
print '__CHECK_READ__ = '.$langs->trans("CheckRead").'<br>';
print '__UNSUSCRIBE__ = '.$langs->trans("MailUnsubcribe").'<br>';
print '__UNSUBSCRIBE__ = '.$langs->trans("MailUnsubcribe").'<br>';
}
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';

View File

@@ -87,7 +87,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable);
$object = new Propal($db);
// Load object
if ($id > 0 || ! empty($ref))
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
@@ -154,29 +154,29 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->prop
// Remove line
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propale->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->deleteline($lineid);
// reorder lines
if ($result) $object->line_order(true);
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
}
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->deleteline($lineid);
// reorder lines
if ($result) $object->line_order(true);
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
}
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
@@ -248,18 +248,18 @@ else if ($action == 'set_ref_client' && $user->rights->propale->creer)
$object->set_ref_client($user, $_POST['ref_client']);
}
else if ($action == 'setnote_public' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setnote_public' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setnote' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
// Create proposal
@@ -952,6 +952,23 @@ else if ($action == 'builddoc' && $user->rights->propale->creer)
}
}
// Remove file in doc form
else if ($action == 'remove_file')
{
if ($object->fetch($id))
{
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
$object->fetch_thirdparty();
$langs->load("other");
$upload_dir = $conf->propal->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
dol_delete_file($file,0,0,0,$object);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('file')).'</div>';
}
}
// Set project
else if ($action == 'classin' && $user->rights->propale->creer)
{
@@ -1049,63 +1066,63 @@ else if ($action == 'down' && $user->rights->propale->creer)
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->propale->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
if ($action == 'addcontact' && $user->rights->propale->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// Bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->propale->creer)
{
if ($object->fetch($id) > 0)
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->propale->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
dol_print_error($db);
}
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// Bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->propale->creer)
{
if ($object->fetch($id) > 0)
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->propale->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
dol_print_error($db);
}
}
}
@@ -1544,19 +1561,19 @@ if ($id > 0 || ! empty($ref))
print '</table><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
@@ -1888,9 +1905,9 @@ else
{
$sql.= " AND p.ref LIKE '%".$db->escape(trim($search_ref))."%'";
}
if ($search_refcustomer)
{
$sql.= " AND p.ref_client LIKE '%".$db->escape(trim($search_refcustomer))."%'";
if ($search_refcustomer)
{
$sql.= " AND p.ref_client LIKE '%".$db->escape(trim($search_refcustomer))."%'";
}
if ($search_societe)
{
@@ -1963,8 +1980,8 @@ else
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="16" name="search_societe" value="'.$search_societe.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
print '<td class="liste_titre">';
print '<input class="flat" size="10" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
print '</td>';
print '<td class="liste_titre" colspan="1" align="center">';
print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
@@ -2032,8 +2049,8 @@ else
print '</td>';
// Customer ref
print '<td nowrap="nowrap">';
print $objp->ref_client;
print '<td nowrap="nowrap">';
print $objp->ref_client;
print '</td>';
// Date propale

View File

@@ -969,7 +969,7 @@ class Propal extends CommonObject
$sql.= ", p.fk_cond_reglement";
$sql.= ", p.fk_mode_reglement";
$sql.= ", c.label as statut_label";
$sql.= ", ca.code as availability_code, ca.label as availability";
$sql.= ", ca.code as availability_code, ca.label as availability";
$sql.= ", dr.code as demand_reason_code, dr.label as demand_reason";
$sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc";
$sql.= ", cp.code as mode_reglement_code, cp.libelle as mode_reglement";
@@ -1801,11 +1801,11 @@ class Propal extends CommonObject
if (! $error)
{
// We remove directory
$propalref = dol_sanitizeFileName($this->ref);
$ref = dol_sanitizeFileName($this->ref);
if ($conf->propal->dir_output)
{
$dir = $conf->propal->dir_output . "/" . $propalref ;
$file = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . ".pdf";
$dir = $conf->propal->dir_output . "/" . $ref ;
$file = $dir . "/" . $ref . ".pdf";
if (file_exists($file))
{
dol_delete_preview($this);
@@ -1819,7 +1819,7 @@ class Propal extends CommonObject
}
if (file_exists($dir))
{
$res=@dol_delete_dir($dir);
$res=@dol_delete_dir_recursive($dir);
if (! $res)
{
$this->error='ErrorFailToDeleteDir';
@@ -2163,7 +2163,7 @@ class Propal extends CommonObject
$this->mode_reglement_id = 7;
$this->mode_reglement_code = 'CHQ';
$this->availability_id = 1;
$this->availability_code = 'DSP';
$this->availability_code = 'AV_NOW';
$this->demand_reason_id = 1;
$this->demand_reason_code = 'SRC_00';
$this->note_public='This is a comment (public)';

View File

@@ -110,11 +110,11 @@ else if ($action == 'deletecontact' && $user->rights->propale->creer)
}
}
else if ($action == 'setaddress' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']);
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setaddress' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']);
if ($result < 0) dol_print_error($db,$object->error);
}
@@ -174,27 +174,27 @@ if ($id > 0 || ! empty($ref))
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
// Delivery address
if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','propal',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','propal',$object->id);
}
print '</td></tr>';
// Delivery address
if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','propal',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','propal',$object->id);
}
print '</td></tr>';
}
print "</table>";

View File

@@ -34,10 +34,17 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
$langs->load('compta');
$langs->load('other');
$action = GETPOST('action');
$confirm = GETPOST('confirm');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$id = GETPOST('id','int');
$ref = GETPOST('ref');
$ref = GETPOST('ref','alpha');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id)
@@ -59,6 +66,11 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$object = new Propal($db);
$object->fetch($id,$ref);
if ($object->id > 0)
{
$object->fetch_thirdparty();
}
/*
* Actions
@@ -67,7 +79,7 @@ $object = new Propal($db);
// Envoi fichier
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->fetch($id))
if ($object->id > 0)
{
$object->fetch_thirdparty();
@@ -112,15 +124,16 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
// Delete
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->fetch($id))
if ($object->id > 0)
{
$langs->load("other");
$object->fetch_thirdparty();
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file,0,0,0,$object);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
@@ -133,83 +146,73 @@ llxHeader();
$form = new Form($db);
if ($id > 0 || ! empty($ref))
if ($object->id > 0)
{
if ($object->fetch($id,$ref))
{
$object->fetch_thirdparty();
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
$head = propal_prepare_head($object);
dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal');
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
$totalsize+=$file['size'];
}
print '<table class="border"width="100%">';
$linkback='<a href="'.DOL_URL_ROOT.'/comm/propal.php'."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder".'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print '</td></tr>';
// Ref client
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>';
print '</tr></table>';
print '</td><td colspan="3">';
print $object->ref_client;
print '</td>';
print '</tr>';
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
dol_htmloutput_mesg($mesg,$mesgs);
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id,'',0,0,$user->rights->propale->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'propal',$param);
}
else
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
$head = propal_prepare_head($object);
dol_fiche_head($head, 'document', $langs->trans('Proposal'), 0, 'propal');
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0;
foreach($filearray as $key => $file)
{
dol_print_error($db);
$totalsize+=$file['size'];
}
print '<table class="border"width="100%">';
$linkback='<a href="'.DOL_URL_ROOT.'/comm/propal.php'."?page=$page&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder".'">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
print '</td></tr>';
// Ref client
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>';
print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>';
print '</tr></table>';
print '</td><td colspan="3">';
print $object->ref_client;
print '</td>';
print '</tr>';
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
dol_htmloutput_mesg($mesg,$mesgs);
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id,'',0,0,$user->rights->propale->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'propal',$param);
}
else
{

View File

@@ -184,16 +184,16 @@ if ($conf->propal->enabled)
$obj = $db->fetch_object($resql);
print "<tr $bc[$var]>";
$propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref;
$propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref;
print '<td nowrap="nowrap">'.$propalstatic->getNomUrl(1).'</td>';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
print '<td>'.$companystatic->getNomUrl(1,'customer',24).'</td>';
print '</tr>';
$i++;
}
@@ -260,17 +260,17 @@ if ($resql)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
print '</td></tr></table>';
print '</td>';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,5).'</td>';
print '</tr>';
@@ -339,11 +339,11 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
print '</td></tr></table>';
print "</td>";
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
print '<td align="left">'.$companystatic->getNomUrl(1,'customer',44).'</td>'."\n";
print '<td align="right">';
@@ -419,7 +419,7 @@ if ($conf->propal->enabled)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
print '</td></tr></table>';
print '</td>';
@@ -491,7 +491,7 @@ if ($conf->propal->enabled)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
print '</td></tr></table>';
print '</td>';

View File

@@ -47,18 +47,18 @@ $object = new Propal($db);
/* Actions */
/******************************************************************************/
if ($action == 'setnote_public' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
if ($action == 'setnote_public' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->propale->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 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
@@ -66,7 +67,6 @@ $stats = new PropaleStats($db, $socid, $userid);
// Build graphic number of object
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
@@ -110,7 +110,6 @@ if (! $mesg)
// Build graphic amount of object
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
if (!$user->rights->societe->client->voir || $user->societe_id)
@@ -151,13 +150,7 @@ if (! $mesg)
$px2->draw($filenameamount,$fileurlamount);
}
$res = $stats->getAverageByMonth($year);
$data = array();
for ($i = 1 ; $i < 13 ; $i++)
{
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@@ -177,8 +170,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
@@ -220,34 +212,36 @@ complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats');
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
if (empty($socid))
{
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<table class="border" width="100%">';
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
// Company
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$filter='s.client in (1,2,3)';
print $form->select_company($socid,'socid',$filter,1);
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
print $form->select_users($userid,'userid',1);
print '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<table class="border" width="100%">';
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
// Company
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$filter='s.client in (1,2,3)';
print $form->select_company($socid,'socid',$filter,1);
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
print $form->select_users($userid,'userid',1);
print '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
}
print '<table class="border" width="100%">';
print '<tr height="24">';

View File

@@ -1,6 +1,6 @@
<?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -272,7 +272,7 @@ if ($socid > 0)
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'">&nbsp;'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
print '<td>';
print $form->load_tva('tva_tx',GETPOST('tva_tx'),'',$mysoc,'');
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc);
print '</td></tr>';
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';

View File

@@ -282,7 +282,7 @@ class Commande extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*');
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'*.*');
}
}
}
@@ -684,7 +684,7 @@ class Commande extends CommonObject
$this->lines[$i]->remise_percent,
$this->lines[$i]->info_bits,
$this->lines[$i]->fk_remise_except,
'HT',
'HT',
0,
$this->lines[$i]->date_start,
$this->lines[$i]->date_end,
@@ -923,13 +923,13 @@ class Commande extends CommonObject
$this->note_public = $object->note_public;
$this->origin = $object->element;
$this->origin_id = $object->id;
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
{
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
$this->origin_id = $object->id;
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
{
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
}
$ret = $this->create($user);
@@ -939,7 +939,7 @@ class Commande extends CommonObject
// Actions hooked (by external module)
if (! is_object($hookmanager))
{
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(array('orderdao'));
@@ -2069,11 +2069,16 @@ class Commande extends CommonObject
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;';
if ($this->db->query($sql) )
{
if (($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1) && $this->propale_id)
if (! empty($conf->propal->enabled) && ! empty($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER))
{
$propal = new Propal($this->db);
$propal->fetch($this->propale_id);
$propal->classer_facturee();
$this->fetchObjectLinked('','propal',$this->id,$this->element);
if (! empty($this->linkedObjects))
{
foreach($this->linkedObjects['propal'] as $element)
{
$ret=$element->classer_facturee();
}
}
}
return 1;
}
@@ -2105,7 +2110,7 @@ class Commande extends CommonObject
* @param int $skip_update_total Skip update of total
* @return int < 0 if KO, > 0 if OK
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0)
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0)
{
global $conf;
@@ -2176,6 +2181,7 @@ class Commande extends CommonObject
$this->line->remise_percent=$remise_percent;
$this->line->subprice=$subprice;
$this->line->info_bits=$info_bits;
$this->line->special_code=0; // To remove special_code=3 coming from proposals copy
$this->line->total_ht=$total_ht;
$this->line->total_tva=$total_tva;
$this->line->total_localtax1=$total_localtax1;
@@ -2294,7 +2300,7 @@ class Commande extends CommonObject
}
if (file_exists($dir))
{
if (! dol_delete_dir($dir))
if (! dol_delete_dir_recursive($dir))
{
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
$this->db->rollback();
@@ -3030,6 +3036,7 @@ class OrderLine
if (empty($this->remise)) $this->remise=0;
if (empty($this->remise_percent)) $this->remise_percent=0;
if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0;
if (empty($this->product_type)) $this->product_type=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
@@ -3055,6 +3062,7 @@ class OrderLine
$sql.= " , total_localtax1=".price2num($this->total_localtax1);
$sql.= " , total_localtax2=".price2num($this->total_localtax2);
$sql.= " , info_bits=".$this->info_bits;
$sql.= " , special_code=".$this->special_code;
if ($this->date_start) { $sql.= " , date_start='".$this->db->idate($this->date_start)."'"; }
else { $sql.=' , date_start=null'; }
if ($this->date_end) { $sql.= " , date_end='".$this->db->idate($this->date_end)."'"; }

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 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
@@ -45,7 +46,7 @@ class CommandeStats extends Stats
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param string $mode Option
* @param int $userid Id user for filter
@@ -73,7 +74,7 @@ class CommandeStats extends Stats
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
$this->field='total_ht';
$this->where.= " c.fk_statut > 0"; // Not draft and not cancelled
$this->where.= " c.fk_statut > 2"; // Only approved & ordered
}
$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;

View File

@@ -106,10 +106,10 @@ else if ($action == 'deletecontact' && $user->rights->commande->creer)
}
}
else if ($action == 'setaddress' && $user->rights->commande->creer)
{
$object->fetch($id);
$object->setDeliveryAddress($_POST['fk_address']);
else if ($action == 'setaddress' && $user->rights->commande->creer)
{
$object->fetch($id);
$object->setDeliveryAddress($_POST['fk_address']);
}
/*
@@ -173,27 +173,27 @@ if ($id > 0 || ! empty($ref))
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
// Delivery address
if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','commande',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','commande',$object->id);
}
print '</td></tr>';
// Delivery address
if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress');
print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','commande',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','commande',$object->id);
}
print '</td></tr>';
}
print "</table>";

View File

@@ -40,6 +40,13 @@ $confirm = GETPOST('confirm');
$id = GETPOST('id','int');
$ref = GETPOST('ref');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id)
{
@@ -59,7 +66,6 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$object = new Commande($db);
@@ -113,7 +119,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
}
// Delete
if ($action == 'confirm_deletefile' && $confirm == 'yes')
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->fetch($id))
{
@@ -123,7 +129,9 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file,0,0,0,$object);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}
@@ -177,7 +185,7 @@ if ($id > 0 || ! empty($ref))
*/
if ($action == 'delete')
{
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}

View File

@@ -64,10 +64,10 @@ $result=restrictedArea($user,'commande',$id,'');
$object = new Commande($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@@ -507,18 +507,18 @@ else if ($action == 'setremiseabsolue' && $user->rights->commande->creer)
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
}
else if ($action == 'setnote_public' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setnote_public' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->commande->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
/*
@@ -738,6 +738,11 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['s
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
$result = -1 ;
}
// Define special_code for special lines
$special_code=0;
if (empty($_POST['qty'])) $special_code=3;
// Check minimum price
if(! empty($_POST['productid']))
{
@@ -1024,10 +1029,12 @@ else if ($action == 'remove_file')
{
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
$object->fetch_thirdparty();
$langs->load("other");
$upload_dir = $conf->commande->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
dol_delete_file($file);
dol_delete_file($file,0,0,0,$object);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('file')).'</div>';
}
}
@@ -1220,64 +1227,64 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
if ($action == 'addcontact' && $user->rights->commande->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->commande->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
@@ -1300,6 +1307,9 @@ $formorder = new FormOrder($db);
*********************************************************************/
if ($action == 'create' && $user->rights->commande->creer)
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print_fiche_titre($langs->trans('CreateOrder'));
dol_htmloutput_mesg($mesg,$mesgs,'error');
@@ -1486,13 +1496,12 @@ if ($action == 'create' && $user->rights->commande->creer)
print $form->selectarray('model',$liste,$conf->global->COMMANDE_ADDON_PDF);
print "</td></tr>";
// Note publique
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
//print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
print '</td></tr>';
@@ -1503,8 +1512,8 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
$doleditor = new DolEditor('note', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
print $doleditor->Create(1);
//print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
print '</td></tr>';
@@ -2045,24 +2054,24 @@ else
print '<td colspan="2">'.$object->getLibStatut(4).'</td>';
print '</tr>';
print '</table><br>';
print '</table><br>';
print "\n";
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
/*

View File

@@ -1,6 +1,8 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 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
@@ -168,12 +170,7 @@ if (! $mesg)
}
$res = $stats->getAverageByMonth($year);
$data = array();
for ($i = 1 ; $i < 13 ; $i++)
{
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@@ -193,8 +190,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
@@ -240,34 +236,37 @@ complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
if (empty($socid))
{
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<table class="border" width="100%">';
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
// Company
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1';
print $form->select_company($socid,'socid',$filter,1);
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
print $form->select_users($userid,'userid',1);
print '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<table class="border" width="100%">';
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
// Company
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1';
print $form->select_company($socid,'socid',$filter,1);
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
print $form->select_users($userid,'userid',1);
print '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
}
print '<table class="border" width="100%">';
print '<tr height="24">';

View File

@@ -48,6 +48,7 @@ $fieldtype = (! empty($ref) ? 'ref' :'rowid');
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
$paiementtype=GETPOST('paiementtype','alpha',3);
$req_nb=GETPOST("req_nb",'',3);
$thirdparty=GETPOST("thirdparty",'',3);
$vline=GETPOST("vline");
@@ -78,17 +79,17 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu
{
$amount = - price2num($_POST["debit"]);
}
$dateop = dol_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]);
$operation=$_POST["operation"];
$num_chq=$_POST["num_chq"];
$label=$_POST["label"];
$cat1=$_POST["cat1"];
if (! $dateop) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
if (! $operation) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
if (! $amount) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
if (! $mesg)
{
$object->fetch($id);
@@ -143,15 +144,15 @@ if ($id > 0 || ! empty($ref))
}
$result=$object->fetch($id, $ref);
// Chargement des categories bancaires dans $options
$nbcategories=0;
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_categ";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY label";
$result = $db->query($sql);
if ($result)
{
@@ -168,7 +169,7 @@ if ($id > 0 || ! empty($ref))
}
$db->free($result);
}
// Definition de sql_rech et param
$param='';
$sql_rech='';
@@ -203,13 +204,13 @@ if ($id > 0 || ! empty($ref))
$param.='&amp;thirdparty='.urlencode($thirdparty);
$mode_search = 1;
}
if (GETPOST("paiementtype"))
if ($paiementtype)
{
$sql_rech.=" AND b.fk_type = '".$db->escape(GETPOST("paiementtype"))."'";
$param.='&amp;paiementtype='.urlencode(GETPOST("paiementtype"));
$sql_rech.=" AND b.fk_type = '".$db->escape($paiementtype)."'";
$param.='&amp;paiementtype='.urlencode($paiementtype);
$mode_search = 1;
}
$sql = "SELECT count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
@@ -222,7 +223,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND b.fk_account = ba.rowid";
$sql.= " AND ba.entity = ".$conf->entity;
$sql.= $sql_rech;
dol_syslog("account.php count transactions - sql=".$sql, LOG_DEBUG);
$result=$db->query($sql);
if ($result)
@@ -230,7 +231,7 @@ if ($id > 0 || ! empty($ref))
$obj = $db->fetch_object($result);
$nbline = $obj->nb;
$total_lines = $nbline;
if ($nbline > $viewline ) $limit = $nbline - $viewline ;
else $limit = $viewline;
@@ -240,7 +241,7 @@ if ($id > 0 || ! empty($ref))
{
dol_print_error($db);
}
if ($page > 0)
{
$limitsql = $nbline - ($page * $viewline);
@@ -253,34 +254,34 @@ if ($id > 0 || ! empty($ref))
$limitsql = $nbline;
}
//print $limitsql.'-'.$page.'-'.$viewline;
// Onglets
$head=bank_prepare_head($object);
dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account');
print '<table class="border" width="100%">';
// Ref
print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'ref','',1,'ref');
print '</td></tr>';
// Label
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
print '<td colspan="3">'.$object->label.'</td></tr>';
print '</table>';
print '<br>';
dol_htmloutput_errors($mesg);
/**
* Search form
*/
$param.='&amp;account='.$object->id;
// Define transaction list navigation string
$navig='';
$navig.='<form action="'.$_SERVER["PHP_SELF"].'" name="newpage" method="GET">';
@@ -289,6 +290,7 @@ if ($id > 0 || ! empty($ref))
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&amp;page='.($page+1).'">'.img_previous().'</a>';
$navig.= $langs->trans("Page")." "; // ' Page ';
$navig.='<input type="text" name="negpage" size="1" class="flat" value="'.($nbpage-$page).'">';
$navig.='<input type="hidden" name="paiementtype" value="'.$paiementtype.'">';
$navig.='<input type="hidden" name="req_nb" value="'.$req_nb.'">';
$navig.='<input type="hidden" name="req_desc" value="'.GETPOST("req_desc").'">';
$navig.='<input type="hidden" name="req_debit" value="'.GETPOST("req_debit").'">';
@@ -303,7 +305,7 @@ if ($id > 0 || ! empty($ref))
}
$navig.='</form>';
//var_dump($navig);
// Confirmation delete
if ($action == 'delete')
{
@@ -311,15 +313,15 @@ if ($id > 0 || ! empty($ref))
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete');
if ($ret == 'html') print '<br>';
}
print '<table class="notopnoleftnoright" width="100%">';
// Show title
if ($action != 'addline' && $action != 'delete')
{
print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>';
}
// Form to add a transaction with no invoice
if ($user->rights->banque->modifier && $action == 'addline')
{
@@ -328,11 +330,11 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="vline" value="'.$vline.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<tr>';
print '<td align="left" colspan="10"><b>'.$langs->trans("AddBankRecordLong").'</b></td>';
print '</tr>';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>&nbsp;</td>';
@@ -343,7 +345,7 @@ if ($id > 0 || ! empty($ref))
print '<td align=right>'.$langs->trans("Credit").'</td>';
print '<td colspan="2" align="center">&nbsp;</td>';
print '</tr>';
print '<tr '.$bc[false].'>';
print '<td nowrap="nowrap" colspan="2">';
$form->select_date($dateop,'op',0,0,0,'transaction');
@@ -366,14 +368,14 @@ if ($id > 0 || ! empty($ref))
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print "</form>";
print '<tr class="noborder"><td colspan="8">&nbsp;</td></tr>'."\n";
}
/*
* Affiche tableau des transactions bancaires
*/
// Ligne de titre tableau des ecritures
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Date").'</td>';
@@ -389,19 +391,19 @@ if ($id > 0 || ! empty($ref))
if ($object->type != 2 && $object->rappro) print $langs->trans("AccountStatementShort");
else print '&nbsp;';
print '</td></tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="search">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<tr class="liste_titre">';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>';
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
$filtertype='';
print $form->select_types_paiements($_REQUEST['paiementtype'],'paiementtype',$filtertype,2,1,1,8);
print $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
print '</td>';
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
print '<td><input type="text" class="flat" name="req_desc" value="'.GETPOST("req_desc").'" size="24"></td>';
@@ -412,13 +414,13 @@ if ($id > 0 || ! empty($ref))
print '<td align="center" width="40"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n";
print "</form>\n";
/*
* Another solution
* create temporary table solde type=heap select amount from llx_bank limit 100 ;
* select sum(amount) from solde ;
*/
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
if ($mode_search)
@@ -428,11 +430,11 @@ if ($id > 0 || ! empty($ref))
/*
if ($mode_search && $conf->adherent->enabled)
{
}
if ($mode_search && $conf->tax->enabled)
{
}
*/
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
@@ -459,22 +461,22 @@ if ($id > 0 || ! empty($ref))
$sql.= $sql_rech;
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
$sql.= $db->plimit($limitsql, 0);
dol_syslog("account.php get transactions - sql=".$sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
$now=dol_now();
$nows=dol_print_date($now,'%Y%m%d');
//$form->load_cache_types_paiements();
//$form->cache_types_paiements
$var=true;
$num = $db->num_rows($result);
$i = 0; $total = 0; $sep = 0;
while ($i < $num)
{
$objp = $db->fetch_object($result);
@@ -482,7 +484,7 @@ if ($id > 0 || ! empty($ref))
if ($i >= ($nbline - $viewline))
{
$var=!$var;
// Is it a transaction in future ?
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
//print "dos=".$dos." nows=".$nows;
@@ -496,26 +498,25 @@ if ($id > 0 || ! empty($ref))
print "<td>&nbsp;</td>";
print '</tr>';
}
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day");
print "</td>\n";
// Payment type
print "<td nowrap>";
$label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type;
// $label=$langs->getTradFromKey("PaymentTypeShort".$objp->fk_type);
if ($objp->fk_type == 'SOLD') $label='&nbsp;';
print $label;
print "</td>\n";
// Num
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
// Description
print '<td>';
// Show generic description
@@ -545,7 +546,7 @@ if ($id > 0 || ! empty($ref))
}
else if ($links[$key]['type']=='company')
{
}
else if ($links[$key]['type']=='payment_sc')
{
@@ -567,11 +568,11 @@ if ($id > 0 || ! empty($ref))
}
else if ($links[$key]['type']=='member')
{
}
else if ($links[$key]['type']=='sc')
{
}
else
{
@@ -592,7 +593,7 @@ if ($id > 0 || ! empty($ref))
}
}
print '</td>';
// Add third party column
print '<td>';
foreach($links as $key=>$val)
@@ -627,7 +628,7 @@ if ($id > 0 || ! empty($ref))
}
}
print '</td>';
// Amount
if ($objp->amount < 0)
{
@@ -637,7 +638,7 @@ if ($id > 0 || ! empty($ref))
{
print '<td>&nbsp;</td><td align="right" nowrap="nowrap">&nbsp;'.price($objp->amount).'</td>'."\n";
}
// Balance
if ($action != 'search')
{
@@ -654,7 +655,7 @@ if ($id > 0 || ! empty($ref))
{
print '<td align="right">-</td>';
}
// Transaction reconciliated or edit link
if ($objp->rappro && $object->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
{
@@ -697,13 +698,13 @@ if ($id > 0 || ! empty($ref))
}
print '</td>';
}
print "</tr>";
}
$i++;
}
// Show total
if ($page == 0 && ! $mode_search)
{
@@ -721,19 +722,19 @@ if ($id > 0 || ! empty($ref))
{
dol_print_error($db);
}
print "</table>";
print "\n</div>\n";
/*
* Boutons actions
*/
if ($action != 'delete')
{
print '<div class="tabsAction">';
if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate
{
if ($user->rights->banque->consolidate)
@@ -745,7 +746,7 @@ if ($id > 0 || ! empty($ref))
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
if ($action != 'addline')
{
if ($user->rights->banque->modifier)
@@ -757,10 +758,10 @@ if ($id > 0 || ! empty($ref))
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
print '</div>';
}
print '<br>';
}
else
@@ -771,4 +772,4 @@ else
llxFooter();
$db->close();
?>
?>

View File

@@ -255,6 +255,9 @@ $form = new Form($db);
*/
if ($action == 'create')
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
print_fiche_titre($langs->trans("NewTrip"));
dol_htmloutput_errors($mesg);
@@ -295,9 +298,10 @@ if ($action == 'create')
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_public',GETPOST('note_public','alpha'),600,200,'dolibarr_notes','In',false,true,true,ROWS_8,100);
$doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100);
print $doleditor->Create(1);
print '</td></tr>';
// Private note
@@ -306,9 +310,10 @@ if ($action == 'create')
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_private',GETPOST('note_private','alpha'),600,200,'dolibarr_notes','In',false,true,true,ROWS_8,100);
$doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100);
print $doleditor->Create(1);
print '</td></tr>';
}
@@ -332,6 +337,9 @@ else if ($id)
if ($action == 'edit' && $user->rights->deplacement->creer)
{
//WYSIWYG Editor
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$soc = new Societe($db);
if ($object->socid)
{
@@ -382,9 +390,10 @@ else if ($id)
// Public note
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td>';
print '<td valign="top" colspan="3">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_public',$object->note_public,600,200,'dolibarr_notes','In',false,true,true,ROWS_8,'100');
$doleditor = new DolEditor('note_public', $object->note_public, 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '100');
print $doleditor->Create(1);
print "</td></tr>";
// Private note
@@ -392,9 +401,10 @@ else if ($id)
{
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td>';
print '<td valign="top" colspan="3">';
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note_private',$object->note_private,600,200,'dolibarr_notes','In',false,true,true,ROWS_8,'100');
$doleditor = new DolEditor('note_private', $object->note_private, 600, 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '100');
print $doleditor->Create(1);
print "</td></tr>";
}
@@ -499,8 +509,8 @@ else if ($id)
print "</table><br>";
// Notes
$blocname = 'notes';
$title = $langs->trans('Notes');
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
print '</div>';

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 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
@@ -137,12 +138,7 @@ if (! $mesg)
}
$res = $stats->getAverageByMonth($year);
$data = array();
for ($i = 1 ; $i < 13 ; $i++)
{
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@@ -162,8 +158,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i = $startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;

View File

@@ -81,10 +81,10 @@ $usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
$object=new Facture($db);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
// Load object
if ($id > 0 || ! empty($ref))
{
$ret=$object->fetch($id, $ref);
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@@ -166,37 +166,37 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fact
// Delete line
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->deleteline($_GET['lineid'], $user);
if ($result > 0)
{
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
$result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
}
if ($result >= 0)
{
Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
exit;
}
}
else
{
$mesg='<div clas="error">'.$object->error.'</div>';
$action='';
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->deleteline($_GET['lineid'], $user);
if ($result > 0)
{
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
$result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
}
if ($result >= 0)
{
Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
exit;
}
}
else
{
$mesg='<div clas="error">'.$object->error.'</div>';
$action='';
}
}
@@ -265,6 +265,15 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setpaymentterm' && $user->rights->facture->creer)
{
$object->fetch($id);
$object->date_lim_reglement=dol_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']);
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;
$result=$object->update($user);
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setconditions' && $user->rights->facture->creer)
{
$object->fetch($id);
@@ -317,18 +326,18 @@ else if ($action == 'set_ref_client' && $user->rights->facture->creer)
$object->set_ref_client($_POST['ref_client']);
}
else if ($action == 'setnote_public' && $user->rights->facture->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->facture->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
else if ($action == 'setnote_public' && $user->rights->facture->creer)
{
$object->fetch($id);
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
else if ($action == 'setnote' && $user->rights->facture->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($result < 0) dol_print_error($db,$object->error);
}
// Classify to validated
@@ -971,7 +980,11 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$price_base_type = 'HT';
// Ecrase $pu par celui du produit
// Define special_code for special lines
$special_code=0;
//if (empty($_POST['qty'])) $special_code=3; // Options should not exists on invoices
// Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit
// Ecrase $base_price_type par celui du produit
@@ -1090,7 +1103,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$pu_ttc,
$type,
-1,
0,
$special_code,
'',
0,
GETPOST('fk_parent_line')
@@ -1162,6 +1175,11 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
$mesg = '<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")).'</div>';
$result = -1 ;
}
// Define special_code for special lines
$special_code=0;
//if (empty($_POST['qty'])) $special_code=3; // Option should not exists onto invoices
// Check minimum price
if (GETPOST('productid'))
{
@@ -1513,64 +1531,81 @@ else if ($action == 'builddoc') // En get ou en post
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
// Remove file in doc form
else if ($action == 'remove_file')
{
if ($action == 'addcontact' && $user->rights->facture->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
if ($object->fetch($id))
{
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
$object->fetch_thirdparty();
$langs->load("other");
$upload_dir = $conf->facture->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
dol_delete_file($file,0,0,0,$object);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('file')).'</div>';
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
if ($action == 'addcontact' && $user->rights->facture->creer)
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->facture->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->facture->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>';
}
else
{
$mesg = '<div class="error">'.$object->error.'</div>';
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut' && $user->rights->facture->creer)
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact' && $user->rights->facture->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else {
dol_print_error($db);
}
}
}
@@ -2808,22 +2843,22 @@ else
print '</table><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
$formcompany= new FormCompany($db);
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$blocname = 'notes';
$title = $langs->trans('Notes');
include(DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php');
}
/*

View File

@@ -146,20 +146,20 @@ class FactureRec extends Facture
for ($i = 0; $i < $num; $i++)
{
$result_insert = $this->addline(
$this->id,
$facsrc->lines[$i]->desc,
$facsrc->lines[$i]->subprice,
$facsrc->lines[$i]->qty,
$facsrc->lines[$i]->tva_tx,
$facsrc->lines[$i]->fk_product,
$facsrc->lines[$i]->remise_percent,
'HT',
0,
'',
0,
$facsrc->lines[$i]->product_type,
$facsrc->lines[$i]->rang,
$facsrc->lines[$i]->special_code
$this->id,
$facsrc->lines[$i]->desc,
$facsrc->lines[$i]->subprice,
$facsrc->lines[$i]->qty,
$facsrc->lines[$i]->tva_tx,
$facsrc->lines[$i]->fk_product,
$facsrc->lines[$i]->remise_percent,
'HT',
0,
'',
0,
$facsrc->lines[$i]->product_type,
$facsrc->lines[$i]->rang,
$facsrc->lines[$i]->special_code
);
if ($result_insert < 0)

View File

@@ -256,30 +256,30 @@ class Facture extends CommonObject
$error++;
}
// TODO mutualiser
if ($origin == 'commande')
{
// On recupere les differents contact interne et externe
// TODO mutualiser
if ($origin == 'commande')
{
// On recupere les differents contact interne et externe
$order = new Commande($this->db);
$order->id = $origin_id;
// On recupere le commercial suivi propale
$order->id = $origin_id;
// On recupere le commercial suivi propale
$this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid)
{
//On passe le commercial suivi commande en commercial suivi paiement
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
}
// On recupere le contact client facturation commande
$this->contactid = $order->getIdcontact('external', 'BILLING');
if ($this->contactid)
{
//On passe le contact client facturation commande en contact client facturation
$this->add_contact($this->contactid[0], 'BILLING', 'external');
}
if ($this->userid)
{
//On passe le commercial suivi commande en commercial suivi paiement
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
}
// On recupere le contact client facturation commande
$this->contactid = $order->getIdcontact('external', 'BILLING');
if ($this->contactid)
{
//On passe le contact client facturation commande en contact client facturation
$this->add_contact($this->contactid[0], 'BILLING', 'external');
}
}
}
}
@@ -349,7 +349,7 @@ class Facture extends CommonObject
$this->lines[$i]->fk_code_ventilation,
$this->lines[$i]->info_bits,
$this->lines[$i]->fk_remise_except,
'HT',
'HT',
0,
$this->lines[$i]->product_type,
$this->lines[$i]->rang,
@@ -400,7 +400,13 @@ class Facture extends CommonObject
$localtax2_tx,
$_facrec->lines[$i]->fk_product,
$_facrec->lines[$i]->remise_percent,
'','',0,0,'','HT',0,
'',
'',
0,
0,
'',
'HT',
0,
$_facrec->lines[$i]->product_type,
$_facrec->lines[$i]->rang,
$_facrec->lines[$i]->special_code
@@ -674,11 +680,11 @@ class Facture extends CommonObject
$this->origin = $object->element;
$this->origin_id = $object->id;
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
{
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
{
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
}
$ret = $this->create($user);
@@ -1237,34 +1243,34 @@ class Facture extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
// On efface le repertoire de pdf provisoire
$ref = dol_sanitizeFileName($this->ref);
if ($conf->facture->dir_output)
{
$dir = $conf->facture->dir_output . "/" . $ref;
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";
if (file_exists($file)) // We must delete all files before deleting directory
{
// On efface le repertoire de pdf provisoire
$ref = dol_sanitizeFileName($this->ref);
if ($conf->facture->dir_output)
{
$dir = $conf->facture->dir_output . "/" . $ref;
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";
if (file_exists($file)) // We must delete all files before deleting directory
{
$ret=dol_delete_preview($this);
if (! dol_delete_file($file,0,0,0,$this)) // For triggers
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
$this->db->rollback();
return 0;
}
}
if (file_exists($dir))
{
if (! dol_delete_dir_recursive($dir)) // For remove dir and meta
{
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
$this->db->rollback();
return 0;
}
}
if (! dol_delete_file($file,0,0,0,$this)) // For triggers
{
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
$this->db->rollback();
return 0;
}
}
if (file_exists($dir))
{
if (! dol_delete_dir_recursive($dir)) // For remove dir and meta
{
$this->error=$langs->trans("ErrorCanNotDeleteDir",$dir);
$this->db->rollback();
return 0;
}
}
}
$this->db->commit();
return 1;
}
@@ -1708,7 +1714,7 @@ class Facture extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'.*');
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*');
}
}
}
@@ -1720,6 +1726,7 @@ class Facture extends CommonObject
$this->ref = $num;
$this->facnumber=$num;
$this->statut=1;
$this->brouillon=0;
$this->date_validation=$now;
}
@@ -1795,7 +1802,7 @@ class Facture extends CommonObject
$mouvP = new MouvementStock($this->db);
// We decrease stock for product
if ($this->type == 2) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref));
else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref));
else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value
}
}
}
@@ -2010,9 +2017,10 @@ class Facture extends CommonObject
* @param int $type Type of line (0=product, 1=service)
* @param int $fk_parent_line ???
* @param int $skip_update_total ???
* @param int $special_code Special code
* @return int < 0 if KO, > 0 if OK
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0)
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $special_code=0)
{
include_once(DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php');
@@ -2093,6 +2101,7 @@ class Facture extends CommonObject
$this->line->product_type = $type;
$this->line->fk_parent_line = $fk_parent_line;
$this->line->skip_update_total = $skip_update_total;
$this->line->special_code = $special_code;
// A ne plus utiliser
//$this->line->price=$price;
@@ -3625,6 +3634,7 @@ class FactureLigne
//if (empty($this->remise)) $this->remise=0;
if (empty($this->remise_percent)) $this->remise_percent=0;
if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0;
if (empty($this->product_type)) $this->product_type=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
@@ -3652,6 +3662,7 @@ class FactureLigne
else { $sql.=',date_end=null'; }
$sql.= ",product_type=".$this->product_type;
$sql.= ",info_bits='".$this->info_bits."'";
$sql.= ",special_code='".$this->special_code."'";
if (empty($this->skip_update_total))
{
$sql.= ",total_ht=".price2num($this->total_ht)."";

View File

@@ -35,7 +35,7 @@ $langs->load("companies");
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref = GETPOST('ref');
$socid=GETPOST('socid','int');
$socid=GETPOST('socid','int');
$action=GETPOST('action','alpha');
// Security check
@@ -166,9 +166,9 @@ if ($id > 0 || ! empty($ref))
print '</div>';
print '<br>';
// Contacts lines
print '<br>';
// Contacts lines
include(DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php');
}
else

View File

@@ -43,6 +43,13 @@ $confirm = GETPOST('confirm');
$id = GETPOST('facid','int');
$ref = GETPOST('ref');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id)
{
@@ -125,7 +132,9 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file,0,0,0,$object);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
}

View File

@@ -313,7 +313,7 @@ if ($resql)
$var=!$var;
print "<tr $bc[$var]>";
print "<tr ".$bc[$var].">";
$classname = "impayee";
print '<td nowrap="nowrap">';
@@ -380,6 +380,7 @@ if ($resql)
print '<td align="right"><b>'.price($total_paid).'</b></td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}

View File

@@ -31,9 +31,9 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php');
$langs->load("companies");
$langs->load("bills");
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int');
$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int')); // For backward compatibility
$ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int');
$action=GETPOST('action','alpha');
// Security check

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 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
@@ -148,12 +149,7 @@ if (! $mesg)
}
$res = $stats->getAverageByMonth($year);
$data = array();
for ($i = 1 ; $i < 13 ; $i++)
{
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@@ -173,8 +169,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i = $startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;
@@ -219,34 +214,37 @@ complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
if (empty($socid))
{
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<table class="border" width="100%">';
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
// Company
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1';
print $form->select_company($socid,'socid',$filter,1);
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
print $form->select_users($userid,'userid',1);
print '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<table class="border" width="100%">';
print '<tr><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
// Company
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1';
print $form->select_company($socid,'socid',$filter,1);
print '</td></tr>';
// User
print '<tr><td>'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").'</td><td>';
print $form->select_users($userid,'userid',1);
print '</td></tr>';
// Year
print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
arsort($arrayyears);
print $form->selectarray('year',$arrayyears,$year,0);
print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>';
print '</form>';
print '<br><br>';
}
print '<table class="border" width="100%">';
print '<tr height="24">';

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,9 +34,9 @@ $langs->load("compta");
// Protection if external user
if ($user->societe_id > 0)
{
accessforbidden();
}
$result = restrictedArea($user, 'societe&facture');
/*******************************************************************
@@ -147,7 +148,7 @@ print "<tr class=\"liste_titre\">";
print "<td>".$langs->trans("Date")."</td>";
print "<td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
print "<td>".$langs->trans("Account")."</td>";
print "<t><td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print "</tr>\n";
$var=true;
@@ -201,7 +202,7 @@ foreach ($tabfac as $key => $val)
foreach ($tabttc[$key] as $k => $mt)
{
print "<td>".$k."</td><td>".$langs->trans("ThirdParty")."</td>";
print '<td align="right">'.($mt<0?-price(-$mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
}
print "</tr>";
@@ -216,4 +217,4 @@ print "</table>";
llxFooter();
$db->close();
?>
?>

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,9 +35,9 @@ $langs->load("compta");
// Protection if external user
if ($user->societe_id > 0)
{
accessforbidden();
}
$result = restrictedArea($user, 'societe&facture');
/*******************************************************************
@@ -86,16 +87,21 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS);
$idpays = $p[0];
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client , fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
$sql.= " p.accountancy_code_sell, s.code_compta , ct.accountancy_code";
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,";
$sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,";
$sql.= " ct.accountancy_code";
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
$sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture";
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'";
$sql.= " WHERE f.fk_statut > 0 AND f.entity = ".$conf->entity;
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_statut > 0";
$sql.= " AND fd.product_type IN (0,1)";
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
$sql .= " order by f.rowid";
$sql.= " ORDER BY f.rowid";
$result = $db->query($sql);
if ($result)
@@ -150,7 +156,7 @@ print "<tr class=\"liste_titre\">";
//print "<td>".$langs->trans("JournalNum")."</td>";
print "<td>".$langs->trans("Date")."</td><td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
print "<td>".$langs->trans("Account")."</td>";
print "<t><td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print "</tr>\n";
$var=true;
@@ -209,4 +215,4 @@ print "</table>";
// End of page
$db->close();
llxFooter();
?>
?>

View File

@@ -263,7 +263,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
var code = $("#selectpaiementcode option:selected").val();
if (code == \'CHQ\')
if (code == \'CHQ\' || code == \'VIR\')
{
$(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
if ($(\'#fieldchqemetteur\').val() == \'\')
@@ -442,12 +442,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.type, ';
$sql.= ' f.datef as df';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
$sql.= ' WHERE f.fk_soc = '.$facture->socid;
$sql.= ' WHERE f.entity = '.$conf->entity;
$sql.= ' AND f.fk_soc = '.$facture->socid;
$sql.= ' AND f.paye = 0';
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled
if ($facture->type != 2)
{
$sql .= ' AND type in (0,1,3)'; // Standard invoice, replacement, deposit
$sql .= ' AND type IN (0,1,3)'; // Standard invoice, replacement, deposit
}
else
{

View File

@@ -119,7 +119,7 @@ class RemiseCheque extends CommonObject
* @param array $toRemise array with cheques to remise
* @return int <0 if KO, >0 if OK
*/
function create($user, $account_id, $limit=40, $toRemise)
function create($user, $account_id, $limit, $toRemise)
{
global $conf;

View File

@@ -216,6 +216,21 @@ if ($action == 'builddoc' && $user->rights->banque->cheque)
}
}
// Remove file in doc form
else if ($action == 'remove_file' && $user->rights->banque->cheque)
{
$remisecheque = new RemiseCheque($db);
if ($remisecheque->fetch($_GET["id"]) > 0)
{
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
$langs->load("other");
$file=$dir.get_exdir($remisecheque->number,2,1) . GETPOST('file');
$ret=dol_delete_file($file);
}
}
/*
* View

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,8 +36,7 @@ $action=GETPOST("action");
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', $langs->trans("SocialContribution"), '', 'charges');
$result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');

View File

@@ -262,8 +262,12 @@ class ChargeSociales extends CommonObject
*/
function solde($year = 0)
{
$sql = "SELECT sum(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as f WHERE paye = 0";
global $conf;
$sql = "SELECT SUM(f.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND paye = 0";
if ($year) {
$sql .= " AND f.datev >= '$y-01-01' AND f.datev <= '$y-12-31' ";
@@ -300,8 +304,8 @@ class ChargeSociales extends CommonObject
*/
function set_paid($user)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
$sql.= " set paye=1";
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
$sql.= " paye = 1";
$sql.= " WHERE rowid = ".$this->id;
$return = $this->db->query($sql);
if ($return) return 1;

View File

@@ -35,7 +35,7 @@ $action=GETPOST("action");
// Security check
$socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'tax', $langs->trans("SocialContribution"), '', 'charges');
$result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
/*

View File

@@ -806,8 +806,12 @@ class Contact extends CommonObject
$sql = "SELECT count(mc.email) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
$sql.= " AND mc.statut=1"; // -1 erreur, 0 non envoye, 1 envoye avec succes
$sql.= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes
dol_syslog(get_class($this)."::getNbOfEMailings sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);

View File

@@ -227,11 +227,9 @@ class Contrat extends CommonObject
* Close all lines of a contract
*
* @param User $user Object User making action
* @param Translate $langs Object Lang
* @param Conf $conf Object Conf
* @return void
*/
function cloture($user,$langs='',$conf='')
function cloture($user)
{
$this->db->begin();
@@ -258,7 +256,7 @@ class Contrat extends CommonObject
if ($this->statut == 0)
{
$result=$this->validate($user,$langs,$conf);
$result=$this->validate($user);
if ($result < 0) $ok=false;
}
@@ -277,12 +275,12 @@ class Contrat extends CommonObject
* Validate a contract
*
* @param User $user Objet User
* @param Translate $langs Environnement langue de l'utilisateur
* @param Conf $conf Environnement de configuration lors de l'operation
* @return int <0 if KO, >0 if OK
*/
function validate($user,$langs,$conf)
function validate($user)
{
global $langs, $conf;
$error=0;
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET statut = 1";
@@ -354,7 +352,8 @@ class Contrat extends CommonObject
$this->note_private = $result["note_private"];
$this->note_public = $result["note_public"];
$this->fk_projet = $result["fk_projet"];
$this->fk_projet = $result["fk_projet"]; // deprecated
$this->fk_project = $result["fk_projet"];
$this->socid = $result["fk_soc"];
$this->fk_soc = $result["fk_soc"];
@@ -443,7 +442,7 @@ class Contrat extends CommonObject
$line->statut = $objp->statut;
$line->remise_percent = $objp->remise_percent;
$line->price_ht = $objp->price_ht;
$line->price = $objp->price; // For backward compatibility
$line->price = $objp->price_ht; // For backward compatibility
$line->total_ht = $objp->total_ht;
$line->total_tva = $objp->total_tva;
$line->total_localtax1 = $objp->total_localtax1;
@@ -697,12 +696,12 @@ class Contrat extends CommonObject
* Supprime l'objet de la base
*
* @param User $user Utilisateur qui supprime
* @param Translate $langs Environnement langue de l'utilisateur
* @param Conf $conf Environnement de configuration lors de l'operation
* @return int < 0 si erreur, > 0 si ok
*/
function delete($user,$langs='',$conf='')
function delete($user)
{
global $conf, $langs;
$error=0;
$this->db->begin();
@@ -791,15 +790,39 @@ class Contrat extends CommonObject
}
}
if (! $error)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('CONTRACT_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
}
if (! $error)
{
// We remove directory
$ref = dol_sanitizeFileName($this->ref);
if ($conf->contrat->dir_output)
{
$dir = $conf->contrat->dir_output . "/" . $ref;
if (file_exists($dir))
{
$res=@dol_delete_dir_recursive($dir);
if (! $res)
{
$this->error='ErrorFailToDeleteDir';
$error++;
}
}
}
}
if (! $error)
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('CONTRACT_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
$this->db->commit();
return 1;
}

View File

@@ -34,9 +34,19 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
$langs->load("other");
$langs->load("products");
$langs->load("contracts");
if (!$user->rights->contrat->lire)
accessforbidden();
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$id = GETPOST('id','int');
$ref = GETPOST('ref','alpha');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id > 0)
@@ -45,6 +55,7 @@ if ($user->societe_id > 0)
$action='';
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'contrat', $id);
// Get parameters
$sortfield = GETPOST("sortfield",'alpha');
@@ -58,10 +69,14 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$contrat = new Contrat($db);
$contrat->fetch($_GET["id"]);
$object = new Contrat($db);
$object->fetch($id, $ref);
if ($object->id > 0)
{
$object->fetch_thirdparty();
}
$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($contrat->ref);
$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart='contract';
@@ -105,6 +120,21 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
}
}
// Delete
if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id)
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file,0,0,0,$object);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
/*
*
@@ -115,24 +145,9 @@ $form = new Form($db);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($contrat->id)
if ($object->id)
{
$soc = new Societe($db);
$soc->fetch($contrat->societe->id);
if ( $error_msg )
{
echo '<div class="error">'.$error_msg.'</div><br>';
}
if ($_GET["action"] == 'delete')
{
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$result=dol_delete_file($file);
//if ($result >= 0) $mesg=$langs->trans("FileWasRemoced");
}
$head=contract_prepare_head($contrat, $user);
$head=contract_prepare_head($object, $user);
dol_fiche_head($head, 'documents', $langs->trans("Contract"), 0, 'contract');
@@ -149,27 +164,38 @@ if ($contrat->id)
print '<table class="border" width="100%">';
// Reference
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$contrat->ref.'</td></tr>';
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$object->ref.'</td></tr>';
// Societe
print '<tr><td>'.$langs->trans("Customer").'</td>';
print '<td colspan="3">'.$soc->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';
print '</div>';
dol_htmloutput_mesg($mesg,$mesgs);
/*
* Confirmation suppression fichier
*/
if ($action == 'delete')
{
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/contrat/document.php?id='.$contrat->id,'',0,0,$user->rights->contrat->creer,50,$object);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/contrat/document.php?id='.$object->id,'',0,0,$user->rights->contrat->creer,50,$object);
// List of document
$param='&id='.$contrat->id;
$formfile->list_of_documents($filearray,$contrat,'contract',$param);
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'contract',$param);
}
else

View File

@@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/price.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php');
require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/contract/modules_contract.php");
if ($conf->produit->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
@@ -415,20 +415,21 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$object->fetch($id);
$result = $object->validate($user,$langs,$conf);
$result = $object->validate($user);
}
// Close all lines
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$object->fetch($id);
$result = $object->cloture($user,$langs,$conf);
$result = $object->cloture($user);
}
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
{
$object->fetch($id);
$result=$object->delete($user,$langs,$conf);
$object->fetch($id);
$object->fetch_thirdparty();
$result=$object->delete($user);
if ($result >= 0)
{
Header("Location: index.php");

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 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
@@ -34,8 +34,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't nee
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/fileupload.class.php");
error_reporting(E_ALL | E_STRICT);
@@ -47,380 +46,29 @@ $fk_element = GETPOST('fk_element','int');
$element = GETPOST('element','alpha');
/**
* \file htdocs/core/ajax/fileupload.php
* \brief This class is used to manage file upload using ajax
*/
class UploadHandler
{
private $_options;
private $_fk_element;
private $_element;
private $_element_ref;
/**
* Constructor
*
* @param array $options Options array
* @param int $fk_element fk_element
* @param string $element element
* @param string $element_ref element ref
*/
function __construct($options=null,$fk_element=null,$element=null)
{
global $db, $conf;
global $object;
$this->_fk_element=$fk_element;
$this->_element=$element;
$pathname=$filename=$element;
if (preg_match('/^([^_]+)_([^_]+)/i',$element,$regs))
{
$pathname = $regs[1];
$filename = $regs[2];
}
// For compatibility
if ($element == 'propal') {
$pathname = 'comm/propal'; $filename = 'propal';
}
if ($element == 'commande') {
$pathname = $filename = 'commande';
}
if ($element == 'facture') {
$pathname = 'compta/facture'; $filename = 'facture';
}
dol_include_once('/'.$pathname.'/class/'.$filename.'.class.php');
$classname = ucfirst($filename);
$object = new $classname($db);
$object->fetch($fk_element);
$object->fetch_thirdparty();
$this->_options = array(
'script_url' => $_SERVER['PHP_SELF'],
'upload_dir' => $conf->$element->dir_output . '/' . $object->ref . '/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$object->ref.'/',
'param_name' => 'files',
// The php.ini settings upload_max_filesize and post_max_size
// take precedence over the following max_file_size setting:
'max_file_size' => null,
'min_file_size' => 1,
'accept_file_types' => '/.+$/i',
'max_number_of_files' => null,
'discard_aborted_uploads' => true,
'image_versions' => array(
// Uncomment the following version to restrict the size of
// uploaded images. You can also add additional versions with
// their own upload directories:
/*
'small' => array(
'upload_dir' => dirname(__FILE__).'/files/',
'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/'
),
*/
'thumbs' => array(
'upload_dir' => $conf->$element->dir_output . '/' . $object->ref . '/thumbs/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$object->ref.'/thumbs/'
)
)
);
if ($options) {
$this->_options = array_merge_recursive($this->_options, $options);
}
}
/**
* Enter description here ...
*
* @param string $file_name Filename
* @return stdClass|NULL
*/
private function get_file_object($file_name)
{
$file_path = $this->_options['upload_dir'].$file_name;
if (is_file($file_path) && $file_name[0] !== '.')
{
$file = new stdClass();
$file->name = $file_name;
$file->mime = dol_mimetype($file_name,'',2);
$file->size = filesize($file_path);
$file->url = $this->_options['upload_url'].rawurlencode($file->name);
foreach($this->_options['image_versions'] as $version => $options) {
if (is_file($options['upload_dir'].$file_name)) {
$tmp=explode('.',$file->name);
$file->{$version.'_url'} = $options['upload_url'].rawurlencode($tmp[0].'_mini.'.$tmp[1]);
}
}
$file->delete_url = $this->_options['script_url']
.'?file='.rawurlencode($file->name).'&fk_element='.$this->_fk_element.'&element='.$this->_element;
$file->delete_type = 'DELETE';
return $file;
}
return null;
}
/**
* Enter description here ...
*
* @return void
*/
private function get_file_objects()
{
return array_values(array_filter(array_map(array($this, 'get_file_object'), scandir($this->_options['upload_dir']))));
}
/**
* Create thumbs
*
* @param string $file_name Filename
* @param string $options is array('max_width', 'max_height')
* @return void
*/
private function create_scaled_image($file_name, $options)
{
global $maxwidthmini, $maxheightmini;
$file_path = $this->_options['upload_dir'].$file_name;
$new_file_path = $options['upload_dir'].$file_name;
if (dol_mkdir($options['upload_dir']) >= 0)
{
list($img_width, $img_height) = @getimagesize($file_path);
if (!$img_width || !$img_height) {
return false;
}
$res=vignette($file_path,$maxwidthmini,$maxheightmini,'_mini');
//return $success;
if (preg_match('/error/i',$res)) return false;
return true;
}
else
{
return false;
}
}
/**
* Enter description here ...
*
* @param string $uploaded_file Uploade file
* @param string $file File
* @param string $error Error
* @return unknown|string
*/
private function has_error($uploaded_file, $file, $error)
{
if ($error) {
return $error;
}
if (!preg_match($this->_options['accept_file_types'], $file->name)) {
return 'acceptFileTypes';
}
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
$file_size = filesize($uploaded_file);
} else {
$file_size = $_SERVER['CONTENT_LENGTH'];
}
if ($this->_options['max_file_size'] && (
$file_size > $this->_options['max_file_size'] ||
$file->size > $this->_options['max_file_size'])
) {
return 'maxFileSize';
}
if ($this->_options['min_file_size'] &&
$file_size < $this->_options['min_file_size']) {
return 'minFileSize';
}
if (is_int($this->_options['max_number_of_files']) && (
count($this->get_file_objects()) >= $this->_options['max_number_of_files'])
) {
return 'maxNumberOfFiles';
}
return $error;
}
/**
* Enter description here ...
*
* @param string $uploaded_file Uploade file
* @param string $name Name
* @param int $size Size
* @param string $type Type
* @param string $error Error
* @return stdClass
*/
private function handle_file_upload($uploaded_file, $name, $size, $type, $error)
{
$file = new stdClass();
$file->name = basename(stripslashes($name));
$file->mime = dol_mimetype($file->name,'',2);
$file->size = intval($size);
$file->type = $type;
$error = $this->has_error($uploaded_file, $file, $error);
if (!$error && $file->name && dol_mkdir($this->_options['upload_dir']) >= 0) {
if ($file->name[0] === '.') {
$file->name = substr($file->name, 1);
}
$file_path = $this->_options['upload_dir'].$file->name;
$append_file = is_file($file_path) && $file->size > filesize($file_path);
clearstatcache();
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
// multipart/formdata uploads (POST method uploads)
if ($append_file) {
file_put_contents(
$file_path,
fopen($uploaded_file, 'r'),
FILE_APPEND
);
} else {
dol_move_uploaded_file($uploaded_file, $file_path, 1);
}
} else {
// Non-multipart uploads (PUT method support)
file_put_contents(
$file_path,
fopen('php://input', 'r'),
$append_file ? FILE_APPEND : 0
);
}
$file_size = filesize($file_path);
if ($file_size === $file->size) {
$file->url = $this->_options['upload_url'].rawurlencode($file->name);
foreach($this->_options['image_versions'] as $version => $options)
{
if ($this->create_scaled_image($file->name, $options))
{
$tmp=explode('.',$file->name);
$file->{$version.'_url'} = $options['upload_url'].rawurlencode($tmp[0].'_mini.'.$tmp[1]);
}
}
} else if ($this->_options['discard_aborted_uploads']) {
unlink($file_path);
$file->error = 'abort';
}
$file->size = $file_size;
$file->delete_url = $this->_options['script_url']
.'?file='.rawurlencode($file->name).'&fk_element='.$this->_fk_element.'&element='.$this->_element;
$file->delete_type = 'DELETE';
} else {
$file->error = $error;
}
return $file;
}
/**
* Output data
*
* @return void
*/
public function get()
{
$file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null;
if ($file_name) {
$info = $this->get_file_object($file_name);
} else {
$info = $this->get_file_objects();
}
header('Content-type: application/json');
echo json_encode($info);
}
/**
* Output data
*
* @return void
*/
public function post()
{
$upload = isset($_FILES[$this->_options['param_name']]) ?
$_FILES[$this->_options['param_name']] : array(
'tmp_name' => null,
'name' => null,
'size' => null,
'type' => null,
'error' => null
);
$info = array();
if (is_array($upload['tmp_name'])) {
foreach ($upload['tmp_name'] as $index => $value) {
$info[] = $this->handle_file_upload(
$upload['tmp_name'][$index],
isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index],
isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index],
isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index],
$upload['error'][$index]
);
}
} else {
$info[] = $this->handle_file_upload(
$upload['tmp_name'],
isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'],
isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'],
isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'],
$upload['error']
);
}
header('Vary: Accept');
if (isset($_SERVER['HTTP_ACCEPT']) &&
(strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {
header('Content-type: application/json');
} else {
header('Content-type: text/plain');
}
echo json_encode($info);
}
/**
* Delete uploaded file
*
* @return void
*/
public function delete()
{
$file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null;
$file_path = $this->_options['upload_dir'].$file_name;
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
if ($success) {
foreach($this->_options['image_versions'] as $version => $options) {
$file = $options['upload_dir'].$file_name;
if (is_file($file)) {
unlink($file);
}
}
}
header('Content-type: application/json');
echo json_encode($success);
}
}
/*
* View
*/
$upload_handler = new UploadHandler(null,$fk_element,$element);
$upload_handler = new FileUpload(null,$fk_element,$element);
header('Pragma: no-cache');
header('Cache-Control: private, no-cache');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Content-Disposition: inline; filename="files.json"');
header('X-Content-Type-Options: nosniff');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
switch ($_SERVER['REQUEST_METHOD']) {
case 'OPTIONS':
break;
case 'HEAD':
case 'GET':
$upload_handler->get();
break;
case 'POST':
$upload_handler->post();
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
$upload_handler->delete();
} else {
$upload_handler->post();
}
break;
case 'DELETE':
$upload_handler->delete();
@@ -430,7 +78,6 @@ switch ($_SERVER['REQUEST_METHOD']) {
exit;
}
$db->close();
?>

View File

@@ -90,7 +90,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
$module = $subelement = $ext_element;
if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs))
{
$module = $regs[1];
$module = $regs[1];
$subelement = $regs[2];
}

View File

@@ -50,11 +50,11 @@ if ((isset($_POST['roworder']) && ! empty($_POST['roworder'])) && (isset($_POST[
if (! empty($value)) $newroworder[] = $value;
}
dol_syslog("AjaxRow roworder=".GETPOST('roworder','alpha',2)." fk_element=".GETPOST('fk_element','int',2), LOG_DEBUG);
dol_syslog("AjaxRow roworder=".GETPOST('roworder','alpha',2)." fk_element=".GETPOST('fk_element','alpha',2), LOG_DEBUG);
$row=new GenericObject($db);
$row->table_element_line = GETPOST('table_element_line','alpha',2);
$row->fk_element = GETPOST('fk_element','int',2);
$row->fk_element = GETPOST('fk_element','alpha',2);
$row->id = GETPOST('element_id','int',2);
$result=$row->line_ajaxorder($newroworder);
$result=$row->line_order(true);

View File

@@ -30,9 +30,9 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
require('../../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/core/class/genericobject.class.php");
$field = GETPOST('field','alpha',2);
$element = GETPOST('element','alpha',2);
$table_element = GETPOST('table_element','alpha',2);
$field = GETPOST('field','alpha',2);
$element = GETPOST('element','alpha',2);
$table_element = GETPOST('table_element','alpha',2);
$fk_element = GETPOST('fk_element','alpha',2);
/*
@@ -132,11 +132,11 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else
{
$module = $subelement = $ext_element;
if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs))
{
$module = $regs[1];
$subelement = $regs[2];
$module = $subelement = $ext_element;
if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs))
{
$module = $regs[1];
$subelement = $regs[2];
}
dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php');

View File

@@ -49,12 +49,12 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname))
$soc->fetch($id);
$return=array();
$return['value'] = $form->load_tva('tva_tx','',$soc,$mysoc,0,0,'',true);
$return['num'] = $form->num;
$return['error'] = $form->error;
$return=array();
$return['value'] = $form->load_tva('tva_tx','',$soc,$mysoc,0,0,'',true);
$return['num'] = $form->num;
$return['error'] = $form->error;
echo json_encode($return);
}

View File

@@ -48,7 +48,7 @@ class box_contracts extends ModeleBoxes
{
global $langs;
$langs->load("contracts");
$langs->load("boxes");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxLastContracts");
}

View File

@@ -73,7 +73,8 @@ class box_members extends ModeleBoxes
if ($user->rights->societe->lire)
{
$sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe, a.fk_soc,";
$sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql.= " t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " WHERE a.entity = ".$conf->entity;
@@ -97,6 +98,14 @@ class box_members extends ModeleBoxes
$memberstatic->lastname=$objp->lastname;
$memberstatic->firstname=$objp->firstname;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$memberstatic->name=$memberstatic->thirdparty->name;
} else {
$memberstatic->name=$objp->company;
}
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/adherents/fiche.php?rowid=".$objp->rowid);

View File

@@ -103,11 +103,15 @@ class CMailFile
{
global $conf;
// We define end of line (RFC 822bis section 2.3)
// We define end of line (RFC 821).
$this->eol="\r\n";
// eol2 is for header fields to manage bugged MTA with option MAIN_FIX_FOR_BUGGED_MTA
$this->eol2=$this->eol;
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) $this->eol2="\n";
// We define end of line for header fields (RFC 822bis section 2.3 says header must contains \r\n).
$this->eol2="\r\n";
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
{
$this->eol="\n";
$this->eol2="\n";
}
// On defini mixed_boundary
$this->mixed_boundary = "multipart_x." . time() . ".x_boundary";
@@ -494,6 +498,7 @@ class CMailFile
/**
* Write content of a SMTP request into a dump file (mode = all)
* Used for debugging.
* Note that to see full SMTP protocol, you can use tcpdump -w /tmp/smtp -s 2000 port 25"
*
* @return void
*/
@@ -593,7 +598,11 @@ class CMailFile
// Sender
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA))
{
$out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2;
}
$out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2;
if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2;
if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2;
@@ -688,7 +697,11 @@ class CMailFile
// Make RFC821 Compliant, replace bare linefeeds
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
{
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
}
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
$strContent = rtrim(wordwrap($strContent));
@@ -1013,4 +1026,4 @@ class CMailFile
}
}
?>
?>

View File

@@ -140,6 +140,26 @@ abstract class CommonDocGenerator
);
}
/**
* Rect pdf
*
* @param PDF $pdf Object PDF
* @param float $x Abscissa of first point
* @param float $y Ordinate of first point
* @param float $l ??
* @param float $h ??
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom
* @return void
*/
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
{
if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y);
$pdf->line($x+$l, $y, $x+$l, $y+$h);
if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
$pdf->line($x, $y+$h, $x, $y);
}
}
?>

View File

@@ -865,93 +865,93 @@ abstract class CommonObject
}
}
/**
* Change the payments methods
*
* @param int $id Id of new payment method
* @return int >0 if OK, <0 if KO
*/
function setPaymentMethods($id)
{
dol_syslog(get_class($this).'::setPaymentMethods('.$id.')');
if ($this->statut >= 0 || $this->element == 'societe')
{
// TODO uniformize field name
$fieldname = 'fk_mode_reglement';
if ($this->element == 'societe') $fieldname = 'mode_reglement';
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' SET '.$fieldname.' = '.$id;
$sql .= ' WHERE rowid='.$this->id;
if ($this->db->query($sql))
{
/**
* Change the payments methods
*
* @param int $id Id of new payment method
* @return int >0 if OK, <0 if KO
*/
function setPaymentMethods($id)
{
dol_syslog(get_class($this).'::setPaymentMethods('.$id.')');
if ($this->statut >= 0 || $this->element == 'societe')
{
// TODO uniformize field name
$fieldname = 'fk_mode_reglement';
if ($this->element == 'societe') $fieldname = 'mode_reglement';
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' SET '.$fieldname.' = '.$id;
$sql .= ' WHERE rowid='.$this->id;
if ($this->db->query($sql))
{
$this->mode_reglement_id = $id;
$this->mode_reglement = $id; // for compatibility
return 1;
}
else
{
dol_syslog(get_class($this).'::setPaymentMethods Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this).'::setPaymentMethods, status of the object is incompatible');
$this->error='Status of the object is incompatible '.$this->statut;
return -2;
}
$this->mode_reglement = $id; // for compatibility
return 1;
}
else
{
dol_syslog(get_class($this).'::setPaymentMethods Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this).'::setPaymentMethods, status of the object is incompatible');
$this->error='Status of the object is incompatible '.$this->statut;
return -2;
}
}
/**
* Change the payments terms
*
* @param int $id Id of new payment terms
* @return int >0 if OK, <0 if KO
*/
function setPaymentTerms($id)
{
dol_syslog(get_class($this).'::setPaymentTerms('.$id.')');
if ($this->statut >= 0 || $this->element == 'societe')
/**
* Change the payments terms
*
* @param int $id Id of new payment terms
* @return int >0 if OK, <0 if KO
*/
function setPaymentTerms($id)
{
dol_syslog(get_class($this).'::setPaymentTerms('.$id.')');
if ($this->statut >= 0 || $this->element == 'societe')
{
// TODO uniformize field name
$fieldname = 'fk_cond_reglement';
if ($this->element == 'societe') $fieldname = 'cond_reglement';
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' SET '.$fieldname.' = '.$id;
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' SET '.$fieldname.' = '.$id;
$sql .= ' WHERE rowid='.$this->id;
if ($this->db->query($sql))
{
if ($this->db->query($sql))
{
$this->cond_reglement_id = $id;
$this->cond_reglement = $id; // for compatibility
return 1;
}
else
{
dol_syslog(get_class($this).'::setPaymentTerms Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this).'::setPaymentTerms, status of the object is incompatible');
$this->error='Status of the object is incompatible '.$this->statut;
return -2;
}
$this->cond_reglement = $id; // for compatibility
return 1;
}
else
{
dol_syslog(get_class($this).'::setPaymentTerms Erreur '.$sql.' - '.$this->db->error());
$this->error=$this->db->error();
return -1;
}
}
else
{
dol_syslog(get_class($this).'::setPaymentTerms, status of the object is incompatible');
$this->error='Status of the object is incompatible '.$this->statut;
return -2;
}
}
/**
* Define delivery address
*
* @param int $id Address id
* @return int <0 si ko, >0 si ok
*/
function setDeliveryAddress($id)
/**
* Define delivery address
*
* @param int $id Address id
* @return int <0 si ko, >0 si ok
*/
function setDeliveryAddress($id)
{
$fieldname = 'fk_adresse_livraison';
if ($this->element == 'delivery' || $this->element == 'shipping') $fieldname = 'fk_address';
@@ -962,14 +962,14 @@ abstract class CommonObject
if ($this->db->query($sql))
{
$this->fk_delivery_address = $id;
return 1;
return 1;
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this).'::setDeliveryAddress Erreur '.$sql.' - '.$this->error);
return -1;
}
}
}
/**
@@ -1854,18 +1854,18 @@ abstract class CommonObject
$sql.= " WHERE rowid=".$elementId;
dol_syslog(get_class($this)."::setStatut sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql))
{
if ($this->db->query($sql))
{
$this->db->commit();
$this->statut = $status;
return 1;
}
else
{
$this->statut = $status;
return 1;
}
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::setStatut ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
dol_syslog(get_class($this)."::setStatut ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
}
@@ -2148,35 +2148,35 @@ abstract class CommonObject
return $nb;
}
/**
/**
* Set extra parameters
*
* @return void
*/
function setExtraParameters()
* @return void
*/
function setExtraParameters()
{
$this->db->begin();
$extraparams = (! empty($this->extraparams) ? json_encode($this->extraparams) : null);
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET extraparams = ".(! empty($extraparams) ? "'".$this->db->escape($extraparams)."'" : "null");
$sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::setExtraParameters sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::setExtraParameters ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
else
{
$this->db->commit();
return 1;
}
dol_syslog(get_class($this)."::setExtraParameters sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::setExtraParameters ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
else
{
$this->db->commit();
return 1;
}
}

View File

@@ -199,7 +199,7 @@ class Conf
{
$modulename=strtolower($reg[1]);
if ($modulename == 'propale') $modulename='propal';
$this->$modulename=(object) array();
if (! isset($this->$modulename) || ! is_object($this->$modulename)) $this->$modulename=(object) array();
$this->$modulename->enabled=true;
$this->modules[]=$modulename; // Add this module in list of enabled modules
}
@@ -213,28 +213,28 @@ class Conf
//var_dump($this->modules);
//var_dump($this->modules_parts);
// Object $mc
if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))
{
global $mc;
$ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php');
if ($ret) $mc = new ActionsMulticompany($db);
// Object $mc
if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))
{
global $mc;
$ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php');
if ($ret) $mc = new ActionsMulticompany($db);
}
// Second or others levels object
$this->propal->cloture = (object) array();
$this->propal->cloture = (object) array();
$this->propal->facturation = (object) array();
$this->commande->client = (object) array();
$this->commande->client = (object) array();
$this->commande->fournisseur = (object) array();
$this->facture->client = (object) array();
$this->facture->client = (object) array();
$this->facture->fournisseur = (object) array();
$this->fournisseur->commande = (object) array();
$this->fournisseur->commande = (object) array();
$this->fournisseur->facture = (object) array();
$this->contrat->services = (object) array();
$this->contrat->services->inactifs = (object) array();
$this->contrat->services = (object) array();
$this->contrat->services->inactifs = (object) array();
$this->contrat->services->expires = (object) array();
$this->adherent->cotisation = (object) array();
$this->bank->rappro = (object) array();
$this->bank->rappro = (object) array();
$this->bank->cheque = (object) array();
// Clean some variables
@@ -268,7 +268,7 @@ class Conf
// Define default dir_output and dir_temp for directories of modules
foreach($this->modules as $module)
{
$this->$module->multidir_output = array($this->entity => $rootfordata."/".$module);
$this->$module->multidir_output = array($this->entity => $rootfordata."/".$module);
$this->$module->multidir_temp = array($this->entity => $rootfordata."/".$module."/temp");
// For backward compatibility
$this->$module->dir_output = $rootfordata."/".$module;
@@ -284,15 +284,15 @@ class Conf
$this->admin->dir_temp=$rootfordata.'/admin/temp';
// For user storage
$this->user->multidir_output = array($this->entity => $rootfordata."/users");
$this->user->multidir_output = array($this->entity => $rootfordata."/users");
$this->user->multidir_temp = array($this->entity => $rootfordata."/users/temp");
// For backward compatibility
$this->user->dir_output=$rootforuser."/users";
$this->user->dir_temp=$rootforuser."/users/temp";
// For propal storage
$this->propal->dir_output=$rootforuser."/propale";
$this->propal->dir_temp=$rootforuser."/propale/temp";
// For propal storage
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";
// Exception: Some dir are not the name of module. So we keep exception here
// for backward compatibility.
@@ -314,9 +314,9 @@ class Conf
$this->service->multidir_output=array($this->entity => $rootfordata."/produit");
$this->service->multidir_temp =array($this->entity => $rootfordata."/produit/temp");
// For backward compatibility
$this->product->dir_output=$rootfordata."/produit";
$this->product->dir_temp =$rootfordata."/produit/temp";
$this->service->dir_output=$rootfordata."/produit";
$this->product->dir_output=$rootfordata."/produit";
$this->product->dir_temp =$rootfordata."/produit/temp";
$this->service->dir_output=$rootfordata."/produit";
$this->service->dir_temp =$rootfordata."/produit/temp";
// Module contrat
@@ -436,10 +436,10 @@ class Conf
if ($this->top_menu == 'eldy.php') $this->top_menu='eldy_backoffice.php';
elseif ($this->top_menu == 'rodolphe.php') $this->top_menu='eldy_backoffice.php';
// Object $mc
if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))
// Object $mc
if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled))
{
if (is_object($mc)) $mc->setValues($this);
if (is_object($mc)) $mc->setValues($this);
}
}
}

View File

@@ -0,0 +1,580 @@
<?php
/* Copyright (C) 2011-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/ajax/fileupload.php
* \brief File to return Ajax response on file upload
*/
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php");
/**
* \file htdocs/core/class/fileupload.class.php
* \brief This class is used to manage file upload using ajax
*/
class FileUpload
{
protected $_options;
protected $_fk_element;
protected $_element;
/**
* Constructor
*
* @param array $options Options array
* @param int $fk_element fk_element
* @param string $element element
*/
function __construct($options=null,$fk_element=null,$element=null)
{
global $db, $conf;
global $object;
$this->_fk_element=$fk_element;
$this->_element=$element;
$pathname=$filename=$element;
if (preg_match('/^([^_]+)_([^_]+)/i',$element,$regs))
{
$pathname = $regs[1];
$filename = $regs[2];
}
// For compatibility
if ($element == 'propal') {
$pathname = 'comm/propal';
$dir_output=$conf->$element->dir_output;
}
elseif ($element == 'facture') {
$pathname = 'compta/facture';
$dir_output=$conf->$element->dir_output;
}
elseif ($element == 'project') {
$element = $pathname = 'projet';
$dir_output=$conf->$element->dir_output;
}
elseif ($element == 'fichinter') {
$element='ficheinter';
$dir_output=$conf->$element->dir_output;
}
elseif ($element == 'order_supplier') {
$pathname = 'fourn'; $filename='fournisseur.commande';
$dir_output=$conf->fournisseur->commande->dir_output;
}
elseif ($element == 'invoice_supplier') {
$pathname = 'fourn'; $filename='fournisseur.facture';
$dir_output=$conf->fournisseur->facture->dir_output;
} else {
$dir_output=$conf->$element->dir_output;
}
dol_include_once('/'.$pathname.'/class/'.$filename.'.class.php');
$classname = ucfirst($filename);
if ($element == 'order_supplier') {
$classname = 'CommandeFournisseur';
} elseif ($element == 'invoice_supplier') {
$classname = 'FactureFournisseur';
}
$object = new $classname($db);
$object->fetch($fk_element);
$object->fetch_thirdparty();
$object_ref = dol_sanitizeFileName($object->ref);
if ($element == 'invoice_supplier') {
$object_ref = get_exdir($object->id, 2) . $object_ref;
}
$this->_options = array(
'script_url' => $_SERVER['PHP_SELF'],
'upload_dir' => $dir_output . '/' . $object_ref . '/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$object_ref.'/',
'param_name' => 'files',
// Set the following option to 'POST', if your server does not support
// DELETE requests. This is a parameter sent to the client:
'delete_type' => 'DELETE',
// The php.ini settings upload_max_filesize and post_max_size
// take precedence over the following max_file_size setting:
'max_file_size' => null,
'min_file_size' => 1,
'accept_file_types' => '/.+$/i',
// The maximum number of files for the upload directory:
'max_number_of_files' => null,
// Image resolution restrictions:
'max_width' => null,
'max_height' => null,
'min_width' => 1,
'min_height' => 1,
// Set the following option to false to enable resumable uploads:
'discard_aborted_uploads' => true,
'image_versions' => array(
// Uncomment the following version to restrict the size of
// uploaded images. You can also add additional versions with
// their own upload directories:
/*
'large' => array(
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/files/',
'upload_url' => $this->getFullUrl().'/files/',
'max_width' => 1920,
'max_height' => 1200,
'jpeg_quality' => 95
),
*/
'thumbnail' => array(
'upload_dir' => $dir_output . '/' . $object_ref . '/thumbs/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$object_ref.'/thumbs/',
'max_width' => 80,
'max_height' => 80
)
)
);
if ($options) {
$this->_options = array_replace_recursive($this->_options, $options);
}
}
/**
* getFullUrl
*
* @return string Full url
*/
protected function getFullUrl()
{
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
return
($https ? 'https://' : 'http://').
(!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
($https && $_SERVER['SERVER_PORT'] === 443 ||
$_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
}
/**
* Set delete url
*
* @param string $file File
* @return void
*/
protected function set_file_delete_url($file)
{
$file->delete_url = $this->_options['script_url']
.'?file='.rawurlencode($file->name).'&fk_element='.$this->_fk_element.'&element='.$this->_element;
$file->delete_type = $this->_options['delete_type'];
if ($file->delete_type !== 'DELETE') {
$file->delete_url .= '&_method=DELETE';
}
}
/**
* Enter description here ...
*
* @param string $file_name Filename
* @return stdClass|NULL
*/
protected function get_file_object($file_name)
{
$file_path = $this->_options['upload_dir'].$file_name;
if (is_file($file_path) && $file_name[0] !== '.')
{
$file = new stdClass();
$file->name = $file_name;
$file->mime = dol_mimetype($file_name,'',2);
$file->size = filesize($file_path);
$file->url = $this->_options['upload_url'].rawurlencode($file->name);
foreach($this->_options['image_versions'] as $version => $options) {
if (is_file($options['upload_dir'].$file_name)) {
$tmp=explode('.',$file->name);
$file->{$version.'_url'} = $options['upload_url'].rawurlencode($tmp[0].'_mini.'.$tmp[1]);
}
}
$this->set_file_delete_url($file);
return $file;
}
return null;
}
/**
* Enter description here ...
*
* @return void
*/
protected function get_file_objects()
{
return array_values(array_filter(array_map(array($this, 'get_file_object'), scandir($this->_options['upload_dir']))));
}
/**
* Create thumbs
*
* @param string $file_name Filename
* @param string $options is array('max_width', 'max_height')
* @return void
*/
protected function create_scaled_image($file_name, $options)
{
global $maxwidthmini, $maxheightmini;
$file_path = $this->_options['upload_dir'].$file_name;
$new_file_path = $options['upload_dir'].$file_name;
if (dol_mkdir($options['upload_dir']) >= 0)
{
list($img_width, $img_height) = @getimagesize($file_path);
if (!$img_width || !$img_height) {
return false;
}
$res=vignette($file_path,$maxwidthmini,$maxheightmini,'_mini');
//return $success;
if (preg_match('/error/i',$res)) return false;
return true;
}
else
{
return false;
}
}
/**
* Enter description here ...
*
* @param string $uploaded_file Uploade file
* @param string $file File
* @param string $error Error
* @param string $index Index
* @return unknown|string
*/
protected function validate($uploaded_file, $file, $error, $index)
{
if ($error) {
$file->error = $error;
return false;
}
if (!$file->name) {
$file->error = 'missingFileName';
return false;
}
if (!preg_match($this->_options['accept_file_types'], $file->name)) {
$file->error = 'acceptFileTypes';
return false;
}
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
$file_size = filesize($uploaded_file);
} else {
$file_size = $_SERVER['CONTENT_LENGTH'];
}
if ($this->_options['max_file_size'] && (
$file_size > $this->_options['max_file_size'] ||
$file->size > $this->_options['max_file_size'])
) {
$file->error = 'maxFileSize';
return false;
}
if ($this->_options['min_file_size'] &&
$file_size < $this->_options['min_file_size']) {
$file->error = 'minFileSize';
return false;
}
if (is_int($this->_options['max_number_of_files']) && (
count($this->get_file_objects()) >= $this->_options['max_number_of_files'])
) {
$file->error = 'maxNumberOfFiles';
return false;
}
list($img_width, $img_height) = @getimagesize($uploaded_file);
if (is_int($img_width)) {
if ($this->_options['max_width'] && $img_width > $this->_options['max_width'] ||
$this->_options['max_height'] && $img_height > $this->_options['max_height']) {
$file->error = 'maxResolution';
return false;
}
if ($this->_options['min_width'] && $img_width < $this->_options['min_width'] ||
$this->_options['min_height'] && $img_height < $this->_options['min_height']) {
$file->error = 'minResolution';
return false;
}
}
return true;
}
/**
* Enter description here ...
*
* @param unknown_type $matches
*/
protected function upcount_name_callback($matches) {
$index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;
$ext = isset($matches[2]) ? $matches[2] : '';
return ' ('.$index.')'.$ext;
}
/**
* Enter description here ...
*
* @param unknown_type $name
*/
protected function upcount_name($name) {
return preg_replace_callback(
'/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/',
array($this, 'upcount_name_callback'),
$name,
1
);
}
/**
* Enter description here ...
*
* @param string $name
* @param string $type
* @param string $index
* @return string Trimed string
*/
protected function trim_file_name($name, $type, $index) {
// Remove path information and dots around the filename, to prevent uploading
// into different directories or replacing hidden system files.
// Also remove control characters and spaces (\x00..\x20) around the filename:
$file_name = trim(basename(stripslashes($name)), ".\x00..\x20");
// Add missing file extension for known image types:
if (strpos($file_name, '.') === false &&
preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) {
$file_name .= '.'.$matches[1];
}
if ($this->_options['discard_aborted_uploads']) {
while(is_file($this->_options['upload_dir'].$file_name)) {
$file_name = $this->upcount_name($file_name);
}
}
return $file_name;
}
/**
* Enter description here ...
*
* @param unknown_type $file
* @param unknown_type $index
*/
protected function handle_form_data($file, $index) {
// Handle form data, e.g. $_REQUEST['description'][$index]
}
/**
* Enter description here ...
*
* @param unknown_type $file_path
*/
protected function orient_image($file_path) {
$exif = @exif_read_data($file_path);
if ($exif === false) {
return false;
}
$orientation = intval(@$exif['Orientation']);
if (!in_array($orientation, array(3, 6, 8))) {
return false;
}
$image = @imagecreatefromjpeg($file_path);
switch ($orientation) {
case 3:
$image = @imagerotate($image, 180, 0);
break;
case 6:
$image = @imagerotate($image, 270, 0);
break;
case 8:
$image = @imagerotate($image, 90, 0);
break;
default:
return false;
}
$success = imagejpeg($image, $file_path);
// Free up memory (imagedestroy does not delete files):
@imagedestroy($image);
return $success;
}
/**
* Enter description here ...
*
* @param string $uploaded_file Uploade file
* @param string $name Name
* @param int $size Size
* @param string $type Type
* @param string $error Error
* @param string $index Index
* @return stdClass
*/
protected function handle_file_upload($uploaded_file, $name, $size, $type, $error, $index)
{
$file = new stdClass();
$file->name = $this->trim_file_name($name, $type, $index);
$file->mime = dol_mimetype($file->name,'',2);
$file->size = intval($size);
$file->type = $type;
if ($this->validate($uploaded_file, $file, $error, $index) && dol_mkdir($this->_options['upload_dir']) >= 0) {
$this->handle_form_data($file, $index);
$file_path = $this->_options['upload_dir'].$file->name;
$append_file = !$this->_options['discard_aborted_uploads'] && is_file($file_path) && $file->size > filesize($file_path);
clearstatcache();
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
// multipart/formdata uploads (POST method uploads)
if ($append_file) {
file_put_contents(
$file_path,
fopen($uploaded_file, 'r'),
FILE_APPEND
);
} else {
dol_move_uploaded_file($uploaded_file, $file_path, 1);
}
} else {
// Non-multipart uploads (PUT method support)
file_put_contents(
$file_path,
fopen('php://input', 'r'),
$append_file ? FILE_APPEND : 0
);
}
$file_size = filesize($file_path);
if ($file_size === $file->size) {
$file->url = $this->_options['upload_url'].rawurlencode($file->name);
foreach($this->_options['image_versions'] as $version => $options)
{
if ($this->create_scaled_image($file->name, $options))
{
$tmp=explode('.',$file->name);
$file->{$version.'_url'} = $options['upload_url'].rawurlencode($tmp[0].'_mini.'.$tmp[1]);
}
}
} else if ($this->_options['discard_aborted_uploads']) {
unlink($file_path);
$file->error = 'abort';
}
$file->size = $file_size;
$this->set_file_delete_url($file);
}
return $file;
}
/**
* Output data
*
* @return void
*/
public function get()
{
$file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null;
if ($file_name) {
$info = $this->get_file_object($file_name);
} else {
$info = $this->get_file_objects();
}
header('Content-type: application/json');
echo json_encode($info);
}
/**
* Output data
*
* @return void
*/
public function post()
{
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
return $this->delete();
}
$upload = isset($_FILES[$this->_options['param_name']]) ?
$_FILES[$this->_options['param_name']] : null;
$info = array();
if ($upload && is_array($upload['tmp_name'])) {
// param_name is an array identifier like "files[]",
// $_FILES is a multi-dimensional array:
foreach ($upload['tmp_name'] as $index => $value) {
$info[] = $this->handle_file_upload(
$upload['tmp_name'][$index],
isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index],
isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index],
isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index],
$upload['error'][$index],
$index
);
}
} elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) {
// param_name is a single object identifier like "file",
// $_FILES is a one-dimensional array:
$info[] = $this->handle_file_upload(
isset($upload['tmp_name']) ? $upload['tmp_name'] : null,
isset($_SERVER['HTTP_X_FILE_NAME']) ?
$_SERVER['HTTP_X_FILE_NAME'] : (isset($upload['name']) ?
$upload['name'] : null),
isset($_SERVER['HTTP_X_FILE_SIZE']) ?
$_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ?
$upload['size'] : null),
isset($_SERVER['HTTP_X_FILE_TYPE']) ?
$_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ?
$upload['type'] : null),
isset($upload['error']) ? $upload['error'] : null
);
}
header('Vary: Accept');
$json = json_encode($info);
$redirect = isset($_REQUEST['redirect']) ?
stripslashes($_REQUEST['redirect']) : null;
if ($redirect) {
header('Location: '.sprintf($redirect, rawurlencode($json)));
return;
}
if (isset($_SERVER['HTTP_ACCEPT']) &&
(strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {
header('Content-type: application/json');
} else {
header('Content-type: text/plain');
}
echo $json;
}
/**
* Delete uploaded file
*
* @return void
*/
public function delete()
{
$file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null;
$file_path = $this->_options['upload_dir'].$file_name;
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
if ($success) {
foreach($this->_options['image_versions'] as $version => $options) {
$file = $options['upload_dir'].$file_name;
if (is_file($file)) {
unlink($file);
}
}
}
header('Content-type: application/json');
echo json_encode($success);
}
}

View File

@@ -56,7 +56,6 @@ class HookManager
/**
* Init array this->hooks with instantiated action controlers.
*
* First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS
* with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file.
* This make conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...))

View File

@@ -285,12 +285,12 @@ class Form
if (! empty($tmp[2])) $savemethod=$tmp[2];
if (! empty($tmp[3])) $button_only=true;
}
else if (preg_match('/^textarea/',$inputType))
{
$tmp=explode(':',$inputType);
else if (preg_match('/^textarea/',$inputType))
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0];
if (! empty($tmp[1])) $rows=$tmp[1];
if (! empty($tmp[2])) $cols=$tmp[2];
if (! empty($tmp[1])) $rows=$tmp[1];
if (! empty($tmp[2])) $cols=$tmp[2];
}
else if (preg_match('/^ckeditor/',$inputType))
{
@@ -669,6 +669,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id;
if ($filter) $sql.= " AND ".$filter;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " ORDER BY nom ASC";
@@ -790,20 +791,20 @@ class Form
}
}
/**
* Return list of all contacts (for a third party or all)
*
* @param int $socid Id ot third party or 0 for all
* @param string $selected Id contact pre-selectionne
* @param string $htmlname Name of HTML field ('none' for a not editable field)
* @param int $showempty 0=no empty value, 1=add an empty value
* @param string $exclude List of contacts id to exclude
* @param string $limitto Disable answers that are not id in this array list
* @param string $showfunction Add function into label
* @param string $moreclass Add more class to class style
* @return int <0 if KO, Nb of contact in list if OK
*/
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='')
/**
* Return list of all contacts (for a third party or all)
*
* @param int $socid Id ot third party or 0 for all
* @param string $selected Id contact pre-selectionne
* @param string $htmlname Name of HTML field ('none' for a not editable field)
* @param int $showempty 0=no empty value, 1=add an empty value
* @param string $exclude List of contacts id to exclude
* @param string $limitto Disable answers that are not id in this array list
* @param string $showfunction Add function into label
* @param string $moreclass Add more class to class style
* @return int <0 if KO, Nb of contact in list if OK
*/
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='')
{
print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass);
return $this->num;
@@ -929,7 +930,7 @@ class Form
* @param int $force_entity Possibility to force entity
* @return void
*/
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=false)
{
print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity);
}
@@ -947,7 +948,7 @@ class Form
* @param int $force_entity Possibility to force entity
* @return string HTML select string
*/
function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=false)
{
global $conf,$user,$langs;
@@ -962,22 +963,32 @@ class Form
$out='';
// On recherche les utilisateurs
$sql = "SELECT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
$sql = "SELECT DISTINCT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
$sql.= ", e.label";
}
$sql.= " FROM ".MAIN_DB_PREFIX ."user as u";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."entity as e on e.rowid=u.entity";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."entity as e ON e.rowid=u.entity";
if ($force_entity) $sql.= " WHERE u.entity IN (0,".$force_entity.")";
else $sql.= " WHERE u.entity IS NOT NULL";
}
else
{
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
if (! empty($conf->multicompany->transverse_mode))
{
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ug.fk_user = u.rowid";
$sql.= " AND ug.entity = ".$conf->entity;
}
else
{
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
}
}
if (! empty($user->societe_id)) $sql.= " AND u.fk_societe = ".$user->societe_id;
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
$sql.= " ORDER BY u.name ASC";
@@ -1020,7 +1031,7 @@ class Form
}
$out.= $userstatic->getFullName($langs);
if(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
if ($obj->admin && ! $obj->entity) $out.=" (".$langs->trans("AllEntities").")";
else $out.=" (".$obj->label.")";
@@ -1359,10 +1370,10 @@ class Form
$sql.= " s.nom";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
if ($socid) $sql.= " AND pfp.fk_soc = ".$socid;
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tobuy = 1";
if ($socid) $sql.= " AND pfp.fk_soc = ".$socid;
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype;
if (! empty($filtre)) $sql.=" ".$filtre;
// Add criteria on ref/label
@@ -1404,7 +1415,7 @@ class Form
$outval='';
$opt = '<option value="'.$objp->idprodfournprice.'"';
if ($selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($objp->fprice == '') $opt.=' disabled="disabled"';
$opt.= '>';
@@ -2774,50 +2785,50 @@ class Form
print $this->selectcurrency($selected,$htmlname);
}
/**
* Load into the cache all currencies
*
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
*/
function load_cache_currencies()
{
/**
* Load into the cache all currencies
*
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
*/
function load_cache_currencies()
{
global $langs;
$langs->load("dict");
if (count($this->cache_currencies)) return 0; // Cache deja charge
$langs->load("dict");
if (count($this->cache_currencies)) return 0; // Cache deja charge
$sql = "SELECT code_iso, label, unicode";
$sql.= " FROM ".MAIN_DB_PREFIX."c_currencies";
$sql.= " WHERE active = 1";
$sql.= " ORDER BY code_iso ASC";
dol_syslog(get_class($this).'::load_cache_currencies sql='.$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
$this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $langs->trans("Currency".$obj->code_iso)!="Currency".$obj->code_iso?$langs->trans("Currency".$obj->code_iso):($obj->label!='-'?$obj->label:''));
dol_syslog(get_class($this).'::load_cache_currencies sql='.$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
$this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $langs->trans("Currency".$obj->code_iso)!="Currency".$obj->code_iso?$langs->trans("Currency".$obj->code_iso):($obj->label!='-'?$obj->label:''));
$this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode($obj->unicode, true);
$label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label'];
$i++;
$i++;
}
array_multisort($label, SORT_ASC, $this->cache_currencies);
return $num;
}
else
{
dol_print_error($this->db);
return -1;
}
return $num;
}
else
{
dol_print_error($this->db);
return -1;
}
}
/**
@@ -2882,32 +2893,32 @@ class Form
print $this->load_tva($htmlname, $selectedrate, $societe_vendeuse, $societe_acheteuse, $idprod, $info_bits, $type);
}
/**
/**
* Load into the cache vat rates of a country
*
* @param string $country_code Country code
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
* @param string $country_code Country code
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
*/
function load_cache_vatrates($country_code)
function load_cache_vatrates($country_code)
{
global $langs;
if (count($this->cache_vatrates)) return 0; // Cache deja charge
$sql = "SELECT DISTINCT t.taux, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql.= " WHERE t.fk_pays = p.rowid";
$sql.= " AND t.active = 1";
$sql.= " AND p.code IN (".$country_code.")";
$sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
if ($num)
{
for ($i = 0; $i < $num; $i++)
$sql = "SELECT DISTINCT t.taux, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql.= " WHERE t.fk_pays = p.rowid";
$sql.= " AND t.active = 1";
$sql.= " AND p.code IN (".$country_code.")";
$sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
if ($num)
{
for ($i = 0; $i < $num; $i++)
{
$obj = $this->db->fetch_object($resql);
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
@@ -2927,7 +2938,7 @@ class Form
{
$this->error = '<font class="error">'.$this->db->error().'</font>';
return -2;
}
}
}
/**
@@ -3023,32 +3034,32 @@ class Form
if ($num > 0)
{
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{
$defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$idprod);
$defaultnpr=get_default_npr($societe_vendeuse,$societe_acheteuse,$idprod);
}
// Si taux par defaut n'a pu etre determine, on prend dernier de la liste.
// Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{
$defaulttx = $this->cache_vatrates[$num-1]['txtva'];
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{
$defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$idprod);
$defaultnpr=get_default_npr($societe_vendeuse,$societe_acheteuse,$idprod);
}
// Si taux par defaut n'a pu etre determine, on prend dernier de la liste.
// Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{
$defaulttx = $this->cache_vatrates[$num-1]['txtva'];
}
if (! $options_only) $return.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
foreach ($this->cache_vatrates as $rate)
{
$return.= '<option value="'.$rate['txtva'];
$return.= $rate['nprtva'] ? '*': '';
$return.= '<option value="'.$rate['txtva'];
$return.= $rate['nprtva'] ? '*': '';
$return.= '"';
if ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr)
{
$return.= ' selected="selected"';
}
$return.= '>'.vatrate($rate['libtva']);
}
$return.= '>'.vatrate($rate['libtva']);
$return.= $rate['nprtva'] ? ' *': '';
$return.= '</option>';
@@ -3297,7 +3308,7 @@ class Form
// Generate the date part, depending on the use or not of the javascript calendar
if (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == "eldy")
{
$base=DOL_URL_ROOT.'/core/lib/';
$base=DOL_URL_ROOT.'/core/';
$reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');';
}
else
@@ -3439,79 +3450,79 @@ class Form
return $out;
}
/**
* Show a multiselect form from an array.
*
/**
* Show a multiselect form from an array.
*
* @param string $htmlname Name of select
* @param array $array Array with key+value
* @param array $array Array with key+value
* @param array $selected Preselected keys
* @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
* @param int $value_as_key 1 to use value as key
* @param string $option Valeur de l'option en fonction du type choisi
* @param int $translate Translate and encode value
* @return string HTML multiselect string
*/
function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0)
{
* @param int $translate Translate and encode value
* @return string HTML multiselect string
*/
function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0)
{
global $conf, $langs;
$out = '<select id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.'>'."\n";
if (is_array($array) && ! empty($array))
$out = '<select id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.'>'."\n";
if (is_array($array) && ! empty($array))
{
if ($value_as_key) $array=array_combine($array, $array);
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && is_array($selected) && ! empty($selected))
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && is_array($selected) && ! empty($selected))
{
foreach ($selected as $selected_value)
{
foreach($array as $key => $value)
{
if ($selected_value == $key)
{
$value=$array[$selected_value];
$out.= '<option value="'.$key.'" selected="selected">';
$newval = ($translate ? $langs->trans(ucfirst($value)) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out.= dol_htmlentitiesbr($newval);
$out.= '</option>'."\n";
unset($array[$key]);
if ($selected_value == $key)
{
$value=$array[$selected_value];
$out.= '<option value="'.$key.'" selected="selected">';
$newval = ($translate ? $langs->trans(ucfirst($value)) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out.= dol_htmlentitiesbr($newval);
$out.= '</option>'."\n";
unset($array[$key]);
}
}
}
if (! empty($array))
{
foreach ($array as $key => $value)
foreach ($array as $key => $value)
{
$out.= '<option value="'.$key.'">';
$newval = ($translate ? $langs->trans(ucfirst($value)) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out.= dol_htmlentitiesbr($newval);
$out.= '</option>'."\n";
$out.= '<option value="'.$key.'">';
$newval = ($translate ? $langs->trans(ucfirst($value)) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out.= dol_htmlentitiesbr($newval);
$out.= '</option>'."\n";
}
}
}
else
{
foreach ($array as $key => $value)
{
$out.= '<option value="'.$key.'"';
if (is_array($selected) && ! empty($selected) && in_array($key, $selected))
{
$out.= ' selected="selected"';
}
$out.= '>';
$newval = ($translate ? $langs->trans(ucfirst($value)) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out.= dol_htmlentitiesbr($newval);
$out.= '</option>'."\n";
foreach ($array as $key => $value)
{
$out.= '<option value="'.$key.'"';
if (is_array($selected) && ! empty($selected) && in_array($key, $selected))
{
$out.= ' selected="selected"';
}
$out.= '>';
$newval = ($translate ? $langs->trans(ucfirst($value)) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out.= dol_htmlentitiesbr($newval);
$out.= '</option>'."\n";
}
}
}
$out.= '</select>'."\n";
return $out;
}
}
$out.= '</select>'."\n";
return $out;
}
@@ -3789,7 +3800,7 @@ class Form
* @param int $force_entity Possibility to force entity
* @return void
*/
function select_dolgroups($selected='',$htmlname='groupid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity='')
function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='')
{
global $conf,$user,$langs;
@@ -3802,14 +3813,14 @@ class Form
// On recherche les groupes
$sql = "SELECT ug.rowid, ug.nom ";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
$sql.= ", e.label";
}
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as ug ";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entity as e on e.rowid=ug.entity";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entity as e ON e.rowid=ug.entity";
if ($force_entity) $sql.= " WHERE ug.entity IN (0,".$force_entity.")";
else $sql.= " WHERE ug.entity IS NOT NULL";
}
@@ -3847,7 +3858,7 @@ class Form
$out.= '>';
$out.= $obj->nom;
if(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
{
$out.= " (".$obj->label.")";
}

View File

@@ -1,185 +1,215 @@
<?php
/* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2010 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/class/html.formactions.class.php
* \ingroup core
* \brief Fichier de la classe des fonctions predefinie de composants html actions
*/
*/
/**
* Class to manage building of HTML components
*/
*/
class FormActions
{
var $db;
var $error;
var $db;
var $error;
/**
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function FormActions($db)
{
$this->db = $db;
return 1;
}
*/
function FormActions($db)
{
$this->db = $db;
return 1;
}
/**
* Show list of action status
*
* @param string $formname Name of form where select in included
* @param string $selected Preselected value
* @param int $canedit 1=can edit, 0=read only
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
* @return void
*/
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
{
global $langs,$conf;
/**
* Show list of action status
*
* @param string $formname Name of form where select in included
* @param string $selected Preselected value (-1..100)
* @param int $canedit 1=can edit, 0=read only
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
* @return void
*/
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
{
global $langs,$conf;
$listofstatus=array('-1'=>$langs->trans("ActionNotApplicable"),
'0'=>$langs->trans("ActionRunningNotStarted"),
'50'=>$langs->trans("ActionRunningShort"),
'100'=>$langs->trans("ActionDoneShort"));
$listofstatus = array(
'-1' => $langs->trans("ActionNotApplicable"),
'0' => $langs->trans("ActionRunningNotStarted"),
'50' => $langs->trans("ActionRunningShort"),
'100' => $langs->trans("ActionDoneShort")
);
if ($conf->use_javascript_ajax)
{
print "\n";
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#select'.$htmlname.'").change(function() { select_status(document.'.$formname.'.status.value); });'."\n";
print 'jQuery("#val'.$htmlname.'").change(function() { select_status(document.'.$formname.'.status.value); });'."\n";
print 'select_status(document.'.$formname.'.status.value);'."\n";
print '});'."\n";
print 'function select_status(mypercentage) {'."\n";
print 'document.'.$formname.'.percentageshown.value=(mypercentage>=0?mypercentage:\'\');'."\n";
print 'document.'.$formname.'.percentage.value=mypercentage;'."\n";
print 'if (mypercentage == -1) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").hide(); }'."\n";
print 'else if (mypercentage == 0) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
print 'else if (mypercentage == 100) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
print 'else { document.'.$formname.'.percentageshown.disabled=false; }'."\n";
print '}'."\n";
print '</script>'."\n";
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
foreach($listofstatus as $key => $val)
{
print '<option value="'.$key.'"'.($selected == $key?' selected="selected"':'').'>'.$val.'</option>';
}
print '</select>';
if ($selected == 0 || $selected == 100) $canedit=0;
print ' <input type="text" id="val'.$htmlname.'" name="percentageshown" class="flat hideifna" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit&&($selected>=0)?'':' disabled="disabled"').'>';
print '<span class="hideifna">%</span>';
print ' <input type="hidden" name="percentage" value="'.$selected.'">';
}
else
{
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit?'':' disabled="disabled"').'>%';
}
}
if (! empty($conf->use_javascript_ajax))
{
print "\n";
print "<script type=\"text/javascript\">
var htmlname = '".$htmlname."';
$(document).ready(function () {
select_status();
$('#select' + htmlname).change(function() {
select_status();
});
// FIXME use another method for update combobox
//$('#val' + htmlname).change(function() {
//select_status();
//});
});
function select_status() {
var defaultvalue = $('#select' + htmlname).val();
var percentage = $('input[name=percentage]');
var selected = '".(isset($selected)?$selected:'')."';
var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:''));
percentage.val(value);
if (defaultvalue == -1) {
percentage.attr('disabled', 'disabled');
$('.hideifna').hide();
}
else if (defaultvalue == 0) {
percentage.val(0);
percentage.attr('disabled', 'disabled');
$('.hideifna').show();
}
else if (defaultvalue == 100) {
percentage.val(100);
percentage.attr('disabled', 'disabled');
$('.hideifna').show();
}
else {
if (defaultvalue == 50 && (percentage.val() == 0 || percentage.val() == 100)) { percentage.val(50) };
percentage.removeAttr('disabled');
$('.hideifna').show();
}
}
</script>\n";
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
foreach($listofstatus as $key => $val)
{
print '<option value="'.$key.'"'.(($selected == $key) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected="selected"' : '').'>'.$val.'</option>';
}
print '</select>';
if ($selected == 0 || $selected == 100) $canedit=0;
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat hideifna" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit&&($selected>=0)?'':' disabled="disabled"').'>';
print '<span class="hideifna">%</span>';
}
else
{
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit?'':' disabled="disabled"').'>%';
}
}
/**
* Show list of actions for element
*
* @param Object $object Object
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
* @param int $socid socid of user
* @return int <0 if KO, >=0 if OK
*/
function showactions($object,$typeelement,$socid=0)
{
global $langs,$conf,$user;
global $bc;
/**
* Show list of actions for element
*
* @param Object $object Object
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
* @param int $socid socid of user
* @return int <0 if KO, >=0 if OK
*/
function showactions($object,$typeelement,$socid=0)
{
global $langs,$conf,$user;
global $bc;
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
$actioncomm = new ActionComm($this->db);
$actioncomm->getActions($socid, $object->id, $typeelement);
$actioncomm = new ActionComm($this->db);
$actioncomm->getActions($socid, $object->id, $typeelement);
$num = count($actioncomm->actions);
if ($num)
{
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
else $title=$langs->trans("Actions");
$num = count($actioncomm->actions);
if ($num)
{
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
else $title=$langs->trans("Actions");
print_titre($title);
print_titre($title);
$total = 0; $var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
print "\n";
$total = 0; $var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
print "\n";
foreach($actioncomm->actions as $action)
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$action->getNomUrl(1).'</td>';
print '<td>'.dol_print_date($action->datep,'day').'</td>';
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
$userstatic = new User($this->db);
$userstatic->id = $action->author->id;
$userstatic->firstname = $action->author->firstname;
$userstatic->lastname = $action->author->lastname;
print '<td>'.$userstatic->getNomUrl(1).'</td>';
print '</tr>';
}
print '</table>';
}
foreach($actioncomm->actions as $action)
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$action->getNomUrl(1).'</td>';
print '<td>'.dol_print_date($action->datep,'day').'</td>';
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
$userstatic = new User($this->db);
$userstatic->id = $action->author->id;
$userstatic->firstname = $action->author->firstname;
$userstatic->lastname = $action->author->lastname;
print '<td>'.$userstatic->getNomUrl(1).'</td>';
print '</tr>';
}
print '</table>';
}
return $num;
}
return $num;
}
/**
* Output list of type of event
*
* @param string $selected Type pre-selectionne
* @param string $htmlname Nom champ formulaire
* @return void
*/
function select_type_actions($selected='',$htmlname='actioncode')
{
global $langs,$user;
/**
* Output list of type of event
*
* @param string $selected Type pre-selectionne
* @param string $htmlname Nom champ formulaire
* @return void
*/
function select_type_actions($selected='',$htmlname='actioncode')
{
global $langs,$user;
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
$caction=new CActionComm($this->db);
$form=new Form($this->db);
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
$caction=new CActionComm($this->db);
$form=new Form($this->db);
$arraylist=$caction->liste_array(1,'code');
array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist);
$arraylist=$caction->liste_array(1,'code');
array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist);
print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
}

View File

@@ -169,7 +169,7 @@ class FormBarCode
{
print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setbarcodetype">';
print '<input type="hidden" name="action" value="set'.$htmlname.'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
$this->select_barcode_type($selected, $htmlname, 1);

View File

@@ -59,13 +59,14 @@ class FormFile
* @param int $size Length of input file area
* @param Object $object Object to use (when attachment is done on an element)
* @param string $options Options
* @param boolean $useajax Use ajax if enabled
* @return int <0 if KO, >0 if OK
*/
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='')
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=true)
{
global $conf,$langs;
if ($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax)
{
return $this->_formAjaxFileUpload($object);
}
@@ -596,7 +597,7 @@ class FormFile
print '</a>';
print "</td>\n";
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
print '<td align="center">'.dol_print_date($file['date'],"dayhour","tzuser").'</td>';
// Preview
if (empty($useinecm))
{
@@ -805,102 +806,11 @@ class FormFile
// Max file size
$max_file_size = (($post_max_size < $upload_max_filesize) ? $post_max_size : $upload_max_filesize);
print '<script type="text/javascript">
$(function () {
\'use strict\';
var max_file_size = \''.$max_file_size.'\';
// Initialize the jQuery File Upload widget:
$("#fileupload").fileupload({
maxFileSize: max_file_size,
done: function (e, data) {
$.ajax(data).success(function () {
location.href=\''.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].'\';
});
},
destroy: function (e, data) {
var that = $(this).data("fileupload");
if ( confirm("Delete this file ?") == true ) {
if (data.url) {
$.ajax(data).success(function () {
that._adjustMaxNumberOfFiles(1);
$(this).fadeOut(function () {
$(this).remove();
});
});
} else {
data.context.fadeOut(function () {
$(this).remove();
});
}
}
}
});
// Load existing files:
// TODO do not delete
if (1 == 2) {
$.getJSON($("#fileupload form").prop("action"), { fk_element: "'.$object->id.'", element: "'.$object->element.'"}, function (files) {
var fu = $("#fileupload").data("fileupload");
fu._adjustMaxNumberOfFiles(-files.length);
fu._renderDownload(files)
.appendTo($("#fileupload .files"))
.fadeIn(function () {
// Fix for IE7 and lower:
$(this).show();
});
});
}
// Open download dialogs via iframes,
// to prevent aborting current uploads:
$("#fileupload .files a:not([target^=_blank])").live("click", function (e) {
e.preventDefault();
$(\'<iframe style="display:none;"></iframe>\')
.prop("src", this.href)
.appendTo("body");
});
});
</script>';
print '<div id="fileupload">';
print '<form action="'.DOL_URL_ROOT.'/core/ajax/fileupload.php" method="POST" enctype="multipart/form-data">';
print '<input type="hidden" name="fk_element" value="'.$object->id.'">';
print '<input type="hidden" name="element" value="'.$object->element.'">';
print '<div class="fileupload-buttonbar">';
print '<input type="hidden" name="protocol" value="http">';
print '<label class="fileinput-button">';
print '<span>'.$langs->trans('AddFiles').'</span>';
print '<input type="file" name="files[]" multiple>';
print '</label>';
print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>';
print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>';
print '</div></form>';
print '</div><!-- end div fileupload -->';
print '<div id="fileupload-view">';
print '<div class="fileupload-content">';
print '<table width="100%" class="files">';
/*print '<tr>';
print '<td>'.$langs->trans("Documents2").'</td>';
print '<td>'.$langs->trans("Preview").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td colspan="3"></td>';
print '</tr>';*/
print '</table>';
// We remove this because there is already individual bars.
//print '<div class="fileupload-progressbar"></div>';
print '</div><!-- end div fileupload-content -->';
print '</div><!-- end div fileupload-view -->';
// Include main
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_main.tpl.php');
// Include template
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxfileupload.tpl.php');
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_view.tpl.php');
}

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