Compare commits
323 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74be7bf334 | ||
|
|
ea0bf44670 | ||
|
|
e7ced32245 | ||
|
|
d8796e4cc7 | ||
|
|
38ed83d05f | ||
|
|
958c3851d7 | ||
|
|
055fe5e275 | ||
|
|
67a2f6ee91 | ||
|
|
2dab183240 | ||
|
|
f928062e2b | ||
|
|
d714d32424 | ||
|
|
5246557493 | ||
|
|
3ba97627ff | ||
|
|
c06c2d0464 | ||
|
|
3c5903f75a | ||
|
|
ba4f306c83 | ||
|
|
269fb87342 | ||
|
|
20a1863866 | ||
|
|
bc29898621 | ||
|
|
4cddb0175b | ||
|
|
2f8afda29d | ||
|
|
64ff12c009 | ||
|
|
efb6e87f3f | ||
|
|
5862037d34 | ||
|
|
c46f9350a5 | ||
|
|
c26c8c7fcc | ||
|
|
c14349f1ea | ||
|
|
35145cd739 | ||
|
|
440df980ea | ||
|
|
6373c82559 | ||
|
|
dba952e596 | ||
|
|
310ecb1e09 | ||
|
|
e5b1e214bc | ||
|
|
b6b8a9e0f0 | ||
|
|
eb497960fc | ||
|
|
6469a31a32 | ||
|
|
62dc6814a3 | ||
|
|
4e9d06785c | ||
|
|
e2ba24826f | ||
|
|
4180862fec | ||
|
|
f385f8bcfa | ||
|
|
9a95401473 | ||
|
|
1eca2d33c0 | ||
|
|
87c240252c | ||
|
|
5bdc4a83b1 | ||
|
|
bd69830cbd | ||
|
|
fa3af485ef | ||
|
|
29b8919a40 | ||
|
|
77a0359cfc | ||
|
|
295eb533f8 | ||
|
|
4e206fa80b | ||
|
|
48ed8d4408 | ||
|
|
2cbfb69f9b | ||
|
|
a01a85c3f6 | ||
|
|
0440e313d2 | ||
|
|
ef2337a338 | ||
|
|
d55f138fb1 | ||
|
|
43f003f6f9 | ||
|
|
4689b0cc11 | ||
|
|
5237a2afc7 | ||
|
|
7d382f7997 | ||
|
|
d79fb71987 | ||
|
|
572be23fc1 | ||
|
|
5fb6705b5c | ||
|
|
9e9f32e3bf | ||
|
|
6a90431cf1 | ||
|
|
fd3ba13130 | ||
|
|
bf6b48f5a0 | ||
|
|
afe4057a97 | ||
|
|
be8e7515a1 | ||
|
|
c64c1a0201 | ||
|
|
420bfd8301 | ||
|
|
c51bc09e39 | ||
|
|
334c14d088 | ||
|
|
d192ed9676 | ||
|
|
6f4cfc86e8 | ||
|
|
0211ad64ee | ||
|
|
5c1daa6135 | ||
|
|
fc8f4b4d6e | ||
|
|
bba8db2b60 | ||
|
|
686a923974 | ||
|
|
d68db2a844 | ||
|
|
8a02c8288b | ||
|
|
9b85a70013 | ||
|
|
b3e3cc14a7 | ||
|
|
6bd13b8071 | ||
|
|
2c6aeac64f | ||
|
|
e79fe7401f | ||
|
|
4cdf17d8b5 | ||
|
|
ff1f7f1a48 | ||
|
|
6c2b46f939 | ||
|
|
05686b532c | ||
|
|
5d585fa04a | ||
|
|
a5b9a210ce | ||
|
|
f08d52b0e8 | ||
|
|
68aac4476c | ||
|
|
e9facbf108 | ||
|
|
6b8707516e | ||
|
|
1a0ad2d1c9 | ||
|
|
727db56576 | ||
|
|
00b610d87f | ||
|
|
8aaa1993c6 | ||
|
|
0251728e28 | ||
|
|
84f5b72d2b | ||
|
|
87fad70f4a | ||
|
|
62dd936b08 | ||
|
|
df39a1054e | ||
|
|
9fa2afb44b | ||
|
|
4e4efc97f0 | ||
|
|
c76af687ed | ||
|
|
1acaf44acf | ||
|
|
a9a3c3b97f | ||
|
|
a8e52f9c54 | ||
|
|
f8f600828d | ||
|
|
fd9f51df88 | ||
|
|
4e9a378f0d | ||
|
|
9f1fa7e212 | ||
|
|
252f00dfe7 | ||
|
|
3f8e9bd181 | ||
|
|
7b7d27920d | ||
|
|
856bfaaa3a | ||
|
|
4fab809604 | ||
|
|
279e7028fb | ||
|
|
f9485bd25b | ||
|
|
b27989d5d4 | ||
|
|
c675f88dda | ||
|
|
dea095dbf7 | ||
|
|
53c9cb38ef | ||
|
|
be9027df1a | ||
|
|
497c751fb9 | ||
|
|
1f2a86078a | ||
|
|
0841feda47 | ||
|
|
0e343ae3b2 | ||
|
|
6cce2860c2 | ||
|
|
425e7ce808 | ||
|
|
8f5d9597f8 | ||
|
|
72cabe2fc3 | ||
|
|
8426e2e506 | ||
|
|
c460873c85 | ||
|
|
1f742c7464 | ||
|
|
d4a85d9fba | ||
|
|
e776f685ba | ||
|
|
6ea05aa311 | ||
|
|
c208fccf35 | ||
|
|
d92604f646 | ||
|
|
53d86e1661 | ||
|
|
9f2bcf0e4f | ||
|
|
f1cf629b80 | ||
|
|
afbee44993 | ||
|
|
3fdd59bf0a | ||
|
|
41354ca00d | ||
|
|
d24f5538f9 | ||
|
|
e3f225e038 | ||
|
|
bf262c2cae | ||
|
|
9dd4a23365 | ||
|
|
c9d8e041d5 | ||
|
|
78cb31e55f | ||
|
|
143c1e03f8 | ||
|
|
7b2fbdd638 | ||
|
|
c20296f963 | ||
|
|
839d4c2a9a | ||
|
|
c2cc9711f7 | ||
|
|
780a5a1996 | ||
|
|
406b271275 | ||
|
|
0df42bc5ea | ||
|
|
d54650905b | ||
|
|
75e337e8d9 | ||
|
|
8c17668665 | ||
|
|
36a6a77d82 | ||
|
|
9eab5206d4 | ||
|
|
8f28e7cf1c | ||
|
|
8febf25c23 | ||
|
|
4e5ca151b5 | ||
|
|
bea789edfe | ||
|
|
d737fd1fd2 | ||
|
|
31acab92a6 | ||
|
|
fbc3efb5a9 | ||
|
|
9e7ded94af | ||
|
|
a9e55fd08f | ||
|
|
d19a9f66b3 | ||
|
|
996c9ca2ba | ||
|
|
b6a83ed5a6 | ||
|
|
322a2a54b8 | ||
|
|
10b481f47f | ||
|
|
5acf961f23 | ||
|
|
e22fb3c538 | ||
|
|
8a9c9f49d5 | ||
|
|
4c1e018ded | ||
|
|
f11fd22809 | ||
|
|
5ad665d00c | ||
|
|
60c0338d64 | ||
|
|
e76124add5 | ||
|
|
fd29bb34be | ||
|
|
4201e8b032 | ||
|
|
e2a88cd010 | ||
|
|
b57c156b60 | ||
|
|
076f2ed9d1 | ||
|
|
72c31c0fa9 | ||
|
|
4da8fb901b | ||
|
|
1907e5da54 | ||
|
|
34adc60d26 | ||
|
|
9c28894ec3 | ||
|
|
0c64fa04bc | ||
|
|
74fb718b77 | ||
|
|
9901406634 | ||
|
|
71ccdb5cfb | ||
|
|
747c49862c | ||
|
|
7037679718 | ||
|
|
f0466ba313 | ||
|
|
a96b92a618 | ||
|
|
d59f62cd75 | ||
|
|
673ce059e6 | ||
|
|
e209fb23a2 | ||
|
|
fecd213bb8 | ||
|
|
bb0de1dcad | ||
|
|
766b8535ae | ||
|
|
4f5e207f08 | ||
|
|
c05df2ab7e | ||
|
|
a585698b69 | ||
|
|
0b7305d21a | ||
|
|
453ed8a05e | ||
|
|
0f27edad5d | ||
|
|
188489c8ef | ||
|
|
fa9103fc97 | ||
|
|
1e2d06bcd1 | ||
|
|
ff5f823bef | ||
|
|
6f128907fe | ||
|
|
1454d942ef | ||
|
|
e1b969cb90 | ||
|
|
6aa13d4189 | ||
|
|
d119e04963 | ||
|
|
9ecc8e5e6b | ||
|
|
dd88a799fb | ||
|
|
c707c899c1 | ||
|
|
fef8203e65 | ||
|
|
a3647bea4e | ||
|
|
5a2dc88d42 | ||
|
|
b99ef6b27c | ||
|
|
4e77a651d4 | ||
|
|
9644e242ae | ||
|
|
5f765419ea | ||
|
|
f3ba115ef0 | ||
|
|
7424b521ed | ||
|
|
8dcd6158e3 | ||
|
|
b8bf21b905 | ||
|
|
df0e64eb7c | ||
|
|
9d0cd148a8 | ||
|
|
dcf3c00023 | ||
|
|
c0433928c6 | ||
|
|
b5b90d1639 | ||
|
|
3ee5920947 | ||
|
|
9e185eec75 | ||
|
|
7cfef16c24 | ||
|
|
f8f1f4fd2b | ||
|
|
f3a28682ea | ||
|
|
d633118bd4 | ||
|
|
b222800012 | ||
|
|
206d6d0f7e | ||
|
|
84fa92045c | ||
|
|
00447f8e72 | ||
|
|
2d35124c71 | ||
|
|
12a08ae4e1 | ||
|
|
3ff8b3e437 | ||
|
|
8309ed5c12 | ||
|
|
a70e73a963 | ||
|
|
f1ab0d36c5 | ||
|
|
00b858e644 | ||
|
|
dc89e6c516 | ||
|
|
077c696c09 | ||
|
|
90b78702e5 | ||
|
|
c125ba0d66 | ||
|
|
75daddbbe2 | ||
|
|
d5ab71ad0f | ||
|
|
178208918f | ||
|
|
c2bdd9b465 | ||
|
|
fe6af7d8eb | ||
|
|
30bfb0eee3 | ||
|
|
f2e2edbc64 | ||
|
|
a71cef3aa6 | ||
|
|
7d4a9b17b6 | ||
|
|
de04f3022c | ||
|
|
49f671eb1d | ||
|
|
1901b2fb3b | ||
|
|
f9973d13b4 | ||
|
|
e85ddbb470 | ||
|
|
378da082bd | ||
|
|
5f507cbbd8 | ||
|
|
8699776930 | ||
|
|
e974b07b09 | ||
|
|
f72f652d98 | ||
|
|
14b6a74b2d | ||
|
|
8dd843ab8f | ||
|
|
57521f628c | ||
|
|
8bb832d06b | ||
|
|
099e3f0376 | ||
|
|
313d9ddacd | ||
|
|
6ffdbf91ec | ||
|
|
7d8013b371 | ||
|
|
38bae655ea | ||
|
|
e36928fd65 | ||
|
|
8251807408 | ||
|
|
30ccd28d01 | ||
|
|
7f60abdf7b | ||
|
|
cb31ab3e2b | ||
|
|
3818bff86a | ||
|
|
e80f29c271 | ||
|
|
8fd9d2a7ce | ||
|
|
7b8096d367 | ||
|
|
4e19500cce | ||
|
|
91bac76511 | ||
|
|
a0fb27bd80 | ||
|
|
95cfce925f | ||
|
|
2d2f59fe3f | ||
|
|
d985c77eca | ||
|
|
e0a88fabd9 | ||
|
|
36beb289f3 | ||
|
|
ca2b66ffb3 | ||
|
|
c75f62ddb7 | ||
|
|
b4c964760d | ||
|
|
3b01b8cb47 | ||
|
|
334766d194 | ||
|
|
27a85c074e | ||
|
|
1d4c747aa2 |
76
ChangeLog
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 & 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>
|
||||
|
||||
@@ -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 & 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>
|
||||
|
||||
BIN
dev/initdata/img/alberteinstein.jpg
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
dev/initdata/img/bookkeepercompany.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
dev/initdata/img/johndoe.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
dev/initdata/img/mariecurie.jpg
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
dev/initdata/img/mybigcompany.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
dev/initdata/img/pierrecurie.jpg
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
dev/initdata/img/printcompany.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
@@ -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)';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
BIN
doc/images/dolibarr_192x192.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
2
htdocs/.gitignore
vendored
@@ -13,3 +13,5 @@
|
||||
/ultimatepdf*
|
||||
/lead
|
||||
/dolimed*
|
||||
/allscreens*
|
||||
/ecommerce/
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
@@ -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">';
|
||||
|
||||
@@ -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\">";
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.= ")";
|
||||
}
|
||||
|
||||
@@ -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__'] = '';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.'&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.'&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.'&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.'&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.'&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");
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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 . '&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&origin=' . $object->element . '&originid=' . $object->id . '&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&origin=' . $object->element . '&originid=' . $object->id . '&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 . '&action=classifybilled&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__'] = '';
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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__'] = '';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
*/
|
||||
|
||||
@@ -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")).'">';
|
||||
|
||||
@@ -952,7 +952,7 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($sep > 0) print ' '; // 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> </td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
|
||||
@@ -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 ' <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> <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 ' <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> <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__'] = '';
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.='&search_paymentmode='.urlencode($search_paymentmode);
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
||||
if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||
if ($search_status) $param.='&search_status='.urlencode($search_status);
|
||||
if ($late) $param.='&late='.urlencode($late);
|
||||
if ($mode) $param.='&mode='.urlencode($mode);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"',
|
||||
|
||||
@@ -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"',
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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')))
|
||||
{
|
||||
|
||||
@@ -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)?'>':' ').'</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;
|
||||
}
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
64
htdocs/core/js/select2_locale.js.php
Normal 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();
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
{
|
||||
|
||||
@@ -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.'&sortfield='.$sortfield.'&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.'&sortfield='.$sortfield.'&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.'&sortfield='.$sortfield.'&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.'&sortfield='.$sortfield.'&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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>";
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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&action=create&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__);
|
||||
|
||||
@@ -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')
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||