Compare commits

...

323 Commits
3.8.0 ... 3.8.2

Author SHA1 Message Date
Laurent Destailleur
74be7bf334 FIX Filter in customer price per product of a thirdparty returned error 2015-11-03 11:40:06 +01:00
Laurent Destailleur
ea0bf44670 The ckecksum file should not be into sources. Only into packages. 2015-11-03 09:43:39 +01:00
Frédéric FRANCE
e7ced32245 Fix Can't edit DictionaryRevenueStamp 2015-11-02 20:08:33 +01:00
Laurent Destailleur
d8796e4cc7 Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/product/stats/commande.php
	htdocs/product/stats/commande_fournisseur.php
	htdocs/product/stats/facture.php
	htdocs/product/stats/facture_fournisseur.php
	htdocs/product/stats/propal.php
2015-11-02 19:25:51 +01:00
Laurent Destailleur
38ed83d05f Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/core/lib/company.lib.php
2015-11-02 19:19:05 +01:00
Laurent Destailleur
958c3851d7 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-11-02 19:17:32 +01:00
Laurent Destailleur
055fe5e275 FIX #3786 Translation of select box. 2015-11-02 19:17:22 +01:00
Laurent Destailleur
67a2f6ee91 Merge pull request #3854 from fmarcet/3.8
FIX: Send emails to contacts who should not receive emails
2015-11-02 18:03:59 +01:00
Laurent Destailleur
2dab183240 Merge pull request #3858 from fappels/3.8
Fix always first warehouse in stock list lotserial
2015-11-02 17:59:33 +01:00
Laurent Destailleur
f928062e2b FIX #3726 Better support for PRODUCT_USE_OLD_PATH_FOR_PHOTO 2015-11-02 17:56:32 +01:00
fappels
d714d32424 Fix always first warehouse in reassortlot 2015-11-02 16:37:51 +01:00
fappels
5246557493 Merge remote-tracking branch 'refs/remotes/Dolibarr/3.8' into 3.8 2015-11-02 16:34:25 +01:00
Laurent Destailleur
3ba97627ff FIX Default thirdparty when cloning invoice was not set. 2015-11-02 15:50:03 +01:00
Laurent Destailleur
c06c2d0464 FIX #3841 creation of a task completed has not status set to finished by
default
2015-11-02 14:21:45 +01:00
fmarcet
3c5903f75a FIX: Contacts are not added to the list with the status "no contact" 2015-11-02 11:52:58 +01:00
fmarcet
ba4f306c83 FIX: Avoid changing the state to a thirdparty who shouldn't be
contacted anymore
2015-11-02 11:52:58 +01:00
Laurent Destailleur
269fb87342 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-11-02 11:46:12 +01:00
Laurent Destailleur
20a1863866 FIX IF autocomplete was set on thirdparty list, it was not possible to
open list of extrafields.
2015-11-02 11:45:59 +01:00
Laurent Destailleur
bc29898621 Merge pull request #3814 from FHenry/3.8
FIX : missing tag myuser_job into ODT replacement
2015-11-02 11:22:52 +01:00
Laurent Destailleur
4cddb0175b Merge pull request #3575 from atm-ph/fix_3.8_clone_order
FIX clone customer order
2015-11-02 11:21:52 +01:00
Juanjo Menent
2f8afda29d Merge pull request #3833 from grandoc/3.8
[Qual] Prevent warning
2015-10-30 22:19:44 +01:00
Juanjo Menent
64ff12c009 Merge pull request #3835 from atm-maxime/fix_product_stats
Fix : stats were wrong if same product on several lines
2015-10-30 22:18:48 +01:00
Juanjo Menent
efb6e87f3f Merge pull request #3839 from fmarcet/3.8
FIX Bad parameter on calling get_exdir function
2015-10-30 22:13:36 +01:00
Ferran Marcet
5862037d34 FIX Bad parameters 2015-10-30 13:03:34 +01:00
Maxime Kohlhaas
c46f9350a5 Fix : stats were wrong if same product on several lines with same quantity because of distinct 2015-10-30 09:50:04 +01:00
philippe grand
c26c8c7fcc [Qual] Prevent warning 2015-10-30 08:47:30 +01:00
Juanjo Menent
c14349f1ea Merge pull request #3829 from hregis/3.8_bug
Fix: add missing hooks
2015-10-29 16:05:35 +01:00
Juanjo Menent
35145cd739 Merge pull request #3830 from fmarcet/3.8
FIX: Show products image on getNomUrl()
2015-10-29 15:52:36 +01:00
fmarcet
440df980ea Fix SQL Query 2015-10-29 13:43:07 +01:00
Regis Houssin
6373c82559 Fix: broken features !!! 2015-10-29 13:14:38 +01:00
fmarcet
dba952e596 Fix: Products image on getNomUrl 2015-10-29 12:51:25 +01:00
fmarcet
310ecb1e09 FIX: Show product image on getNomUrl() 2015-10-29 12:28:28 +01:00
Regis Houssin
e5b1e214bc Fix: add missing hooks 2015-10-29 11:50:16 +01:00
Juanjo Menent
b6b8a9e0f0 Merge pull request #3824 from aspangaro/3.8-23
Review 3.8
2015-10-29 10:54:01 +01:00
Juanjo Menent
eb497960fc Merge pull request #3827 from fmarcet/3.8
FIX #3726 Not showing images on product card
2015-10-29 10:53:43 +01:00
fmarcet
6469a31a32 Style corrections 2015-10-29 10:38:21 +01:00
fmarcet
62dc6814a3 FIX #3726 Not showing images on product card 2015-10-29 10:14:54 +01:00
aspangaro
4e9d06785c Fix #3818 & presentation 2015-10-29 06:47:42 +01:00
aspangaro
e2ba24826f Review 3.8 2015-10-29 06:06:56 +01:00
phf
4180862fec Merge branch '3.8' into fix_3.8_clone_order 2015-10-28 14:36:31 +01:00
phf
f385f8bcfa FIX better fix to generate a PROV ref after clone 2015-10-28 14:34:34 +01:00
Florian HENRY
9a95401473 FIX : add tag myuser_job into ODT replacement 2015-10-28 11:27:39 +01:00
Laurent Destailleur
1eca2d33c0 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-27 22:24:29 +01:00
Laurent Destailleur
87c240252c FIX Can export a field into task time table with export project profile 2015-10-27 22:24:18 +01:00
Laurent Destailleur
5bdc4a83b1 Merge pull request #3804 from atm-alexis/3.8_FIX_action_dont_appear_before_an_update
FIX action not appear before an update
2015-10-26 22:57:11 +01:00
Laurent Destailleur
bd69830cbd Merge pull request #3803 from atm-robin/3.7_fix_supplier_rights
FIX supplier rights for orderToInvoice
2015-10-26 22:46:12 +01:00
Alexis Algoud
fa3af485ef FIX action not appear before an update
because of a lack of line in action ressource
2015-10-26 18:33:22 +01:00
atm-robin
29b8919a40 FIX supplier rights for orderToInvoice 2015-10-26 14:34:46 +01:00
Laurent Destailleur
77a0359cfc Fix bad test 2015-10-25 20:17:43 +01:00
Laurent Destailleur
295eb533f8 FIX Bad picto for expense report 2015-10-25 20:16:40 +01:00
Laurent Destailleur
4e206fa80b Fix doxygen 2015-10-25 19:53:59 +01:00
Laurent Destailleur
48ed8d4408 FIX The thumb of user into top menu was using the image in full size.
This make a large download at each page call. We must use the mini
thumbs.
2015-10-25 19:42:00 +01:00
Laurent Destailleur
2cbfb69f9b Update template 2015-10-23 15:28:14 +02:00
Laurent Destailleur
a01a85c3f6 FIX tag object_total_vat_x need x to be a string with unknown decimal
lenght. Now use for x the real vat real with no more decimal (x = 20 or
x = 8.5 or x = 5.99, ...)
2015-10-23 15:13:02 +02:00
Laurent Destailleur
0440e313d2 Merge pull request #3787 from atm-maxime/3.8
Fixes on invoice list and creation
2015-10-22 17:58:04 +02:00
Maxime Kohlhaas
ef2337a338 Merge branch '3.8' of github.com:Dolibarr/dolibarr into 3.8
Conflicts:
	htdocs/compta/facture/list.php
2015-10-22 14:41:58 +02:00
Laurent Destailleur
d55f138fb1 Merge pull request #3785 from frederic34/patch-19
FIX Error message not returne into update fournisseur.commande.class.php
2015-10-22 10:43:10 +02:00
Laurent Destailleur
43f003f6f9 Merge pull request #3783 from frederic34/patch-18
Fix lost searchstatus on next page list
2015-10-22 10:35:40 +02:00
Frédéric FRANCE
4689b0cc11 Update fournisseur.commande.class.php 2015-10-21 17:31:51 +02:00
Frédéric FRANCE
5237a2afc7 Fix lost searchstatus on next page list 2015-10-20 17:45:24 +02:00
Laurent Destailleur
7d382f7997 FIX Revert option WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES
into option WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED
for better compatibility with old versions
2015-10-19 18:17:19 +02:00
Maxime Kohlhaas
d79fb71987 FIX : search_status not used in mergefusiontool 2015-10-19 16:17:47 +02:00
Maxime Kohlhaas
572be23fc1 FIX : filters on supplier invoices list are not used, search_status instead 2015-10-19 15:57:23 +02:00
Maxime Kohlhaas
5fb6705b5c FIX : Search status not saved into list 2015-10-19 15:53:13 +02:00
Maxime Kohlhaas
9e9f32e3bf FIX : project was not retrieved on invoice creation form 2015-10-19 15:38:28 +02:00
Laurent Destailleur
6a90431cf1 Prepare 3.8.2 2015-10-19 14:04:47 +02:00
Laurent Destailleur
fd3ba13130 FIX #3541 Bypass authentication when user was created using LDAP 2015-10-18 21:33:47 +02:00
Laurent Destailleur
bf6b48f5a0 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-18 21:17:29 +02:00
Laurent Destailleur
afe4057a97 FIX #3757 Can't set amount in a social contribution with some languages 2015-10-18 21:17:19 +02:00
Laurent Destailleur
be8e7515a1 Merge pull request #3762 from simnandez/3.8
Fix: Last page total is 0
2015-10-18 20:27:17 +02:00
Laurent Destailleur
c64c1a0201 FIX If no end date is set on survey, we should be able to vote. 2015-10-18 20:11:26 +02:00
Laurent Destailleur
420bfd8301 FIX Preview pages was not using correct style for ref 2015-10-18 19:09:35 +02:00
Laurent Destailleur
c51bc09e39 FIX The preview of PDF was never refreshed if PDF document was changed 2015-10-18 18:54:54 +02:00
Juanjo Menent
334c14d088 Fix: Last page total is 0 2015-10-18 11:56:42 +02:00
Juanjo Menent
d192ed9676 Merge pull request #3761 from frederic34/patch-18
Fix getFullName() on a non-object in notify.class.php
2015-10-18 11:50:04 +02:00
Frédéric FRANCE
6f4cfc86e8 Update notify.class.php
http://www.dolibarr.fr/forum/12-howto--aide/54061-probleme-sur-la-validation-des-commande-fournisseu
Fatal error: Call to a member function getFullName() on a non-object in /home/xxxx/public_html/xxxxx/htdocs/core/class/notify.class.php on line 374
2015-10-18 11:25:55 +02:00
Laurent Destailleur
0211ad64ee FIX Total in summary was not same than into detail on the referrer page.
Conflicts:
	htdocs/product/stats/facture.php
2015-10-17 12:36:51 +02:00
Laurent Destailleur
5c1daa6135 Merge pull request #3746 from atm-gauthier/3.8_fix_function_update_extra
FIX : 1/ update_extra() function musn't be in  "if(!empty(MAIN_DISABL…
2015-10-17 10:39:37 +02:00
Laurent Destailleur
fc8f4b4d6e Merge pull request #3745 from atm-arnaud/3.8_fix_propale_facturee
FIX bug invoice classified in propale next update commonobject class …
2015-10-17 10:38:35 +02:00
Laurent Destailleur
bba8db2b60 Merge pull request #3744 from atm-gauthier/3.8_fix_thirdparty_parent
FIX : Societe::set_parent() function needs societe object to be fetch…
2015-10-17 10:37:36 +02:00
Laurent Destailleur
686a923974 Merge pull request #3754 from frederic34/patch-16
FIX Update status of fournisseur.commande.class.php
2015-10-17 10:36:09 +02:00
Frédéric FRANCE
d68db2a844 Update fournisseur.commande.class.php 2015-10-17 08:48:53 +02:00
Laurent Destailleur
8a02c8288b Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/comm/propal/class/propal.class.php
	htdocs/product/index.php
2015-10-16 09:56:55 +02:00
Laurent Destailleur
9b85a70013 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	ChangeLog
	htdocs/comm/propal.php
	htdocs/comm/propal/class/propal.class.php
2015-10-16 09:52:38 +02:00
Gauthier
b3e3cc14a7 FIX : 1/ update_extra() function musn't be in "if(!empty(MAIN_DISABLE_CONTACTS_TAB)" test.
2/ Reindented code
2015-10-15 17:26:16 +02:00
arnaud
6bd13b8071 FIX bug invoice classified in propale next update commonobject class in 3.8 2015-10-15 17:02:33 +02:00
Gauthier
2c6aeac64f FIX : Societe::set_parent() function needs societe object to be fetched to update parent 2015-10-15 16:48:52 +02:00
Laurent Destailleur
e79fe7401f Merge pull request #3741 from fmarcet/3.8
FIX #3689 Bug on workflow module
2015-10-15 13:09:43 +02:00
fmarcet
4cdf17d8b5 FIX #3689 Bug on workflow module 2015-10-15 12:17:57 +02:00
Laurent Destailleur
ff1f7f1a48 Merge pull request #3739 from GPCsolutions/3.8-3728
Fix #3728 Properly remove last category
2015-10-15 12:00:22 +02:00
Raphaël Doursenaud
6c2b46f939 Fix #3728 Properly remove last category 2015-10-15 10:15:37 +02:00
Laurent Destailleur
05686b532c Merge pull request #3733 from fappels/3.8-shipment-lot-delete
FIX: #3605 deleting a shipping
2015-10-14 21:41:20 +02:00
Laurent Destailleur
5d585fa04a Merge pull request #3729 from FHenry/3.7
FIX : #3724 Bug: Blank page after cloning proposal with changed client
2015-10-14 21:32:26 +02:00
Laurent Destailleur
a5b9a210ce Merge pull request #3725 from FHenry/3.8
FIX : #3724 Bug: Blank page after cloning proposal with changed client
2015-10-14 21:27:58 +02:00
Laurent Destailleur
f08d52b0e8 Merge pull request #3723 from atm-alexis/FIX_double_escape_entrepot
FIX double db escape add too quote
2015-10-14 21:27:39 +02:00
fappels
68aac4476c FIX: #3605 deleting a shipping
Get lots to move back to stock.
Move lots back to stock.
Do not log object because it will be deleted
Improve error reporting
2015-10-14 12:16:54 +02:00
Laurent Destailleur
e9facbf108 FIX bad property so after creating an event from calendar, filter were
lost.
2015-10-14 10:53:38 +02:00
Florian HENRY
6b8707516e FIX : skeleton class must use db->order rather than ORDER BY into
fetchAll
2015-10-14 10:05:42 +02:00
fappels
1a0ad2d1c9 Merge remote-tracking branch 'refs/remotes/Dolibarr/3.8' into 3.8 2015-10-14 09:40:47 +02:00
Florian HENRY
727db56576 FIX : #3724 Bug: Blank page after cloning proposal with changed client 2015-10-14 08:27:56 +02:00
Florian HENRY
00b610d87f FIX : fix HTML into formconfirm box 2015-10-14 08:23:52 +02:00
Florian HENRY
8aaa1993c6 FIX : #3724 Bug: Blank page after cloning proposal with changed client 2015-10-13 09:37:33 +02:00
Alexis Algoud
0251728e28 FIX double db escape add too quote 2015-10-12 17:36:24 +02:00
Laurent Destailleur
84f5b72d2b Merge pull request #3719 from Dolibarr/revert-3573-FIX_remove_file_from_mail_remove_file
Revert "FIX no need to remove file into mail form"
2015-10-11 20:43:16 +02:00
Laurent Destailleur
87fad70f4a Revert "FIX no need to remove file into mail form" 2015-10-11 20:42:49 +02:00
Laurent Destailleur
62dd936b08 Merge pull request #3573 from atm-alexis/FIX_remove_file_from_mail_remove_file
FIX no need to remove file into mail form
2015-10-11 20:42:42 +02:00
Laurent Destailleur
df39a1054e Fix 3.8.1 2015-10-11 20:19:52 +02:00
Laurent Destailleur
9fa2afb44b Merge branch '3.6' of github.com:Dolibarr/dolibarr into 3.6
Conflicts:
	ChangeLog
2015-10-11 19:55:50 +02:00
Laurent Destailleur
4e4efc97f0 Merge branch 'marcosgdf-bug-1776' into 3.6 2015-10-11 19:54:51 +02:00
Laurent Destailleur
c76af687ed Merge pull request #3715 from marcosgdf/clone-proposals
FIX 1794 Error when cloning Proposal gives error in a malformed page
2015-10-11 19:52:30 +02:00
Laurent Destailleur
1acaf44acf Merge pull request #3718 from hregis/3.8_bug
Fix: wrong files name
2015-10-11 19:48:25 +02:00
Laurent Destailleur
a9a3c3b97f Exclude file from sources. It is generated when building package. 2015-10-11 19:47:47 +02:00
Laurent Destailleur
a8e52f9c54 Update filelist 2015-10-11 19:45:53 +02:00
Regis Houssin
f8f600828d Fix: wrong files name 2015-10-11 19:18:03 +02:00
Marcos García de La Fuente
fd9f51df88 Missing changelog 2015-10-11 12:39:42 +02:00
Marcos García de La Fuente
4e9a378f0d Merge branch '3.6' into bug-1776 2015-10-11 12:37:41 +02:00
Marcos García de La Fuente
9f1fa7e212 Missing changelog 2015-10-11 12:32:02 +02:00
Marcos García de La Fuente
252f00dfe7 Merge branch '3.6' into clone-proposals 2015-10-11 12:29:45 +02:00
Laurent Destailleur
3f8e9bd181 Remove warning 2015-10-10 19:24:31 +02:00
Laurent Destailleur
7b7d27920d Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/adherents/type.php
	htdocs/categories/class/categorie.class.php
	htdocs/core/class/commonobject.class.php
	htdocs/core/class/extrafields.class.php
	htdocs/core/lib/tax.lib.php
	htdocs/product/composition/card.php
2015-10-10 18:56:28 +02:00
Laurent Destailleur
856bfaaa3a Merge pull request #3691 from FHenry/3.8
FIX : Always use type send in parameters in showCategories method
2015-10-09 20:39:28 +02:00
Laurent Destailleur
4fab809604 Merge pull request #3684 from aspangaro/3.8-21
Fix : Lines from ER show date in english format
2015-10-09 20:38:29 +02:00
Laurent Destailleur
279e7028fb Merge pull request #3686 from grandoc/3.7
3.7
2015-10-09 20:38:16 +02:00
Laurent Destailleur
f9485bd25b Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/core/class/extrafields.class.php
2015-10-09 20:35:17 +02:00
Laurent Destailleur
b27989d5d4 Merge pull request #3665 from altatof/fix_extrafields
reenable search criteria in sql clause
2015-10-09 20:32:42 +02:00
Laurent Destailleur
c675f88dda Merge pull request #3678 from GPCsolutions/3.7-calcul_price_total-warning
[Qual] Prevent warning
2015-10-09 20:29:24 +02:00
Laurent Destailleur
dea095dbf7 Merge pull request #3710 from GPCsolutions/3.8-rmdebug
Fix: remove debugging leftover
2015-10-09 20:19:41 +02:00
Laurent Destailleur
53c9cb38ef Merge pull request #3664 from FHenry/3.7
FIX : New adherent from, always redirect on entity
2015-10-09 20:15:23 +02:00
Laurent Destailleur
be9027df1a Merge pull request #3687 from grandoc/3.8
syntax error
2015-10-09 20:14:08 +02:00
Raphaël Doursenaud
497c751fb9 Fix: remove debugging leftover 2015-10-09 16:24:42 +02:00
Florian HENRY
1f2a86078a FIX : Always use type send in parameters in showCategories method 2015-10-08 11:03:08 +02:00
philippe grand
0841feda47 syntax error 2015-10-08 09:40:00 +02:00
philippe grand
0e343ae3b2 syntax error 2015-10-08 09:34:02 +02:00
philippe grand
6cce2860c2 Merge branch '3.7' of https://github.com/Dolibarr/dolibarr.git into 3.7 2015-10-08 09:12:36 +02:00
aspangaro
425e7ce808 Fix : ER Show date in english format 2015-10-07 22:31:23 +02:00
Laurent Destailleur
8f5d9597f8 Merge pull request #3675 from GPCsolutions/3.7-3666
Fixes for checkbox extrafields
2015-10-07 14:31:30 +02:00
Laurent Destailleur
72cabe2fc3 More complete description of margin rules calculation 2015-10-06 19:27:48 +02:00
Laurent Destailleur
8426e2e506 FIX Can't reopen a canceled invoice. 2015-10-06 18:38:43 +02:00
Laurent Destailleur
c460873c85 FIX The filter on thirdparty prices should be visible if there is at
least one thirdparty price.
2015-10-06 17:13:35 +02:00
Laurent Destailleur
1f742c7464 FIX Add a test to save life when ref of object (invoice ref, order ref,
...) was empty. The was no way to go back to a clean situation, even
after vaidating again the object.
2015-10-06 16:38:27 +02:00
Laurent Destailleur
d4a85d9fba Fix missing css 2015-10-06 16:12:09 +02:00
Laurent Destailleur
e776f685ba FIX when editing time spent, date of line suggested was a rubbish value 2015-10-06 16:09:24 +02:00
Laurent Destailleur
6ea05aa311 FIX Bad translation key for project "Overview" 2015-10-06 16:03:47 +02:00
Raphaël Doursenaud
c208fccf35 [Qual] Prevent warning
calcul_price_total() prefers to have the seller and localtaxes specified
2015-10-06 15:03:59 +02:00
Laurent Destailleur
d92604f646 FIX Link of project must be cickable if user has permission to read all
projects
FIX Missing information into the alt of project picto
2015-10-06 00:46:26 +02:00
Laurent Destailleur
53d86e1661 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-05 23:54:13 +02:00
Laurent Destailleur
9f2bcf0e4f FIX The admin flag is mising. 2015-10-05 23:53:49 +02:00
Laurent Destailleur
f1cf629b80 FIX List of project for user that are restrited as sale repreentative to
some thirdparties.
2015-10-05 23:52:54 +02:00
Raphaël Doursenaud
afbee44993 Fix #3667 checkbox extrafields on edit
For actions and members.
2015-10-05 20:51:43 +02:00
Raphaël Doursenaud
3fdd59bf0a Fix #3666 checkbox extrafields on edit 2015-10-05 20:39:14 +02:00
Raphaël Doursenaud
41354ca00d Added type hinting to extrafields object 2015-10-05 20:30:55 +02:00
Raphaël Doursenaud
d24f5538f9 Fix: wrong parameters order 2015-10-05 20:25:55 +02:00
Laurent Destailleur
e3f225e038 FIX bad link into project box 2015-10-05 19:41:41 +02:00
Christophe Battarel
bf262c2cae reenable search criteria in sql clause 2015-10-05 15:41:28 +02:00
Florian HENRY
9dd4a23365 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2015-10-05 15:22:38 +02:00
Florian HENRY
c9d8e041d5 FIX : New adherent from, always redirect on entity 2015-10-05 15:20:55 +02:00
philippe grand
78cb31e55f Merge branch '3.7' of https://github.com/Dolibarr/dolibarr.git into 3.7 2015-10-05 14:50:30 +02:00
Laurent Destailleur
143c1e03f8 FIX Missing menu entry for list of thirdparties when using auguria menu
manager
2015-10-05 10:30:49 +02:00
Laurent Destailleur
7b2fbdd638 FIX Can't change the admin with default setup 2015-10-05 10:04:34 +02:00
Laurent Destailleur
c20296f963 Merge remote-tracking branch 'origin/3.7' into 3.8 2015-10-04 20:46:17 +02:00
Laurent Destailleur
839d4c2a9a Merge pull request #3650 from frederic34/patch-19
Update printing.php
2015-10-04 20:03:21 +02:00
Laurent Destailleur
c2cc9711f7 FIX Thirdparty is missing on card 2015-10-04 20:01:08 +02:00
Frédéric FRANCE
780a5a1996 Update files.lib.php 2015-10-04 19:59:26 +02:00
Laurent Destailleur
406b271275 Merge pull request #3635 from FHenry/3.7
FIX : Mass Mailing activity don't display all status
2015-10-04 19:57:29 +02:00
Laurent Destailleur
0df42bc5ea FIX Filter on status of thirdparty list and bad encoding of url 2015-10-04 19:37:49 +02:00
Laurent Destailleur
d54650905b FIX debian install when module mysqli is not installed. 2015-10-04 19:08:10 +02:00
Laurent Destailleur
75e337e8d9 FIX select of project using ajax autocomplete option 2015-10-04 16:02:50 +02:00
Laurent Destailleur
8c17668665 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-04 15:01:34 +02:00
Laurent Destailleur
36a6a77d82 Fix missing picto for launchpad 2015-10-04 15:01:17 +02:00
Laurent Destailleur
9eab5206d4 Fix typo 2015-10-04 14:08:32 +02:00
Juanjo Menent
8f28e7cf1c Merge remote-tracking branch 'upstream/3.8' into 3.8 2015-10-03 23:34:37 +02:00
Juanjo Menent
8febf25c23 Fix: #3566 2015-10-03 23:34:10 +02:00
Laurent Destailleur
4e5ca151b5 Make process to update launchpad easier. 2015-10-03 20:39:15 +02:00
Laurent Destailleur
bea789edfe Make process to update launchpad easier. 2015-10-03 20:09:54 +02:00
Laurent Destailleur
d737fd1fd2 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-03 19:06:44 +02:00
Laurent Destailleur
31acab92a6 Doc comments 2015-10-03 18:48:51 +02:00
Juanjo Menent
fbc3efb5a9 Merge pull request #3641 from grandoc/3.8
fix : Typo
2015-10-03 15:55:56 +02:00
Laurent Destailleur
9e7ded94af Clean init/demo file. Demo init must contains real and clean values 2015-10-03 13:00:44 +02:00
Laurent Destailleur
a9e55fd08f FIX Missing contracts into list in page of Refering objects of a
thirdparty.
2015-10-03 12:57:58 +02:00
philippe grand
d19a9f66b3 Merge branch '3.8' of https://github.com/Dolibarr/dolibarr.git into 3.8 2015-10-03 12:43:38 +02:00
Laurent Destailleur
996c9ca2ba FIX Can't change state on a contact 2015-10-03 12:21:27 +02:00
Laurent Destailleur
b6a83ed5a6 FIX Can't delete thirdparty if there is some discounts 2015-10-03 12:20:50 +02:00
Frédéric FRANCE
322a2a54b8 Update printing.php 2015-10-03 11:34:14 +02:00
Laurent Destailleur
10b481f47f Fix colspan 2015-10-03 11:15:12 +02:00
Laurent Destailleur
5acf961f23 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-03 00:10:19 +02:00
philippe grand
e22fb3c538 fix : Typo 2015-10-02 12:39:09 +02:00
philippe grand
8a9c9f49d5 fix : Typo 2015-10-02 12:37:13 +02:00
Juanjo Menent
4c1e018ded Merge pull request #3621 from fmarcet/3.8
FIX Only are showing one object linked
2015-10-02 11:03:19 +02:00
Laurent Destailleur
f11fd22809 More accurate message 2015-10-01 22:27:02 +02:00
Laurent Destailleur
5ad665d00c Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-10-01 16:50:52 +02:00
Laurent Destailleur
60c0338d64 FIX #3628 2015-10-01 16:50:18 +02:00
Laurent Destailleur
e76124add5 FIX #3606 2015-10-01 16:09:51 +02:00
Florian HENRY
fd29bb34be FIX : Mass Mailing activity don't display all status 2015-10-01 16:09:04 +02:00
Laurent Destailleur
4201e8b032 FIX #3630 - Wrong balance report when module salaries and donation
disabled
2015-10-01 14:38:31 +02:00
Laurent Destailleur
e2a88cd010 Merge pull request #3626 from GPCsolutions/3.8-3607
FIX #3607 Better categories setting and unsetting
2015-10-01 13:59:05 +02:00
Laurent Destailleur
b57c156b60 Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/core/modules/modContrat.class.php
	htdocs/fichinter/card.php
	htdocs/install/upgrade2.php
2015-10-01 11:16:35 +02:00
Laurent Destailleur
076f2ed9d1 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/core/lib/security.lib.php
2015-10-01 11:10:47 +02:00
Laurent Destailleur
72c31c0fa9 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-10-01 10:48:28 +02:00
Laurent Destailleur
4da8fb901b Add comment 2015-10-01 10:48:09 +02:00
Laurent Destailleur
1907e5da54 Merge pull request #3619 from atm-arnaud/3.6_fix_facturestat
FIX facturestat bad sql when customer view is limited
2015-10-01 10:48:05 +02:00
Laurent Destailleur
34adc60d26 Merge pull request #3618 from atm-alexis/fix_event_for_user_restricted_if_no_company
FIX error in SQL due to a previous fix
2015-10-01 10:35:07 +02:00
Laurent Destailleur
9c28894ec3 Merge pull request #3615 from FHenry/3.7
FIX : When delete actioncomm also delete actioncomm_resources
2015-10-01 10:34:54 +02:00
Laurent Destailleur
0c64fa04bc Merge pull request #3614 from marcosgdf/bug-3572
FIX #3572 Impossible to attach project in order. The option to use autocompletion for project failed.
2015-10-01 10:32:32 +02:00
Laurent Destailleur
74fb718b77 Merge pull request #3612 from grandoc/3.7
missing translation
2015-10-01 10:28:27 +02:00
Laurent Destailleur
9901406634 A paswword can be set on member card but member can't login. Too much
work to fix this into a stable version, so I just introduce a warning to
explain why and how to solve this.
2015-10-01 10:15:07 +02:00
Laurent Destailleur
71ccdb5cfb FIX Payment form for paypal and paybox was not centered. 2015-09-30 19:37:41 +02:00
Laurent Destailleur
747c49862c Try to solve a flush pb 2015-09-30 19:15:45 +02:00
Laurent Destailleur
7037679718 FIX When update a member login for a member linked to a user, the login
of user was not sync (not updated).
2015-09-30 19:15:09 +02:00
Raphaël Doursenaud
f0466ba313 FIX #3607 Better categories setting and unsetting
This allows triggering CATEGORY_LINK and CATEGORY_UNLINK each time.
2015-09-30 18:47:02 +02:00
Florian HENRY
a96b92a618 FIX : Email selector contact must not include inactive contact 2015-09-30 14:06:45 +02:00
Laurent Destailleur
d59f62cd75 Sync transifex 2015-09-30 01:25:35 +02:00
Laurent Destailleur
673ce059e6 Fix locale for nl_BE must match netherland language 2015-09-29 23:55:38 +02:00
Florian HENRY
e209fb23a2 FIX : Admin fiche inter page do not take good action 2015-09-29 18:27:39 +02:00
Florian HENRY
fecd213bb8 FIX: display error on extrafields on ficheinter 2015-09-29 16:57:05 +02:00
Florian HENRY
bb0de1dcad FIX : update2.php test res befre assign it 2015-09-29 15:00:11 +02:00
Florian HENRY
766b8535ae spacing 2015-09-29 09:47:23 +02:00
Florian HENRY
4f5e207f08 review 2015-09-29 09:45:04 +02:00
Laurent Destailleur
c05df2ab7e FIX Wizard for restore does not show import command 2015-09-29 09:11:13 +02:00
fmarcet
a585698b69 FIX: Only are showing one object linked 2015-09-29 08:49:11 +02:00
arnaud
0b7305d21a FIX facturestat bad sql when customer view is limited 2015-09-28 16:55:34 +02:00
Alexis ALGOUD
453ed8a05e FIX error in SQL due to a previous fix 2015-09-28 15:36:27 +02:00
Florian HENRY
0f27edad5d FIX : When delete actioncomm also delete actioncomm_resources 2015-09-28 10:14:19 +02:00
Marcos García de La Fuente
188489c8ef FIX #3572 Impossible to attach project in order
Added missing file of commit 65d3f79

Close #3572
2015-09-27 21:52:44 +02:00
Laurent Destailleur
fa9103fc97 FIX Bad title line in project view when using jmobile 2015-09-27 16:50:47 +02:00
Laurent Destailleur
1e2d06bcd1 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-27 16:02:44 +02:00
Laurent Destailleur
ff5f823bef FIX not responsive part for project page 2015-09-27 16:01:57 +02:00
Grand Philippe
6f128907fe fix : Missing argument 1 for CommonDocGenerator::__construct() 2015-09-27 11:30:23 +02:00
philippe
1454d942ef missing translation 2015-09-27 11:06:45 +02:00
Laurent Destailleur
e1b969cb90 FIX Init into bad var 2015-09-26 16:52:58 +02:00
Laurent Destailleur
6aa13d4189 Fix the $colorbackvmenu2 was removed with 3.8 2015-09-26 16:34:43 +02:00
Laurent Destailleur
d119e04963 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-26 14:17:02 +02:00
Laurent Destailleur
9ecc8e5e6b FIX Regression on bad use of fk_account showing the bad bank account on
PDF.
2015-09-26 14:11:39 +02:00
Laurent Destailleur
dd88a799fb FIX Event from ical stream should not be movable into calendar view 2015-09-26 13:54:50 +02:00
Laurent Destailleur
c707c899c1 Fix remove warning 2015-09-26 13:22:05 +02:00
Laurent Destailleur
fef8203e65 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-26 12:01:58 +02:00
Laurent Destailleur
a3647bea4e Fix bad information in report 2015-09-26 11:53:36 +02:00
Laurent Destailleur
5a2dc88d42 Merge pull request #3610 from defrance/patch-80
3.8 bad filtering caused by statut filter #3580
2015-09-26 11:20:54 +02:00
Laurent Destailleur
b99ef6b27c Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-26 11:05:12 +02:00
Laurent Destailleur
4e77a651d4 Merge pull request #3600 from fmarcet/3.8
FIX #3599 Not saving legal form
2015-09-26 11:05:02 +02:00
Laurent Destailleur
9644e242ae Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-26 11:04:32 +02:00
Laurent Destailleur
5f765419ea Fix because project module introduced opportunity, user may create
project (opportunity) even when thirdparty does not exists yet, so we
must provide a solution for this.
2015-09-26 11:04:17 +02:00
Laurent Destailleur
f3ba115ef0 Fix missing default value 2015-09-26 10:53:59 +02:00
Laurent Destailleur
7424b521ed Merge pull request #3609 from aspangaro/3.8-20
Fix centering on login page
2015-09-26 10:30:24 +02:00
BENKE Charlie
8dcd6158e3 3.8 bad filtering caused by statut filter #3580
correction ported on 3.8 too, sorry for the bad step process
2015-09-26 10:15:42 +02:00
Juanjo Menent
b8bf21b905 Merge pull request #3582 from grandoc/3.8
FIX: order ref must not be translated
2015-09-26 08:54:25 +02:00
aspangaro
df0e64eb7c Fix centering on login page 2015-09-26 07:59:06 +02:00
Laurent Destailleur
9d0cd148a8 Fix duplicate log 2015-09-25 11:47:24 +02:00
Laurent Destailleur
dcf3c00023 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-25 11:28:59 +02:00
Laurent Destailleur
c0433928c6 FIX sortder field was missing so manually added values were moved to
begin.
2015-09-25 11:28:49 +02:00
fmarcet
b5b90d1639 FIX #3599 Not saving legal form 2015-09-25 08:50:00 +02:00
Laurent Destailleur
3ee5920947 Merge pull request #3571 from fmarcet/3.8
FIX: When filter with empty status, by default get canceled status (-1)
2015-09-24 18:40:06 +02:00
philippe
9e185eec75 FIX: order ref must not be translated 2015-09-24 15:29:17 +02:00
Laurent Destailleur
7cfef16c24 git push origin 3.8Merge branch 'AlainRnet-patch-2' into 3.8 2015-09-23 18:30:03 +02:00
Laurent Destailleur
f8f1f4fd2b Merge branch 'patch-2' of https://github.com/AlainRnet/dolibarr into
AlainRnet-patch-2

Conflicts:
	htdocs/categories/categorie.php
2015-09-23 18:29:56 +02:00
tysauron
f3a28682ea For not error Undefined property: stdClass::$MAIN_AGENDA_EXPORT_CACHE 2015-09-23 18:26:50 +02:00
Laurent Destailleur
d633118bd4 Merge pull request #3574 from FHenry/3.8
FIX : avoid SQL error when no sortfield send to method (price by customer)
2015-09-23 18:21:21 +02:00
phf
b222800012 FIX clone customer order create new order with validate ref and not with PROV 2015-09-23 15:14:08 +02:00
Florian HENRY
206d6d0f7e FIX : avoid SQL error in getValueFrom common object when all params are
not send
2015-09-23 13:17:58 +02:00
Florian HENRY
84fa92045c FIX : avoid SQL error when no sortfield send to method 2015-09-23 12:10:38 +02:00
Florian HENRY
00447f8e72 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-23 12:06:58 +02:00
Alexis Algoud
2d35124c71 FIX no need to remove file into mail form, the temp dir will be deleted after any sending 2015-09-23 11:11:19 +02:00
Laurent Destailleur
12a08ae4e1 Prepare 3.8.1 2015-09-23 10:25:06 +02:00
fmarcet
3ff8b3e437 FIX: Error retrieving customer prices 2015-09-23 10:23:29 +02:00
fmarcet
8309ed5c12 FIX: When filter with empty status, by default get canceled status (-1) 2015-09-23 09:24:49 +02:00
Laurent Destailleur
a70e73a963 FIX Missing validate button if permission are not valid. 2015-09-23 01:08:23 +02:00
tysauron
f1ab0d36c5 Chmod new file not old file 2015-09-23 00:32:30 +02:00
Laurent Destailleur
00b858e644 Merge pull request #3564 from FHenry/3.8
FIX : remove twice same test
2015-09-23 00:07:28 +02:00
Laurent Destailleur
dc89e6c516 Merge pull request #3557 from hregis/3.8
Fix: use get instead getJSON for avoid freezing
2015-09-22 23:56:36 +02:00
Laurent Destailleur
077c696c09 Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/.gitignore
	htdocs/theme/.gitignore
2015-09-22 16:28:34 +02:00
Laurent Destailleur
90b78702e5 Update ignore to secure packaging 2015-09-22 16:23:51 +02:00
Laurent Destailleur
c125ba0d66 Update ignore to secure
Conflicts:
	htdocs/.gitignore
2015-09-22 15:42:59 +02:00
Laurent Destailleur
75daddbbe2 Update ignore to secure 2015-09-22 15:40:49 +02:00
Florian HENRY
d5ab71ad0f Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-22 12:03:42 +02:00
Florian HENRY
178208918f FIX : remove twice same test 2015-09-22 12:03:11 +02:00
Laurent Destailleur
c2bdd9b465 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-22 11:29:49 +02:00
Laurent Destailleur
fe6af7d8eb FIX Description of tags was mandatory in edit mode but not in create
mode. Should not be mandatory.
2015-09-22 11:29:26 +02:00
AlainRnet
30bfb0eee3 Update categorie.php
voir https://github.com/Dolibarr/dolibarr/pull/3562
2015-09-22 09:40:13 +02:00
Laurent Destailleur
f2e2edbc64 FIX not closing CSS. 2015-09-21 15:10:52 +02:00
Laurent Destailleur
a71cef3aa6 Merge pull request #3553 from aspangaro/3.8-19
Missing translations in checks deposits exports
2015-09-21 14:46:12 +02:00
Laurent Destailleur
7d4a9b17b6 FIX Creation of tables or keys must not be done with a random order. 2015-09-21 14:00:02 +02:00
Regis Houssin
de04f3022c Fix: use get instead getJSON for avoid freezing 2015-09-20 09:05:52 +02:00
aspangaro
49f671eb1d Correct name 2015-09-19 07:24:32 +02:00
aspangaro
1901b2fb3b Missing translations in checks deposits exports 2015-09-19 07:15:13 +02:00
Laurent Destailleur
f9973d13b4 Merge pull request #3550 from AlainRnet/patch-2
Update categorie.php
2015-09-18 20:51:46 +02:00
Laurent Destailleur
e85ddbb470 Merge pull request #3537 from GPCsolutions/3.8-3533
FIX #3533 Load categories language
2015-09-18 20:48:58 +02:00
Laurent Destailleur
378da082bd Fix selector or margin with jmobile 2015-09-18 20:43:10 +02:00
Laurent Destailleur
5f507cbbd8 Fix missing closing div making jmobile crazy 2015-09-18 20:23:06 +02:00
Laurent Destailleur
8699776930 Better usability with dolidroid 2015-09-18 16:17:52 +02:00
Laurent Destailleur
e974b07b09 Fix javascript error 2015-09-18 16:05:38 +02:00
Laurent Destailleur
f72f652d98 FIX Pb into pagination scroll widget
FIX Style of previous-next card when using dolidroid
2015-09-18 15:51:27 +02:00
Laurent Destailleur
14b6a74b2d Fix javascript error on POS 2015-09-18 14:13:15 +02:00
AlainRnet
8dd843ab8f Update categorie.php
voir https://github.com/Dolibarr/dolibarr/pull/3540/files (je n'avais pas vu dans quelle branche j'étais)
2015-09-17 23:23:18 +02:00
Laurent Destailleur
57521f628c Fix bad path 2015-09-17 19:35:03 +02:00
Laurent Destailleur
8bb832d06b Fix Natural english 2015-09-17 00:48:10 +02:00
Laurent Destailleur
099e3f0376 FIX Removed warnings 2015-09-17 00:47:56 +02:00
Laurent Destailleur
313d9ddacd FIX #3534 2015-09-16 22:04:03 +02:00
Raphaël Doursenaud
6ffdbf91ec FIX #3533 Load categories language 2015-09-16 21:35:20 +02:00
Laurent Destailleur
7d8013b371 FIX #3533 2015-09-16 21:34:01 +02:00
Laurent Destailleur
38bae655ea Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8
Conflicts:
	htdocs/core/class/html.form.class.php
2015-09-16 21:24:51 +02:00
Laurent Destailleur
e36928fd65 FIX #3529 2015-09-16 21:23:52 +02:00
Laurent Destailleur
8251807408 Merge pull request #3532 from FHenry/3.7
FIX : #3530
2015-09-16 21:08:17 +02:00
Laurent Destailleur
30ccd28d01 Merge pull request #3535 from GPCsolutions/3.7-debian
FIX Syntax error in Debian Apache configuration
2015-09-16 21:07:04 +02:00
Laurent Destailleur
7f60abdf7b FIX #3524 2015-09-16 21:05:02 +02:00
Raphaël Doursenaud
cb31ab3e2b FIX Syntax error in Debian Apache configuration
This issue prevented Apache from starting after dolibarr deb package
installation with the following error:
Syntax error on line 30 of /etc/apache2/conf.d/dolibarr.conf:
order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
2015-09-16 19:53:32 +02:00
Marcos García de La Fuente
3818bff86a Fix: [ bug 1776 ] Undefined $deliverycompany variable in pdf_build_address 2015-09-16 12:49:05 +02:00
Marcos García de La Fuente
e80f29c271 Fix: [ bug 1794 ] - Error when cloning Proposal gives error in a malformed page 2015-09-16 12:47:13 +02:00
Florian HENRY
8fd9d2a7ce FIX : #3530 2015-09-16 10:21:32 +02:00
Juanjo Menent
7b8096d367 Merge pull request #3523 from defrance/patch-78
fix error on tabcollectors and enhance
2015-09-15 15:16:14 +02:00
Juanjo Menent
4e19500cce Merge pull request #3527 from FHenry/3.7
FIX : Must not be able to create Proposal on thridparty with "close" status  #3526
2015-09-15 15:13:36 +02:00
Juanjo Menent
91bac76511 Merge pull request #3522 from aspangaro/3.8-18
Fix :  Class 'Categorie' not found in core\class\html.form.class.php in supplier card
2015-09-15 15:11:26 +02:00
Florian HENRY
a0fb27bd80 FIX : Can create Proposal on close thridparty #3526 2015-09-15 14:34:49 +02:00
BENKE Charlie
95cfce925f fix error on tabcollectors and enhance
fix error on tabcollectors feature
add number of tabs present in tab collectors
2015-09-15 03:33:27 +02:00
aspangaro
2d2f59fe3f Fix : Class 'Categorie' not found in core\class\html.form.class.php 2015-09-14 22:33:48 +02:00
Laurent Destailleur
d985c77eca Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2015-09-14 18:36:08 +02:00
Laurent Destailleur
e0a88fabd9 FIX #3521 2015-09-14 17:54:53 +02:00
Laurent Destailleur
36beb289f3 Merge pull request #3520 from aspangaro/3.8-18
Fix #3225 Missing translations in interventions
2015-09-14 17:24:42 +02:00
Laurent Destailleur
ca2b66ffb3 Merge pull request #3519 from aspangaro/3.8-17
Fix #3227 #3226 Missing translations in supplier exports
2015-09-14 17:24:22 +02:00
Laurent Destailleur
c75f62ddb7 FIX icon into export profile may be not correctly output 2015-09-14 12:12:14 +02:00
Laurent Destailleur
b4c964760d Sync transifex 2015-09-13 23:25:55 +02:00
Laurent Destailleur
3b01b8cb47 Fix security hole 2015-09-13 22:50:08 +02:00
aspangaro
334766d194 Fix #3225 Missing translations in interventions 2015-09-13 22:03:54 +02:00
aspangaro
27a85c074e Merge remote-tracking branch 'origin/3.8-18' into 3.8-17 2015-09-13 21:45:32 +02:00
aspangaro
1d4c747aa2 Fix #3227 #3226 Missing translations in supplier exports 2015-09-13 21:44:59 +02:00
1203 changed files with 12081 additions and 21851 deletions

View File

@@ -9,6 +9,74 @@ Upgrading to any other version or any other database system is abolutely require
make a Dolibarr upgrade.
***** ChangeLog for 3.8.1 compared to 3.8.0 *****
FIX: #3521 postgresql migration error
FIX: #3524
FIX: #3529
FIX: #3530
FIX: #3533
FIX: #3533 Load categories language
FIX: #3534
FIX: #3572 Impossible to attach project in order
FIX: #3599 Not saving legal form
FIX: #3606
FIX: #3607 Better categories setting and unsetting
FIX: #3628
FIX: #3630 - Wrong balance report when module salaries and donation disabled
FIX: Add a test to save life when ref of object (invoice ref, order ref, ...) was empty. The was no way to go back to a clean situation, even after vaidating again the object.
FIX: Admin fiche inter page do not take good action
FIX: Always use type send in parameters in showCategories method
FIX: avoid SQL error in getValueFrom common object when all params are not send
FIX: avoid SQL error when no sortfield send to method
FIX: bad link into project box
FIX: Bad title line in project view when using jmobile
FIX: Bad translation key for project "Overview"
FIX: Can create Proposal on close thridparty #3526
FIX: Can't change state on a contact
FIX: Can't change the admin with default setup
FIX: Can't delete thirdparty if there is some discounts
FIX: Can't reopen a canceled invoice.
FIX: Creation of tables or keys must not be done with a random order.
FIX: debian install when module mysqli is not installed.
FIX: Description of tags was mandatory in edit mode but not in create mode. Should not be mandatory.
FIX: display error on extrafields on ficheinter
FIX: Email selector contact must not include inactive contact
FIX: error in SQL due to a previous fix
FIX: Error retrieving customer prices
FIX: Event from ical stream should not be movable into calendar view
FIX: facturestat bad sql when customer view is limited
FIX: Filter on status of thirdparty list and bad encoding of url
FIX: icon into export profile may be not correctly output
FIX: Init into bad var
FIX: Link of project must be cickable if user has permission to read all projects FIX: Missing information into the alt of project picto
FIX: List of project for user that are restrited as sale repreentative to some thirdparties.
FIX: Mass Mailing activity don't display all status
FIX: Missing contracts into list in page of Refering objects of a thirdparty.
FIX: Missing menu entry for list of thirdparties when using auguria menu manager
FIX: Missing validate button if permission are not valid.
FIX: New adherent from, always redirect on entity
FIX: not closing CSS.
FIX: not responsive part for project page
FIX: Only are showing one object linked
FIX: order ref must not be translated
FIX: Payment form for paypal and paybox was not centered.
FIX: Pb into pagination scroll widget FIX: Style of previous-next card when using dolidroid
FIX: Regression on bad use of fk_account showing the bad bank account on PDF.
FIX: Removed warnings
FIX: remove twice same test
FIX: select of project using ajax autocomplete option
FIX: sortder field was missing so manually added values were moved to begin.
FIX: Syntax error in Debian Apache configuration
FIX: The admin flag is mising.
FIX: The filter on thirdparty prices should be visible if there is at least one thirdparty price.
FIX: Thirdparty is missing on card
FIX: update2.php test res befre assign it
FIX: When delete actioncomm also delete actioncomm_resources
FIX: when editing time spent, date of line suggested was a rubbish value
FIX: When filter with empty status, by default get canceled status (-1)
FIX: When update a member login for a member linked to a user, the login of user was not sync (not updated).
FIX: Wizard for restore does not show import command
***** ChangeLog for 3.8 compared to 3.7.* *****
For users:
FIX: #2519
@@ -344,7 +412,7 @@ For users:
Use accesskey on form search.
- New: Intervention documents are now available in ECM module.
- New: Add attachments on user card + in ECM module.
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- New: Can add __PROJECT_REF__ and __THIRDPARTY_NAME__ into email topic or content template.
- New: [ task #1204 ] add Numering contrat module free (like leopard in product module).
- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice.
- New: Enable supplier price log table.
@@ -465,6 +533,12 @@ Dolibarr better:
warehouse module and your Point Of Sale module setup if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address
- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page
***** ChangeLog for 3.6.4 compared to 3.6.3 *****
- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service

View File

@@ -15,7 +15,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
# Require all granted
# </IfVersion>
# <IfVersion < 2.3>
# Order allow, deny
# Order allow,deny
# Allow from all
# </IfVersion>
#
@@ -27,7 +27,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order allow, deny
Order allow,deny
Allow from all
</IfVersion>

View File

@@ -40,10 +40,28 @@ enable_install_upgrade_wizard() {
rm -f /var/lib/dolibarr/documents/install.lock
}
php_install() {
if which php5enmod >/dev/null 2>&1 ;then
# php5endmod exists for ubuntu only
echo "Enable php module mysqli with php5enmod"
php5enmod mysqli
fi
}
apache_install() {
webserver=$1
# Enable Apache 2 alias module
if which a2enmod >/dev/null 2>&1 ;then
echo "Enable apache module alias with a2enmod"
a2enmod alias
fi
# Enable dolibarr conf
if which a2enconf >/dev/null 2>&1 ;then
# a2enconf exists for ubuntu only
echo "Enable link for Apache config file with a3enconf"
a2enconf dolibarr
else
if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then
@@ -88,11 +106,7 @@ case "$1" in
echo This is not a first install
fi
# Apache 2 setup
if which a2enmod >/dev/null 2>&1 ;then
a2enmod alias
fi
php_install
apache_install
lighttpd_install

View File

@@ -277,7 +277,7 @@ help=!(Port > 0);
Usage:
if (help) {
printf("----- %s V%s (c)Laurent Destailleur -----\n",PROG,VERSION);
printf("%s is a software that allows you to know if a TCP/IP port is used\n",PROG);
printf("%s is software that allows you to know if a TCP/IP port is used\n",PROG);
printf("%s sources can be compiled for WIN32 (VC++, GCC CYGWIN, MINGW) or for\n");
printf("Unix/Linux (GCC)\n",PROG);
printf("\n");

View File

@@ -41,23 +41,21 @@ If you want to build/test package locally:
# Push/declare Dolibarr sources to Launchpad
#----------------------------------
- From Launchpad project (https://launchpad.net/dolibarr), register a series:
Call it 'trunk' or 'beta' or 'stable'
Call it 'trunk' or 'stable'
Use branch (dev):
~eldy/dolibarr/develop
~eldy/dolibarr/beta
~eldy/dolibarr/stable
https://launchpad.net/~eldy/dolibarr/develop
https://launchpad.net/~eldy/dolibarr/stable
or
Use URL pattern (beta or stable):
Use URL pattern (stable):
For stable: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz
For beta: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz
- For Dev, you can also add link serie to GIT HEAD.
- For beta and stable, you can init from command line
cd bzr/dolibarr-[beta|stable]
- For stable, you can init from command line
cd bzr/dolibarr-stable
bzr init
bzr add
bzr commit -m "Init"
bzr push lp:~yourlogin/dolibarr/[beta|stable]
bzr push lp:~yourlogin/dolibarr/stable
- List of series are visible here: https://launchpad.net/dolibarr/+series
@@ -65,19 +63,19 @@ If you want to build/test package locally:
#----------------------------------
# create local repository
cd bzr
bzr branch lp:~yourlogin/dolibarr/[develop|beta|stable] dolibarr-[dev|beta|stable]
cd dolibarr-[dev|beta|stable]
bzr branch lp:~yourlogin/dolibarr/[develop|stable] dolibarr-[dev|stable]
cd dolibarr-[dev|stable]
# Update
bzr update
-- Update files here. Remove all and overwrite --
-- Update files here: Remove all (except .bzr dir) and overwrite --
bzr status
bzr add *
bzr commit -m "Description of change"
bzr commit -m "Upstream version x.y"
bzr push
# Init debian dir repository into launchpad (when repository for sources does not exist)
#----------------------------------
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
cd bzr
mkdir debian
cd debian
@@ -85,25 +83,25 @@ If you want to build/test package locally:
bzr init
bzr add
bzr commit -m "Init control files"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name or just bzr push if into a known branch)
bzr push lp:~yourlogin/+junk/debian-[dev|stable] (put here any branch name or just bzr push if into a known branch)
- or download it from launchpad bazaar:
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
# Get debian dir repository from launchpad (when repository for sources already exists)
#----------------------------------
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
# To update debian dir into launchpad (when repository for sources already exists)
#----------------------------------
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
cd debian-[dev|beta|stable]
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
cd debian-[dev|stable]
bzr status
-- Update files here --
-- Update files here: Remove all (except .bzr dir) and overwrite. Restore version into the file changelog --
bzr commit -m "Description of change"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable]
bzr push lp:~yourlogin/+junk/debian-[dev|stable]
# Define a recipe into launchpad (a rule to build packages into a PPA)
@@ -115,10 +113,6 @@ If you want to build/test package locally:
# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
lp:dolibarr
merge packaging lp:~yourlogin/+junk/debian-dev
For beta:
# bzr-builder format 0.3 deb-version {debupstream}-1~{revno}
lp:dolibarr/beta
merge packaging lp:~yourlogin/+junk/debian-beta
For stable:
# bzr-builder format 0.3 deb-version {debupstream}-2~{revno}
lp:dolibarr/stable
@@ -126,13 +120,12 @@ If you want to build/test package locally:
- Run command
cd bzr
bzr dailydeb dolibarr.recipe working-dir
This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|beta|stable]
This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|stable]
- Test package sources
sudo pbuilder build <working-dir>/<project>_<version>.dsc
List of recipes created
https://code.launchpad.net/~eldy/+recipe/dolibarr-dev
https://code.launchpad.net/~eldy/+recipe/dolibarr-beta
https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
@@ -147,9 +140,6 @@ https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
For the development snapshot version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
For the beta version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-beta/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-beta/ubuntu precise main
For the stable version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main

View File

@@ -467,6 +467,7 @@ if ($nboftargetok) {
# Removed known external modules to avoid any error when packaging from env where external modules are tested
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
@@ -481,8 +482,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`; # This is a dev tool
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;

View File

@@ -8,15 +8,16 @@ This files describe steps made by Dolibarr packaging team to make a
beta version of Dolibarr, step by step.
- Check all files are commited.
- Update version/info in ChangeLog. To generate a changelog, you can do "git log `git merge-base 3.7.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
- Update version/info in ChangeLog.
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x-1.y-1.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x.y.z-1 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
- Update version number with x.y.z-w in build/debian/changelog
- Commit all changes.
- Add a Tag (x.y.z-beta) and push it: git push --tags
- Create a branch (x.y).
- Run makepack-dolibarr.pl to generate all packages.
- Create a branch (x.y), if version seems stable enough.
- Move build files into www.dolibarr.org web site
(/home/dolibarr/wwwroot/files/lastbuild).
@@ -29,9 +30,10 @@ 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. To generate a changelog, you can do "git log `git merge-base 3.7.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
- Update version/info in ChangeLog.
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x-1.y-1.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x.y.z-1 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
- Update version number with x.y.z in htdocs/filefunc.inc.php
- Update version number with x.y.z in build/debian/changelog
- Commit all changes.
- Run makepack-dolibarr.pl to generate all packages.

View File

@@ -41,7 +41,7 @@
<Char_Desc_45>DoliWamp, Dolibarr ERP/CRM for Windows</Char_Desc_45>
<Char_Desc_80>DoliWamp, the easy to use Dolibarr for Windows to manage your company,foundation</Char_Desc_80>
<Char_Desc_250>DoliWamp is the Dolibarr ERP/CRM for Windows, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs.</Char_Desc_250>
<Char_Desc_450>DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations.</Char_Desc_450>
<Char_Desc_450>DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations.</Char_Desc_450>
<Char_Desc_2000>DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP &amp; CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop.
DoliWamp is the auto-installer for Windows users with no technical knowledge to install Dolibarr ERP/CRM and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file.</Char_Desc_2000>

View File

@@ -71,7 +71,7 @@
<Char_Desc_45>DoliWamp, Dolibarr ERP/CRM for Windows</Char_Desc_45>
<Char_Desc_80>DoliWamp, the easy to use Dolibarr for Windows to manage your company,foundation</Char_Desc_80>
<Char_Desc_250>DoliWamp is the Dolibarr ERP/CRM for Windows, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs.</Char_Desc_250>
<Char_Desc_450>DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations.</Char_Desc_450>
<Char_Desc_450>DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations.</Char_Desc_450>
<Char_Desc_2000>DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP &amp; CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop.
DoliWamp is the auto-installer for Windows users with no technical knowledge to install Dolibarr ERP/CRM and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file.</Char_Desc_2000>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

File diff suppressed because one or more lines are too long

View File

@@ -228,11 +228,14 @@ class modMyModule extends DolibarrModules
// Example:
// $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_label[$r]='MyModule'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled.
// $this->export_permission[$r]=array(array("facture","facture","export"));
// $this->export_icon[$r]='generic:MyModule';
// $this->export_permission[$r]=array(array("mymodule","level1","level2"));
// $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef');
// $this->export_TypeFields_array[$r]=array('t.date'=>'Date', 't.qte'=>'Numeric', 't.poids'=>'Numeric', 't.fad'=>'Numeric', 't.paq'=>'Numeric', 't.stockage'=>'Numeric', 't.fadparliv'=>'Numeric', 't.livau100'=>'Numeric', 't.forfait'=>'Numeric', 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text');
// $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product');
// $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';

View File

@@ -244,7 +244,7 @@ class Skeleton_Class extends CommonObject
}
if (!empty($sortfield)) {
$sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder;
$sql .= $this->db->order($sortfield,$sortorder);
}
if (!empty($limit)) {
$sql .= ' ' . $this->db->plimit($limit + 1, $offset);

View File

@@ -30,8 +30,9 @@ then
else
for file in `find htdocs/langs/$1/*.lang -type f`
do
echo $file
export basefile=`basename $file | sed -s s/\.lang//g`
echo "tx push --skip -r dolibarr.$basfile -t -l $1 $2 $3 $4"
echo "tx push --skip -r dolibarr.$basefile -t -l $1 $2 $3 $4"
tx push --skip -r dolibarr.$basefile -t -l $1 $2 $3 $4
done
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

2
htdocs/.gitignore vendored
View File

@@ -13,3 +13,5 @@
/ultimatepdf*
/lead
/dolimed*
/allscreens*
/ecommerce/

View File

@@ -200,7 +200,7 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
print '<tr '.$bc[$var].' id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';;
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
}

View File

@@ -326,25 +326,8 @@ if (empty($reshook))
if ($result >= 0 && ! count($object->errors))
{
// Categories association
// First we delete all categories association
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_member';
$sql .= ' WHERE fk_member = ' . $object->id;
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
// Then we add the associated categories
$categories = GETPOST('memcats', 'array');
if (! empty($categories))
{
$cat = new Categorie($db);
foreach ($categories as $id_category)
{
$cat->fetch($id_category);
$cat->add_type($object, 'member');
}
}
$object->setCategories($categories);
// Logo/Photo save
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'member').'/photos';
@@ -560,15 +543,7 @@ if (empty($reshook))
{
// Categories association
$memcats = GETPOST('memcats', 'array');
if (! empty($memcats))
{
$cat = new Categorie($db);
foreach ($memcats as $id_category)
{
$cat->fetch($id_category);
$cat->add_type($object, 'member');
}
}
$object->setCategories($memcats);
$db->commit();
$rowid=$object->id;
@@ -1478,7 +1453,14 @@ else
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$object->pass).'</td></tr>';
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$object->pass);
if ((! empty($object->pass) || ! empty($object->pass_crypted)) && empty($object->user_id))
{
$langs->load("errors");
$htmltext=$langs->trans("WarningPasswordSetWithNoAccount");
print ' '.$form->textwithpicto('', $htmltext,1,'warning');
}
print '</td></tr>';
}
// Address

View File

@@ -540,10 +540,12 @@ class Adherent extends CommonObject
if ($result >= 0)
{
//var_dump($this->user_login);exit;
//var_dump($this->login);exit;
$luser->login=$this->login;
$luser->civility_id=$this->civility_id;
$luser->firstname=$this->firstname;
$luser->lastname=$this->lastname;
$luser->login=$this->user_login;
$luser->pass=$this->pass;
$luser->societe_id=$this->societe;
@@ -1957,6 +1959,51 @@ class Adherent extends CommonObject
}
}
/**
* Sets object to supplied categories.
*
* Deletes object from existing categories not supplied.
* Adds it to non existing supplied categories.
* Existing categories are left untouch.
*
* @param int[]|int $categories Category or categories IDs
*/
public function setCategories($categories)
{
// Handle single category
if (!is_array($categories)) {
$categories = array($categories);
}
// Get current categories
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$c = new Categorie($this->db);
$existing = $c->containing($this->id, Categorie::TYPE_MEMBER, 'id');
// Diff
if (is_array($existing)) {
$to_del = array_diff($existing, $categories);
$to_add = array_diff($categories, $existing);
} else {
$to_del = array(); // Nothing to delete
$to_add = $categories;
}
// Process
foreach ($to_del as $del) {
if ($c->fetch($del) > 0) {
$c->del_type($this, 'member');
}
}
foreach ($to_add as $add) {
if ($c->fetch($add) > 0) {
$c->add_type($this, 'member');
}
}
return;
}
/**
* Function used to replace a thirdparty id with another one.
*

View File

@@ -679,7 +679,16 @@ if ($rowid > 0)
print '<br><br><table class="border" width="100%">';
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $adht->array_options["options_" . $key];
}
print '<tr><td width="30%">'.$label.'</td><td>';
print $extrafields->showInputField($key,$value);
print "</td></tr>\n";

View File

@@ -414,9 +414,9 @@ if ($action == 'edit' || $action == 'updateedit')
// Forme juridique
$var=!$var;
print '<tr '.$bc[$var].'><td><label for="legal_form">'.$langs->trans("JuridicalStatus").'</label></td><td>';
print '<tr '.$bc[$var].'><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
if ($mysoc->country_code) {
print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'legal_form');
print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code');
} else {
print $countrynotdefined;
}

View File

@@ -151,7 +151,7 @@ $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country a
$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.fdm, c.decalage, c.active, c.sortorder FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c";
$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
@@ -215,7 +215,7 @@ $tabfield[8] = "code,libelle,country_id,country";
$tabfield[9] = "code,label,unicode";
$tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11]= "element,source,code,libelle";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfield[13]= "code,libelle,type,accountancy_code";
$tabfield[14]= "code,libelle,price,organization,country_id,country";
$tabfield[15]= "code,libelle,width,height,unit";
@@ -247,7 +247,7 @@ $tabfieldvalue[8] = "code,libelle,country";
$tabfieldvalue[9] = "code,label,unicode";
$tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[11]= "element,source,code,libelle";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfieldvalue[13]= "code,libelle,type,accountancy_code";
$tabfieldvalue[14]= "code,libelle,price,organization,country";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
@@ -279,7 +279,7 @@ $tabfieldinsert[8] = "code,libelle,fk_country";
$tabfieldinsert[9] = "code_iso,label,unicode";
$tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[11]= "element,source,code,libelle";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage,sortorder";
$tabfieldinsert[13]= "code,libelle,type,accountancy_code";
$tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
@@ -445,6 +445,7 @@ if ($id == 11)
$langs->load("interventions");
$elementList = array(
'' => '',
'societe' => $langs->trans('ThirdParty'),
// 'proposal' => $langs->trans('Proposal'),
// 'order' => $langs->trans('Order'),
// 'invoice' => $langs->trans('Bill'),
@@ -517,8 +518,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1;
foreach ($listfield as $f => $value)
{
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
@@ -1594,6 +1595,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
if ($fieldlist[$field]=='accountancy_code') $size='size="10" ';
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" ';
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" ';
if ($fieldlist[$field]=='sortorder') $size='size="2" ';
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
print '</td>';
}

View File

@@ -203,7 +203,6 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -544,7 +543,7 @@ print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</form>';
// print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@@ -126,7 +126,9 @@ if ($action == 'activate_encryptdbpassconf')
$result = encodedecode_dbpassconf(1);
if ($result > 0)
{
// database value not required
sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
// database value not required
//dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
header("Location: security.php");
exit;
@@ -141,6 +143,8 @@ else if ($action == 'disable_encryptdbpassconf')
$result = encodedecode_dbpassconf(0);
if ($result > 0)
{
sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
// database value not required
//dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
header("Location: security.php");
@@ -288,6 +292,7 @@ $var=!$var;
$this->NbRepeat = $tabConf[4];
$this->WithoutAmbi = $tabConf[5];
*/
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3"> '.$langs->trans("PasswordPatternDesc").'</td>';
@@ -328,13 +333,17 @@ $var=!$var;
print '<td>' . $langs->trans("NoAmbiCaracAutoGeneration")."</td>";
print '<td colspan="2"><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
print '</tr>';
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="2"></td><td width="103" align="center"><a id="linkChangePattern">'.$langs->trans("Save").'</a></td>';
print '</tr>';
print '</table>';
print '<br>';
print '<table align="right">';
print '<tr><td>';
print '<a class="button" id="linkChangePattern">'.$langs->trans("Save").'</a>';
print '</td></tr>';
print '</table>';
print '<br><br>';
print '<script type="text/javascript">';
print ' function getStringArg(){';
print ' var pattern = "";';
@@ -385,7 +394,7 @@ $var=!$var;
// Cryptage mot de passe
print '<br>';
$var=true;
print "<form method=\"post\" action=\"security.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=\"encrypt\">";

View File

@@ -39,6 +39,8 @@ $showpass=GETPOST('showpass');
*/
$label=$db::LABEL;
$type=$db->type;
$help_url='EN:Restores|FR:Restaurations|ES:Restauraciones';
llxHeader('','',$help_url);
@@ -91,7 +93,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
<fieldset id="exportoptions">
<legend><?php echo $langs->trans("ImportMethod"); ?></legend>
<?php
if ($label == 'MySQL')
if (in_array($type, array('mysql', 'mysqli')))
{
?>
<div class="formelementrow">
@@ -100,7 +102,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
</div>
<?php
}
else if ($label == 'PostgreSQL')
else if (in_array($type, array('pgsql')))
{
?>
<div class="formelementrow">
@@ -123,7 +125,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
<div id="div_container_sub_exportoptions">
<?php
if ($label == 'MySQL')
if (in_array($type, array('mysql', 'mysqli')))
{
?>
<fieldset id="mysql_options">
@@ -157,7 +159,7 @@ if ($label == 'MySQL')
</fieldset>
<?php
}
else if ($label == 'PostgreSQL')
else if (in_array($type, array('pgsql')))
{
?>
<fieldset id="postgresql_options">

View File

@@ -60,10 +60,10 @@ function afficheDonnees(aId, aTexte) {
// aCible : id du bloc de destination; aCode : argument a passer a la page php chargee du traitement et de l'affichage
function verifResultat(aCible, aCode, iLimit = 1) {
function verifResultat(aCible, aCode, iLimit) {
if (aCode != '' && aCode.length >= iLimit) {
if (texte = file ('facturation_dhtml.php?code='+escape(aCode))) {
if (texte = file('facturation_dhtml.php?code='+escape(aCode))) {
afficheDonnees (aCible, texte);

View File

@@ -419,7 +419,7 @@ else if ($id || $ref)
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td class="valeur">';
print $form->showrefnav($member,'id');
print $form->showrefnav($member,'id','','1','rowid','ref','','&type='.$type);
print '</td></tr>';
// Login

View File

@@ -222,6 +222,8 @@ class Categorie extends CommonObject
$error=0;
dol_syslog(get_class($this).'::create', LOG_DEBUG);
// Clean parameters
$this->label = trim($this->label);
$this->description = trim($this->description);
@@ -239,7 +241,6 @@ class Categorie extends CommonObject
$this->db->begin();
dol_syslog(get_class($this).'::create', LOG_DEBUG);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (";
$sql.= "fk_parent,";
$sql.= " label,";
@@ -266,7 +267,6 @@ class Categorie extends CommonObject
$sql.= $conf->entity;
$sql.= ")";
dol_syslog(get_class($this).'::create', LOG_DEBUG);
$res = $this->db->query($sql);
if ($res)
{
@@ -1222,7 +1222,7 @@ class Categorie extends CommonObject
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode
* (0, 1, 2, ...) is deprecated.
* @param string $mode 'object'=Get array of fetched category instances, 'label'=Get array of category
* labels
* labels, 'id'= Get array of category IDs
*
* @return mixed Array of category objects or < 0 if KO
*/
@@ -1239,7 +1239,7 @@ class Categorie extends CommonObject
$type = $map_type[$type];
}
$sql = "SELECT ct.fk_categorie, c.label";
$sql = "SELECT ct.fk_categorie, c.label, c.rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . $id . " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
@@ -1249,11 +1249,11 @@ class Categorie extends CommonObject
{
while ($obj = $this->db->fetch_object($res))
{
if ($mode == 'label')
{
if ($mode == 'id') {
$cats[] = $obj->rowid;
} else if ($mode == 'label') {
$cats[] = $obj->label;
}
else {
} else {
$cat = new Categorie($this->db);
$cat->fetch($obj->fk_categorie);
$cats[] = $cat;

View File

@@ -82,20 +82,16 @@ if ($action == 'update' && $user->rights->categorie->creer)
if (empty($categorie->label))
{
$action = 'create';
$error++;
$action = 'edit';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
}
if (empty($categorie->description))
{
$action = 'create';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors');
}
if (empty($categorie->error))
{
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
if ($ret < 0) $error++;
if ($categorie->update($user) > 0)
if (! $error && $categorie->update($user) > 0)
{
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type);
exit;
@@ -138,14 +134,14 @@ dol_fiche_head('');
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">';
print '<tr><td class="fieldrequired" width="25%">';
print $langs->trans("Ref").'</td>';
print '<td><input type="text" size="25" id="label" name ="label" value="'.$object->label.'" />';
print '</tr>';
// Description
print '<tr>';
print '<td class="fieldrequired" width="25%">'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td >';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('description',$object->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50);

View File

@@ -323,7 +323,7 @@ if ($action == 'add')
unset($_SESSION['assignedtouser']);
$moreparam='';
if ($user->id != $object->ownerid) $moreparam="usertodo=-1"; // We force to remove filter so created record is visible when going back to per user view.
if ($user->id != $object->userownerid) $moreparam="usertodo=-1"; // We force to remove filter so created record is visible when going back to per user view.
$db->commit();
if (! empty($backtopage))
@@ -1303,7 +1303,16 @@ if ($id > 0)
print '<br><br><table class="border" width="100%">';
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $object->array_options["options_" . $key];
}
print '<tr><td width="30%">'.$label.'</td><td>';
print $extrafields->showOutputField($key,$value);
print "</td></tr>\n";

View File

@@ -622,7 +622,19 @@ class ActionComm extends CommonObject
$this->error=$this->db->lasterror();
$error++;
}
if (! $error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
$this->error=$this->db->lasterror();
$error++;
}
}
// Removed extrafields
if (! $error) {
$result=$this->deleteExtraFields();

View File

@@ -1210,7 +1210,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
}
else if ($event->type_code == 'ICALEVENT')
else if ($event->type_code == 'ICALEVENT') // Event come from external ical file
{
$numical++;
if (! empty($event->icalname)) {
@@ -1220,7 +1220,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++;
}
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unmovable');
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
}
else if ($event->type_code == 'BIRTHDAY')
{
@@ -1266,6 +1266,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
$cssclass.= " unmovable";
}
else if ($event->type_code == 'ICALEVENT')
{
$cssclass.= " unmovable";
}
else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
{
$tmpyearend = date('Y',$event->date_end_in_calendar);

View File

@@ -199,7 +199,7 @@ if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (
if ($filtert > 0 || $usergroup > 0)
{
$sql.= " AND (";
if ($filtert > 0) $sql.= "ar.fk_element = ".$filtert;
if ($filtert > 0) $sql.= "(ar.fk_element = ".$filtert." OR a.fk_user_action=".$filtert.")";
if ($usergroup > 0) $sql.= ($filtert>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup;
$sql.= ")";
}

View File

@@ -1800,7 +1800,7 @@ if ($action == 'create')
// Tableau des substitutions
$formmail->substit['__ASKREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__CONTACTCIVNAME__'] = '';
$formmail->substit['__PERSONALIZED__'] = '';

View File

@@ -1289,12 +1289,12 @@ class AskPriceSupplier extends CommonObject
$soc->fetch($this->socid);
// Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($soc);
}
else
{
{
$num = $this->ref;
}
$this->newref = $num;

View File

@@ -965,25 +965,25 @@ if ($id > 0)
print '<div class="tabsAction">';
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
{
$langs->load("propal");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>';
}
if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1)
{
$langs->load("orders");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
}
if ($user->rights->contrat->creer)
if ($user->rights->contrat->creer && $object->status==1)
{
$langs->load("contracts");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
}
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1)
{
$langs->load("fichinter");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
@@ -992,7 +992,7 @@ if ($id > 0)
// Add invoice
if ($user->societe_id == 0)
{
if (! empty($conf->deplacement->enabled))
if (! empty($conf->deplacement->enabled) && $object->status==1)
{
$langs->load("trips");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
@@ -1000,7 +1000,7 @@ if ($id > 0)
if (! empty($conf->facture->enabled))
{
if ($user->rights->facture->creer)
if ($user->rights->facture->creer && $object->status==1)
{
$langs->load("bills");
$langs->load("orders");

View File

@@ -164,8 +164,7 @@ if ($result)
print '<td align="right" class="nowrap">';
if ($filteremail)
{
if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error();
if ($obj->sendstatut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
print $email::libStatutDest($obj->sendstatut,2);
}
else
{

View File

@@ -128,7 +128,7 @@ if (empty($reshook))
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
if (! GETPOST('socid', 3))
{
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
@@ -140,7 +140,7 @@ if (empty($reshook))
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
exit();
} else {
setEventMessage($object->error, 'errors');
if (count($object->errors) > 0) setEventMessage($object->errors, 'errors');
$action = '';
}
}
@@ -195,22 +195,18 @@ if (empty($reshook))
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} else {
$langs->load("errors");
@@ -1327,7 +1323,7 @@ if ($action == 'create')
print '</td>';
} else {
print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 2 OR s.client = 3', 1);
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1);
print '</td>';
}
print '</tr>' . "\n";
@@ -2168,18 +2164,20 @@ if ($action == 'create')
if ($action != 'statut' && $action != 'editline')
{
// Validate
if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0 &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
{
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->propal->propal_advance->validate)))
) {
if (count($object->lines) > 0)
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=validate">' . $langs->trans('Validate') . '</a></div>';
// else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
}
else
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">' . $langs->trans('Validate') . '</a></div>';
}
// Create event
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
{
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
}
// Edit
if ($object->statut == Propal::STATUS_VALIDATED && $user->rights->propal->creer) {
@@ -2225,7 +2223,7 @@ if ($action == 'create')
}
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES))
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED))
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=classifybilled&amp;socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
}
@@ -2369,7 +2367,7 @@ if ($action == 'create')
$formmail->substit['__PROPREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__REFCLIENT__'] = $object->ref_client;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__PERSONALIZED__'] = '';
$formmail->substit['__CONTACTCIVNAME__'] = '';

View File

@@ -47,8 +47,9 @@ $result = restrictedArea($user, 'propal', $id);
* View Mode
*/
llxHeader();
$form = new Form($db);
llxHeader();
if ($id > 0 || ! empty($ref))
{
@@ -68,10 +69,12 @@ if ($id > 0 || ! empty($ref))
*/
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<td colspan="5">'.$object->ref.'</td>';
print '</tr>';
$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';
// Ref client
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
@@ -144,7 +147,7 @@ if ($id > 0 || ! empty($ref))
print "</table>\n";
// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{

View File

@@ -462,7 +462,7 @@ class Propal extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, '', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -1063,7 +1063,7 @@ class Propal extends CommonObject
{
global $db, $user,$langs,$conf,$hookmanager;
dol_include_once('/projet/class.project.class.php');
dol_include_once('/projet/class/project.class.php');
$this->context['createfromclone']='createfromclone';
@@ -1076,44 +1076,42 @@ class Propal extends CommonObject
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);
// Load dest object
$clonedObj = clone $this;
$objsoc=new Societe($this->db);
// Change socid if needed
if (! empty($socid) && $socid != $this->socid)
if (! empty($socid) && $socid != $clonedObj->socid)
{
if ($objsoc->fetch($socid) > 0)
{
$this->socid = $objsoc->id;
$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$project = new Project($db);
if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) {
if($project->socid <= 0) $this->fk_project = $objFrom->fk_project;
else $this->fk_project = '';
$clonedObj->socid = $objsoc->id;
$clonedObj->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
$clonedObj->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$clonedObj->fk_delivery_address = '';
$project = new Project($db);
if ($this->fk_project > 0 && $project->fetch($this->fk_project)) {
if ($project->socid <= 0) $clonedObj->fk_project = $this->fk_project;
else $clonedObj->fk_project = '';
} else {
$this->fk_project = '';
$clonedObj->fk_project = '';
}
$this->fk_delivery_address = '';
}
// reset ref_client
$this->ref_client = '';
$clonedObj->ref_client = '';
// TODO Change product price if multi-prices
}
else
{
$objsoc->fetch($this->socid);
$objsoc->fetch($clonedObj->socid);
}
$this->id=0;
$this->statut=self::STATUS_DRAFT;
$clonedObj->id=0;
$clonedObj->statut=self::STATUS_DRAFT;
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
@@ -1122,32 +1120,32 @@ class Propal extends CommonObject
}
// Clear fields
$this->user_author = $user->id;
$this->user_valid = '';
$this->date = $now;
$this->datep = $now; // deprecated
$this->fin_validite = $this->date + ($this->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $this->ref_client = '';
$clonedObj->user_author = $user->id;
$clonedObj->user_valid = '';
$clonedObj->date = $now;
$clonedObj->datep = $now; // deprecated
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Set ref
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
$obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj;
$this->ref = $modPropale->getNextValue($objsoc,$this);
$clonedObj->ref = $modPropale->getNextValue($objsoc,$clonedObj);
// Create clone
$result=$this->create($user);
$result=$clonedObj->create($user);
if ($result < 0) $error++;
else
{
// copy internal contacts
if ($this->copy_linked_contact($objFrom, 'internal') < 0)
if ($clonedObj->copy_linked_contact($this, 'internal') < 0)
$error++;
// copy external contacts if same company
elseif ($objFrom->socid == $this->socid)
elseif ($this->socid == $clonedObj->socid)
{
if ($this->copy_linked_contact($objFrom, 'external') < 0)
if ($clonedObj->copy_linked_contact($this, 'external') < 0)
$error++;
}
}
@@ -1157,9 +1155,9 @@ class Propal extends CommonObject
// Hook of thirdparty module
if (is_object($hookmanager))
{
$parameters=array('objFrom'=>$objFrom);
$parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$clonedObj,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
@@ -1175,7 +1173,7 @@ class Propal extends CommonObject
if (! $error)
{
$this->db->commit();
return $this->id;
return $clonedObj->id;
}
else
{
@@ -1481,12 +1479,12 @@ class Propal extends CommonObject
$soc->fetch($this->socid);
// Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($soc);
}
else
{
{
$num = $this->ref;
}
$this->newref = $num;
@@ -2124,26 +2122,26 @@ class Propal extends CommonObject
$this->fetchObjectLinked($id,$this->element);
foreach($this->linkedObjectsIds as $objecttype => $objectid)
{
$numi=count($objectid);
for ($i=0;$i<$numi;$i++)
// Nouveau système du comon object renvoi des rowid et non un id linéaire de 1 à n
// On parcourt donc une liste d'objets en tant qu'objet unique
foreach($objectid as $key => $object)
{
// Cas des factures liees directement
if ($objecttype == 'facture')
{
$linkedInvoices[] = $objectid[$i];
$linkedInvoices[] = $object;
}
// Cas des factures liees par un autre objet (ex: commande)
else
{
$this->fetchObjectLinked($objectid[$i],$objecttype);
$this->fetchObjectLinked($object,$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{
$numj=count($subobjectid);
for ($j=0;$j<$numj;$j++)
foreach($subobjectid as $subkey => $subobject)
{
if ($subobjecttype == 'facture')
{
$linkedInvoices[] = $subobjectid[$j];
$linkedInvoices[] = $subobject;
}
}
}

View File

@@ -48,7 +48,7 @@ class PropaleStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param int $userid Id user for filter (creation user)
*/
function __construct($db, $socid=0, $userid=0)

View File

@@ -468,6 +468,7 @@ if ($resql)
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Status
print '<td class="liste_titre" align="right">';
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
print '</td>';

View File

@@ -47,6 +47,8 @@ $result=restrictedArea($user,'commande',$id,'');
* View Mode
*/
$form = new Form($db);
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
if ($id > 0 || ! empty($ref))
@@ -64,9 +66,12 @@ if ($id > 0 || ! empty($ref))
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref")."</td>";
print '<td colspan="5">'.$object->ref.'</td></tr>';
//$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';
// Ref cde client
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
@@ -142,7 +147,7 @@ if ($id > 0 || ! empty($ref))
print "</table>\n";
// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@@ -88,7 +88,7 @@ $extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ordercard','globalcard'));
@@ -150,7 +150,7 @@ if (empty($reshook))
// Reopen a closed order
else if ($action == 'reopen' && $user->rights->commande->creer)
{
if ($object->statut == STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED)
if ($object->statut == Commande::STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED)
{
$result = $object->set_reopen($user);
if ($result > 0)
@@ -165,7 +165,7 @@ if (empty($reshook))
}
}
// Suppression de la commande
// Remove order
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer)
{
$result = $object->delete($user);
@@ -1165,8 +1165,10 @@ if (empty($reshook))
if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) {
if ($action == 'addcontact') {
if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer)
{
if ($action == 'addcontact')
{
if ($object->id > 0) {
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
@@ -1186,7 +1188,8 @@ if (empty($reshook))
}
// bascule du statut d'un contact
else if ($action == 'swapstatut') {
else if ($action == 'swapstatut')
{
if ($object->id > 0) {
$result = $object->swapContactStatus(GETPOST('ligne'));
} else {
@@ -1195,7 +1198,8 @@ if (empty($reshook))
}
// Efface un contact
else if ($action == 'deletecontact') {
else if ($action == 'deletecontact')
{
$result = $object->delete_contact($lineid);
if ($result >= 0) {
@@ -1423,6 +1427,8 @@ if ($action == 'create' && $user->rights->commande->creer)
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1);
print '</td></tr>';
// TODO How record was recorded OrderMode (llx_c_input_method)
// Project
if (! empty($conf->projet->enabled) && $socid > 0)
{
@@ -1964,7 +1970,7 @@ if ($action == 'create' && $user->rights->commande->creer)
}
print '</td></tr>';
// Source
// Origin
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Source');
@@ -1984,6 +1990,8 @@ if ($action == 'create' && $user->rights->commande->creer)
// print '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=22&origin=order&originid='.$object->id.'">'.$langs->trans("DictionarySource").'</a>';
print '</td></tr>';
// TODO How record was recorded OrderMode (llx_c_input_method)
// Project
if (! empty($conf->projet->enabled))
{
@@ -2401,7 +2409,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$formmail->substit ['__ORDERREF__'] = $object->ref;
$formmail->substit ['__SIGNATURE__'] = $user->signature;
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit ['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit ['__PERSONALIZED__'] = '';
$formmail->substit ['__CONTACTCIVNAME__'] = '';

View File

@@ -263,14 +263,14 @@ class Commande extends CommonOrder
// Protection
if ($this->statut == self::STATUS_VALIDATED)
{
dol_syslog(get_class($this)."::valid no draft status", LOG_WARNING);
dol_syslog(get_class($this)."::valid action abandonned: no draft status", LOG_WARNING);
return 0;
}
if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))))
{
$this->error='Permission denied';
$this->error='ErrorPermissionDenied';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
return -1;
}
@@ -287,7 +287,7 @@ class Commande extends CommonOrder
$result=$soc->set_as_client();
// Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($soc);
}
@@ -978,6 +978,7 @@ class Commande extends CommonOrder
}
$this->id=0;
$this->ref = '';
$this->statut=self::STATUS_DRAFT;
// Clear fields
@@ -986,14 +987,7 @@ class Commande extends CommonOrder
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
// Set ref
require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php';
$obj = $conf->global->COMMANDE_ADDON;
$modCommande = new $obj;
$this->ref = $modCommande->getNextValue($objsoc,$this);
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
@@ -1045,116 +1039,112 @@ class Commande extends CommonOrder
$error=0;
// Signed proposal
if ($object->statut == 2)
$this->date_commande = dol_now();
$this->source = 0;
$num=count($object->lines);
for ($i = 0; $i < $num; $i++)
{
$this->date_commande = dol_now();
$this->source = 0;
$line = new OrderLine($this->db);
$num=count($object->lines);
for ($i = 0; $i < $num; $i++)
{
$line = new OrderLine($this->db);
$line->libelle = $object->lines[$i]->libelle;
$line->label = $object->lines[$i]->label;
$line->desc = $object->lines[$i]->desc;
$line->price = $object->lines[$i]->price;
$line->subprice = $object->lines[$i]->subprice;
$line->tva_tx = $object->lines[$i]->tva_tx;
$line->localtax1_tx = $object->lines[$i]->localtax1_tx;
$line->localtax2_tx = $object->lines[$i]->localtax2_tx;
$line->qty = $object->lines[$i]->qty;
$line->fk_remise_except = $object->lines[$i]->fk_remise_except;
$line->remise_percent = $object->lines[$i]->remise_percent;
$line->fk_product = $object->lines[$i]->fk_product;
$line->info_bits = $object->lines[$i]->info_bits;
$line->product_type = $object->lines[$i]->product_type;
$line->rang = $object->lines[$i]->rang;
$line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->fk_unit = $object->lines[$i]->fk_unit;
$line->libelle = $object->lines[$i]->libelle;
$line->label = $object->lines[$i]->label;
$line->desc = $object->lines[$i]->desc;
$line->price = $object->lines[$i]->price;
$line->subprice = $object->lines[$i]->subprice;
$line->tva_tx = $object->lines[$i]->tva_tx;
$line->localtax1_tx = $object->lines[$i]->localtax1_tx;
$line->localtax2_tx = $object->lines[$i]->localtax2_tx;
$line->qty = $object->lines[$i]->qty;
$line->fk_remise_except = $object->lines[$i]->fk_remise_except;
$line->remise_percent = $object->lines[$i]->remise_percent;
$line->fk_product = $object->lines[$i]->fk_product;
$line->info_bits = $object->lines[$i]->info_bits;
$line->product_type = $object->lines[$i]->product_type;
$line->rang = $object->lines[$i]->rang;
$line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->fk_unit = $object->lines[$i]->fk_unit;
$line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end;
$line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
$line->pa_ht = $marginInfos[0];
$line->marge_tx = $marginInfos[1];
$line->marque_tx = $marginInfos[2];
// get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;
$this->lines[$i] = $line;
}
$this->socid = $object->socid;
$this->fk_project = $object->fk_project;
$this->cond_reglement_id = $object->cond_reglement_id;
$this->mode_reglement_id = $object->mode_reglement_id;
$this->fk_account = $object->fk_account;
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison;
$this->shipping_method_id = $object->shipping_method_id;
$this->fk_delivery_address = $object->fk_delivery_address;
$this->contact_id = $object->contactid;
$this->ref_client = $object->ref_client;
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
$this->origin = $object->element;
$this->origin_id = $object->id;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
$line->pa_ht = $marginInfos[0];
$line->marge_tx = $marginInfos[1];
$line->marque_tx = $marginInfos[2];
// get extrafields from original line
$object->fetch_optionals($object->id);
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;
$e = new ExtraFields($db);
$element_extrafields = $e->fetch_name_optionals_label($this->element);
$this->lines[$i] = $line;
}
foreach($object->array_options as $options_key => $value) {
if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){
$this->array_options[$options_key] = $value;
}
$this->socid = $object->socid;
$this->fk_project = $object->fk_project;
$this->cond_reglement_id = $object->cond_reglement_id;
$this->mode_reglement_id = $object->mode_reglement_id;
$this->fk_account = $object->fk_account;
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison;
$this->shipping_method_id = $object->shipping_method_id;
$this->fk_delivery_address = $object->fk_delivery_address;
$this->contact_id = $object->contactid;
$this->ref_client = $object->ref_client;
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
$this->origin = $object->element;
$this->origin_id = $object->id;
// get extrafields from original line
$object->fetch_optionals($object->id);
$e = new ExtraFields($db);
$element_extrafields = $e->fetch_name_optionals_label($this->element);
foreach($object->array_options as $options_key => $value) {
if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){
$this->array_options[$options_key] = $value;
}
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
}
// 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);
if ($ret > 0)
{
// Actions hooked (by external module)
$hookmanager->initHooks(array('orderdao'));
$parameters=array('objFrom'=>$object);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
if (! $error)
{
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
}
$ret = $this->create($user);
if ($ret > 0)
{
// Actions hooked (by external module)
$hookmanager->initHooks(array('orderdao'));
$parameters=array('objFrom'=>$object);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
if (! $error)
// Ne pas passer par la commande provisoire
if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1)
{
// Ne pas passer par la commande provisoire
if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1)
{
$this->fetch($ret);
$this->valid($user);
}
return $ret;
$this->fetch($ret);
$this->valid($user);
}
else return -1;
return $ret;
}
else return -1;
}
else return 0;
else return -1;
}

View File

@@ -48,7 +48,7 @@ class CommandeStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/

View File

@@ -338,7 +338,7 @@ if ($resql)
print '</td>';
print '<td align="right">';
$liststatus=array('0'=>$langs->trans("StatusOrderDraftShort"), '1'=>$langs->trans("StatusOrderValidated"), '2'=>$langs->trans("StatusOrderSentShort"), '3'=>$langs->trans("StatusOrderToBill"), '4'=>$langs->trans("StatusOrderProcessed"), '-1'=>$langs->trans("StatusOrderCanceledShort"));
print $form->selectarray('viewstatut', $liststatus, $viewstatut, 1);
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
print '</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';

View File

@@ -952,7 +952,7 @@ if ($id > 0 || ! empty($ref))
if ($sep > 0) print '&nbsp;'; // If we had at least one line in future
else print $langs->trans("CurrentBalance");
print ' '.$object->currency_code.'</td>';
print '<td align="right" class="nowrap"><b>'.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
print '<td align="right" class="nowrap"><b>'.price($total, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
print '<td>&nbsp;</td>';
print '</tr>';
} else {

View File

@@ -1737,40 +1737,41 @@ if (empty($reshook))
$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");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
if ($result >= 0) {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit();
} else {
setEventMessage($object->error, 'errors');
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
} else {
setEventMessage($object->error, 'errors');
}
}
}
}
// bascule du statut d'un contact
else if ($action == 'swapstatut')
{
if ($object->fetch($id)) {
$result = $object->swapContactStatus(GETPOST('ligne'));
} else {
dol_print_error($db);
// bascule du statut d'un contact
else if ($action == 'swapstatut')
{
if ($object->fetch($id)) {
$result = $object->swapContactStatus(GETPOST('ligne'));
} else {
dol_print_error($db);
}
}
// Efface un contact
else if ($action == 'deletecontact')
{
$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);
}
}
// Efface un contact
else if ($action == 'deletecontact')
{
$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);
}
}
@@ -1790,17 +1791,16 @@ if (empty($reshook))
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
// some hooks
if (empty($reshook)) {
$result = $object->insertExtraFields();
if ($result < 0) {
$error ++;
}
} else if ($reshook < 0)
$result = $object->insertExtraFields();
if ($result < 0) {
$error ++;
}
if ($error)
$action = 'edit_extras';
}
} else if ($reshook < 0)
$error ++;
}
if ($error)
$action = 'edit_extras';
}
}
@@ -1877,7 +1877,7 @@ if ($action == 'create')
$objectsrc->fetch_lines();
$objectsrc->fetch_thirdparty();
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
$projectid = (! empty($projectid) ? $projectid : $objectsrc->fk_project);
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
@@ -2186,9 +2186,9 @@ if ($action == 'create')
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
print $desc;
print '<div id="credit_note_options">';
print '&nbsp;&nbsp;&nbsp; <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop("checked", true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
print '<br>&nbsp;&nbsp;&nbsp; <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop("checked", true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
print '<div id="credit_note_options" class="clearboth">';
print '&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
print '<br>&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
print '</div>';
print '</div></div>';
@@ -2257,9 +2257,6 @@ if ($action == 'create')
// Project
if (! empty($conf->projet->enabled) && $socid > 0)
{
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
$langs->load('projects');
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
@@ -2551,7 +2548,8 @@ else if ($id > 0 || ! empty($ref))
$qualified_for_stock_change = $object->hasProductsOrServices(1);
}
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut >= 1) {
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut >= 1)
{
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
@@ -2741,17 +2739,19 @@ else if ($id > 0 || ! empty($ref))
}
// Clone confirmation
if ($action == 'clone') {
if ($action == 'clone')
{
// Create an array for form
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company('', 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1)));
array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1)));
// Paiement incomplet. On demande si motif = escompte ou autre
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
}
if (! $formconfirm) {
if (! $formconfirm)
{
$parameters = array('lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
@@ -3857,7 +3857,7 @@ else if ($id > 0 || ! empty($ref))
$formmail->substit['__FACREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__REFCLIENT__'] = $object->ref_client;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__PROJECT_NAME__'] = (is_object($object->projet)?$object->projet->title:'');
$formmail->substit['__PERSONALIZED__'] = '';

View File

@@ -66,7 +66,6 @@ llxHeader('',$langs->trans("BillsSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup');
print '<br>';
$head = invoice_admin_prepare_head();

View File

@@ -67,7 +67,6 @@ llxHeader('',$langs->trans("BillsSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup');
print '<br>';
$head = invoice_admin_prepare_head();

View File

@@ -29,6 +29,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -79,10 +80,21 @@ if ($id > 0 || ! empty($ref))
*/
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<td colspan="5">'.$object->ref.'</td>';
print '</tr>';
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
$morehtmlref = '';
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0) {
$morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')';
}
if ($result < 0) {
dol_print_error('', $discount->error);
}
print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
print '</td></tr>';
// Ref customer
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
@@ -280,7 +292,7 @@ if ($id > 0 || ! empty($ref))
print "</table>\n";
// Conversion du PDF en image png si fichier png non existant
if (! file_exists($fileimage) && ! file_exists($fileimagebis))
if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file)))
{
if (class_exists("Imagick"))
{

View File

@@ -180,7 +180,7 @@ class Facture extends CommonInvoice
const TYPE_DEPOSIT = 3;
/**
* Proforma invoice
* Proforma invoice (should not be used. a proforma is an order)
*/
const TYPE_PROFORMA = 4;
@@ -1827,7 +1827,7 @@ class Facture extends CommonInvoice
{
$num = $force_number;
}
else if (preg_match('/^[\(]?PROV/i', $this->ref))
else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
{
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date
{

View File

@@ -45,7 +45,7 @@ class FactureStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/
@@ -168,7 +168,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
$sql.= " AND ".$this->where;
$sql.= " GROUP BY dm";
@@ -188,7 +188,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE ".$this->where;
$sql.= " GROUP BY year";
$sql.= $this->db->order('year','DESC');

View File

@@ -69,7 +69,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha');
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$search_status=GETPOST('search_status','alpha');
$search_status=GETPOST('search_status','int');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@@ -191,7 +191,7 @@ if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcusto
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
if ($search_status != '') $sql.= " AND f.fk_statut = '".$db->escape($search_status)."'";
if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status);
if ($month > 0)
{
if ($year > 0 && empty($day))
@@ -270,6 +270,7 @@ if ($resql)
if ($search_user > 0) $param.='&search_user=' .$search_user;
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
if ($search_status != '') $param.='&search_status='.$search_status;
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png');
$i = 0;

View File

@@ -417,6 +417,7 @@ $search_societe = GETPOST("search_societe");
$search_paymentmode = GETPOST("search_paymentmode");
$search_montant_ht = GETPOST("search_montant_ht");
$search_montant_ttc = GETPOST("search_montant_ttc");
$search_status = GETPOST("search_status");
$late = GETPOST("late");
// Do we click on purge search criteria ?
@@ -428,6 +429,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_paymentmode='';
$search_montant_ht='';
$search_montant_ttc='';
$search_status='';
}
$sortfield = GETPOST("sortfield",'alpha');
@@ -483,6 +485,7 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmo
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
if ($search_status) $sql .= " AND f.fk_statut = ".$search_status;
if ($month > 0)
{
if ($year > 0)
@@ -528,6 +531,7 @@ if ($resql)
if ($search_societe) $param.='&amp;search_paymentmode='.urlencode($search_paymentmode);
if ($search_montant_ht) $param.='&amp;search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_ttc) $param.='&amp;search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status) $param.='&amp;search_status='.urlencode($search_status);
if ($late) $param.='&amp;late='.urlencode($late);
if ($mode) $param.='&amp;mode='.urlencode($mode);
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;

View File

@@ -552,7 +552,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
* Salaries
*/
if ($conf->salaries->enabled)
if (! empty($conf->salaries->enabled))
{
if ($modecompta == 'CREANCES-DETTES') {
$column = 'p.datev';
@@ -626,13 +626,16 @@ if ($conf->salaries->enabled)
* Donation
*/
if ($conf->donation->enabled)
if (! empty($conf->don->enabled))
{
print '<tr><td colspan="4">'.$langs->trans("Donation").'</td></tr>';
$sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND fk_statut=2";
if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND fk_statut in (1,2)";
else
$sql.= " AND fk_statut=2";
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";

View File

@@ -477,85 +477,93 @@ $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$acti
/*
* Salaries
*/
if ($modecompta == 'CREANCES-DETTES') {
$column = 'p.datev';
} else {
$column = 'p.datep';
}
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result=$db->query($sql);
if ($result)
if (! empty($conf->salaries->enabled))
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0;
$decaiss[$obj->dm] += $obj->amount;
if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0;
$decaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
if ($modecompta == 'CREANCES-DETTES') {
$column = 'p.datev';
} else {
$column = 'p.datep';
}
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0;
$decaiss[$obj->dm] += $obj->amount;
if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0;
$decaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
}
}
/*
* get dunning paiement
*/
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND fk_statut=2";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
dol_syslog("get social salaries payments");
$result=$db->query($sql);
if ($result)
* Donation get dunning paiement
*/
if (! empty($conf->don->enabled))
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0;
$encaiss[$obj->dm] += $obj->amount;
if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0;
$encaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND fk_statut in (1,2)";
else
$sql.= " AND fk_statut=2";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
dol_syslog("get donation payments");
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0;
$encaiss[$obj->dm] += $obj->amount;
if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0;
$encaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
}
}
/*

View File

@@ -79,7 +79,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
{
$dateech=@dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
$dateperiod=@dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
$amount=GETPOST('amount');
$amount=price2num(GETPOST('amount'));
$actioncode=GETPOST('actioncode');
if (! $dateech)
{
@@ -114,7 +114,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
$chargesociales->lib=GETPOST('label');
$chargesociales->date_ech=$dateech;
$chargesociales->periode=$dateperiod;
$chargesociales->amount=price2num($amount);
$chargesociales->amount=$amount;
$id=$chargesociales->create($user);
if ($id <= 0)
@@ -130,7 +130,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
{
$dateech=dol_mktime(GETPOST('echhour'),GETPOST('echmin'),GETPOST('echsec'),GETPOST('echmonth'),GETPOST('echday'),GETPOST('echyear'));
$dateperiod=dol_mktime(GETPOST('periodhour'),GETPOST('periodmin'),GETPOST('periodsec'),GETPOST('periodmonth'),GETPOST('periodday'),GETPOST('periodyear'));
$amount=GETPOST('amount');
$amount=price2num(GETPOST('amount'));
if (! $dateech)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors');
@@ -146,7 +146,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors');
$action = 'edit';
}
else
elseif (! is_numeric($amount))
{
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
$action = 'create';
}
else
{
$chargesociales=new ChargeSociales($db);
$result=$chargesociales->fetch($id);

View File

@@ -100,6 +100,10 @@ if ($user->societe_id) {
}
$result = restrictedArea($user, 'tax', '', '', 'charges');
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta");
/*
@@ -292,7 +296,14 @@ if (is_array($coll_list)) {
} else {
$langs->load("errors");
if ($coll_list == -1) {
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
if ($modecompta == 'CREANCES-DETTES')
{
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
}
else
{
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
}
} else if ($coll_list == -2) {
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
} else {
@@ -377,7 +388,14 @@ if (is_array($coll_list)) {
} else {
$langs->load("errors");
if ($coll_list == -1) {
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
if ($modecompta == 'CREANCES-DETTES')
{
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
}
else
{
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
}
} else if ($coll_list == -2) {
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
} else {
@@ -457,7 +475,14 @@ if ($special_report) {
} else {
$langs->load("errors");
if ($coll_list == -1) {
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
if ($modecompta == 'CREANCES-DETTES')
{
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
}
else
{
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
}
} else {
if ($coll_list == -2) {
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
@@ -530,7 +555,14 @@ if ($special_report) {
} else {
$langs->load("errors");
if ($coll_list == -1) {
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
if ($modecompta == 'CREANCES-DETTES')
{
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
}
else
{
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
}
} else {
if ($coll_list == -2) {
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';

View File

@@ -224,13 +224,7 @@ if (empty($reshook))
} else {
// Categories association
$contcats = GETPOST( 'contcats', 'array' );
if (!empty( $contcats )) {
$cat = new Categorie( $db );
foreach ($contcats as $id_category) {
$cat->fetch( $id_category );
$cat->add_type( $object, 'contact' );
}
}
$object->setCategories($contcats);
}
}
@@ -304,6 +298,7 @@ if (empty($reshook))
$object->zip = GETPOST("zipcode");
$object->town = GETPOST("town");
$object->state_id = GETPOST("state_id",'int');
$object->fk_departement = GETPOST("state_id",'int'); // For backward compatibility
$object->country_id = GETPOST("country_id",'int');
$object->email = GETPOST("email",'alpha');
@@ -333,13 +328,8 @@ if (empty($reshook))
// Then we add the associated categories
$categories = GETPOST( 'contcats', 'array' );
if (!empty( $categories )) {
$cat = new Categorie( $db );
foreach ($categories as $id_category) {
$cat->fetch( $id_category );
$cat->add_type( $object, 'contact' );
}
}
$object->setCategories($categories);
$object->old_lastname='';
$object->old_firstname='';
$action = 'view';

View File

@@ -1123,6 +1123,51 @@ class Contact extends CommonObject
}
}
/**
* Sets object to supplied categories.
*
* Deletes object from existing categories not supplied.
* Adds it to non existing supplied categories.
* Existing categories are left untouch.
*
* @param int[]|int $categories Category or categories IDs
*/
public function setCategories($categories)
{
// Handle single category
if (!is_array($categories)) {
$categories = array($categories);
}
// Get current categories
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$c = new Categorie($this->db);
$existing = $c->containing($this->id, Categorie::TYPE_CONTACT, 'id');
// Diff
if (is_array($existing)) {
$to_del = array_diff($existing, $categories);
$to_add = array_diff($categories, $existing);
} else {
$to_del = array(); // Nothing to delete
$to_add = $categories;
}
// Process
foreach ($to_del as $del) {
if ($c->fetch($del) > 0) {
$c->del_type($this, 'contact');
}
}
foreach ($to_add as $add) {
if ($c->fetch($add) > 0) {
$c->add_type($this, 'contact');
}
}
return;
}
/**
* Function used to replace a thirdparty id with another one.
*

View File

@@ -104,6 +104,25 @@ if ($object->id)
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
if ($object->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</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>';

View File

@@ -793,7 +793,7 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
setEventMessage($object->errors, 'errors');
}
$result = $object->setValueFrom('ref',GETPOST('ref','alpha'));;
$result = $object->setValueFrom('ref',GETPOST('ref','alpha'));
if ($result < 0) {
setEventMessage($object->errors, 'errors');
$action = 'editref';
@@ -1317,7 +1317,7 @@ else
$sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
$sql.= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,";
$sql.= " cd.fk_unit,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype";
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity";
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
$sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id;
@@ -1352,6 +1352,7 @@ else
$productstatic->id=$objp->fk_product;
$productstatic->type=$objp->ptype;
$productstatic->ref=$objp->pref;
$productstatic->entity=$objp->pentity;
$text = $productstatic->getNomUrl(1,'',20);
if ($objp->label)
{
@@ -1485,6 +1486,7 @@ else
$productstatic->id=$objp->fk_product;
$productstatic->type=$objp->ptype;
$productstatic->ref=$objp->pref;
$productstatic->entity=$objp->pentity;
print $productstatic->getNomUrl(1,'',20);
print $objp->label?' - '.dol_trunc($objp->label,16):'';
print '<br>';

View File

@@ -402,7 +402,7 @@ class Contrat extends CommonObject
$result=$this->thirdparty->set_as_client();
// Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($this->thirdparty);
}
@@ -1284,7 +1284,7 @@ class Contrat extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,'', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -1457,7 +1457,7 @@ class Contrat extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -2449,7 +2449,7 @@ class ContratLigne extends CommonObjectLine
*/
function update($user, $notrigger=0)
{
global $conf, $langs;
global $conf, $langs, $mysoc;
$error=0;
@@ -2491,7 +2491,9 @@ class ContratLigne extends CommonObjectLine
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice=calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1);
$localtaxes_type = getLocalTaxesFromRate($this->txtva, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1, $mysoc, $localtaxes_type);
$this->total_ht = $tabprice[0];
$this->total_tva = $tabprice[1];
$this->total_ttc = $tabprice[2];

View File

@@ -371,7 +371,7 @@ print '<br>';
$sql = "SELECT c.ref, c.fk_soc, ";
$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
$sql.= " s.nom as name,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -413,6 +413,7 @@ if ($resql)
$productstatic->id=$obj->fk_product;
$productstatic->type=$obj->ptype;
$productstatic->ref=$obj->pref;
$productstatic->entity=$obj->pentity;
print $productstatic->getNomUrl(1,'',20);
}
else
@@ -449,7 +450,7 @@ print '<br>';
// Not activated services
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
$sql.= " s.nom as name,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -493,6 +494,7 @@ if ($resql)
$productstatic->id=$obj->fk_product;
$productstatic->type=$obj->ptype;
$productstatic->ref=$obj->pref;
$productstatic->entity=$obj->pentity;
print $productstatic->getNomUrl(1,'',20);
}
else
@@ -528,7 +530,7 @@ print '<br>';
// Expired services
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
$sql.= " s.nom as name,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -573,6 +575,7 @@ if ($resql)
$productstatic->id=$obj->fk_product;
$productstatic->type=$obj->ptype;
$productstatic->ref=$obj->pref;
$productstatic->entity=$obj->pentity;
print $productstatic->getNomUrl(1,'',20);
}
else

View File

@@ -98,7 +98,7 @@ llxHeader();
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
$sql.= " s.rowid as socid, s.nom as name,";
$sql.= " cd.rowid, cd.description, cd.statut,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= " cd.date_ouverture_prevue,";
$sql.= " cd.date_ouverture,";
@@ -225,6 +225,7 @@ if ($resql)
$productstatic->id=$obj->pid;
$productstatic->type=$obj->ptype;
$productstatic->ref=$obj->pref;
$productstatic->entity=$obj->pentity;
print $productstatic->getNomUrl(1,'',20);
print $obj->label?' - '.dol_trunc($obj->label,16):'';
if (! empty($obj->description) && ! empty($conf->global->PRODUCT_DESC_IN_LIST)) print '<br>'.dol_nl2br($obj->description);

View File

@@ -28,7 +28,7 @@
// $cancel must be defined
// $id or $ref must be defined (object is loaded in this file with fetch)
if (($id > 0 || ! empty($ref)) && empty($cancel))
if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask')))) && empty($cancel))
{
$ret = $object->fetch($id,$ref);
if ($ret > 0)

View File

@@ -64,7 +64,7 @@ class box_produits extends ModeleBoxes
if ($user->rights->produit->lire || $user->rights->service->lire)
{
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression";
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
@@ -103,6 +103,7 @@ class box_produits extends ModeleBoxes
$productstatic->ref = $objp->ref;
$productstatic->type = $objp->fk_product_type;
$productstatic->label = $objp->label;
$productstatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',

View File

@@ -66,7 +66,7 @@ class box_produits_alerte_stock extends ModeleBoxes
if ($user->rights->produit->lire || $user->rights->service->lire)
{
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte,";
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte,p.entity,";
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
@@ -110,6 +110,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$productstatic->ref = $objp->ref;
$productstatic->type = $objp->fk_product_type;
$productstatic->label = $objp->label;
$productstatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
'td' => 'align="left"',

View File

@@ -104,7 +104,7 @@ class box_project extends ModeleBoxes
'td' => 'align="left"',
'text' => $objp->ref,
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][2] = array(

View File

@@ -75,6 +75,7 @@ abstract class CommonDocGenerator
'myuser_mobile'=>$user->user_mobile,
'myuser_email'=>$user->email,
'myuser_logo'=>$user->photo,
'myuser_job'=>$user->job,
'myuser_web'=>'' // url not exist in $user object
);
}
@@ -388,11 +389,16 @@ abstract class CommonDocGenerator
// Add vat by rates
foreach ($object->lines as $line)
{
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0;
$resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]);
// $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example)
$vatformated=vatrate($line->tva_tx);
if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0;
$resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva;
$resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]);
}
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options))
{

View File

@@ -452,13 +452,15 @@ abstract class CommonObject
// Check parameters
if ($fk_socpeople <= 0)
{
$this->error=$langs->trans("ErrorWrongValueForParameter","1");
$langs->load("errors");
$this->error=$langs->trans("ErrorWrongValueForParameterX","1");
dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR);
return -1;
}
if (! $type_contact)
{
$this->error=$langs->trans("ErrorWrongValueForParameter","2");
$langs->load("errors");
$this->error=$langs->trans("ErrorWrongValueForParameterX","2");
dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR);
return -2;
}
@@ -486,7 +488,7 @@ abstract class CommonObject
}
$datecreate = dol_now();
$this->db->begin();
// Insertion dans la base
@@ -504,7 +506,11 @@ abstract class CommonObject
if (! $notrigger)
{
$result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user);
if ($result < 0) { $this->db->rollback(); return -1; }
if ($result < 0)
{
$this->db->rollback();
return -1;
}
}
$this->db->commit();
@@ -1077,18 +1083,18 @@ abstract class CommonObject
function getValueFrom($table, $id, $field)
{
$result=false;
$sql = "SELECT ".$field." FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE rowid = ".$id;
dol_syslog(get_class($this).'::getValueFrom', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$row = $this->db->fetch_row($resql);
$result = $row[0];
}
if (!empty($id) && !empty($field) && !empty($table)) {
$sql = "SELECT ".$field." FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE rowid = ".$id;
dol_syslog(get_class($this).'::getValueFrom', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$row = $this->db->fetch_row($resql);
$result = $row[0];
}
}
return $result;
}
@@ -2265,7 +2271,7 @@ abstract class CommonObject
{
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
foreach($objectids as $i => $objectid); // $i is rowid into llx_element_element
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
{
$object = new $classname($this->db);
$ret = $object->fetch($objectid);
@@ -3799,10 +3805,10 @@ abstract class CommonObject
/**
* Function to show lines of extrafields with output datas
*
* @param object $extrafields Extrafield Object
* @param string $mode Show output ('view') or input ('edit') for extrafield
* @param array $params Optionnal parameters. Example: array('colspan'=>2)
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param Extrafields $extrafields Extrafield Object
* @param string $mode Show output (view) or input (edit) for extrafield
* @param array $params Optional parameters
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
*
* @return string
*/
@@ -3833,7 +3839,16 @@ abstract class CommonObject
$value=$this->array_options["options_".$key];
break;
case "edit":
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]);
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $this->array_options["options_" . $key];
}
break;
}
if ($extrafields->attribute_type[$key] == 'separate')

View File

@@ -387,8 +387,8 @@ class Conf
// conf->global->ACCOUNTING_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
// By default, suppliers ojbects can be linked to all projects
$conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
// By default, suppliers objects can be linked to all projects
$this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
// conf->liste_limit = constante de taille maximale des listes
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;

View File

@@ -739,10 +739,10 @@ class ExtraFields
elseif ($type == 'select')
{
$out = '';
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), 0);
}
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
@@ -760,10 +760,10 @@ class ExtraFields
elseif ($type == 'sellist')
{
$out = '';
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
$out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), 0);
}
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
@@ -815,7 +815,9 @@ class ExtraFields
{
$sqlwhere.= ' WHERE '.$InfoFieldList[4];
}
}else {
}
else
{
$sqlwhere.= ' WHERE 1';
}
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
@@ -1451,7 +1453,7 @@ class ExtraFields
else if (in_array($key_type,array('checkbox')))
{
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
$value_key=implode($value_arr,',');
$value_key=implode(',', $value_arr);
}
else if (in_array($key_type,array('price','double')))
{

View File

@@ -3015,6 +3015,8 @@ class Form
global $langs;
$langs->load("categories");
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$cat = new Categorie($this->db);
$cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
@@ -3231,7 +3233,7 @@ class Form
if (! empty($more)) {
$formconfirm.= '<div class="confirmquestions">'.$more.'</div>';
}
$formconfirm.= ($question ? '<div class="confirmmessage"'.img_help('','').' '.$question . '</div>': '');
$formconfirm.= ($question ? '<div class="confirmmessage">'.img_help('','').' '.$question . '</div>': '');
$formconfirm.= '</div>'."\n";
$formconfirm.= "\n<!-- begin ajax form_confirm page=".$page." -->\n";
@@ -4673,6 +4675,8 @@ class Form
{
global $db;
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$cat = new Categorie($db);
$categories = $cat->containing($id, $type);
@@ -4692,7 +4696,7 @@ class Form
if ($rendermode == 0)
{
$cate_arbo = $this->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
$cate_arbo = $this->select_all_categories($type, '', 'parent', 64, 0, 1);
foreach($categories as $c) {
$arrayselected[] = $c->id;
}
@@ -5057,10 +5061,7 @@ class Form
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'>':'&nbsp;').'</a>':'';
//print "xx".$previous_ref."x".$next_ref;
//if ($previous_ref || $next_ref || $morehtml) {
//$ret.='<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
$ret.='<div style="vertical-align: middle"><div class="inline-block floatleft refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
//}
$ret.='<div style="vertical-align: middle"><div class="inline-block floatleft refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
$ret.=dol_htmlentities($object->$fieldref);
if ($morehtmlref)
@@ -5134,9 +5135,10 @@ class Form
* @param int $height Height of photo (auto if 0)
* @param int $caneditfield Add edit fields
* @param string $cssclass CSS name to use on img for photo
* @param string $imagesize 'mini', 'small' or '' (original)
* @return string HTML code to output photo
*/
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin')
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='')
{
global $conf,$langs;
@@ -5155,7 +5157,12 @@ class Form
else if ($modulepart=='userphoto')
{
$dir=$conf->user->dir_output;
if ($object->photo) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
if (! empty($object->photo))
{
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}

View File

@@ -820,7 +820,12 @@ class FormFile
if ($object->element == 'member') $relativepath=get_exdir($object->id,2,0,0,$object,'member').$relativepath; // TODO Call using a defined value for $relativepath
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
}
// For backward compatiblity, we detect file is stored into an old path
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $file['level1name'] == 'photos')
{
$relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/';
}
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>';

View File

@@ -90,29 +90,30 @@ class FormProjets
}
/**
* Returns an array with projects qualified for a third party
* Returns an array with projects qualified for a third party
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param int $mode 0 for HTML mode and 1 for JSON mode
* @param string $filterkey Key to filter
* @return int Nber of project if OK, <0 if KO
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param int $mode 0 for HTML mode and 1 for array return (to be used by json_encode for example)
* @param string $filterkey Key to filter
* @return int Nb of project if OK, <0 if KO
*/
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '')
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '')
{
global $user,$conf,$langs;
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$out='';
$outarray=array();
$hideunselectables = false;
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;

View File

@@ -0,0 +1,64 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 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 3 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/js/timepicker.js.php
* \brief File that include javascript functions for timepicker
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1);
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(FALSE);
require_once '../../main.inc.php';
// Define javascript type
header('Content-type: text/javascript; charset=UTF-8');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
else header('Cache-Control: no-cache');
?>
/**
* Select2 French translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['xx'] = {
formatMatches: function (matches) { return matches + " <?php echo dol_escape_js($langs->trans("Select2ResultFoundUseArrows")); ?>"; },
formatNoMatches: function () { return "<?php echo dol_escape_js($langs->trans("Select2NotFound")); ?>"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacters")); ?>"; },
formatLoadMore: function (pageNumber) { return "<?php echo dol_escape_js($langs->trans("Select2LoadingMoreResults")); ?>"; },
formatSearching: function () { return "<?php echo dol_escape_js($langs->trans("Select2SearchInProgress")); ?>"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['xx']);
})(jQuery);
<?php
if (is_object($db)) $db->close();

View File

@@ -126,19 +126,25 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'.$langs->trans("VisibleTimeRange").'</td>';
print "<td class='nowrap maxwidthonsmartphone'>";
print '<div class="ui-grid-a"><div class="ui-block-a">';
print '<input type="number" class="short" name="begin_h" value="'.$begin_h.'" min="0" max="23">';
if (empty($conf->dol_use_jmobile)) print ' - ';
else print '</div><div class="ui-block-b">';
print '<input type="number" class="short" name="end_h" value="'.$end_h.'" min="1" max="24">';
if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H");
print '</div></div>';
print '</td></tr>';
// Filter on days
print '<tr>';
print '<td class="nowrap">'.$langs->trans("VisibleDaysRange").'</td>';
print "<td class='nowrap maxwidthonsmartphone'>";
print '<div class="ui-grid-a"><div class="ui-block-a">';
print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">';
if (empty($conf->dol_use_jmobile)) print ' - ';
else print '</div><div class="ui-block-b">';
print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">';
print '</div></div>';
print '</td></tr>';
}

View File

@@ -94,7 +94,7 @@ function societe_prepare_head(Societe $object)
}*/
// Tab to link resources
if ($conf->resource->enabled && ! empty($conf->global->RESOURCE_ON_THIRDPARTIES))
if (! empty($conf->resource->enabled) && ! empty($conf->global->RESOURCE_ON_THIRDPARTIES))
{
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id;
$head[$h][1] = $langs->trans("Resources");
@@ -537,7 +537,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
else
{
$var = false;
print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
}
$db->free($result);
}

View File

@@ -627,7 +627,7 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
else dol_syslog("files.lib.php::dol_move failed", LOG_WARNING);
}
if (empty($newmask) && ! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK;
@chmod($newpathofsrcfile, octdec($newmask));
@chmod($newpathofdestfile, octdec($newmask));
}
return $result;
@@ -1603,6 +1603,16 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='".$db->escape($refname)."' AND entity IN (".getEntity('societe', 1).")";
}
// Wrapping for contact
else if ($modulepart == 'contact')
{
if ($fuser->rights->societe->lire)
{
$accessallowed=1;
}
$original_file=$conf->societe->multidir_output[$entity].'/contact/'.$original_file;
}
// Wrapping for invoices
else if ($modulepart == 'facture' || $modulepart == 'invoice')
{

View File

@@ -731,6 +731,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
// if =0 we don't use the feature
$limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD);
$displaytab=0;
$nbintab=0;
for ($i = 0 ; $i <= $maxkey ; $i++)
{
@@ -767,7 +768,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
}
else
{
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabunactive tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
}
}
$out.='</div>';
@@ -787,6 +788,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
$outmore.='<a'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
$outmore.='</div>';
$nbintab++;
}
$displaytab=$i;
}
@@ -795,18 +797,18 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
{
$tabsname=str_replace("@", "", $picto);
$out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
$out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>';
$out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").' <span class="badge">'.$nbintab.'</span></a>';
$out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>';
$out.="</div>\n";
$out.="<script>";
$out.="$('#moretabs".$tabsname.").mouseenter( function() { $('#moretabsList".$tabsname.").css('left','auto');});";
$out.="$('#moretabs".$tabsname.").mouseleave( function() { $('#moretabsList".$tabsname.").css('left','-999em');});";
$out.="$('#moretabs".$tabsname."').mouseenter( function() { $('#moretabsList".$tabsname."').css('left','auto');});";
$out.="$('#moretabs".$tabsname."').mouseleave( function() { $('#moretabsList".$tabsname."').css('left','-999em');});";
$out.="</script>";
}
$out.="</div>\n";
if (! $notab) $out.="\n".'<div class="tabBar">'."\n";
return $out;
@@ -2847,7 +2849,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
{
if ($totalnboflines) // If we know total nb of lines
{
$maxnbofpage=(empty($conf->dol_optimize_smallscreen)?10:3); // nb before and after selected page
$maxnbofpage=(empty($conf->dol_optimize_smallscreen) ? 6 : 3); // nb before and after selected page + ... + first or last
$nbpages=ceil($totalnboflines/$conf->liste_limit);
$cpt=($page-$maxnbofpage);
@@ -2856,8 +2858,10 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
if ($cpt>=1)
{
$pagelist.= '<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><a '.(empty($conf->dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'&amp;sortfield='.$sortfield.'&amp;sortorder='.$sortorder.'">1</a></li>';
if ($cpt >= 2) $pagelist.='<li><span class="inactive">...</span></li>';
if ($cpt > 2) $pagelist.='<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><span '.(empty($conf->dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...</span></li>';
else if ($cpt == 2) $pagelist.='<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><a '.(empty($conf->dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'&amp;sortfield='.$sortfield.'&amp;sortorder='.$sortorder.'">2</a></li>';
}
do
{
if ($cpt==$page)
@@ -2871,9 +2875,11 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
$cpt++;
}
while ($cpt < $nbpages && $cpt<=$page+$maxnbofpage);
if ($cpt<$nbpages)
{
if ($cpt<$nbpages-1) $pagelist.= '<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><span '.(empty($conf->dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...</span></li>';
if ($cpt<$nbpages-2) $pagelist.= '<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><span '.(empty($conf->dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...</span></li>';
else if ($cpt == $nbpages-2) $pagelist.= '<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><a '.(empty($conf->dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'&amp;sortfield='.$sortfield.'&amp;sortorder='.$sortorder.'">'.($nbpages - 1).'</a></li>';
$pagelist.= '<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><a '.(empty($conf->dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'&amp;sortfield='.$sortfield.'&amp;sortorder='.$sortorder.'">'.$nbpages.'</a></li>';
}
}
@@ -3738,13 +3744,14 @@ function yn($yesno, $case=1, $color=0)
/**
* Return a path to have a directory according to object.
* Examples: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
* Examples: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
* New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart')
* Old usage: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
* Old usage: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
*
* @param string $num Id of object
* @param int $level Level of subdirs to return (1, 2 or 3 levels)
* @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0).
* @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '')
* @param string $num Id of object (deprecated, $object will be used in future)
* @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
* @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). (deprecated, global option will be used in future)
* @param int $withoutslash 0=With slash at end (except if '/', we return ''), 1=without slash at end
* @param Object $object Object
* @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...')
* @return string Dir to use ending. Example '' or '1/' or '1/2/'
@@ -3755,9 +3762,6 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
$path = '';
// TODO if object is null, load it from id and modulepart.
if (! empty($level) && in_array($modulepart, array('cheque','user','category','holiday','shipment', 'member','don','donation','supplier_invoice','invoice_supplier')))
{
// This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided
@@ -3772,7 +3776,7 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
{
// TODO
// We will introduce here a common way of forging path for document storage
// Here, $num=id, ref and modulepart are required.
// Here, object->id, object->ref and object->modulepart are required.
}
@@ -5112,3 +5116,32 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
return $res;
}
/**
* Return the filename of file to get the thumbs
*
* @param string $file Original filename
* @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini')
* @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image.
* @return string New file name
*/
function getImageFileNameForSize($file, $extName, $extImgTarget='')
{
$dirName = dirname($file);
if ($dirName == '.') $dirName='';
$fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse
$fileName = basename($fileName);
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':'');
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'');
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':'');
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':'');
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':'');
if (! $extImgTarget) return $file;
$subdir='';
if ($extName) $subdir = 'thumbs/';
return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb
}

View File

@@ -337,7 +337,6 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if ($mode == 'source' && ! is_object($sourcecompany)) return -1;
if ($mode == 'target' && ! is_object($targetcompany)) return -1;
if ($mode == 'delivery' && ! is_object($deliverycompany)) return -1;
if (! empty($sourcecompany->state_id) && empty($sourcecompany->departement)) $sourcecompany->departement=getState($sourcecompany->state_id); //TODO: Deprecated
if (! empty($sourcecompany->state_id) && empty($sourcecompany->state)) $sourcecompany->state=getState($sourcecompany->state_id);
@@ -1198,7 +1197,10 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
// TODO add hook function
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
$reshook = $hookmanager->executeHooks('pdf_getlinenum',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1224,7 +1226,10 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
// TODO add hook function
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
$reshook = $hookmanager->executeHooks('pdf_getlineref',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1249,7 +1254,10 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0)
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
// TODO add hook function
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
$reshook = $hookmanager->executeHooks('pdf_getlineref_supplier',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1276,7 +1284,8 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1306,7 +1315,8 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1331,10 +1341,10 @@ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
foreach($object->hooks as $modules)
{
if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails);
}
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
$reshook = $hookmanager->executeHooks('pdf_getlineupwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1363,7 +1373,8 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1393,7 +1404,8 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1423,7 +1435,8 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1453,7 +1466,8 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1488,8 +1502,8 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
'special_code' => $special_code
);
$action = '';
return $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object,
$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
} else {
if (empty($hidedetails) || $hidedetails > 1) {
return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
@@ -1522,7 +1536,8 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1549,7 +1564,8 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code);
$action = '';
return $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
} else {
if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%';
}
@@ -1584,7 +1600,8 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1619,7 +1636,8 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else
{
@@ -1657,7 +1675,10 @@ function pdf_getTotalQty($object,$type,$outputlangs)
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
// TODO add hook function
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
$reshook = $hookmanager->executeHooks('pdf_getTotalQty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
else if ($type==0 && $object->lines[$i]->product_type == 0)
{
@@ -1693,7 +1714,7 @@ function pdf_getLinkedObjects($object,$outputlangs)
if ($objecttype == 'propal')
{
$outputlangs->load('propal');
foreach($objects as $elementobject)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
@@ -1743,7 +1764,7 @@ function pdf_getLinkedObjects($object,$outputlangs)
else // We show both info of order and shipment
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref) . ($order->ref_client ? ' ('.$order->ref_client.')' : '');
$linkedobjects[$objecttype]['ref_value'].= ' / ' . $outputlangs->transnoentities($elementobject->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);

View File

@@ -53,7 +53,7 @@ function project_prepare_head($object)
|| ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
{
$head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id;
$head[$h][1] = $langs->trans("Overview");
$head[$h][1] = $langs->trans("ProjectOverview");
$head[$h][2] = 'element';
$h++;
}
@@ -348,7 +348,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$projectstatic->id=$lines[$i]->fk_project;
$projectstatic->ref=$lines[$i]->projectref;
$projectstatic->public=$lines[$i]->public;
if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId)) print $projectstatic->getNomUrl(1);
if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId) || ! empty($user->rights->projet->all->lire)) print $projectstatic->getNomUrl(1);
else print $projectstatic->getNomUrl(1,'nolink');
if ($showlineingray) print '</i>';
print "</td>";

View File

@@ -416,7 +416,10 @@ function encodedecode_dbpassconf($level=0)
if ($fp = @fopen($file,'w'))
{
fputs($fp, $config);
fflush($fp);
fclose($fp);
clearstatcache();
// It's config file, so we set read permission for creator only.
// Should set permission to web user and groups for users used by batch
//@chmod($file, octdec('0600'));

View File

@@ -79,7 +79,7 @@ function tax_prepare_head(ChargeSociales $object)
* @param int $y Year
* @param string $date_start Start date
* @param string $date_end End date
* @param int $modetax 0 or 1 (option vat on debit)
* @param int $modetax 0 or 1 (option vat on debit, 1 => $modecompta = 'CREANCES-DETTES')
* @param string $direction 'sell' or 'buy'
* @param int $m Month
* @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error

View File

@@ -59,12 +59,14 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
fwrite($calfileh,"CALSCALE:GREGORIAN\n");
fwrite($calfileh,"X-WR-CALNAME:".$encoding.format_cal($format,$title)."\n");
fwrite($calfileh,"X-WR-CALDESC:".$encoding.format_cal($format,$desc)."\n");
$hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
$mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
//fwrite($calfileh,"X-WR-TIMEZONE:Europe/Paris\n");
if (! empty($conf->global->MAIN_AGENDA_EXPORT_CACHE)
&& $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60) fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
&& $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60){
$hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
$mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
}
foreach ($events_array as $date => $event)
{

View File

@@ -91,7 +91,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
if (! $passok)
{
if ((! $passcrypted || $passtyped)
&& ($passtyped == $passclear))
&& ($passclear && ($passtyped == $passclear)))
{
$passok=true;
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database");

View File

@@ -68,6 +68,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Third parties
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/soc.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/fourn/list.php?leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/soc.php?leftmenu=supplier&amp;action=create&amp;type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/comm/prospect/list.php?leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__);

View File

@@ -623,8 +623,14 @@ abstract class DolibarrModules
{
$dirfound++;
// Run llx_mytable.sql files
// Run llx_mytable.sql files, then llx_mytable_*.sql
$files = array();
while (($file = readdir($handle))!==false)
{
$files[] = $file;
}
sort($files);
foreach ($files as $file)
{
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{
@@ -635,8 +641,14 @@ abstract class DolibarrModules
rewinddir($handle);
// Run llx_mytable.key.sql files (Must be done after llx_mytable.sql)
// Run llx_mytable.key.sql files (Must be done after llx_mytable.sql) then then llx_mytable_*.key.sql
$files = array();
while (($file = readdir($handle))!==false)
{
$files[] = $file;
}
sort($files);
foreach ($files as $file)
{
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{
@@ -648,7 +660,13 @@ abstract class DolibarrModules
rewinddir($handle);
// Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
$files = array();
while (($file = readdir($handle))!==false)
{
$files[] = $file;
}
sort($files);
foreach ($files as $file)
{
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
{
@@ -660,7 +678,13 @@ abstract class DolibarrModules
rewinddir($handle);
// Run update_xxx.sql files
$files = array();
while (($file = readdir($handle))!==false)
{
$files[] = $file;
}
sort($files);
foreach ($files as $file)
{
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
{

View File

@@ -771,9 +771,10 @@ class pdf_einstein extends ModelePDFCommandes
// If payment mode not forced or forced to VIR, show payment with BAN
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
{
if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
if (! empty($object->fk_account) || ! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
{
$bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank);
$bankid=(empty($object->fk_account)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_account);
if (! empty($object->fk_bank)) $bankid=$object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
$account = new Account($this->db);
$account->fetch($bankid);

View File

@@ -191,7 +191,7 @@ class pdf_crabe extends ModelePDFFactures
$objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,'product') . $object->lines[$i]->fk_product ."/photos/";
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
$dir = $conf->product->dir_output.'/'.$pdir;
$realpath='';
@@ -958,9 +958,10 @@ class pdf_crabe extends ModelePDFFactures
// If payment mode not forced or forced to VIR, show payment with BAN
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
{
if (! empty($object->fk_account) || ! empty($conf->global->FACTURE_RIB_NUMBER))
if (! empty($object->fk_account) || ! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
{
$bankid=(empty($object->fk_account)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_account);
if (! empty($object->fk_bank)) $bankid=$object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
$account = new Account($this->db);
$account->fetch($bankid);

View File

@@ -75,6 +75,7 @@ class mailing_contacts1 extends MailingTargets
$statssql[0].= " WHERE c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND c.email != ''"; // Note that null != '' is false
$statssql[0].= " AND c.no_email = 0";
$statssql[0].= " AND c.statut = 1";
return $statssql;
}
@@ -98,6 +99,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@@ -204,6 +206,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email <> ''";
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
$sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
foreach($filtersarray as $key)
{

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