forked from Wavyzz/dolibarr
Compare commits
335 Commits
phpstan-ba
...
3.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e918d9115e | ||
|
|
8ee98b4846 | ||
|
|
1e5a861766 | ||
|
|
fa668910c2 | ||
|
|
ff143e9bc3 | ||
|
|
f3b952ef2d | ||
|
|
ffa593eda2 | ||
|
|
114ee9dc07 | ||
|
|
7847e544a4 | ||
|
|
637aa69e37 | ||
|
|
715c88b52e | ||
|
|
d4e1300620 | ||
|
|
74579860c7 | ||
|
|
a2cd3e5969 | ||
|
|
6222d8b2cb | ||
|
|
a3fb6efe69 | ||
|
|
54a57941a0 | ||
|
|
8c1c301a3d | ||
|
|
aaa19c23ec | ||
|
|
4bcee36349 | ||
|
|
b5406c704a | ||
|
|
93eaf722a1 | ||
|
|
5b74a5aa9a | ||
|
|
8cbdcb9c20 | ||
|
|
6c2b1f5244 | ||
|
|
2548c1d2a4 | ||
|
|
2297e940b3 | ||
|
|
9635f5858a | ||
|
|
c4f40462d1 | ||
|
|
c0b5a25430 | ||
|
|
0a0e426e40 | ||
|
|
4fee09738b | ||
|
|
28116d13fb | ||
|
|
f298f302ff | ||
|
|
2af2280006 | ||
|
|
11c2a7c076 | ||
|
|
bf8b8f180f | ||
|
|
745acdf313 | ||
|
|
609d01d386 | ||
|
|
e4a32f2d23 | ||
|
|
db04e91f06 | ||
|
|
eaac97256e | ||
|
|
f4817de2d0 | ||
|
|
b2b5505304 | ||
|
|
051d6f5ce8 | ||
|
|
7fdf1d8f3b | ||
|
|
b4123e4e4c | ||
|
|
99ea8e6bf0 | ||
|
|
9229f8799a | ||
|
|
e99e7973df | ||
|
|
81f58fe8ff | ||
|
|
eaf3e2a3ec | ||
|
|
8e912dde63 | ||
|
|
1d12f8e188 | ||
|
|
7c54bbfd2e | ||
|
|
5e00e2dc15 | ||
|
|
7586204aad | ||
|
|
f32e92dbcd | ||
|
|
ec33c4a999 | ||
|
|
4987bec341 | ||
|
|
981aa4e0df | ||
|
|
1b926f6a7e | ||
|
|
508f581bca | ||
|
|
0374d9836f | ||
|
|
ee15efdd7e | ||
|
|
98025222e0 | ||
|
|
575661eddc | ||
|
|
126f170122 | ||
|
|
666fc9b91d | ||
|
|
692f19db2a | ||
|
|
88293c9ab8 | ||
|
|
dd80a7854b | ||
|
|
a34358fe00 | ||
|
|
420c7309f7 | ||
|
|
123fab92d3 | ||
|
|
6671e8cf5b | ||
|
|
4126b6149f | ||
|
|
f822a03a82 | ||
|
|
f0a15ff975 | ||
|
|
737eb57b33 | ||
|
|
4e1d689bf8 | ||
|
|
0ffc86fe02 | ||
|
|
22a26b9e2b | ||
|
|
8b1b3ef1b3 | ||
|
|
fe212f729f | ||
|
|
26c3bd4993 | ||
|
|
f142d4f0f1 | ||
|
|
42343a1206 | ||
|
|
6110ec4b2a | ||
|
|
6a610e6518 | ||
|
|
8abbf6a537 | ||
|
|
b75f610ec1 | ||
|
|
72459ac35c | ||
|
|
52ee7183d9 | ||
|
|
5741b19203 | ||
|
|
f07557f6ec | ||
|
|
0317ae75de | ||
|
|
5311001ae2 | ||
|
|
e76290c767 | ||
|
|
385d75f0e2 | ||
|
|
8d8629eab9 | ||
|
|
390214e265 | ||
|
|
99b300f01b | ||
|
|
025e887e04 | ||
|
|
e54bfd21b7 | ||
|
|
d9dea81e75 | ||
|
|
86801c2e8a | ||
|
|
6f11d1e28e | ||
|
|
8336e81b95 | ||
|
|
57b12edbbb | ||
|
|
731cb8d806 | ||
|
|
1c00dead1c | ||
|
|
f5ad2692f5 | ||
|
|
2a3c726f41 | ||
|
|
635f9ce3aa | ||
|
|
919ea45ccb | ||
|
|
ad8bf92d98 | ||
|
|
130c89a18c | ||
|
|
dfbe0c78dc | ||
|
|
0d47653e14 | ||
|
|
500d60fc7e | ||
|
|
608ad7c688 | ||
|
|
d34a653734 | ||
|
|
eee0d1aa07 | ||
|
|
8348de5591 | ||
|
|
cb7c17e11a | ||
|
|
468d79e8c4 | ||
|
|
a06a1cb25c | ||
|
|
9aebe0d1ba | ||
|
|
d452049790 | ||
|
|
fc1087ac8d | ||
|
|
a069c1ce63 | ||
|
|
180ca71367 | ||
|
|
5f42ab9d65 | ||
|
|
6a590ffec8 | ||
|
|
829b8e98ad | ||
|
|
ab4a1af224 | ||
|
|
1970a5dda9 | ||
|
|
51c1cfed8a | ||
|
|
86fb0aa1b7 | ||
|
|
598e87ab62 | ||
|
|
03c82f3dee | ||
|
|
115d08b4d7 | ||
|
|
424eabd13c | ||
|
|
41f73f57a3 | ||
|
|
ab7ffebf83 | ||
|
|
a2a20ab527 | ||
|
|
216d786638 | ||
|
|
c26f78516c | ||
|
|
1900a96ca6 | ||
|
|
0324b532f8 | ||
|
|
fa0d06dd8c | ||
|
|
e291c209e6 | ||
|
|
d8c92fd210 | ||
|
|
738d327fcf | ||
|
|
5e1ebe9de3 | ||
|
|
cb6f960b42 | ||
|
|
96e05a0363 | ||
|
|
ceccedcac0 | ||
|
|
5c5682998c | ||
|
|
cd19b1f2d6 | ||
|
|
035bc672a8 | ||
|
|
d8004865b1 | ||
|
|
5c9300ac39 | ||
|
|
47e5bd9bf1 | ||
|
|
5c0f95db44 | ||
|
|
1c06114383 | ||
|
|
af97652c9b | ||
|
|
cc39ca7287 | ||
|
|
e1db0ef946 | ||
|
|
6e90b6c082 | ||
|
|
9dd6c64b38 | ||
|
|
4b49bae945 | ||
|
|
5240a5d7cf | ||
|
|
05da13c469 | ||
|
|
fbdccb217a | ||
|
|
092f0dcf77 | ||
|
|
3617a36f06 | ||
|
|
0a7cdf53e7 | ||
|
|
e113c84745 | ||
|
|
9f8d5f75a6 | ||
|
|
769ae718f8 | ||
|
|
920b521a2c | ||
|
|
0baaf26d2d | ||
|
|
29bb629ded | ||
|
|
b96bd1a929 | ||
|
|
14243f4120 | ||
|
|
3c04c18a54 | ||
|
|
588388f2e8 | ||
|
|
8021b51fe1 | ||
|
|
c5772a56eb | ||
|
|
b931a59da1 | ||
|
|
4392776bfb | ||
|
|
da921bb973 | ||
|
|
eb7fd25ced | ||
|
|
973c98aa31 | ||
|
|
3f59e585d0 | ||
|
|
2b1ace1b8c | ||
|
|
ecc11e39b3 | ||
|
|
6a275e9c64 | ||
|
|
73c9295178 | ||
|
|
fdbf579d25 | ||
|
|
f0f200295a | ||
|
|
0b935cabdf | ||
|
|
4356eb8b16 | ||
|
|
f46c148fc6 | ||
|
|
6cf20da188 | ||
|
|
c9cd90b19e | ||
|
|
cd51211292 | ||
|
|
5c25d43473 | ||
|
|
eabf281c20 | ||
|
|
3972267c3b | ||
|
|
f4433923b7 | ||
|
|
a4853e4d31 | ||
|
|
296d8e490d | ||
|
|
23da34b339 | ||
|
|
a8409589bc | ||
|
|
73437223d8 | ||
|
|
fa95cb2540 | ||
|
|
c4ae5968b2 | ||
|
|
850cf003f1 | ||
|
|
133ef22ef8 | ||
|
|
416c2cb93e | ||
|
|
74ba59f8d3 | ||
|
|
4a1b8d2c70 | ||
|
|
11bf3e9f4d | ||
|
|
594d8db7cf | ||
|
|
d91663e97b | ||
|
|
aa9ccb41cc | ||
|
|
8b534d1391 | ||
|
|
be18f46b4a | ||
|
|
3ed533fc7e | ||
|
|
8baee6658f | ||
|
|
19920dd2a7 | ||
|
|
6ccb3dcc98 | ||
|
|
bbef42e594 | ||
|
|
1761aca350 | ||
|
|
80ed70d32e | ||
|
|
c41f26fb0a | ||
|
|
8f32052fe1 | ||
|
|
8796cc5aad | ||
|
|
9f5687decb | ||
|
|
3e27fb9d97 | ||
|
|
e40cef2b85 | ||
|
|
98605f08ac | ||
|
|
bf64059357 | ||
|
|
767da4d86a | ||
|
|
e4b445fcb1 | ||
|
|
20dea64979 | ||
|
|
e1b50e4456 | ||
|
|
014cf0b1e6 | ||
|
|
c10a1d7d4e | ||
|
|
1b644466b2 | ||
|
|
818742f8d1 | ||
|
|
66eda574ea | ||
|
|
eba944b80b | ||
|
|
9c823a7310 | ||
|
|
0525fb8f64 | ||
|
|
115e5e5243 | ||
|
|
4f64548061 | ||
|
|
820722f113 | ||
|
|
49d98fcb6f | ||
|
|
864c15afe1 | ||
|
|
d9e7c6b71d | ||
|
|
222d123800 | ||
|
|
8dc2a9b2c9 | ||
|
|
e2fcf23985 | ||
|
|
65b543c1bf | ||
|
|
ed5f26ac02 | ||
|
|
462fddd63a | ||
|
|
993c8a8bab | ||
|
|
16a5028904 | ||
|
|
c3460f2d41 | ||
|
|
a9918d8818 | ||
|
|
d2fb25ef24 | ||
|
|
f097b11967 | ||
|
|
89adc77bd1 | ||
|
|
f42250d0be | ||
|
|
b02b67bce2 | ||
|
|
ff02f5ca03 | ||
|
|
92897d5cca | ||
|
|
f6870bcaa5 | ||
|
|
f46a6e62fd | ||
|
|
ec3e706051 | ||
|
|
f48cb64447 | ||
|
|
380cfe87b8 | ||
|
|
0c51cc4d6e | ||
|
|
306aec52c3 | ||
|
|
4bc4316d86 | ||
|
|
b2ba52247c | ||
|
|
8a1a542d95 | ||
|
|
a34206e6e6 | ||
|
|
da3e3a6616 | ||
|
|
49368b5d5b | ||
|
|
d690261eba | ||
|
|
cfbe8515c1 | ||
|
|
7811037f48 | ||
|
|
a5c350f169 | ||
|
|
0829fd31ef | ||
|
|
93367e9d57 | ||
|
|
1b31edf654 | ||
|
|
98b62da53e | ||
|
|
697d314970 | ||
|
|
08b1f16306 | ||
|
|
66f0676909 | ||
|
|
1cb871e295 | ||
|
|
5320e8c2c9 | ||
|
|
12812ef28b | ||
|
|
f790f36a62 | ||
|
|
86f811aeee | ||
|
|
7633e2ecf4 | ||
|
|
2adc0e5710 | ||
|
|
ef08148a47 | ||
|
|
6ac1deb70b | ||
|
|
a84544e916 | ||
|
|
f11b9bbf6d | ||
|
|
dcd2e50ac4 | ||
|
|
5036cae36c | ||
|
|
61871f6f7b | ||
|
|
9d21bdfddb | ||
|
|
2d936e86c0 | ||
|
|
7360bc1b6f | ||
|
|
3a1da723e2 | ||
|
|
2a96589009 | ||
|
|
69aee95b21 | ||
|
|
8a58ab981e | ||
|
|
944277bc5e | ||
|
|
9f81bd2c72 | ||
|
|
2d42ab0d35 | ||
|
|
333e7092ab | ||
|
|
5baa28b3bb | ||
|
|
0831bbd3bf | ||
|
|
7d1cfe36e0 | ||
|
|
5ae3a2d35a | ||
|
|
916a9f7a39 |
@@ -2,7 +2,9 @@
|
|||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Dolibarr is distributed under GPL terms 2.0 (See COPYING file)
|
Dolibarr is released under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the License,
|
||||||
|
or (at your option) any later version
|
||||||
|
|
||||||
However it uses some external libraries under different licences. This is compatibility summary:
|
However it uses some external libraries under different licences. This is compatibility summary:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
--------------------------------------------------------------
|
||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
|
$Id$
|
||||||
|
--------------------------------------------------------------
|
||||||
|
|
||||||
***** ChangeLog for 3.0 compared to 2.9 *****
|
***** ChangeLog for 3.0 compared to 2.9 *****
|
||||||
|
|
||||||
@@ -6,7 +9,7 @@ For users:
|
|||||||
- New: Can edit date of cheque receipts.
|
- New: Can edit date of cheque receipts.
|
||||||
- New: Add Sales journal and Purchase journal report.
|
- New: Add Sales journal and Purchase journal report.
|
||||||
- New: Can create supplier invoice from supplier order.
|
- New: Can create supplier invoice from supplier order.
|
||||||
New: Support login by openid
|
- New: Support login by openid
|
||||||
- New: Support "full day" event in calendar module.
|
- New: Support "full day" event in calendar module.
|
||||||
- New: Add a weather on dashboard.
|
- New: Add a weather on dashboard.
|
||||||
- New: Add a Paypal module.
|
- New: Add a Paypal module.
|
||||||
@@ -69,6 +72,7 @@ For users:
|
|||||||
readers when using "mail php function".
|
readers when using "mail php function".
|
||||||
- Fix: When cloning commercial proposal, due date is creation date + delay
|
- Fix: When cloning commercial proposal, due date is creation date + delay
|
||||||
by default.
|
by default.
|
||||||
|
- Fix: Can edit ordering methods.
|
||||||
|
|
||||||
For translators:
|
For translators:
|
||||||
- New: Update and complete slovenian language sl_SL.
|
- New: Update and complete slovenian language sl_SL.
|
||||||
@@ -84,6 +88,9 @@ For developers:
|
|||||||
- New: Add first Selenium GUI tests.
|
- New: Add first Selenium GUI tests.
|
||||||
- New: Enhance a lot of internal function to build external modules
|
- New: Enhance a lot of internal function to build external modules
|
||||||
more easily.
|
more easily.
|
||||||
|
- New: Add a user field ref_ext in object tables to allow external
|
||||||
|
systems to store their id and make self-developed synchronizing
|
||||||
|
functions easier to build.
|
||||||
- New: Local user timezone is saved into session (not used yet).
|
- New: Local user timezone is saved into session (not used yet).
|
||||||
- New: Works with Mysql 5.5.
|
- New: Works with Mysql 5.5.
|
||||||
- Qual: Menu system code is simpler.
|
- Qual: Menu system code is simpler.
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ makepack-google.conf
|
|||||||
module_google-*.tgz
|
module_google-*.tgz
|
||||||
module_pibarcode-1.0.tgz
|
module_pibarcode-1.0.tgz
|
||||||
*.exe
|
*.exe
|
||||||
|
*.tgz
|
||||||
*.torrent
|
*.torrent
|
||||||
|
*.zip
|
||||||
version-phpsane.txt
|
version-phpsane.txt
|
||||||
makepack-phpsane.conf
|
makepack-phpsane.conf
|
||||||
html
|
html
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Section: web
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Recommends: mozilla | netscape
|
Recommends: mozilla | netscape
|
||||||
Homepage: http://www.dolibarr.org
|
Homepage: http://www.dolibarr.org
|
||||||
Description: Dolibarr ERP/CRM
|
Description: Dolibarr ERP & CRM
|
||||||
Dolibarr ERP/CRM is an open source/free software for
|
Dolibarr ERP/CRM is an open source/free software for
|
||||||
small and medium companies, foundations or freelances. It includes
|
small and medium companies, foundations or freelances. It includes
|
||||||
different features for Enterprise Resource Planning (ERP) and Customer
|
different features for Enterprise Resource Planning (ERP) and Customer
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
# This file is used to add Ubuntu menu entry
|
# This file is used to add Ubuntu menu entry
|
||||||
# It must be saved into directory /usr/share/applications
|
# It must be saved into directory /usr/share/applications
|
||||||
|
Version=1.0
|
||||||
Encoding=UTF-8
|
Encoding=UTF-8
|
||||||
Name=Dolibarr ERP/CRM
|
Name=Dolibarr ERP/CRM
|
||||||
GenericName=Dolibarr ERP/CRM
|
GenericName=Dolibarr ERP/CRM
|
||||||
@@ -10,7 +11,8 @@ Exec=xdg-open http://localhost/dolibarr
|
|||||||
Icon=dolibarr
|
Icon=dolibarr
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
Category=Application;Office
|
Category=Application;Office;
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
|
InitialPreference=5
|
||||||
#NoDisplay=true
|
#NoDisplay=true
|
||||||
#OnlyShowIn=GNOME
|
#OnlyShowIn=GNOME
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# This file seems to be useless for Ubuntu
|
# This file seems to be useless for Ubuntu
|
||||||
# Good way to add menu on Ubuntu is adding file dolibarr.desktop
|
# Good way to add menu on Ubuntu is adding file dolibarr.desktop
|
||||||
?package(dolibarr):needs="X11" section="Applications/File Management" \
|
?package(dolibarr):needs="X11" section="Applications/Office"\
|
||||||
title="Dolibarr" command="/usr/share/dolibarr/build/deb/rundolibarr.sh" icon="/usr/share/pixmaps/dolibarr.xpm"
|
title="Dolibarr ERP & CRM" longtitle="The manager for small and medium enterprises or foundations"\
|
||||||
|
description="Dolibarr ERP & CRM features agenda, orders, invoices and stock management, marketing campaigns, POS, etc."\
|
||||||
|
command="/usr/share/dolibarr/build/deb/rundolibarr.sh" icon="/usr/share/pixmaps/dolibarr.xpm"
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ case "$1" in
|
|||||||
cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config
|
cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create /var/lib/dolibarr/documents
|
||||||
|
mkdir -p /var/lib/dolibarr/documents
|
||||||
|
chown -R www-data.www-data /var/lib/dolibarr/documents;
|
||||||
|
chmod -R 775 /var/lib/dolibarr/documents;
|
||||||
|
chmod -R g+s /var/lib/dolibarr/documents;
|
||||||
|
|
||||||
# Create empty conf.php
|
# Create empty conf.php
|
||||||
if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ]
|
if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ]
|
||||||
then
|
then
|
||||||
@@ -120,18 +126,21 @@ case "$1" in
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Copy icon file
|
# Copy icon file
|
||||||
echo "Copy icon file"
|
#echo "Copy icon file"
|
||||||
fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm"
|
#fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm"
|
||||||
target="/usr/share/pixmaps/"
|
#target="/usr/share/pixmaps/"
|
||||||
cp -p $fileorig $target
|
#cp -f $fileorig $target
|
||||||
|
|
||||||
echo "Install menu entry"
|
#echo "Install menu entry"
|
||||||
# This one is for Gnome ubuntu
|
# This one is for Gnome ubuntu
|
||||||
fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop"
|
#fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop"
|
||||||
target="/usr/share/applications/"
|
#target="/usr/share/applications/"
|
||||||
cp -p $fileorig $target
|
#cp -f $fileorig $target
|
||||||
# Not sure this one is usefull
|
# Not sure this is usefull
|
||||||
if test -x /usr/bin/update-menus; then update-menus; fi
|
if test -x /usr/bin/update-menus; then
|
||||||
|
echo "update-menus"
|
||||||
|
update-menus;
|
||||||
|
fi
|
||||||
|
|
||||||
# TODO Create the file to force parameters in Web installer
|
# TODO Create the file to force parameters in Web installer
|
||||||
#if grep DBHOST /usr/share/dolibarr/htdocs/conf/conf.php > /dev/null
|
#if grep DBHOST /usr/share/dolibarr/htdocs/conf/conf.php > /dev/null
|
||||||
|
|||||||
@@ -221,11 +221,11 @@ case "$1" in
|
|||||||
echo "postrm Force remove of /usr/share/dolibarr/htdocs/install"
|
echo "postrm Force remove of /usr/share/dolibarr/htdocs/install"
|
||||||
rm -fr /usr/share/dolibarr/htdocs/install
|
rm -fr /usr/share/dolibarr/htdocs/install
|
||||||
|
|
||||||
echo "postrm Remove menu entry and image"
|
#echo "postrm Remove menu entry and image"
|
||||||
fileorig="/usr/share/applications/dolibarr.desktop"
|
#fileorig="/usr/share/applications/dolibarr.desktop"
|
||||||
rm -f $fileorig
|
#rm -f $fileorig
|
||||||
fileorig="/usr/share/pixmaps/dolibarr.xpm"
|
#fileorig="/usr/share/pixmaps/dolibarr.xpm"
|
||||||
rm -f $fileorig
|
#rm -f $fileorig
|
||||||
# Not sure this is usefull
|
# Not sure this is usefull
|
||||||
if test -x /usr/bin/update-menus; then update-menus; fi
|
if test -x /usr/bin/update-menus; then update-menus; fi
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -48,8 +48,8 @@
|
|||||||
<release>
|
<release>
|
||||||
<Version>
|
<Version>
|
||||||
<name>stable</name>
|
<name>stable</name>
|
||||||
<created>2010-08-01</created>
|
<created>2011-02-09</created>
|
||||||
<revision>2.9.0</revision>
|
<revision>3.0.0</revision>
|
||||||
</Version>
|
</Version>
|
||||||
</release>
|
</release>
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
; ----- Change this -----
|
; ----- Change this -----
|
||||||
AppName=DoliWamp
|
AppName=DoliWamp
|
||||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
||||||
AppVerName=DoliWamp-3.0.0-beta
|
AppVerName=DoliWamp-3.0.0
|
||||||
; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
||||||
OutputBaseFilename=DoliWamp-3.0.0-beta
|
OutputBaseFilename=DoliWamp-3.0.0
|
||||||
; Define full path from wich all relative path are defined
|
; Define full path from wich all relative path are defined
|
||||||
; You must modify this to put here your dolibarr root directory
|
; You must modify this to put here your dolibarr root directory
|
||||||
SourceDir=C:\Work\Data\Workspace\dolibarr
|
SourceDir=C:\Work\Data\Workspace\dolibarr
|
||||||
@@ -35,7 +35,7 @@ AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
|
|||||||
AppCopyright=Copyright (C) 2008-2011 Laurent Destailleur, NLTechno
|
AppCopyright=Copyright (C) 2008-2011 Laurent Destailleur, NLTechno
|
||||||
DefaultDirName=c:\dolibarr
|
DefaultDirName=c:\dolibarr
|
||||||
DefaultGroupName=Dolibarr
|
DefaultGroupName=Dolibarr
|
||||||
LicenseFile=COPYING
|
;LicenseFile=COPYING
|
||||||
;Compression=none
|
;Compression=none
|
||||||
Compression=lzma
|
Compression=lzma
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use Cwd;
|
|||||||
$PROJECT="dolibarr";
|
$PROJECT="dolibarr";
|
||||||
$MAJOR="3";
|
$MAJOR="3";
|
||||||
$MINOR="0";
|
$MINOR="0";
|
||||||
$BUILD="0-dev"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
$BUILD="0"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||||
$RPMSUBVERSION="1"; # A incrementer au moment de la release
|
$RPMSUBVERSION="1"; # A incrementer au moment de la release
|
||||||
|
|
||||||
@LISTETARGET=("TGZ","ZIP","RPM","DEB","EXE","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
@LISTETARGET=("TGZ","ZIP","RPM","DEB","EXE","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||||
@@ -104,6 +104,10 @@ my $batch=0;
|
|||||||
for (0..@ARGV-1) {
|
for (0..@ARGV-1) {
|
||||||
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||||
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
|
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
|
||||||
|
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
|
||||||
|
$PREFIX=$1;
|
||||||
|
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "Makepack version $VERSION\n";
|
print "Makepack version $VERSION\n";
|
||||||
@@ -215,9 +219,11 @@ if ($nboftargetok) {
|
|||||||
if ($nboftargetneedcvs)
|
if ($nboftargetneedcvs)
|
||||||
{
|
{
|
||||||
print "Go to directory $SOURCE\n";
|
print "Go to directory $SOURCE\n";
|
||||||
|
$olddir=getcwd();
|
||||||
chdir("$SOURCE");
|
chdir("$SOURCE");
|
||||||
print "Run cvs update -P -d\n";
|
print "Run cvs update -P -d\n";
|
||||||
$ret=`cvs update -P -d 2>&1`;
|
$ret=`cvs update -P -d 2>&1`;
|
||||||
|
chdir("$olddir");
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update buildroot if required
|
# Update buildroot if required
|
||||||
@@ -229,9 +235,9 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr "$BUILDROOT"`;
|
$ret=`rm -fr "$BUILDROOT"`;
|
||||||
|
|
||||||
mkdir "$BUILDROOT";
|
mkdir "$BUILDROOT";
|
||||||
mkdir "$BUILDROOT/dolibarr";
|
mkdir "$BUILDROOT/$PROJECT";
|
||||||
print "Copy $SOURCE into $BUILDROOT/dolibarr\n";
|
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
|
||||||
$ret=`cp -pr "$SOURCE" "$BUILDROOT/dolibarr"`;
|
$ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
|
||||||
}
|
}
|
||||||
print "Clean $BUILDROOT\n";
|
print "Clean $BUILDROOT\n";
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
||||||
@@ -263,11 +269,11 @@ if ($nboftargetok) {
|
|||||||
if ($target eq 'SNAPSHOT') {
|
if ($target eq 'SNAPSHOT') {
|
||||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMESNAPSHOT\n";
|
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMESNAPSHOT\n";
|
||||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMESNAPSHOT");
|
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMESNAPSHOT");
|
||||||
unlink("$FILENAMESNAPSHOT.tgz");
|
unlink("$DESTI/$FILENAMESNAPSHOT.tgz");
|
||||||
|
|
||||||
print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
|
print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
|
||||||
#$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
#$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||||
$cmd="tar --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
$cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||||
print $cmd."\n";
|
print $cmd."\n";
|
||||||
$ret=`$cmd`;
|
$ret=`$cmd`;
|
||||||
if ($OS =~ /windows/i)
|
if ($OS =~ /windows/i)
|
||||||
@@ -298,28 +304,36 @@ if ($nboftargetok) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||||
}
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($target eq 'ZIP') {
|
if ($target eq 'ZIP') {
|
||||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ\n";
|
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEZIP\n";
|
||||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMETGZ");
|
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMEZIP");
|
||||||
unlink("$FILENAMEZIP.zip");
|
unlink("$DESTI/$FILENAMEZIP.zip");
|
||||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
|
||||||
|
|
||||||
print "Go to directory $BUILDROOT\n";
|
print "Go to directory $BUILDROOT\n";
|
||||||
|
$olddir=getcwd();
|
||||||
chdir("$BUILDROOT");
|
chdir("$BUILDROOT");
|
||||||
|
$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\\*";
|
||||||
$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMETGZ\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*";
|
|
||||||
print $cmd."\n";
|
print $cmd."\n";
|
||||||
$ret= `$cmd`;
|
$ret= `$cmd`;
|
||||||
#print $ret;
|
chdir("$olddir");
|
||||||
#print "Go to directory $DESTI\n";
|
|
||||||
#chdir("$DESTI");
|
if ($OS =~ /windows/i)
|
||||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
{
|
||||||
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
|
print "Move $FILENAMEZIP.zip to $DESTI/$FILENAMEZIP.zip\n";
|
||||||
|
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "Move $FILENAMEZIP.zip to $DESTI/$FILENAMEZIP.zip\n";
|
||||||
|
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||||
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,7 +343,7 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ\n";
|
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ\n";
|
||||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMETGZ");
|
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMETGZ");
|
||||||
unlink("$FILENAMETGZ.tgz");
|
unlink("$DESTI/$FILENAMETGZ.tgz");
|
||||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||||
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ.tgz" $FILENAMETGZ`;
|
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ.tgz" $FILENAMETGZ`;
|
||||||
|
|
||||||
@@ -358,6 +372,7 @@ if ($nboftargetok) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($target eq 'DEB') {
|
if ($target eq 'DEB') {
|
||||||
|
unlink("$DESTI/$FILENAMEDEB.deb");
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||||
|
|
||||||
@@ -417,18 +432,26 @@ if ($nboftargetok) {
|
|||||||
open (SPECTO,">$BUILDROOT/$PROJECT/DEBIAN/control") || die "Error";
|
open (SPECTO,">$BUILDROOT/$PROJECT/DEBIAN/control") || die "Error";
|
||||||
while (<SPECFROM>) {
|
while (<SPECFROM>) {
|
||||||
$newbuild = $BUILD;
|
$newbuild = $BUILD;
|
||||||
$newbuild =~ s/dev/0/gi;
|
$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||||
$newbuild =~ s/alpha/0/gi;
|
$newbuild =~ s/beta/1/gi; # beta
|
||||||
$newbuild =~ s/beta/1/gi;
|
$newbuild =~ s/rc./2/gi; # rc
|
||||||
if ($newbuild !~ /-/) { $newbuild.='-2'; }
|
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||||
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/;
|
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/;
|
||||||
print SPECTO $_;
|
print SPECTO $_;
|
||||||
}
|
}
|
||||||
close SPECFROM;
|
close SPECFROM;
|
||||||
close SPECTO;
|
close SPECTO;
|
||||||
|
print "Version set to $MAJOR.$MINOR.$newbuild\n";
|
||||||
|
|
||||||
print "Create directory $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents\n";
|
print "Create directory $BUILDROOT/$PROJECT/usr/share/applications\n";
|
||||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/$PROJECT/documents"`;
|
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/applications"`;
|
||||||
|
print "Copy desktop file into $BUILDROOT/$PROJECT/usr/share/applications/dolibarr.desktop\n";
|
||||||
|
$ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT/usr/share/applications/dolibarr.desktop"`;
|
||||||
|
|
||||||
|
print "Create directory $BUILDROOT/$PROJECT/usr/share/pixmaps\n";
|
||||||
|
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/pixmaps"`;
|
||||||
|
print "Copy pixmap file into $BUILDROOT/$PROJECT/usr/share/pixmaps/dolibarr.xpm\n";
|
||||||
|
$ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT/usr/share/pixmaps/dolibarr.xpm"`;
|
||||||
|
|
||||||
#print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
#print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
||||||
#$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
#$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
||||||
@@ -445,6 +468,9 @@ if ($nboftargetok) {
|
|||||||
#print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
#print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
||||||
#$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
#$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
||||||
|
|
||||||
|
print "Create directory $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents\n";
|
||||||
|
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/$PROJECT/documents"`;
|
||||||
|
|
||||||
print "Set permissions/owners on files/dir\n";
|
print "Set permissions/owners on files/dir\n";
|
||||||
$ret=`chown -R root.root $BUILDROOT/$PROJECT`;
|
$ret=`chown -R root.root $BUILDROOT/$PROJECT`;
|
||||||
$ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`;
|
$ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`;
|
||||||
@@ -454,17 +480,30 @@ if ($nboftargetok) {
|
|||||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/DEBIAN`;
|
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/DEBIAN`;
|
||||||
|
|
||||||
print "Go to directory $BUILDROOT\n";
|
print "Go to directory $BUILDROOT\n";
|
||||||
|
$olddir=getcwd();
|
||||||
chdir("$BUILDROOT");
|
chdir("$BUILDROOT");
|
||||||
|
|
||||||
$cmd="dpkg -b $BUILDROOT/$PROJECT $BUILDROOT/${FILENAMEDEB}.deb";
|
$cmd="dpkg -b $BUILDROOT/$PROJECT $BUILDROOT/${FILENAMEDEB}.deb";
|
||||||
print "Launch DEB build ($cmd)\n";
|
print "Launch DEB build ($cmd)\n";
|
||||||
$ret=`$cmd`;
|
$ret=`$cmd`;
|
||||||
print $ret."\n";
|
print $ret."\n";
|
||||||
|
chdir("$olddir");
|
||||||
|
|
||||||
|
if ($OS =~ /windows/i)
|
||||||
|
{
|
||||||
|
print "Move ${FILENAMEDEB}.deb to $BUILDROOT/${FILENAMEDEB}.deb\n";
|
||||||
|
$ret=`mv "$BUILDROOT/${FILENAMEDEB}.deb" "$DESTI/${FILENAMEDEB}.deb"`;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "Move ${FILENAMEDEB}.deb to $BUILDROOT/${FILENAMEDEB}.deb\n";
|
||||||
|
$ret=`mv "$BUILDROOT/${FILENAMEDEB}.deb" "$DESTI/${FILENAMEDEB}.deb"`;
|
||||||
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($target eq 'EXE') {
|
if ($target eq 'EXE') {
|
||||||
unlink "$FILENAMEEXE.exe";
|
unlink "$DESTI/$FILENAMEEXE.exe";
|
||||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
||||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
||||||
print "$command\n";
|
print "$command\n";
|
||||||
@@ -476,7 +515,7 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
if ($target eq 'EXEDOLIWAMP')
|
if ($target eq 'EXEDOLIWAMP')
|
||||||
{
|
{
|
||||||
unlink "$FILENAMEEXEDOLIWAMP.exe";
|
unlink "$DESTI/$FILENAMEEXEDOLIWAMP.exe";
|
||||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||||
$cmd= "iscc.exe \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"";
|
$cmd= "iscc.exe \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"";
|
||||||
print "$cmd\n";
|
print "$cmd\n";
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ $PROJECT="mymodule";
|
|||||||
@LISTETARGET=("TGZ"); # Possible packages
|
@LISTETARGET=("TGZ"); # Possible packages
|
||||||
%REQUIREMENTTARGET=( # Tool requirement for each package
|
%REQUIREMENTTARGET=( # Tool requirement for each package
|
||||||
"TGZ"=>"tar",
|
"TGZ"=>"tar",
|
||||||
|
"ZIP"=>"7z"
|
||||||
);
|
);
|
||||||
%ALTERNATEPATH=(
|
%ALTERNATEPATH=(
|
||||||
);
|
);
|
||||||
@@ -68,28 +69,22 @@ $BUILDROOT="$TEMP/dolibarr-buildroot";
|
|||||||
my $copyalreadydone=0;
|
my $copyalreadydone=0;
|
||||||
my $batch=0;
|
my $batch=0;
|
||||||
|
|
||||||
print "Makepack module version $VERSION\n";
|
for (0..@ARGV-1) {
|
||||||
print "Enter name for your module (mymodule, mywonderfulmondule, ...) : ";
|
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||||
$PROJECT=<STDIN>;
|
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
|
||||||
chomp($PROJECT);
|
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
|
||||||
print "Move to ".$DIR." directory.\n";
|
$PREFIX=$1;
|
||||||
chdir($DIR);
|
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||||
|
}
|
||||||
if (! -f "makepack-".$PROJECT.".conf")
|
|
||||||
{
|
|
||||||
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
|
|
||||||
print "\n";
|
|
||||||
print "For help on building a module package, see web page\n";
|
|
||||||
print "http://wiki.dolibarr.org/index.php/Module_development#Create_a_package_to_distribute_and_install_your_module\n";
|
|
||||||
print "makepack-dolibarrmodule.pl aborted.\n";
|
|
||||||
sleep 2;
|
|
||||||
exit 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "Makepack for modules version $VERSION\n";
|
||||||
|
|
||||||
# Ask and set version $MAJOR and $MINOR
|
# Ask and set version $MAJOR and $MINOR
|
||||||
print "Enter value for version: ";
|
print "Enter value for version: ";
|
||||||
$PROJVERSION=<STDIN>;
|
$PROJVERSION=<STDIN>;
|
||||||
chomp($PROJVERSION);
|
chomp($PROJVERSION);
|
||||||
($MAJOR,$MINOR)=split(/\./,$PROJVERSION,2);
|
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
|
||||||
if ($MINOR eq '')
|
if ($MINOR eq '')
|
||||||
{
|
{
|
||||||
print "Enter value for minor version: ";
|
print "Enter value for minor version: ";
|
||||||
@@ -97,30 +92,74 @@ if ($MINOR eq '')
|
|||||||
chomp($MINOR);
|
chomp($MINOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$FILENAME="$PROJECT";
|
# Ask module
|
||||||
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR";
|
print "Enter name for your module (mymodule, mywonderfulmondule, ...) : ";
|
||||||
if (-d "/usr/src/redhat") {
|
$PROJECTINPUT=<STDIN>;
|
||||||
# redhat
|
chomp($PROJECTINPUT);
|
||||||
$RPMDIR="/usr/src/redhat";
|
print "Move to ".$DIR." directory.\n";
|
||||||
}
|
chdir($DIR);
|
||||||
if (-d "/usr/src/RPM") {
|
|
||||||
# mandrake
|
|
||||||
$RPMDIR="/usr/src/RPM";
|
|
||||||
}
|
|
||||||
|
|
||||||
$SOURCE="$DIR/..";
|
$SOURCE="$DIR/..";
|
||||||
$DESTI="$SOURCE/build";
|
$DESTI="$SOURCE/build";
|
||||||
|
|
||||||
|
print "Source directory: $SOURCE\n";
|
||||||
|
print "Target directory: $DESTI\n";
|
||||||
|
|
||||||
# Choose package targets
|
my @PROJECTLIST=();
|
||||||
#-----------------------
|
if ($PROJECTINPUT eq "all")
|
||||||
$target="TGZ"; # Dolibarr modules are tgz format
|
{
|
||||||
$CHOOSEDTARGET{uc($target)}=1;
|
opendir(DIR, $DIR) || return;
|
||||||
|
local @rv = grep { /^makepack\-(.*)\.conf$/ } sort readdir(DIR);
|
||||||
|
closedir(DIR);
|
||||||
|
foreach my $xxx (0..@rv-1) {
|
||||||
|
if ($rv[$xxx] =~ /^makepack\-(.*)\.conf$/)
|
||||||
|
{
|
||||||
|
@PROJECTLIST[$xxx]=$1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@PROJECTLIST=($PROJECTINPUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Test if requirement is ok
|
# Loop on each projects
|
||||||
#--------------------------
|
foreach my $PROJECT (@PROJECTLIST) {
|
||||||
foreach my $target (keys %CHOOSEDTARGET) {
|
|
||||||
|
if (! -f "makepack-".$PROJECT.".conf")
|
||||||
|
{
|
||||||
|
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
|
||||||
|
print "\n";
|
||||||
|
print "For help on building a module package, see web page\n";
|
||||||
|
print "http://wiki.dolibarr.org/index.php/Module_development#Create_a_package_to_distribute_and_install_your_module\n";
|
||||||
|
print "makepack-dolibarrmodule.pl aborted.\n";
|
||||||
|
sleep 2;
|
||||||
|
exit 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
$FILENAME="$PROJECT";
|
||||||
|
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR";
|
||||||
|
$FILENAMEZIP="module_$PROJECT-$MAJOR.$MINOR";
|
||||||
|
if (-d "/usr/src/redhat") {
|
||||||
|
# redhat
|
||||||
|
$RPMDIR="/usr/src/redhat";
|
||||||
|
}
|
||||||
|
if (-d "/usr/src/RPM") {
|
||||||
|
# mandrake
|
||||||
|
$RPMDIR="/usr/src/RPM";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Choose package targets
|
||||||
|
#-----------------------
|
||||||
|
$target="ZIP"; # Dolibarr modules are this format
|
||||||
|
$CHOOSEDTARGET{uc($target)}=1;
|
||||||
|
|
||||||
|
|
||||||
|
# Test if requirement is ok
|
||||||
|
#--------------------------
|
||||||
|
foreach my $target (keys %CHOOSEDTARGET) {
|
||||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
|
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
|
||||||
# Test
|
# Test
|
||||||
print "Test requirement for target $target: Search '$req'... ";
|
print "Test requirement for target $target: Search '$req'... ";
|
||||||
@@ -143,26 +182,52 @@ foreach my $target (keys %CHOOSEDTARGET) {
|
|||||||
print " Found ".$REQUIREMENTTARGET{$target}."\n";
|
print " Found ".$REQUIREMENTTARGET{$target}."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
# Check if there is at least on target to build
|
# Check if there is at least on target to build
|
||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
$nboftargetok=0;
|
$nboftargetok=0;
|
||||||
foreach my $target (keys %CHOOSEDTARGET) {
|
$nboftargetneedbuildroot=0;
|
||||||
|
$nboftargetneedcvs=0;
|
||||||
|
foreach my $target (keys %CHOOSEDTARGET) {
|
||||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||||
|
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
|
||||||
|
{
|
||||||
|
$nboftargetneedbuildroot++;
|
||||||
|
}
|
||||||
|
if ($target eq 'SNAPSHOT')
|
||||||
|
{
|
||||||
|
$nboftargetneedcvs++;
|
||||||
|
}
|
||||||
$nboftargetok++;
|
$nboftargetok++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($nboftargetok) {
|
if ($nboftargetok) {
|
||||||
|
|
||||||
# Update buildroot
|
# Update CVS if required
|
||||||
#-----------------
|
#-----------------------
|
||||||
|
if ($nboftargetneedcvs)
|
||||||
|
{
|
||||||
|
print "Go to directory $SOURCE\n";
|
||||||
|
$olddir=getcwd();
|
||||||
|
chdir("$SOURCE");
|
||||||
|
print "Run cvs update -P -d\n";
|
||||||
|
$ret=`cvs update -P -d 2>&1`;
|
||||||
|
chdir("$olddir");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Update buildroot if required
|
||||||
|
#-----------------------------
|
||||||
|
if ($nboftargetneedbuildroot)
|
||||||
|
{
|
||||||
if (! $copyalreadydone) {
|
if (! $copyalreadydone) {
|
||||||
print "Delete directory $BUILDROOT\n";
|
print "Delete directory $BUILDROOT\n";
|
||||||
$ret=`rm -fr "$BUILDROOT"`;
|
$ret=`rm -fr "$BUILDROOT"`;
|
||||||
|
|
||||||
mkdir "$BUILDROOT";
|
mkdir "$BUILDROOT";
|
||||||
|
mkdir "$BUILDROOT/$PROJECT";
|
||||||
|
|
||||||
$result=open(IN,"<makepack-".$PROJECT.".conf");
|
$result=open(IN,"<makepack-".$PROJECT.".conf");
|
||||||
if (! $result) { die "Error: Can't open conf file makepack-".$PROJECT.".conf for reading.\n"; }
|
if (! $result) { die "Error: Can't open conf file makepack-".$PROJECT.".conf for reading.\n"; }
|
||||||
@@ -172,24 +237,45 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
$_ =~ s/\n//;
|
$_ =~ s/\n//;
|
||||||
$_ =~ /^(.*)\/[^\/]+/;
|
$_ =~ /^(.*)\/[^\/]+/;
|
||||||
print "Create directory $BUILDROOT/$1\n";
|
print "Create directory $BUILDROOT/$PROJECT/$1\n";
|
||||||
$ret=`mkdir -p "$BUILDROOT/$1"`;
|
$ret=`mkdir -p "$BUILDROOT/$PROJECT/$1"`;
|
||||||
print "Copy $SOURCE/$_ into $BUILDROOT/$_\n";
|
if ($_ !~ /version\-/)
|
||||||
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$_"`;
|
{
|
||||||
|
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECT/$_\n";
|
||||||
|
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECT/$_"`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
close IN;
|
close IN;
|
||||||
|
|
||||||
@timearray=localtime(time());
|
@timearray=localtime(time());
|
||||||
$fulldate=($timearray[5]+1900).'-'.($timearray[4]+1).'-'.$timearray[3].' '.$timearray[2].':'.$timearray[1];
|
$fulldate=($timearray[5]+1900).'-'.($timearray[4]+1).'-'.$timearray[3].' '.$timearray[2].':'.$timearray[1];
|
||||||
$versionfile=open(VF,">$BUILDROOT/build/version-".$PROJECT.".txt");
|
open(VF,">$BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt");
|
||||||
|
|
||||||
print "Create version file $BUILDROOT/build/version-".$PROJECT.".txt with date ".$fulldate."\n";
|
print "Create version file $BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt with date ".$fulldate."\n";
|
||||||
$ret=`mkdir -p "$BUILDROOT/build"`;
|
$ret=`mkdir -p "$BUILDROOT/$PROJECT/build"`;
|
||||||
print VF "Version: ".$MAJOR.".".$MINOR."\n";
|
print VF "Version: ".$MAJOR.".".$MINOR."\n";
|
||||||
print VF "Build : ".$fulldate."\n";
|
print VF "Build : ".$fulldate."\n";
|
||||||
close VF;
|
close VF;
|
||||||
}
|
}
|
||||||
|
print "Clean $BUILDROOT\n";
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/index.php`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom2`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`;
|
||||||
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
#------------------------------
|
#------------------------------
|
||||||
@@ -216,19 +302,26 @@ if ($nboftargetok) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($target eq 'ZIP') {
|
if ($target eq 'ZIP') {
|
||||||
unlink $FILENAMEZIP.zip;
|
print "Remove target $FILENAMEZIP.zip...\n";
|
||||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
unlink "$DESTI/$FILENAMEZIP.zip";
|
||||||
chdir("$BUILDROOT");
|
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
|
||||||
#print "cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*\n";
|
|
||||||
#$ret=`cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
print "Go to directory $BUILDROOT/$PROJECT\n";
|
||||||
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
$olddir=getcwd();
|
||||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
chdir("$BUILDROOT/$PROJECT");
|
||||||
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
|
$cmd= "7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip *";
|
||||||
|
print $cmd."\n";
|
||||||
|
$ret= `$cmd`;
|
||||||
|
chdir("$olddir");
|
||||||
|
|
||||||
|
print "Move $FILENAMEZIP.zip to $DESTI/$FILENAMEZIP.zip\n";
|
||||||
|
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($target eq 'EXE') {
|
if ($target eq 'EXE') {
|
||||||
unlink "$FILENAMEEXE.exe";
|
print "Remove target $FILENAMEEXE.exe...\n";
|
||||||
|
unlink "$DESTI/$FILENAMEEXE.exe";
|
||||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
||||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
||||||
print "$command\n";
|
print "$command\n";
|
||||||
@@ -240,18 +333,22 @@ if ($nboftargetok) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n----- Summary -----\n";
|
print "\n----- Summary -----\n";
|
||||||
foreach my $target (keys %CHOOSEDTARGET) {
|
foreach my $target (keys %CHOOSEDTARGET) {
|
||||||
if ($CHOOSEDTARGET{$target} < 0) {
|
if ($CHOOSEDTARGET{$target} < 0) {
|
||||||
print "Package $target not built (bad requirement).\n";
|
print "Package $target not built (bad requirement).\n";
|
||||||
} else {
|
} else {
|
||||||
print "Package $target built successfully in $DESTI\n";
|
print "Package $target built successfully in $DESTI\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $btach) {
|
|
||||||
|
if (! $batch) {
|
||||||
print "\nPress key to finish...";
|
print "\nPress key to finish...";
|
||||||
my $WAITKEY=<STDIN>;
|
my $WAITKEY=<STDIN>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ beta version of Dolibarr, step by step.
|
|||||||
|
|
||||||
- Check all files are commited.
|
- Check all files are commited.
|
||||||
- Update version/info in / directory (README*.txt, ChangeLog...)
|
- Update version/info in / directory (README*.txt, ChangeLog...)
|
||||||
- Update version number in build/makepack-dolibarr.pl
|
- Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile
|
||||||
- Update version number in build/exe/doliwamp/doliwamp.iss
|
- Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl
|
||||||
- Update version number in htdocs/filefunc.inc.php
|
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
|
||||||
- Update version number in htdocs/install/inc.php
|
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
|
||||||
|
- Update version number with x.x.x-y in htdocs/filefunc.inc.php
|
||||||
|
- Update version number with x.x.x-y in htdocs/install/inc.php
|
||||||
- Commit all changes.
|
- Commit all changes.
|
||||||
- Add a CVS Tag (DOLIBARR_x_y_BETA)
|
- Add a CVS Tag (DOLIBARR_x_y_BETA)
|
||||||
- If it's a new branch (Vx.y), create a branch (DOLIBARR_x_y_BRANCH).
|
- If it's a new branch (Vx.y), create a branch (DOLIBARR_x_y_BRANCH).
|
||||||
@@ -35,12 +37,10 @@ complete release of Dolibarr, step by step.
|
|||||||
|
|
||||||
- Check all files are commited.
|
- Check all files are commited.
|
||||||
- Update version/info in / directory (README*.txt, ChangeLog...)
|
- Update version/info in / directory (README*.txt, ChangeLog...)
|
||||||
- Update version number in build/makepack-dolibarr.pl
|
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
|
||||||
- Update version number in build/doxygen/dolibarr-doxygen.doxyfile
|
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
|
||||||
- Update version number in build/exe/doliwamp/doliwamp.iss
|
- Update version number with x.x.x-y in htdocs/filefunc.inc.php
|
||||||
- Update version number in build/perl/virtualmin/dolibarr.pl
|
- Update version number with x.x.x-y in htdocs/install/inc.php
|
||||||
- Update version number in htdocs/filefunc.inc.php
|
|
||||||
- Update version number in htdocs/install/inc.php
|
|
||||||
- Update PAD and DOAP files.
|
- Update PAD and DOAP files.
|
||||||
- Commit all changes.
|
- Commit all changes.
|
||||||
- Add a CVS Tag (DOLIBARR_x_y)
|
- Add a CVS Tag (DOLIBARR_x_y)
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ CVS
|
|||||||
.#*
|
.#*
|
||||||
.cache
|
.cache
|
||||||
.cvsignore
|
.cvsignore
|
||||||
|
.externalToolBuilders
|
||||||
.htaccess
|
.htaccess
|
||||||
.settings
|
.settings
|
||||||
.project
|
.project
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# Script to purge and init a database with demo values.
|
# Script to purge and init a database with demo values.
|
||||||
# Note: "dialog" tool need to be available.
|
# Note: "dialog" tool need to be available.
|
||||||
@@ -7,12 +7,19 @@
|
|||||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# WARNING: This script erase all data of database
|
# WARNING: This script erase all data of database
|
||||||
# with data into initdemo.sql
|
# with data into dump file
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
|
|
||||||
export mydir=`echo "$_" | sed -e 's/initdemo.sh//'`;
|
|
||||||
|
export dumpfile="mysqldump_dolibarr_3.0.0.sql"
|
||||||
|
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
|
||||||
|
if [ "x$mydir" = "x" ]
|
||||||
|
then
|
||||||
|
export mydir="."
|
||||||
|
fi
|
||||||
export id=`id -u`;
|
export id=`id -u`;
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------- check if root
|
# ----------------------------- check if root
|
||||||
if [ "x$id" != "x0" -a "x$id" != "x1001" ]
|
if [ "x$id" != "x0" -a "x$id" != "x1001" ]
|
||||||
then
|
then
|
||||||
@@ -20,13 +27,30 @@ then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ----------------------------- input file
|
||||||
|
DIALOG=${DIALOG=dialog}
|
||||||
|
DIALOG="$DIALOG --ascii-lines"
|
||||||
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
|
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||||
|
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
|
--inputbox "Input dump file :" 16 55 $dumpfile 2> $fichtemp
|
||||||
|
valret=$?
|
||||||
|
case $valret in
|
||||||
|
0)
|
||||||
|
dumpfile=`cat $fichtemp`;;
|
||||||
|
1)
|
||||||
|
exit;;
|
||||||
|
255)
|
||||||
|
exit;;
|
||||||
|
esac
|
||||||
|
|
||||||
# ----------------------------- database name
|
# ----------------------------- database name
|
||||||
DIALOG=${DIALOG=dialog}
|
DIALOG=${DIALOG=dialog}
|
||||||
DIALOG="$DIALOG --ascii-lines"
|
DIALOG="$DIALOG --ascii-lines"
|
||||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
--inputbox "Mysql database name :" 16 51 dolibarrdemo 2> $fichtemp
|
--inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp
|
||||||
valret=$?
|
valret=$?
|
||||||
case $valret in
|
case $valret in
|
||||||
0)
|
0)
|
||||||
@@ -42,7 +66,7 @@ DIALOG=${DIALOG=dialog}
|
|||||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
--inputbox "Mysql port (ex: 3306):" 16 51 3306 2> $fichtemp
|
--inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp
|
||||||
|
|
||||||
valret=$?
|
valret=$?
|
||||||
|
|
||||||
@@ -60,7 +84,7 @@ DIALOG=${DIALOG=dialog}
|
|||||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
--inputbox "Mysql root login (ex: root):" 16 51 root 2> $fichtemp
|
--inputbox "Mysql root login (ex: root):" 16 55 root 2> $fichtemp
|
||||||
|
|
||||||
valret=$?
|
valret=$?
|
||||||
|
|
||||||
@@ -78,7 +102,7 @@ DIALOG=${DIALOG=dialog}
|
|||||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
--inputbox "Password for Mysql root login :" 16 51 2> $fichtemp
|
--inputbox "Password for Mysql root login :" 16 55 2> $fichtemp
|
||||||
|
|
||||||
valret=$?
|
valret=$?
|
||||||
|
|
||||||
@@ -96,7 +120,7 @@ esac
|
|||||||
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
#trap "rm -f $fichtemp" 0 1 2 5 15
|
#trap "rm -f $fichtemp" 0 1 2 5 15
|
||||||
#$DIALOG --title "Init Dolibarr with demo values" --clear \
|
#$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 51 2> $fichtemp
|
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 55 2> $fichtemp
|
||||||
|
|
||||||
#valret=$?
|
#valret=$?
|
||||||
|
|
||||||
@@ -112,7 +136,7 @@ esac
|
|||||||
# ---------------------------- confirmation
|
# ---------------------------- confirmation
|
||||||
DIALOG=${DIALOG=dialog}
|
DIALOG=${DIALOG=dialog}
|
||||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||||
--yesno "Do you confirm ? \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 40
|
--yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 55
|
||||||
|
|
||||||
case $? in
|
case $? in
|
||||||
0) echo "Ok, start process...";;
|
0) echo "Ok, start process...";;
|
||||||
@@ -125,10 +149,10 @@ if [ "x$passwd" != "x" ]
|
|||||||
then
|
then
|
||||||
export passwd="-p$passwd"
|
export passwd="-p$passwd"
|
||||||
fi
|
fi
|
||||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/initdemo.sql"
|
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||||
#mysql -P$port -u$admin $passwd $base < $mydir/initdemo.sql
|
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||||
echo "mysql -P$port $base < $mydir/initdemo.sql"
|
echo "mysql -P$port $base < $mydir/$dumpfile"
|
||||||
mysql -P$port -u$admin $passwd $base < $mydir/initdemo.sql
|
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||||
|
|
||||||
echo "Dolibarr data demo has been loaded."
|
echo "Dolibarr data demo has been loaded."
|
||||||
echo
|
echo
|
||||||
|
|||||||
0
dev/initdata/initdemo.sql → dev/initdata/mysqldump_dolibarr_2.9.0.sql
Normal file → Executable file
0
dev/initdata/initdemo.sql → dev/initdata/mysqldump_dolibarr_2.9.0.sql
Normal file → Executable file
5272
dev/initdata/mysqldump_dolibarr_3.0.0.sql
Executable file
5272
dev/initdata/mysqldump_dolibarr_3.0.0.sql
Executable file
File diff suppressed because one or more lines are too long
@@ -4,6 +4,8 @@
|
|||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -699,7 +699,7 @@ if ($rowid)
|
|||||||
});
|
});
|
||||||
jQuery("#invoiceonly").click(function() {
|
jQuery("#invoiceonly").click(function() {
|
||||||
jQuery(".bankswitchclass").hide();
|
jQuery(".bankswitchclass").hide();
|
||||||
jQuery(".bankswitchclass2").show();
|
jQuery(".bankswitchclass2").hide();
|
||||||
});
|
});
|
||||||
';
|
';
|
||||||
if (GETPOST('paymentsave')) print 'jQuery("#'.GETPOST('paymentsave').'").attr(\'checked\',true);';
|
if (GETPOST('paymentsave')) print 'jQuery("#'.GETPOST('paymentsave').'").attr(\'checked\',true);';
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -49,9 +50,9 @@ $adh = new Adherent($db);
|
|||||||
$adho = new AdherentOptions($db);
|
$adho = new AdherentOptions($db);
|
||||||
$errmsg='';
|
$errmsg='';
|
||||||
|
|
||||||
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
$action=GETPOST("action");
|
||||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
$rowid=GETPOST("rowid");
|
||||||
$typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"];
|
$typeid=GETPOST("typeid");
|
||||||
|
|
||||||
if ($rowid)
|
if ($rowid)
|
||||||
{
|
{
|
||||||
@@ -122,6 +123,7 @@ if ($_POST['action'] == 'setsocid')
|
|||||||
{
|
{
|
||||||
$sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
$sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
||||||
$sql.=" WHERE fk_soc = '".$_POST["socid"]."'";
|
$sql.=" WHERE fk_soc = '".$_POST["socid"]."'";
|
||||||
|
$sql.=" AND entity = ".$conf->entity;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@@ -133,7 +135,7 @@ if ($_POST['action'] == 'setsocid')
|
|||||||
$thirdparty=new Societe($db);
|
$thirdparty=new Societe($db);
|
||||||
$thirdparty->fetch($_POST["socid"]);
|
$thirdparty->fetch($_POST["socid"]);
|
||||||
$error++;
|
$error++;
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
|
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +178,7 @@ if ($_POST["action"] == 'confirm_create_thirdparty' && $_POST["confirm"] == 'yes
|
|||||||
{
|
{
|
||||||
// Creation user
|
// Creation user
|
||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
$result=$company->create_from_member($adh,$_POST["name"]);
|
$result=$company->create_from_member($adh,$_POST["companyname"]);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@@ -616,13 +618,9 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("NewMember"));
|
print_fiche_titre($langs->trans("NewMember"));
|
||||||
|
|
||||||
if ($errmsg)
|
if ($errmsg) print '<div class="error">'.$errmsg.'</div>';
|
||||||
{
|
|
||||||
print '<div class="error">'.$errmsg.'</div>';
|
|
||||||
}
|
|
||||||
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
||||||
|
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
@@ -635,7 +633,6 @@ if ($action == 'create')
|
|||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@@ -818,7 +815,6 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
||||||
|
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
@@ -1014,7 +1010,7 @@ if ($rowid && $action != 'edit')
|
|||||||
|
|
||||||
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
||||||
|
|
||||||
if ($msg) print '<div class="error">'.$msg.'</div>';
|
dol_htmloutput_errors($errmsg,$errmsgs);
|
||||||
|
|
||||||
// Confirm create user
|
// Confirm create user
|
||||||
if ($_GET["action"] == 'create_user')
|
if ($_GET["action"] == 'create_user')
|
||||||
@@ -1039,9 +1035,7 @@ if ($rowid && $action != 'edit')
|
|||||||
// Confirm create third party
|
// Confirm create third party
|
||||||
if ($_GET["action"] == 'create_thirdparty')
|
if ($_GET["action"] == 'create_thirdparty')
|
||||||
{
|
{
|
||||||
$name =$adh->nom;
|
$name = $adh->getFullName($langs);
|
||||||
if ($adh->nom && $adh->prenom) $name.=' ';
|
|
||||||
$name.=$adh->prenom;
|
|
||||||
if (! empty($name))
|
if (! empty($name))
|
||||||
{
|
{
|
||||||
if ($adh->societe) $name.=' ('.$adh->societe.')';
|
if ($adh->societe) $name.=' ('.$adh->societe.')';
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
|
|||||||
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->adherent->cotisation->creer)
|
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->adherent->cotisation->creer)
|
||||||
{
|
{
|
||||||
$result=$subscription->fetch($rowid);
|
$result=$subscription->fetch($rowid);
|
||||||
$result=$subscription->delete();
|
$result=$subscription->delete($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
Header("Location: card_subscriptions.php?rowid=".$subscription->fk_adherent);
|
Header("Location: card_subscriptions.php?rowid=".$subscription->fk_adherent);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -33,6 +34,9 @@ $langs->load("members");
|
|||||||
|
|
||||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if (! $user->rights->adherent->lire) accessforbidden();
|
||||||
|
|
||||||
if ($_REQUEST["button_removefilter"])
|
if ($_REQUEST["button_removefilter"])
|
||||||
{
|
{
|
||||||
$_GET["search_nom"]="";
|
$_GET["search_nom"]="";
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyName").'</td><td>';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("CompanyName").'</td><td>';
|
||||||
print '<input name="nom" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '"></td></tr>'."\n";
|
print '<input name="nom" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '"></td></tr>'."\n";
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@@ -302,7 +302,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
|
|
||||||
// Country
|
// Country
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td>';
|
||||||
$pays_selected=$pays_id;
|
$pays_selected=$pays_id;
|
||||||
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
||||||
$form->select_pays($pays_selected,'pays_id');
|
$form->select_pays($pays_selected,'pays_id');
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formadmin.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formadmin.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
@@ -51,7 +52,7 @@ $active = 1;
|
|||||||
// Mettre ici tous les caracteristiques des dictionnaires
|
// Mettre ici tous les caracteristiques des dictionnaires
|
||||||
|
|
||||||
// Ordres d'affichage des dictionnaires (0 pour espace)
|
// Ordres d'affichage des dictionnaires (0 pour espace)
|
||||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,18,0,15);
|
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,20,18,0,15);
|
||||||
|
|
||||||
// Nom des tables des dictionnaires
|
// Nom des tables des dictionnaires
|
||||||
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
||||||
@@ -73,6 +74,7 @@ $tabname[16]= MAIN_DB_PREFIX."c_prospectlevel";
|
|||||||
$tabname[17]= MAIN_DB_PREFIX."c_type_fees";
|
$tabname[17]= MAIN_DB_PREFIX."c_type_fees";
|
||||||
$tabname[18]= MAIN_DB_PREFIX."c_shipment_mode";
|
$tabname[18]= MAIN_DB_PREFIX."c_shipment_mode";
|
||||||
$tabname[19]= MAIN_DB_PREFIX."c_effectif";
|
$tabname[19]= MAIN_DB_PREFIX."c_effectif";
|
||||||
|
$tabname[20]= MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
|
||||||
// Dictionary labels
|
// Dictionary labels
|
||||||
$tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType");
|
$tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType");
|
||||||
@@ -94,6 +96,7 @@ $tablib[16]= $langs->trans("DictionnaryProspectLevel");
|
|||||||
$tablib[17]= $langs->trans("DictionnaryFees");
|
$tablib[17]= $langs->trans("DictionnaryFees");
|
||||||
$tablib[18]= $langs->trans("DictionnarySendingMethods");
|
$tablib[18]= $langs->trans("DictionnarySendingMethods");
|
||||||
$tablib[19]= $langs->trans("DictionnaryStaff");
|
$tablib[19]= $langs->trans("DictionnaryStaff");
|
||||||
|
$tablib[20]= $langs->trans("DictionnaryOrderMethods");
|
||||||
|
|
||||||
// Requete pour extraction des donnees des dictionnaires
|
// Requete pour extraction des donnees des dictionnaires
|
||||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
||||||
@@ -115,6 +118,7 @@ $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_pro
|
|||||||
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
|
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
|
||||||
$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
|
$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
|
||||||
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
|
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
|
||||||
|
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
|
||||||
// Critere de tri du dictionnaire
|
// Critere de tri du dictionnaire
|
||||||
$tabsqlsort[1] ="pays ASC, code ASC";
|
$tabsqlsort[1] ="pays ASC, code ASC";
|
||||||
@@ -136,6 +140,7 @@ $tabsqlsort[16]="sortorder ASC";
|
|||||||
$tabsqlsort[17]="code ASC";
|
$tabsqlsort[17]="code ASC";
|
||||||
$tabsqlsort[18]="code ASC, libelle ASC";
|
$tabsqlsort[18]="code ASC, libelle ASC";
|
||||||
$tabsqlsort[19]="id ASC";
|
$tabsqlsort[19]="id ASC";
|
||||||
|
$tabsqlsort[20]="code ASC, libelle ASC";
|
||||||
|
|
||||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||||
$tabfield[1] = "code,libelle,pays";
|
$tabfield[1] = "code,libelle,pays";
|
||||||
@@ -157,6 +162,7 @@ $tabfield[16]= "code,libelle";
|
|||||||
$tabfield[17]= "code,libelle";
|
$tabfield[17]= "code,libelle";
|
||||||
$tabfield[18]= "code,libelle";
|
$tabfield[18]= "code,libelle";
|
||||||
$tabfield[19]= "code,libelle";
|
$tabfield[19]= "code,libelle";
|
||||||
|
$tabfield[20]= "code,libelle";
|
||||||
|
|
||||||
// Nom des champs d'edition pour modification d'un enregistrement
|
// Nom des champs d'edition pour modification d'un enregistrement
|
||||||
$tabfieldvalue[1] = "code,libelle,pays";
|
$tabfieldvalue[1] = "code,libelle,pays";
|
||||||
@@ -178,6 +184,7 @@ $tabfieldvalue[16]= "code,libelle";
|
|||||||
$tabfieldvalue[17]= "code,libelle";
|
$tabfieldvalue[17]= "code,libelle";
|
||||||
$tabfieldvalue[18]= "code,libelle";
|
$tabfieldvalue[18]= "code,libelle";
|
||||||
$tabfieldvalue[19]= "code,libelle";
|
$tabfieldvalue[19]= "code,libelle";
|
||||||
|
$tabfieldvalue[20]= "code,libelle";
|
||||||
|
|
||||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||||
$tabfieldinsert[1] = "code,libelle,fk_pays";
|
$tabfieldinsert[1] = "code,libelle,fk_pays";
|
||||||
@@ -199,8 +206,11 @@ $tabfieldinsert[16]= "code,label";
|
|||||||
$tabfieldinsert[17]= "code,libelle";
|
$tabfieldinsert[17]= "code,libelle";
|
||||||
$tabfieldinsert[18]= "code,libelle";
|
$tabfieldinsert[18]= "code,libelle";
|
||||||
$tabfieldinsert[19]= "code,libelle";
|
$tabfieldinsert[19]= "code,libelle";
|
||||||
|
$tabfieldinsert[20]= "code,libelle";
|
||||||
|
|
||||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||||
|
// Example: "" if id field is "rowid" and has autoincrement on
|
||||||
|
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
||||||
$tabrowid[1] = "";
|
$tabrowid[1] = "";
|
||||||
$tabrowid[2] = "";
|
$tabrowid[2] = "";
|
||||||
$tabrowid[3] = "";
|
$tabrowid[3] = "";
|
||||||
@@ -220,6 +230,7 @@ $tabrowid[16]= "code";
|
|||||||
$tabrowid[17]= "id";
|
$tabrowid[17]= "id";
|
||||||
$tabrowid[18]= "rowid";
|
$tabrowid[18]= "rowid";
|
||||||
$tabrowid[19]= "id";
|
$tabrowid[19]= "id";
|
||||||
|
$tabrowid[20]= "";
|
||||||
|
|
||||||
// Condition to show dictionnary in setup page
|
// Condition to show dictionnary in setup page
|
||||||
$tabcond[1] = true;
|
$tabcond[1] = true;
|
||||||
@@ -241,6 +252,7 @@ $tabcond[16]= $conf->societe->enabled;
|
|||||||
$tabcond[17]= $conf->deplacement->enabled;
|
$tabcond[17]= $conf->deplacement->enabled;
|
||||||
$tabcond[18]= $conf->expedition->enabled;
|
$tabcond[18]= $conf->expedition->enabled;
|
||||||
$tabcond[19]= $conf->societe->enabled;
|
$tabcond[19]= $conf->societe->enabled;
|
||||||
|
$tabcond[20]= $conf->fournisseur->enabled;
|
||||||
|
|
||||||
$msg='';
|
$msg='';
|
||||||
|
|
||||||
|
|||||||
@@ -579,7 +579,5 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
closedir($handle);
|
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||||
|
|
||||||
$head = ldap_prepare_head();
|
$head = ldap_prepare_head();
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||||
|
|
||||||
$head = ldap_prepare_head();
|
$head = ldap_prepare_head();
|
||||||
|
|
||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||||
|
|
||||||
$head = ldap_prepare_head();
|
$head = ldap_prepare_head();
|
||||||
|
|
||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||||
|
|
||||||
$head = ldap_prepare_head();
|
$head = ldap_prepare_head();
|
||||||
|
|
||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||||
|
|
||||||
$head = ldap_prepare_head();
|
$head = ldap_prepare_head();
|
||||||
|
|
||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
|
|||||||
@@ -51,12 +51,14 @@ $substitutionarrayfortest=array(
|
|||||||
if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["cancel"]))
|
if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["cancel"]))
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", $_POST["MAIN_DISABLE_ALL_MAILS"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", $_POST["MAIN_DISABLE_ALL_MAILS"],'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", $_POST["MAIN_MAIL_SENDMODE"],'chaine',0,'',0);
|
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", $_POST["MAIN_MAIL_SENDMODE"],'chaine',0,'',0);
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", $_POST["MAIN_MAIL_SMTP_PORT"],'chaine',0,'',0);
|
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", $_POST["MAIN_MAIL_SMTP_PORT"],'chaine',0,'',0);
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", $_POST["MAIN_MAIL_SMTP_SERVER"],'chaine',0,'',0);
|
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", $_POST["MAIN_MAIL_SMTP_SERVER"],'chaine',0,'',0);
|
||||||
if (isset($_POST["MAIN_MAIL_SMTPS_ID"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", $_POST["MAIN_MAIL_SMTPS_ID"],'chaine',0,'',0);
|
if (isset($_POST["MAIN_MAIL_SMTPS_ID"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", $_POST["MAIN_MAIL_SMTPS_ID"],'chaine',0,'',0);
|
||||||
if (isset($_POST["MAIN_MAIL_SMTPS_PW"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", $_POST["MAIN_MAIL_SMTPS_PW"],'chaine',0,'',0);
|
if (isset($_POST["MAIN_MAIL_SMTPS_PW"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", $_POST["MAIN_MAIL_SMTPS_PW"],'chaine',0,'',0);
|
||||||
if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0);
|
if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
@@ -600,9 +602,9 @@ else
|
|||||||
$formmail->withsubstit=0;
|
$formmail->withsubstit=0;
|
||||||
$formmail->withfrom=1;
|
$formmail->withfrom=1;
|
||||||
$formmail->witherrorsto=1;
|
$formmail->witherrorsto=1;
|
||||||
$formmail->withto=(isset($_POST['sendto'])?$_POST['sendto']:$user->email?$user->email:1);
|
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
|
||||||
$formmail->withtocc=(isset($_POST['sendtocc'])?$_POST['sendtocc']:1);
|
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc=(isset($_POST['sendtoccc'])?$_POST['sendtoccc']:1);
|
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly=0;
|
$formmail->withtopicreadonly=0;
|
||||||
$formmail->withfile=2;
|
$formmail->withfile=2;
|
||||||
@@ -645,9 +647,9 @@ else
|
|||||||
$formmail->withsubstit=0;
|
$formmail->withsubstit=0;
|
||||||
$formmail->withfrom=1;
|
$formmail->withfrom=1;
|
||||||
$formmail->witherrorsto=1;
|
$formmail->witherrorsto=1;
|
||||||
$formmail->withto=(isset($_POST['sendto'])?$_POST['sendto']:$user->email?$user->email:1);
|
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
|
||||||
$formmail->withtocc=(isset($_POST['sendtocc'])?$_POST['sendtocc']:1);
|
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc=(isset($_POST['sendtoccc'])?$_POST['sendtoccc']:1);
|
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly=0;
|
$formmail->withtopicreadonly=0;
|
||||||
$formmail->withfile=2;
|
$formmail->withfile=2;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -35,9 +35,9 @@ $langs->load("admin");
|
|||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$dirtop = "../../includes/menus/standard";
|
$dirtop = "/includes/menus/standard";
|
||||||
$dirleft = "../../includes/menus/standard";
|
$dirleft = "/includes/menus/standard";
|
||||||
$dirsmartphone = "../../includes/menus/smartphone";
|
$dirsmartphone = "/includes/menus/smartphone";
|
||||||
|
|
||||||
$dirmenu = array($dirleft,$dirsmartphone);
|
$dirmenu = array($dirleft,$dirsmartphone);
|
||||||
|
|
||||||
@@ -333,7 +333,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
elseif (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||||
{
|
{
|
||||||
print_fiche_titre($langs->trans("ModifMenu"),'','setup');
|
print_fiche_titre($langs->trans("ModifMenu"),'','setup');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -35,9 +35,9 @@ $langs->load("admin");
|
|||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$dirtop = "../../includes/menus/standard";
|
$dirtop = "/includes/menus/standard";
|
||||||
$dirleft = "../../includes/menus/standard";
|
$dirleft = "/includes/menus/standard";
|
||||||
$dirsmartphone = "../../includes/menus/smartphone";
|
$dirsmartphone = "/includes/menus/smartphone";
|
||||||
|
|
||||||
$dirmenu = array($dirleft,$dirsmartphone);
|
$dirmenu = array($dirleft,$dirsmartphone);
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/system/dolibarr.php
|
* \file htdocs/admin/system/modules.php
|
||||||
* \brief Fichier page info systemes Dolibarr
|
* \brief Page to list all modules
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -97,12 +97,12 @@ foreach($sortorder as $numero=>$name)
|
|||||||
$alt=$name.' - '.$modules_files[$numero];
|
$alt=$name.' - '.$modules_files[$numero];
|
||||||
if (! empty($picto[$numero]))
|
if (! empty($picto[$numero]))
|
||||||
{
|
{
|
||||||
if (preg_match('/^\//',$picto[$numero])) print img_picto($alt,$picto[$numero],'',1);
|
if (preg_match('/^\//',$picto[$numero])) print img_picto($alt,$picto[$numero],'width="14px"',1);
|
||||||
else print img_object($alt,$picto[$numero]);
|
else print img_object($alt,$picto[$numero],'width="14px"');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print img_object($alt,$picto[$numero]);
|
print img_object($alt,$picto[$numero],'width="14px"');
|
||||||
}
|
}
|
||||||
print ' '.$modules[$numero]->getName();
|
print ' '.$modules[$numero]->getName();
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
@@ -61,12 +61,18 @@ $formfile = new FormFile($db);
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("Backup"),'','setup');
|
print_fiche_titre($langs->trans("Backup"),'','setup');
|
||||||
|
|
||||||
// TODO Define ExecTimeLimit and MemoryLimit
|
$ExecTimeLimit=600;
|
||||||
if (!empty($ExecTimeLimit)) {
|
if (!empty($ExecTimeLimit)) {
|
||||||
@set_time_limit($ExecTimeLimit);
|
// Cette page peut etre longue. On augmente le delai autorise.
|
||||||
|
// Ne fonctionne que si on est pas en safe_mode.
|
||||||
|
$err=error_reporting();
|
||||||
|
error_reporting(0); // Disable all errors
|
||||||
|
//error_reporting(E_ALL);
|
||||||
|
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
|
||||||
|
error_reporting($err);
|
||||||
}
|
}
|
||||||
if (!empty($MemoryLimit)) {
|
if (!empty($MemoryLimit)) {
|
||||||
@ini_set('memory_limit', $MemoryLimit);
|
@ini_set('memory_limit', $MemoryLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start with empty buffer
|
// Start with empty buffer
|
||||||
@@ -158,12 +164,14 @@ if ($what == 'mysql')
|
|||||||
|
|
||||||
if ($handle)
|
if ($handle)
|
||||||
{
|
{
|
||||||
|
$ok=0;
|
||||||
dol_syslog("Run command ".$fullcommandcrypted);
|
dol_syslog("Run command ".$fullcommandcrypted);
|
||||||
$handlein = popen($fullcommandclear, 'r');
|
$handlein = popen($fullcommandclear, 'r');
|
||||||
while (!feof($handlein))
|
while (!feof($handlein))
|
||||||
{
|
{
|
||||||
$read = fgets($handlein);
|
$read = fgets($handlein);
|
||||||
fwrite($handle,$read);
|
fwrite($handle,$read);
|
||||||
|
if (preg_match('/-- Dump completed/i',$read)) $ok=1;
|
||||||
}
|
}
|
||||||
pclose($handlein);
|
pclose($handlein);
|
||||||
|
|
||||||
@@ -192,7 +200,7 @@ if ($what == 'mysql')
|
|||||||
if ($compression == 'none') fclose($handle);
|
if ($compression == 'none') fclose($handle);
|
||||||
if ($compression == 'gz') gzclose($handle);
|
if ($compression == 'gz') gzclose($handle);
|
||||||
if ($compression == 'bz') bzclose($handle);
|
if ($compression == 'bz') bzclose($handle);
|
||||||
if (preg_match('/^-- MySql/i',$errormsg)) $errormsg=''; // Pas erreur
|
if ($ok && preg_match('/^-- MySql/i',$errormsg)) $errormsg=''; // Pas erreur
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Renommer fichier sortie en fichier erreur
|
// Renommer fichier sortie en fichier erreur
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/admin.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/admin.lib.php');
|
||||||
|
|
||||||
|
$langs->load("install");
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ function printBookmarksList ($aDb, $aLangs)
|
|||||||
|
|
||||||
$bookm = new Bookmark($db);
|
$bookm = new Bookmark($db);
|
||||||
|
|
||||||
$langs->load("@bookmarks");
|
$langs->load("bookmarks");
|
||||||
|
|
||||||
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
|
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
/*
|
|
||||||
* Language code: it_IT
|
|
||||||
* Automatic generated via autotranslator.php tool
|
|
||||||
* Generation date 2009-08-13 20:49:18
|
|
||||||
*/
|
|
||||||
|
|
||||||
// START - Lines generated via autotranslator.php tool (2009-08-13 20:49:18).
|
|
||||||
// Reference language: en_US
|
|
||||||
CHARSET=UTF-8
|
|
||||||
Bookm=Segnalibri
|
|
||||||
NewBookmark=Nuovo segnalibro
|
|
||||||
AddThisPageToBookmarks=Aggiungi questa pagina ai preferiti
|
|
||||||
// STOP - Lines generated via autotranslator.php tool (2009-08-13 20:49:18).
|
|
||||||
@@ -27,6 +27,5 @@ CREATE TABLE llx_pos_tmp (
|
|||||||
remise real NOT NULL,
|
remise real NOT NULL,
|
||||||
total_ht double(24,8) NOT NULL,
|
total_ht double(24,8) NOT NULL,
|
||||||
total_tva double(24,8) NOT NULL,
|
total_tva double(24,8) NOT NULL,
|
||||||
total_ttc double(24,8) NOT NULL,
|
total_ttc double(24,8) NOT NULL
|
||||||
PRIMARY KEY (id)
|
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ require("../main.inc.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||||
|
|
||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
|
$langs->load("products");
|
||||||
|
|
||||||
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
|
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
|
||||||
|
|
||||||
|
|||||||
@@ -265,39 +265,88 @@ class Categorie
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete category
|
* Delete a category from database
|
||||||
* Les produits et sous-categories deviennent orphelins
|
* @param user Object user that ask to delete
|
||||||
* si $all = false, et sont (seront :) supprimes sinon
|
|
||||||
*/
|
*/
|
||||||
function remove ($all = false)
|
function delete($user)
|
||||||
{
|
{
|
||||||
|
global $conf,$langs;
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_product";
|
$error=0;
|
||||||
|
|
||||||
|
dol_syslog("Categorie::remove");
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
|
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_fournisseur";
|
||||||
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_product";
|
||||||
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member";
|
||||||
|
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Link childs to parent
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_association";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_association";
|
||||||
$sql .= " WHERE fk_categorie_mere = ".$this->id;
|
$sql .= " WHERE fk_categorie_mere = ".$this->id;
|
||||||
$sql .= " OR fk_categorie_fille = ".$this->id;
|
$sql .= " OR fk_categorie_fille = ".$this->id;
|
||||||
|
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete category
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
if (!$this->db->query($sql))
|
if (!$this->db->query($sql))
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -305,12 +354,21 @@ class Categorie
|
|||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('CATEGORY_DELETE',$this,$user,$langs,$conf);
|
$result=$interface->run_triggers('CATEGORY_DELETE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) { $error++; $this->errors=$interface->errors; $this->error=join(',',$this->errors); }
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
}
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ $type=$c->type;
|
|||||||
|
|
||||||
if ($user->rights->categorie->supprimer && $_POST["action"] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
if ($user->rights->categorie->supprimer && $_POST["action"] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
||||||
{
|
{
|
||||||
if ($c->remove() >= 0)
|
if ($c->delete($user) >= 0)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type);
|
||||||
exit;
|
exit;
|
||||||
@@ -331,7 +331,7 @@ if($c->type == 2)
|
|||||||
// List of members
|
// List of members
|
||||||
if ($c->type == 3)
|
if ($c->type == 3)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/Adherent.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
|
||||||
|
|
||||||
$prods = $c->get_type("member","Adherent");
|
$prods = $c->get_type("member","Adherent");
|
||||||
if ($prods < 0)
|
if ($prods < 0)
|
||||||
|
|||||||
@@ -422,18 +422,18 @@ class ActionComm extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
$now=gmmktime(); // gmmktime(0,0,0,1,1,1970) -> 0, mktime(0,0,0,1,1,1970) -> -3600;
|
$now=dol_now();
|
||||||
|
|
||||||
$this->nbtodo=$this->nbtodolate=0;
|
$this->nbtodo=$this->nbtodolate=0;
|
||||||
$sql = "SELECT a.id, a.datep as dp";
|
$sql = "SELECT a.id, a.datep as dp";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= ")";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity in (0, ".$conf->entity.")";
|
||||||
$sql.= " WHERE a.percent < 100";
|
$sql.= " WHERE a.percent < 100";
|
||||||
$sql.= " AND a.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
|
||||||
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND a.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND a.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
||||||
|
//print $sql;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ class CActionComm {
|
|||||||
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
|
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
|
||||||
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
|
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
|
||||||
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
|
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
|
||||||
|
if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||||
|
if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||||
}
|
}
|
||||||
if ($qualified)
|
if ($qualified)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ if (GETPOST('action') == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// If company is forced, we propose contacts (may be contact is also forced)
|
// If company is forced, we propose contacts (may be contact is also forced)
|
||||||
if (GETPOST("socid") > 0)
|
if (GETPOST("contactid") > 0 || GETPOST("socid") > 0)
|
||||||
{
|
{
|
||||||
print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>';
|
print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||||
$html->select_contacts(GETPOST("socid"),GETPOST('contactid'),'contactid',1,1);
|
$html->select_contacts(GETPOST("socid"),GETPOST('contactid'),'contactid',1,1);
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ if ($showbirthday)
|
|||||||
|
|
||||||
$maxlength=16;
|
$maxlength=16;
|
||||||
$cachethirdparties=array();
|
$cachethirdparties=array();
|
||||||
$cachecontact=array();
|
$cachecontacts=array();
|
||||||
|
|
||||||
// Define theme_datacolor array
|
// Define theme_datacolor array
|
||||||
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
||||||
@@ -484,7 +484,7 @@ else // View by day
|
|||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
|
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
|
||||||
show_day_events ($db, $day, $month, $year, $month, $style, $actionarray, 0, 0, $maxlength);
|
show_day_events ($db, $day, $month, $year, $month, $style, $actionarray, 0, 80, $newparam);
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
@@ -510,15 +510,13 @@ llxFooter('$Date$ - $Revision$');
|
|||||||
* @param $maxPrint Nb of actions to show each day on month view (0 means non limit)
|
* @param $maxPrint Nb of actions to show each day on month view (0 means non limit)
|
||||||
* @param $maxnbofchar Nb of characters to show for event line
|
* @param $maxnbofchar Nb of characters to show for event line
|
||||||
* @param $newparam Parameters on current URL
|
* @param $newparam Parameters on current URL
|
||||||
* @param $companystatic Object thirdparty
|
|
||||||
* @param $contactstatic Object contact
|
|
||||||
*/
|
*/
|
||||||
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$actionarray, $maxPrint=0, $maxnbofchar=14, $newparam='')
|
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$actionarray, $maxPrint=0, $maxnbofchar=14, $newparam='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
global $filter, $filtera, $filtert, $filterd, $status;
|
global $filter, $filtera, $filtert, $filterd, $status;
|
||||||
global $theme_datacolor;
|
global $theme_datacolor;
|
||||||
global $cachethirdparty, $cachecontact;
|
global $cachethirdparties, $cachecontacts;
|
||||||
|
|
||||||
if ($_GET["action"] == 'maxPrint')
|
if ($_GET["action"] == 'maxPrint')
|
||||||
{
|
{
|
||||||
@@ -613,16 +611,18 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
|
|||||||
$thirdparty->fetch($action->societe->id);
|
$thirdparty->fetch($action->societe->id);
|
||||||
$cachethirdparties[$action->societe->id]=$thirdparty;
|
$cachethirdparties[$action->societe->id]=$thirdparty;
|
||||||
}
|
}
|
||||||
|
else $thirdparty=$cachethirdparties[$event->societe->id];
|
||||||
$linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
|
$linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
|
||||||
}
|
}
|
||||||
if (! empty($action->contact->id))
|
if (! empty($action->contact->id))
|
||||||
{
|
{
|
||||||
if (empty($cachetcontact[$action->societe->id]))
|
if (empty($cachecontacts[$action->contact->id]))
|
||||||
{
|
{
|
||||||
$contact=new Contact($db);
|
$contact=new Contact($db);
|
||||||
$contact->fetch($action->contact->id);
|
$contact->fetch($action->contact->id);
|
||||||
$cachethirdparties[$action->contact->id]=$thirdparty;
|
$cachecontacts[$action->contact->id]=$contact;
|
||||||
}
|
}
|
||||||
|
else $contact=$cachecontacts[$event->contact->id];
|
||||||
if ($linerelatedto) $linerelatedto.=' / ';
|
if ($linerelatedto) $linerelatedto.=' / ';
|
||||||
$linerelatedto.=$contact->getNomUrl(1,'',$length);
|
$linerelatedto.=$contact->getNomUrl(1,'',$length);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/comm/action/listactions.php
|
* \file htdocs/comm/action/listactions.php
|
||||||
* \ingroup agenda
|
* \ingroup agenda
|
||||||
* \brief Page liste des actions commerciales
|
* \brief Page to list actions
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ $offset = $limit * $page ;
|
|||||||
if (! $sortorder)
|
if (! $sortorder)
|
||||||
{
|
{
|
||||||
$sortorder="ASC";
|
$sortorder="ASC";
|
||||||
if ($status == 'todo') $sortorder="DESC";
|
if ($status == 'todo') $sortorder="ASC";
|
||||||
if ($status == 'done') $sortorder="DESC";
|
if ($status == 'done') $sortorder="DESC";
|
||||||
}
|
}
|
||||||
if (! $sortfield)
|
if (! $sortfield)
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ if ($socid > 0)
|
|||||||
|
|
||||||
if ($objsoc->client)
|
if ($objsoc->client)
|
||||||
{
|
{
|
||||||
|
$langs->load("compta");
|
||||||
|
|
||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||||
print $objsoc->code_client;
|
print $objsoc->code_client;
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
|||||||
*/
|
*/
|
||||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom, s.client";
|
$sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@@ -158,8 +158,8 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print "<tr class=\"liste_titre\">";
|
print '<tr class="liste_titre">';
|
||||||
print "<td colspan=\"3\">".$langs->trans("ProposalsDraft")."</td></tr>";
|
print '<td colspan="3">'.$langs->trans("ProposalsDraft").'</td></tr>';
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var=true;
|
$var=true;
|
||||||
@@ -174,8 +174,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id=$obj->socid;
|
||||||
$companystatic->nom=$obj->nom;
|
$companystatic->name=$obj->name;
|
||||||
$companystatic->client=$obj->client;
|
$companystatic->client=$obj->client;
|
||||||
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1,'customer',16);
|
print $companystatic->getNomUrl(1,'customer',16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>';
|
print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>';
|
||||||
@@ -205,7 +206,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
|
|||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom, s.client";
|
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@@ -235,8 +236,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
|
|||||||
print '<tr '.$bc[$var].'><td nowrap="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
|
print '<tr '.$bc[$var].'><td nowrap="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id=$obj->socid;
|
||||||
$companystatic->nom=$obj->nom;
|
$companystatic->name=$obj->name;
|
||||||
$companystatic->client=$obj->client;
|
$companystatic->client=$obj->client;
|
||||||
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1,'customer',16);
|
print $companystatic->getNomUrl(1,'customer',16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||||
@@ -277,7 +279,7 @@ $max=3;
|
|||||||
|
|
||||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
|
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
|
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@@ -326,12 +328,18 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left"><a href="fiche.php?socid='.$objp->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
|
print '<td align="left">';
|
||||||
print "<td align=\"right\">";
|
$companystatic->id=$objp->socid;
|
||||||
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
$companystatic->name=$objp->name;
|
||||||
print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
|
$companystatic->client=$objp->client;
|
||||||
print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($objp->fk_statut,3)."</td>\n";
|
$companystatic->canvas=$objp->canvas;
|
||||||
print "</tr>\n";
|
print $companystatic->getNomUrl(1,'customer',44);
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print dol_print_date($db->jdate($objp->dp),'day').'</td>'."\n";
|
||||||
|
print '<td align="right">'.price($objp->total_ht).'</td>'."\n";
|
||||||
|
print '<td align="center" width="14">'.$propalstatic->LibStatut($objp->fk_statut,3).'</td>'."\n";
|
||||||
|
print '</tr>'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
@@ -352,7 +360,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
|||||||
{
|
{
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
|
|
||||||
$sql = "SELECT s.rowid,s.nom,s.client,s.datec,s.tms";
|
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec,s.tms";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
$sql.= " WHERE s.client IN (1, 2, 3)";
|
||||||
@@ -376,15 +384,15 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$company=new Societe($db);
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$company->id=$objp->rowid;
|
$companystatic->id=$objp->rowid;
|
||||||
$company->nom=$objp->nom;
|
$companystatic->name=$objp->name;
|
||||||
$company->client=$objp->client;
|
$companystatic->client=$objp->client;
|
||||||
|
$companystatic->canvas=$objp->canvas;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td nowrap="nowrap">'.$company->getNomUrl(1,'customer',48).'</td>';
|
print '<td nowrap="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
|
||||||
print '<td align="right" nowrap>';
|
print '<td align="right" nowrap>';
|
||||||
if ($objp->client == 2 || $objp->client == 3) print $langs->trans("Prospect");
|
if ($objp->client == 2 || $objp->client == 3) print $langs->trans("Prospect");
|
||||||
if ($objp->client == 3) print ' / ';
|
if ($objp->client == 3) print ' / ';
|
||||||
@@ -412,7 +420,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
|||||||
{
|
{
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc, s.tms as dm";
|
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.fournisseur = 1";
|
$sql.= " WHERE s.fournisseur = 1";
|
||||||
@@ -435,14 +443,14 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$company=new Societe($db);
|
|
||||||
while ($i < $num && $i < $max)
|
while ($i < $num && $i < $max)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$company->id=$objp->rowid;
|
$companystatic->id=$objp->rowid;
|
||||||
$company->nom=$objp->nom;
|
$companystatic->name=$objp->name;
|
||||||
|
$companystatic->canvas=$objp->canvas;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td nowrap="nowrap">'.$company->getNomUrl(1,'supplier',48).'</td>';
|
print '<td nowrap="nowrap">'.$companystatic->getNomUrl(1,'supplier',44).'</td>';
|
||||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
|
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@@ -485,7 +493,8 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
|
|||||||
{
|
{
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid, c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
|
$sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
|
||||||
|
$sql.= " c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."product as p";
|
$sql.= ", ".MAIN_DB_PREFIX."product as p";
|
||||||
@@ -517,7 +526,12 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print "<tr ".$bc[$var]."><td><a href=\"../contrat/fiche.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
|
print "<tr ".$bc[$var]."><td><a href=\"../contrat/fiche.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
|
||||||
print "<td><a href=\"fiche.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany","company"))." ".$obj->nom."</a></td>\n";
|
print '<td>';
|
||||||
|
$companystatic->id=$objp->rowid;
|
||||||
|
$companystatic->name=$objp->name;
|
||||||
|
$companystatic->canvas=$objp->canvas;
|
||||||
|
print $companystatic->getNomUrl(1,'customer',44);
|
||||||
|
print '</td>'."\n";
|
||||||
print "<td align=\"right\">".$staticcontrat->LibStatut($obj->statut,3)."</td></tr>\n";
|
print "<td align=\"right\">".$staticcontrat->LibStatut($obj->statut,3)."</td></tr>\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$i++;
|
$i++;
|
||||||
@@ -590,12 +604,12 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
|||||||
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td align=\"left\"><a href=\"fiche.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dol_trunc($obj->nom,44)."</a></td>\n";
|
print '<td align="left"><a href="fiche.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n";
|
||||||
print "<td align=\"right\">";
|
print '<td align="right">';
|
||||||
print dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
|
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
||||||
print "<td align=\"right\">".price($obj->total_ttc)."</td>";
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||||
print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($obj->fk_statut,3)."</td>\n";
|
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut,3).'</td>'."\n";
|
||||||
print "</tr>\n";
|
print '</tr>'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
$total += $obj->total_ttc;
|
$total += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes')
|
|||||||
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
|
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
|
||||||
$_GET["action"]='';
|
$_GET["action"]='';
|
||||||
}
|
}
|
||||||
|
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||||
|
{
|
||||||
|
$message='<div class="warning">'.$langs->trans("NotEnoughPermissions").'</div>';
|
||||||
|
$_GET["action"]='';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mil=new Mailing($db);
|
$mil=new Mailing($db);
|
||||||
@@ -297,14 +302,18 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"]))
|
|||||||
$mil = new Mailing($db);
|
$mil = new Mailing($db);
|
||||||
$result=$mil->fetch($_POST["mailid"]);
|
$result=$mil->fetch($_POST["mailid"]);
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($mil->id,2,0,1);
|
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($mil->id,2,0,1);
|
||||||
|
|
||||||
$mil->sendto = $_POST["sendto"];
|
$mil->sendto = $_POST["sendto"];
|
||||||
if (! $mil->sendto)
|
if (! $mil->sendto)
|
||||||
{
|
{
|
||||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
|
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
if ($mil->sendto)
|
|
||||||
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Ajout CSS
|
// Ajout CSS
|
||||||
if (!empty($mil->bgcolor)) $arr_css['bgcolor'] = $mil->bgcolor;
|
if (!empty($mil->bgcolor)) $arr_css['bgcolor'] = $mil->bgcolor;
|
||||||
@@ -419,7 +428,7 @@ if ($_REQUEST["action"] == 'setdesc' || $_REQUEST["action"] == 'setfrom' || $_RE
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Action update emailing
|
// Action update emailing
|
||||||
if (! empty($_POST["removedfile"]))
|
if (! empty($_POST["removedfileid"]))
|
||||||
{
|
{
|
||||||
$mil = new Mailing($db);
|
$mil = new Mailing($db);
|
||||||
$mil->fetch($_POST["id"]);
|
$mil->fetch($_POST["id"]);
|
||||||
@@ -429,7 +438,7 @@ if (! empty($_POST["removedfile"]))
|
|||||||
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
|
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
|
||||||
|
|
||||||
// Remove file
|
// Remove file
|
||||||
$filenb=($_POST["removedfile"]-1);
|
$filenb=($_POST["removedfileid"]-1);
|
||||||
if (isset($listofpaths[$filenb]))
|
if (isset($listofpaths[$filenb]))
|
||||||
{
|
{
|
||||||
$result=dol_delete_file($listofpaths[$filenb]['fullname'],1);
|
$result=dol_delete_file($listofpaths[$filenb]['fullname'],1);
|
||||||
@@ -602,7 +611,7 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("NewMailing"));
|
print_fiche_titre($langs->trans("NewMailing"));
|
||||||
|
|
||||||
if ($message) print "$message<br>";
|
if ($message) print $message."<br>";
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
|
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
|
||||||
@@ -645,6 +654,8 @@ else
|
|||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Mailing"), 0, 'email');
|
dol_fiche_head($head, 'card', $langs->trans("Mailing"), 0, 'email');
|
||||||
|
|
||||||
|
if ($message) print $message."<br>";
|
||||||
|
|
||||||
// Confirmation de la validation du mailing
|
// Confirmation de la validation du mailing
|
||||||
if ($_GET["action"] == 'valid')
|
if ($_GET["action"] == 'valid')
|
||||||
{
|
{
|
||||||
@@ -691,7 +702,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text='';
|
$text='';
|
||||||
if (empty($conf->file->mailing_limit_sendbyweb))
|
if ($conf->file->mailing_limit_sendbyweb == 0)
|
||||||
{
|
{
|
||||||
$text.=$langs->trans("MailingNeedCommand");
|
$text.=$langs->trans("MailingNeedCommand");
|
||||||
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$_GET["id"].'</textarea>';
|
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$_GET["id"].'</textarea>';
|
||||||
@@ -735,11 +746,20 @@ else
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
$nbemail = ($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>');
|
$nbemail = ($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>');
|
||||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
||||||
|
{
|
||||||
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
||||||
{
|
{
|
||||||
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||||
print $html->textwithpicto($nbemail,$text,1,'warning');
|
print $html->textwithpicto($nbemail,$text,1,'warning');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
$text=$langs->trans('NotEnoughPermissions');
|
||||||
|
print $html->textwithpicto($nbemail,$text,1,'warning');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
print $nbemail;
|
print $nbemail;
|
||||||
}
|
}
|
||||||
@@ -803,9 +823,16 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (($mil->statut == 1 || $mil->statut == 2) && $mil->nbemail > 0 && $user->rights->mailing->valider)
|
if (($mil->statut == 1 || $mil->statut == 2) && $mil->nbemail > 0 && $user->rights->mailing->valider)
|
||||||
|
{
|
||||||
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendMailing").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=sendall&id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=sendall&id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($user->rights->mailing->creer)
|
if ($user->rights->mailing->creer)
|
||||||
{
|
{
|
||||||
@@ -888,7 +915,6 @@ else
|
|||||||
foreach($listofpaths as $key => $val)
|
foreach($listofpaths as $key => $val)
|
||||||
{
|
{
|
||||||
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
|
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
|
||||||
//print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -975,7 +1001,8 @@ else
|
|||||||
foreach($listofpaths as $key => $val)
|
foreach($listofpaths as $key => $val)
|
||||||
{
|
{
|
||||||
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
|
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
|
||||||
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
|
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="removedfile" name="removedfile" />';
|
||||||
|
print '<input type="hidden" name="removedfileid" value="'.($key+1).'" />';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,12 +45,11 @@ $langs->load('bills');
|
|||||||
$langs->load('orders');
|
$langs->load('orders');
|
||||||
$langs->load('products');
|
$langs->load('products');
|
||||||
|
|
||||||
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
|
$sall=GETPOST("sall");
|
||||||
if (isset($_GET["msg"])) { $mesg=$_GET["mesg"]; }
|
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
||||||
$year=isset($_GET["year"])?$_GET["year"]:"";
|
$year=GETPOST("year");
|
||||||
$month=isset($_GET["month"])?$_GET["month"]:"";
|
$month=GETPOST("month");
|
||||||
$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid'];
|
$socid=GETPOST('socid');
|
||||||
$mesg=isset($_GET['mesg'])?$_GET['mesg']:'';
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$module='propale';
|
$module='propale';
|
||||||
@@ -370,11 +369,11 @@ if ($_GET["action"] == 'classifybilled')
|
|||||||
/*
|
/*
|
||||||
* Cloture de la propale
|
* Cloture de la propale
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST['action'] == 'setstatut' && $user->rights->propale->cloturer)
|
if (GETPOST('action') == 'setstatut' && $user->rights->propale->cloturer)
|
||||||
{
|
{
|
||||||
if (! $_POST['cancel'])
|
if (! $_POST['cancel'])
|
||||||
{
|
{
|
||||||
if (empty($_REQUEST['statut']))
|
if (! GETPOST('statut'))
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")).'</div>';
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")).'</div>';
|
||||||
$_REQUEST['action']='statut';
|
$_REQUEST['action']='statut';
|
||||||
@@ -672,12 +671,14 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
|
|||||||
{
|
{
|
||||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||||
|
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pu_ht = $prod->price;
|
$pu_ht = $prod->price;
|
||||||
$pu_ttc = $prod->price_ttc;
|
$pu_ttc = $prod->price_ttc;
|
||||||
|
$price_min = $prod->price_min;
|
||||||
$price_base_type = $prod->price_base_type;
|
$price_base_type = $prod->price_base_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,9 +715,9 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
|
|||||||
$info_bits=0;
|
$info_bits=0;
|
||||||
if ($tva_npr) $info_bits |= 0x01;
|
if ($tva_npr) $info_bits |= 0x01;
|
||||||
|
|
||||||
if ($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
if ($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -794,10 +795,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
|
|||||||
{
|
{
|
||||||
$product = new Product($db) ;
|
$product = new Product($db) ;
|
||||||
$res=$product->fetch($productid) ;
|
$res=$product->fetch($productid) ;
|
||||||
|
$price_min = $product->price_min;
|
||||||
|
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level];
|
||||||
}
|
}
|
||||||
if ($productid && $product->price_min && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($product->price_min)))
|
if ($productid && $price_min && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($product->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -960,8 +963,8 @@ $companystatic=new Societe($db);
|
|||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
$id = $_REQUEST['id']?$_REQUEST['id']:$_REQUEST['id'];
|
$id = GETPOST('id');
|
||||||
$ref= $_REQUEST['ref'];
|
$ref= GETPOST('ref');
|
||||||
|
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
@@ -1504,7 +1507,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Close
|
// Close
|
||||||
if ($object->statut == 1 && $user->rights->propale->cloturer)
|
if ($object->statut == 1 && $user->rights->propale->cloturer)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=statut#close"';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=statut'.(empty($conf->global->MAIN_JUMP_TAG)?'':'#close').'"';
|
||||||
print '>'.$langs->trans('Close').'</a>';
|
print '>'.$langs->trans('Close').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1555,7 +1558,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
foreach($object->linked_object as $linked_object => $linked_objectid)
|
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||||
{
|
{
|
||||||
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
$element = $subelement = $linked_object;
|
||||||
|
if (preg_match('/^([^_]+)_([^_]+)/i',$linked_object,$regs))
|
||||||
|
{
|
||||||
|
$element = $regs[1];
|
||||||
|
$subelement = $regs[2];
|
||||||
|
}
|
||||||
|
if($conf->$element->enabled && $element != $object->element)
|
||||||
{
|
{
|
||||||
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ class Propal extends CommonObject
|
|||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$this->labelstatut[0]=$langs->trans("PropalStatusDraft");
|
$this->labelstatut[0]=$langs->trans("PropalStatusDraft");
|
||||||
$this->labelstatut[1]=$langs->trans("PropalStatusValidated");
|
$this->labelstatut[1]=$langs->trans("PropalStatusValidated");
|
||||||
$this->labelstatut[2]=$langs->trans("PropalStatusSigned");
|
$this->labelstatut[2]=($conf->global->PROPAL_STATUS_SIGNED_LABEL ? $conf->global->PROPAL_STATUS_SIGNED_LABEL : $langs->trans("PropalStatusSigned"));
|
||||||
$this->labelstatut[3]=$langs->trans("PropalStatusNotSigned");
|
$this->labelstatut[3]=($conf->global->PROPAL_STATUS_NOTSIGNED_LABEL ? $conf->global->PROPAL_STATUS_NOTSIGNED_LABEL : $langs->trans("PropalStatusNotSigned"));
|
||||||
$this->labelstatut[4]=$langs->trans("PropalStatusBilled");
|
$this->labelstatut[4]=$langs->trans("PropalStatusBilled");
|
||||||
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort");
|
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort");
|
||||||
$this->labelstatut_short[1]=$langs->trans("Opened");
|
$this->labelstatut_short[1]=$langs->trans("Opened");
|
||||||
@@ -484,7 +484,7 @@ class Propal extends CommonObject
|
|||||||
$sql.= " , tva_tx=".price2num($txtva);
|
$sql.= " , tva_tx=".price2num($txtva);
|
||||||
$sql.= " , localtax1_tx=".price2num($txlocaltax1);
|
$sql.= " , localtax1_tx=".price2num($txlocaltax1);
|
||||||
$sql.= " , localtax2_tx=".price2num($txlocaltax2);
|
$sql.= " , localtax2_tx=".price2num($txlocaltax2);
|
||||||
$sql.= " , description='".addslashes($desc)."'";
|
$sql.= " , description='".$this->db->escape($desc)."'";
|
||||||
$sql.= " , total_ht=".price2num($total_ht);
|
$sql.= " , total_ht=".price2num($total_ht);
|
||||||
$sql.= " , total_tva=".price2num($total_tva);
|
$sql.= " , total_tva=".price2num($total_tva);
|
||||||
$sql.= " , total_localtax1=".price2num($total_localtax1);
|
$sql.= " , total_localtax1=".price2num($total_localtax1);
|
||||||
@@ -631,13 +631,13 @@ class Propal extends CommonObject
|
|||||||
$sql.= ", '".$this->db->idate($now)."'";
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
$sql.= ", '(PROV)'";
|
$sql.= ", '(PROV)'";
|
||||||
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null");
|
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null");
|
||||||
$sql.= ", '".addslashes($this->note)."'";
|
$sql.= ", '".$this->db->escape($this->note)."'";
|
||||||
$sql.= ", '".addslashes($this->note_public)."'";
|
$sql.= ", '".$this->db->escape($this->note_public)."'";
|
||||||
$sql.= ", '".$this->modelpdf."'";
|
$sql.= ", '".$this->modelpdf."'";
|
||||||
$sql.= ", '".$this->db->idate($this->fin_validite)."'";
|
$sql.= ", '".$this->db->idate($this->fin_validite)."'";
|
||||||
$sql.= ", ".$this->cond_reglement_id;
|
$sql.= ", ".$this->cond_reglement_id;
|
||||||
$sql.= ", ".$this->mode_reglement_id;
|
$sql.= ", ".$this->mode_reglement_id;
|
||||||
$sql.= ", '".addslashes($this->ref_client)."'";
|
$sql.= ", '".$this->db->escape($this->ref_client)."'";
|
||||||
$sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":'null');
|
$sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":'null');
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
@@ -773,9 +773,10 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Insert en base un objet propal completement definie par ses donnees membres (resultant d'une copie par exemple).
|
* Insert en base un objet propal completement definie par ses donnees membres (resultant d'une copie par exemple).
|
||||||
* \return int l'id du nouvel objet propal en base si ok, <0 si ko
|
* @param user Object user making creation
|
||||||
* \see create
|
* @return int Id of new created object if OK, <0 if KO
|
||||||
|
* @see create
|
||||||
*/
|
*/
|
||||||
function create_from($user)
|
function create_from($user)
|
||||||
{
|
{
|
||||||
@@ -785,10 +786,10 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
* \param fromid Id of object to clone
|
* @param fromid Id of object to clone
|
||||||
* \param invertdetail Reverse sign of amounts for lines
|
* @param invertdetail Reverse sign of amounts for lines
|
||||||
* \return int New id of clone
|
* @return int New id of clone
|
||||||
*/
|
*/
|
||||||
function createFromClone($fromid,$invertdetail=0)
|
function createFromClone($fromid,$invertdetail=0)
|
||||||
{
|
{
|
||||||
@@ -800,14 +801,14 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$object=new Propal($this->db);
|
$object=new Propal($this->db);
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||||
{
|
{
|
||||||
$object->callHooks('objectcard');
|
$object->callHooks('objectcard');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
|
||||||
|
|
||||||
// Load source object
|
// Load source object
|
||||||
$object->fetch($fromid);
|
$object->fetch($fromid);
|
||||||
$objFrom = $object;
|
$objFrom = $object;
|
||||||
@@ -885,10 +886,10 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Load a proposal from database and its ligne array
|
* Load a proposal from database and its ligne array
|
||||||
* \param rowid id of object to load
|
* @param rowid id of object to load
|
||||||
* \param ref Ref of proposal
|
* @param ref Ref of proposal
|
||||||
* \return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($rowid,$ref='')
|
function fetch($rowid,$ref='')
|
||||||
{
|
{
|
||||||
@@ -983,7 +984,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
$sql = "SELECT d.rowid, d.fk_propal, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,";
|
$sql = "SELECT d.rowid, d.fk_propal, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,";
|
||||||
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.marge_tx, d.marque_tx, d.special_code, d.rang, d.product_type,";
|
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.marge_tx, d.marque_tx, d.special_code, d.rang, d.product_type,";
|
||||||
$sql.= " p.ref, p.label, p.description as product_desc";
|
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label';
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE d.fk_propal = ".$this->id;
|
$sql.= " WHERE d.fk_propal = ".$this->id;
|
||||||
@@ -1027,10 +1028,11 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$line->fk_product = $objp->fk_product;
|
$line->fk_product = $objp->fk_product;
|
||||||
|
|
||||||
|
$line->ref = $objp->product_ref;
|
||||||
$line->libelle = $objp->label; // TODO deprecated
|
$line->libelle = $objp->label; // TODO deprecated
|
||||||
$line->label = $objp->label; // Label produit
|
$line->label = $objp->label; // Label produit
|
||||||
$line->product_desc = $objp->product_desc; // Description produit
|
$line->product_desc = $objp->product_desc; // Description produit
|
||||||
$line->ref = $objp->ref;
|
$line->fk_product_type = $objp->fk_product_type;
|
||||||
|
|
||||||
$this->lines[$i] = $line;
|
$this->lines[$i] = $line;
|
||||||
//dol_syslog("1 ".$line->fk_product);
|
//dol_syslog("1 ".$line->fk_product);
|
||||||
@@ -1061,9 +1063,9 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Passe au statut valider une propale
|
* Passe au statut valider une propale
|
||||||
* \param user Objet utilisateur qui valide
|
* @param user Objet utilisateur qui valide
|
||||||
* \return int <0 si ko, >=0 si ok
|
* @return int <0 si ko, >=0 si ok
|
||||||
*/
|
*/
|
||||||
function valid($user, $notrigger=0)
|
function valid($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
@@ -1118,10 +1120,10 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Define proposal date
|
* Define proposal date
|
||||||
* \param user Object user that modify
|
* @param user Object user that modify
|
||||||
* \param date Date
|
* @param date Date
|
||||||
* \return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function set_date($user, $date)
|
function set_date($user, $date)
|
||||||
{
|
{
|
||||||
@@ -1237,7 +1239,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
|
dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.addslashes($ref_client).'\'');
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.$this->db->escape($ref_client).'\'');
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@@ -1340,7 +1342,7 @@ class Propal extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||||
$sql.= " SET fk_statut = ".$statut.", note = '".addslashes($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@@ -1540,6 +1542,8 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sizeof($linkedInvoices) > 0)
|
||||||
|
{
|
||||||
$sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye";
|
$sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||||
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";
|
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";
|
||||||
@@ -1579,6 +1583,8 @@ class Propal extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else return $ga;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Efface propal
|
* \brief Efface propal
|
||||||
@@ -2315,7 +2321,7 @@ class PropaleLigne
|
|||||||
$sql.= ' info_bits, ';
|
$sql.= ' info_bits, ';
|
||||||
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, special_code, rang, marge_tx, marque_tx)';
|
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, special_code, rang, marge_tx, marque_tx)';
|
||||||
$sql.= " VALUES (".$this->fk_propal.",";
|
$sql.= " VALUES (".$this->fk_propal.",";
|
||||||
$sql.= " '".addslashes($this->desc)."',";
|
$sql.= " '".$this->db->escape($this->desc)."',";
|
||||||
$sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").",";
|
$sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").",";
|
||||||
$sql.= " '".$this->product_type."',";
|
$sql.= " '".$this->product_type."',";
|
||||||
$sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").",";
|
$sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").",";
|
||||||
@@ -2379,7 +2385,7 @@ class PropaleLigne
|
|||||||
|
|
||||||
// Mise a jour ligne en base
|
// Mise a jour ligne en base
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propaldet SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propaldet SET";
|
||||||
$sql.= " description='".addslashes($this->desc)."'";
|
$sql.= " description='".$this->db->escape($this->desc)."'";
|
||||||
if ($fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except;
|
if ($fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except;
|
||||||
else $sql.= ",fk_remise_except=null";
|
else $sql.= ",fk_remise_except=null";
|
||||||
$sql.= ",tva_tx='".price2num($this->tva_tx)."'";
|
$sql.= ",tva_tx='".price2num($this->tva_tx)."'";
|
||||||
|
|||||||
@@ -88,13 +88,14 @@ class PropaleStats extends Stats
|
|||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getNbByMonth($year, $sql);
|
return $this->_getNbByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de propale par ann<EFBFBD>e
|
* Renvoie le nombre de propale par annee
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getNbByYear()
|
function getNbByYear()
|
||||||
@@ -105,12 +106,13 @@ class PropaleStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$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 && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getNbByYear($sql);
|
return $this->_getNbByYear($sql);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de propale par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
* Renvoie le nombre de propale par mois pour une annee donnee
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getAmountByMonth($year)
|
function getAmountByMonth($year)
|
||||||
@@ -122,7 +124,8 @@ class PropaleStats extends Stats
|
|||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getAmountByMonth($year, $sql);
|
return $this->_getAmountByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
@@ -139,7 +142,8 @@ class PropaleStats extends Stats
|
|||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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 date_format(p.datep,'%Y') = ".$year;
|
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getAverageByMonth($year, $sql);
|
return $this->_getAverageByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
@@ -157,7 +161,8 @@ class PropaleStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY year DESC";
|
$sql.= " GROUP BY year";
|
||||||
|
$sql.= $this->db->order('year','DESC');
|
||||||
|
|
||||||
return $this->_getAllByYear($sql);
|
return $this->_getAllByYear($sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -809,6 +809,9 @@ class Commande extends CommonObject
|
|||||||
if (empty($qty)) $qty=0;
|
if (empty($qty)) $qty=0;
|
||||||
if (empty($info_bits)) $info_bits=0;
|
if (empty($info_bits)) $info_bits=0;
|
||||||
if (empty($rang)) $rang=0;
|
if (empty($rang)) $rang=0;
|
||||||
|
if (empty($txtva)) $txtva=0;
|
||||||
|
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||||
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
@@ -1342,8 +1345,12 @@ class Commande extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function nb_expedition()
|
function nb_expedition()
|
||||||
{
|
{
|
||||||
$sql = 'SELECT count(*) FROM '.MAIN_DB_PREFIX.'expedition as e';
|
$sql = 'SELECT count(*)';
|
||||||
$sql .=" WHERE e.fk_commande = ".$this->id;
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||||
|
$sql.= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||||
|
$sql.= ' WHERE el.fk_source = '.$this->id;
|
||||||
|
$sql.= " AND el.fk_target = e.rowid";
|
||||||
|
$sql.= " AND el.targettype = 'shipping'";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@@ -1351,6 +1358,7 @@ class Commande extends CommonObject
|
|||||||
$row = $this->db->fetch_row($resql);
|
$row = $this->db->fetch_row($resql);
|
||||||
return $row[0];
|
return $row[0];
|
||||||
}
|
}
|
||||||
|
else dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1852,6 +1860,8 @@ class Commande extends CommonObject
|
|||||||
if (empty($txtva)) $txtva=0;
|
if (empty($txtva)) $txtva=0;
|
||||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
|
if (empty($remise)) $remise=0;
|
||||||
|
if (empty($remise_percent)) $remise_percent=0;
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu = price2num($pu);
|
$pu = price2num($pu);
|
||||||
|
|||||||
@@ -100,13 +100,14 @@ class CommandeStats extends Stats
|
|||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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 date_format(c.date_commande,'%Y') = ".$year;
|
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getNbByMonth($year, $sql);
|
return $this->_getNbByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de commande par ann<EFBFBD>e
|
* Renvoie le nombre de commande par annee
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getNbByYear()
|
function getNbByYear()
|
||||||
@@ -118,13 +119,14 @@ class CommandeStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getNbByYear($sql);
|
return $this->_getNbByYear($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de commande par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
* Renvoie le nombre de commande par mois pour une annee donnee
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getAmountByMonth($year)
|
function getAmountByMonth($year)
|
||||||
@@ -137,13 +139,14 @@ class CommandeStats extends Stats
|
|||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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 date_format(c.date_commande,'%Y') = ".$year;
|
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getAmountByMonth($year, $sql);
|
return $this->_getAmountByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de commande par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
* Renvoie le nombre de commande par mois pour une annee donnee
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getAverageByMonth($year)
|
function getAverageByMonth($year)
|
||||||
@@ -156,7 +159,8 @@ class CommandeStats extends Stats
|
|||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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 date_format(c.date_commande,'%Y') = ".$year;
|
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getAverageByMonth($year, $sql);
|
return $this->_getAverageByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
@@ -174,7 +178,8 @@ class CommandeStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
if (!$user->rights->societe->client->voir && !$this->socid) $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.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY year DESC";
|
$sql.= " GROUP BY year";
|
||||||
|
$sql.= $this->db->order('year','DESC');
|
||||||
|
|
||||||
return $this->_getAllByYear($sql);
|
return $this->_getAllByYear($sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,11 +19,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/commande/contact.php
|
* \file htdocs/commande/contact.php
|
||||||
\ingroup commande
|
* \ingroup commande
|
||||||
\brief Onglet de gestion des contacts de commande
|
* \brief Onglet de gestion des contacts de commande
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||||
@@ -31,7 +31,6 @@ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
||||||
|
|
||||||
$langs->load("facture");
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
@@ -217,9 +216,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Ajouter une ligne de contact
|
* Ajouter une ligne de contact
|
||||||
* Non affich<EFBFBD> en mode modification de ligne
|
* Non affiche en mode modification de ligne
|
||||||
*/
|
*/
|
||||||
if ($_GET["action"] != 'editline' && $user->rights->facture->creer)
|
if ($_GET["action"] != 'editline' && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Source").'</td>';
|
print '<td>'.$langs->trans("Source").'</td>';
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ $comid = GETPOST("id");
|
|||||||
if (empty($comid)) $comid=GETPOST("orderid");
|
if (empty($comid)) $comid=GETPOST("orderid");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=GETPOST('socid');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'commande',$comid,'');
|
$result=restrictedArea($user,'commande',$comid,'');
|
||||||
|
|
||||||
@@ -402,12 +402,14 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
|||||||
{
|
{
|
||||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||||
|
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pu_ht = $prod->price;
|
$pu_ht = $prod->price;
|
||||||
$pu_ttc = $prod->price_ttc;
|
$pu_ttc = $prod->price_ttc;
|
||||||
|
$price_min = $prod->price_min;
|
||||||
$price_base_type = $prod->price_base_type;
|
$price_base_type = $prod->price_base_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,10 +452,10 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
|||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
||||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -548,10 +550,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
|
|||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$product->fetch($productid);
|
$product->fetch($productid);
|
||||||
$type=$product->type;
|
$type=$product->type;
|
||||||
|
$price_min = $product->price_min;
|
||||||
|
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level];
|
||||||
}
|
}
|
||||||
if ($product->price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num($_POST['elremise_percent'])/100) < price2num($product->price_min)))
|
if ($price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num($_POST['elremise_percent'])/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($product->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||||
$result=-1;
|
$result=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1856,7 +1860,13 @@ else
|
|||||||
|
|
||||||
foreach($object->linked_object as $linked_object => $linked_objectid)
|
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||||
{
|
{
|
||||||
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
$element = $subelement = $linked_object;
|
||||||
|
if (preg_match('/^([^_]+)_([^_]+)/i',$linked_object,$regs))
|
||||||
|
{
|
||||||
|
$element = $regs[1];
|
||||||
|
$subelement = $regs[2];
|
||||||
|
}
|
||||||
|
if($conf->$element->enabled && $element != $object->element)
|
||||||
{
|
{
|
||||||
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ for ($i = 0 ; $i < $num ; $i++)
|
|||||||
$linkedObjectBlock->fetch($objectid[$i]);
|
$linkedObjectBlock->fetch($objectid[$i]);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
?>
|
?>
|
||||||
<tr <?php echo $bc[$var]; ?> ><td>
|
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
|
||||||
<a href="<?php echo DOL_URL_ROOT.'/commande/fiche.php?id='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$linkedObjectBlock->ref; ?></a></td>
|
<a href="<?php echo DOL_URL_ROOT.'/commande/fiche.php?id='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$linkedObjectBlock->ref; ?></a></td>
|
||||||
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
|
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
|
||||||
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -34,6 +34,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
|||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$action=GETPOST("action");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||||
{
|
{
|
||||||
@@ -49,7 +51,9 @@ $result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
|
|||||||
*/
|
*/
|
||||||
if ($_POST["action"] == 'add')
|
if ($_POST["action"] == 'add')
|
||||||
{
|
{
|
||||||
// Creation compte
|
$error=0;
|
||||||
|
|
||||||
|
// Create account
|
||||||
$account = new Account($db,0);
|
$account = new Account($db,0);
|
||||||
|
|
||||||
$account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
|
$account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
|
||||||
@@ -73,7 +77,21 @@ if ($_POST["action"] == 'add')
|
|||||||
$account->min_desired = $_POST["account_min_desired"];
|
$account->min_desired = $_POST["account_min_desired"];
|
||||||
$account->comment = trim($_POST["account_comment"]);
|
$account->comment = trim($_POST["account_comment"]);
|
||||||
|
|
||||||
if ($account->label)
|
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
|
||||||
|
{
|
||||||
|
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
|
||||||
|
$action='create'; // Force chargement page en mode creation
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($account->label))
|
||||||
|
{
|
||||||
|
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||||
|
$action='create'; // Force chargement page en mode creation
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
{
|
{
|
||||||
$id = $account->create($user->id);
|
$id = $account->create($user->id);
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
@@ -82,17 +100,16 @@ if ($_POST["action"] == 'add')
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$message='<div class="error">'.$account->error().'</div>';
|
$message='<div class="error">'.$account->error().'</div>';
|
||||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
$action='create'; // Force chargement page en mode creation
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
|
||||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||||
{
|
{
|
||||||
// Modification
|
$error=0;
|
||||||
|
|
||||||
|
// Update account
|
||||||
$account = new Account($db, $_POST["id"]);
|
$account = new Account($db, $_POST["id"]);
|
||||||
$account->fetch($_POST["id"]);
|
$account->fetch($_POST["id"]);
|
||||||
|
|
||||||
@@ -127,7 +144,21 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||||||
$account->min_desired = $_POST["account_min_desired"];
|
$account->min_desired = $_POST["account_min_desired"];
|
||||||
$account->comment = trim($_POST["account_comment"]);
|
$account->comment = trim($_POST["account_comment"]);
|
||||||
|
|
||||||
if ($account->label)
|
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
|
||||||
|
{
|
||||||
|
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
|
||||||
|
$action='edit'; // Force chargement page en mode creation
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($account->label))
|
||||||
|
{
|
||||||
|
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||||
|
$action='edit'; // Force chargement page en mode creation
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result = $account->update($user);
|
$result = $account->update($user);
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
@@ -137,11 +168,8 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$message='<div class="error">'.$account->error().'</div>';
|
$message='<div class="error">'.$account->error().'</div>';
|
||||||
$_REQUEST["action"]='edit'; // Force chargement page edition
|
$action='edit'; // Force chargement page edition
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
|
||||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +201,7 @@ $htmlcompany = new FormCompany($db);
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
if ($_REQUEST["action"] == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
$account=new Account($db);
|
$account=new Account($db);
|
||||||
|
|
||||||
@@ -214,17 +242,6 @@ if ($_REQUEST["action"] == 'create')
|
|||||||
print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Code compta
|
|
||||||
if ($conf->global->MAIN_BANCK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
|
|
||||||
{
|
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
|
|
||||||
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<input type="hidden" name="account_number" value="'.$account->account_number.'">';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
@@ -266,6 +283,26 @@ if ($_REQUEST["action"] == 'create')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Conciliable
|
||||||
|
/*print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
if ($account->type == 0 || $account->type == 1) print '<input type="checkbox" class="flat" name="norappro" '.($account->rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation");
|
||||||
|
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||||
|
print '</td></tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Accountancy code
|
||||||
|
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
|
||||||
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
|
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
|
||||||
@@ -307,7 +344,7 @@ if ($_REQUEST["action"] == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (($_GET["id"] || $_GET["ref"]) && $_REQUEST["action"] != 'edit')
|
if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||||
{
|
{
|
||||||
$account = new Account($db);
|
$account = new Account($db);
|
||||||
if ($_GET["id"])
|
if ($_GET["id"])
|
||||||
@@ -331,7 +368,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Confirmation to delete
|
* Confirmation to delete
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"] == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
||||||
if ($ret == 'html') print '<br>';
|
if ($ret == 'html') print '<br>';
|
||||||
@@ -387,12 +424,9 @@ else
|
|||||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Code compta
|
// Accountancy code
|
||||||
if ($conf->accounting->enabled)
|
|
||||||
{
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
print '<td colspan="3">'.$account->account_number.'</td></tr>';
|
print '<td colspan="3">'.$account->account_number.'</td></tr>';
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||||
print '<td colspan="3">'.$account->min_allowed.'</td></tr>';
|
print '<td colspan="3">'.$account->min_allowed.'</td></tr>';
|
||||||
@@ -416,7 +450,6 @@ else
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
@@ -441,10 +474,10 @@ else
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
if ($_REQUEST["id"] && $_REQUEST["action"] == 'edit' && $user->rights->banque->configurer)
|
if (GETPOST("id") && $action == 'edit' && $user->rights->banque->configurer)
|
||||||
{
|
{
|
||||||
$account = new Account($db, $_REQUEST["id"]);
|
$account = new Account($db);
|
||||||
$account->fetch($_REQUEST["id"]);
|
$account->fetch(GETPOST("id"));
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("EditFinancialAccount"));
|
print_fiche_titre($langs->trans("EditFinancialAccount"));
|
||||||
print "<br>";
|
print "<br>";
|
||||||
@@ -525,21 +558,23 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Conciliable
|
||||||
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
if ($account->type == 0 || $account->type == 1) print '<input type="checkbox" class="flat" name="norappro" '.($account->rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation");
|
if ($account->type == 0 || $account->type == 1) print '<input type="checkbox" class="flat" name="norappro" '.($account->rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation");
|
||||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Code compta
|
// Accountancy code
|
||||||
if ($conf->accounting->enabled)
|
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'">';
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance
|
// Balance
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ if ($mode == 'showalltime')
|
|||||||
{
|
{
|
||||||
print '<tr><td align="center">';
|
print '<tr><td align="center">';
|
||||||
$file = "balance".$account.".png";
|
$file = "balance".$account.".png";
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank_temp&file='.$file.'" alt="" title="">';
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ if ($result)
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='company') {
|
else if ($links[$key]['type']=='company') {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$links[$key]['url_id'].'">';
|
print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
|
||||||
print img_object($langs->trans('ShowCustomer'),'company').' ';
|
print img_object($langs->trans('ShowCustomer'),'company').' ';
|
||||||
print $links[$key]['label'];
|
print $links[$key]['label'];
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
$sql.= " AND clos = 0";
|
$sql.= " AND clos = 0";
|
||||||
|
$sql.= " ORDER BY label";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
|
|||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.fk_stcomm = st.id AND s.client=1";
|
$sql.= " WHERE s.fk_stcomm = st.id AND s.client in (1,3)";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
|
||||||
|
|||||||
@@ -273,23 +273,23 @@ class Deplacement extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($mode == 2)
|
if ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
if ($statut==0 || $statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
if ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
if ($statut==0 || $statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
if ($statut==0 || $statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
//if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||||
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
if ($statut==0 || $statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ class DeplacementStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
$sql.= " WHERE YEAR(dated) = ".$year;
|
$sql.= " WHERE YEAR(dated) = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
$res=$this->_getNbByMonth($year, $sql);
|
$res=$this->_getNbByMonth($year, $sql);
|
||||||
//var_dump($res);print '<br>';
|
//var_dump($res);print '<br>';
|
||||||
@@ -113,7 +114,8 @@ class DeplacementStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
$res=$this->_getAmountByMonth($year, $sql);
|
$res=$this->_getAmountByMonth($year, $sql);
|
||||||
//var_dump($res);print '<br>';
|
//var_dump($res);print '<br>';
|
||||||
@@ -131,7 +133,8 @@ class DeplacementStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm DESC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getAverageByMonth($year, $sql);
|
return $this->_getAverageByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
@@ -145,7 +148,8 @@ class DeplacementStats extends Stats
|
|||||||
$sql = "SELECT date_format(dated,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
|
$sql = "SELECT date_format(dated,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
|
||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY year DESC";
|
$sql.= " GROUP BY year";
|
||||||
|
$sql.= $this->db->order('year','DESC');
|
||||||
|
|
||||||
return $this->_getAllByYear($sql);
|
return $this->_getAllByYear($sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,10 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/deplacement/index.php
|
* \file htdocs/compta/deplacement/index.php
|
||||||
\brief Page liste des deplacements
|
* \brief Page liste des deplacements
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/compta/tva/class/tva.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/compta/tva/class/tva.class.php");
|
||||||
@@ -58,7 +58,7 @@ $sql.= " u.name, u.firstname"; // Qui
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."deplacement as d";
|
$sql.= ", ".MAIN_DB_PREFIX."deplacement as d";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on d.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on d.fk_soc = s.rowid";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||||
$sql.= " WHERE d.fk_user = u.rowid";
|
$sql.= " WHERE d.fk_user = u.rowid";
|
||||||
$sql.= " AND d.entity = ".$conf->entity;
|
$sql.= " AND d.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ for ($i = 0 ; $i < 3 ; $i++)
|
|||||||
print '<td><a href="liste.php?statut='.$i.'">'.$donstatic->LibStatut($i,4).'</a></td>';
|
print '<td><a href="liste.php?statut='.$i.'">'.$donstatic->LibStatut($i,4).'</a></td>';
|
||||||
print '<td align="right">'.$nb[$i].'</td>';
|
print '<td align="right">'.$nb[$i].'</td>';
|
||||||
print '<td align="right">'.($nb[$i]?price($somme[$i],'MT'):' ').'</td>';
|
print '<td align="right">'.($nb[$i]?price($somme[$i],'MT'):' ').'</td>';
|
||||||
print '<td align="right">'.($nb[$i]?price($somme[$i]/$nb[$i],'MT'):' ').'</td>';
|
print '<td align="right">'.($nb[$i]?price(price2num($somme[$i]/$nb[$i],'MT')):' ').'</td>';
|
||||||
$totalnb += $nb[$i];
|
$totalnb += $nb[$i];
|
||||||
$total += $somme[$i];
|
$total += $somme[$i];
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
@@ -97,7 +97,7 @@ print '<tr class="liste_total">';
|
|||||||
print '<td>'.$langs->trans("Total").'</td>';
|
print '<td>'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right">'.$totalnb.'</td>';
|
print '<td align="right">'.$totalnb.'</td>';
|
||||||
print '<td align="right">'.price($total,'MT').'</td>';
|
print '<td align="right">'.price($total,'MT').'</td>';
|
||||||
print '<td align="right">'.($totalnb?price($total/$totalnb,'MT'):' ').'</td>';
|
print '<td align="right">'.($totalnb?price(price2num($total/$totalnb,'MT')):' ').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ if ($result)
|
|||||||
|
|
||||||
if ($statut >= 0)
|
if ($statut >= 0)
|
||||||
{
|
{
|
||||||
print_barre_liste($libelle[$statut], $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
$donationstatic->statut=$statut;
|
||||||
|
$label=$donationstatic->getLibStatut(0);
|
||||||
|
print_barre_liste($label, $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ $sall=isset($_GET['sall'])?trim($_GET['sall']):trim($_POST['sall']);
|
|||||||
$projectid=isset($_GET['projectid'])?$_GET['projectid']:0;
|
$projectid=isset($_GET['projectid'])?$_GET['projectid']:0;
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid'];
|
$socid=GETPOST("socid");
|
||||||
$facid=GETPOST("id");
|
$facid=GETPOST("id");
|
||||||
if (empty($facid)) $facid=GETPOST("facid"); // For backward compatibility
|
if (empty($facid)) $facid=GETPOST("facid"); // For backward compatibility
|
||||||
$ref=GETPOST("ref");
|
$ref=GETPOST("ref");
|
||||||
@@ -851,12 +851,14 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $
|
|||||||
{
|
{
|
||||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||||
|
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pu_ht = $prod->price;
|
$pu_ht = $prod->price;
|
||||||
$pu_ttc = $prod->price_ttc;
|
$pu_ttc = $prod->price_ttc;
|
||||||
|
$price_min = $prod->price_min;
|
||||||
$price_base_type = $prod->price_base_type;
|
$price_base_type = $prod->price_base_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -905,9 +907,9 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $
|
|||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)) ;
|
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)) ;
|
||||||
$result = -1 ;
|
$result = -1 ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1003,11 +1005,13 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST
|
|||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$product->fetch($productid);
|
$product->fetch($productid);
|
||||||
$type=$product->type;
|
$type=$product->type;
|
||||||
|
$price_min = $product->price_min;
|
||||||
|
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level];
|
||||||
}
|
}
|
||||||
if ($object->type!=2 && $product->price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($product->price_min)))
|
if ($object->type!=2 && $price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
||||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($product->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>';
|
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>';
|
||||||
$result=-1;
|
$result=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1310,20 +1314,20 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
|
|||||||
/*
|
/*
|
||||||
* Generate document
|
* Generate document
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
if (GETPOST('action') == 'builddoc') // En get ou en post
|
||||||
{
|
{
|
||||||
$object->fetch($facid);
|
$object->fetch($facid);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
if ($_REQUEST['model'])
|
if (GETPOST('model'))
|
||||||
{
|
{
|
||||||
$object->setDocModel($user, $_REQUEST['model']);
|
$object->setDocModel($user, GETPOST('model'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang='';
|
$newlang='';
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||||
if (! empty($newlang))
|
if (! empty($newlang))
|
||||||
{
|
{
|
||||||
@@ -2776,7 +2780,13 @@ else
|
|||||||
|
|
||||||
foreach($object->linked_object as $linked_object => $linked_objectid)
|
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||||
{
|
{
|
||||||
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
$element = $subelement = $linked_object;
|
||||||
|
if (preg_match('/^([^_]+)_([^_]+)/i',$linked_object,$regs))
|
||||||
|
{
|
||||||
|
$element = $regs[1];
|
||||||
|
$subelement = $regs[2];
|
||||||
|
}
|
||||||
|
if($conf->$element->enabled && $element != $object->element)
|
||||||
{
|
{
|
||||||
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,11 +195,9 @@ class FactureRec extends Facture
|
|||||||
*/
|
*/
|
||||||
function fetch($rowid, $socid=0)
|
function fetch($rowid, $socid=0)
|
||||||
{
|
{
|
||||||
dol_syslog("Facture::Fetch rowid=".$rowid.", societe_id=".$socid, LOG_DEBUG);
|
|
||||||
|
|
||||||
$sql = 'SELECT f.titre,f.fk_soc,f.amount,f.tva,f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise';
|
$sql = 'SELECT f.titre,f.fk_soc,f.amount,f.tva,f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise';
|
||||||
$sql.= ', f.date_lim_reglement as dlr';
|
$sql.= ', f.date_lim_reglement as dlr';
|
||||||
$sql.= ', f.note, f.note_public, f.fk_user_author, f.rang, f.special_code';
|
$sql.= ', f.note, f.note_public, f.fk_user_author';
|
||||||
$sql.= ', f.fk_mode_reglement, f.fk_cond_reglement';
|
$sql.= ', f.fk_mode_reglement, f.fk_cond_reglement';
|
||||||
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||||
$sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
|
$sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
|
||||||
@@ -211,8 +209,8 @@ class FactureRec extends Facture
|
|||||||
$sql.= ' WHERE f.rowid='.$rowid;
|
$sql.= ' WHERE f.rowid='.$rowid;
|
||||||
if ($socid > 0) $sql.= ' AND f.fk_soc = '.$socid;
|
if ($socid > 0) $sql.= ' AND f.fk_soc = '.$socid;
|
||||||
|
|
||||||
|
dol_syslog("FactureRec::Fetch rowid=".$rowid.", societe_id=".$socid." sql=".$sql, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows($result))
|
if ($this->db->num_rows($result))
|
||||||
@@ -409,7 +407,7 @@ class FactureRec extends Facture
|
|||||||
*/
|
*/
|
||||||
function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0)
|
function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0)
|
||||||
{
|
{
|
||||||
dol_syslog("FactureRec::Addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG);
|
dol_syslog("FactureRec::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG);
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@@ -490,9 +488,9 @@ class FactureRec extends Facture
|
|||||||
$sql.= ", '".price2num($remise)."'";
|
$sql.= ", '".price2num($remise)."'";
|
||||||
$sql.= ", '".price2num($total_ht)."'";
|
$sql.= ", '".price2num($total_ht)."'";
|
||||||
$sql.= ", '".price2num($total_tva)."'";
|
$sql.= ", '".price2num($total_tva)."'";
|
||||||
$sql.= ", '".price2num($total_ttc)."') ;";
|
$sql.= ", '".price2num($total_ttc)."'";
|
||||||
$sql.= ", ".$rang;
|
$sql.= ", ".$rang;
|
||||||
$sql.= ", ".$special_code;
|
$sql.= ", ".$special_code.")";
|
||||||
|
|
||||||
dol_syslog("FactureRec::addline sql=".$sql, LOG_DEBUG);
|
dol_syslog("FactureRec::addline sql=".$sql, LOG_DEBUG);
|
||||||
if ($this->db->query( $sql))
|
if ($this->db->query( $sql))
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class Facture extends CommonObject
|
|||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
|
var $errors=array();
|
||||||
var $element='facture';
|
var $element='facture';
|
||||||
var $table_element='facture';
|
var $table_element='facture';
|
||||||
var $table_element_line = 'facturedet';
|
var $table_element_line = 'facturedet';
|
||||||
@@ -293,7 +294,7 @@ class Facture extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog("There is ".sizeof($this->lines)." lines that are array lines");
|
dol_syslog("There is ".sizeof($this->lines)." lines that are array lines");
|
||||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
foreach ($this->lines as $i => $val)
|
||||||
{
|
{
|
||||||
if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||||
{
|
{
|
||||||
@@ -464,6 +465,11 @@ class Facture extends CommonObject
|
|||||||
dol_syslog("Facture::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".sizeof($facture->lines));
|
dol_syslog("Facture::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".sizeof($facture->lines));
|
||||||
|
|
||||||
$facid = $facture->create($user);
|
$facid = $facture->create($user);
|
||||||
|
if ($facid <= 0)
|
||||||
|
{
|
||||||
|
$this->error=$facture->error;
|
||||||
|
$this->errors=$facture->errors;
|
||||||
|
}
|
||||||
|
|
||||||
return $facid;
|
return $facid;
|
||||||
}
|
}
|
||||||
@@ -1676,6 +1682,9 @@ class Facture extends CommonObject
|
|||||||
if (empty($info_bits)) $info_bits=0;
|
if (empty($info_bits)) $info_bits=0;
|
||||||
if (empty($rang)) $rang=0;
|
if (empty($rang)) $rang=0;
|
||||||
if (empty($ventil)) $ventil=0;
|
if (empty($ventil)) $ventil=0;
|
||||||
|
if (empty($txtva)) $txtva=0;
|
||||||
|
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||||
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class FactureStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= " ORDER BY dm DESC";
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getNbByYear($sql);
|
return $this->_getNbByYear($sql);
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ class FactureStats extends Stats
|
|||||||
$sql.= " WHERE datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql.= " WHERE datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= " ORDER BY dm DESC";
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
$res=$this->_getNbByMonth($year, $sql);
|
$res=$this->_getNbByMonth($year, $sql);
|
||||||
//var_dump($res);print '<br>';
|
//var_dump($res);print '<br>';
|
||||||
@@ -129,7 +129,7 @@ class FactureStats extends Stats
|
|||||||
$sql.= " WHERE date_format(datef,'%Y') = ".$year;
|
$sql.= " WHERE date_format(datef,'%Y') = ".$year;
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= " ORDER BY dm DESC";
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
$res=$this->_getAmountByMonth($year, $sql);
|
$res=$this->_getAmountByMonth($year, $sql);
|
||||||
//var_dump($res);print '<br>';
|
//var_dump($res);print '<br>';
|
||||||
@@ -148,7 +148,7 @@ class FactureStats extends Stats
|
|||||||
$sql.= " WHERE datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
$sql.= " WHERE datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
|
||||||
$sql.= " AND ".$this->where;
|
$sql.= " AND ".$this->where;
|
||||||
$sql.= " GROUP BY dm";
|
$sql.= " GROUP BY dm";
|
||||||
$sql.= " ORDER BY dm DESC";
|
$sql.= $this->db->order('dm','DESC');
|
||||||
|
|
||||||
return $this->_getAverageByMonth($year, $sql);
|
return $this->_getAverageByMonth($year, $sql);
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ class FactureStats extends Stats
|
|||||||
$sql.= " FROM ".$this->from;
|
$sql.= " FROM ".$this->from;
|
||||||
$sql.= " WHERE ".$this->where;
|
$sql.= " WHERE ".$this->where;
|
||||||
$sql.= " GROUP BY year";
|
$sql.= " GROUP BY year";
|
||||||
$sql.= " ORDER BY year DESC";
|
$sql.= $this->db->order('year','DESC');
|
||||||
|
|
||||||
return $this->_getAllByYear($sql);
|
return $this->_getAllByYear($sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,9 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||||
|
|
||||||
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('\.pdf|',$_POST['toGenerate']).'\.pdf','\.meta$|\.png','date',SORT_DESC) ;
|
$arrayofexclusion=array();
|
||||||
|
foreach($_POST['toGenerate'] as $tmppdf) $arrayofexclusion[]=preg_quote($tmppdf.'.pdf','/');
|
||||||
|
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofexclusion),'\.meta$|\.png','date',SORT_DESC) ;
|
||||||
|
|
||||||
// liste les fichiers
|
// liste les fichiers
|
||||||
$files = array() ;
|
$files = array() ;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ for ($i = 0 ; $i < $num ; $i++)
|
|||||||
$linkedObjectBlock->fetch($objectid[$i]);
|
$linkedObjectBlock->fetch($objectid[$i]);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
?>
|
?>
|
||||||
<tr <?php echo $bc[$var]; ?> ><td>
|
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
|
||||||
<a href="<?php echo DOL_URL_ROOT.'/compta/facture.php?facid='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$linkedObjectBlock->ref; ?></a></td>
|
<a href="<?php echo DOL_URL_ROOT.'/compta/facture.php?facid='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$linkedObjectBlock->ref; ?></a></td>
|
||||||
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
|
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
|
||||||
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -24,14 +25,24 @@
|
|||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../../main.inc.php");
|
require_once("../../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php');
|
require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php");
|
||||||
|
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load("compta");
|
|
||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace the default llxHeader function
|
||||||
|
* @param $head
|
||||||
|
* @param $title
|
||||||
|
* @param $help_url
|
||||||
|
* @param $target
|
||||||
|
* @param $disablejs
|
||||||
|
* @param $disablehead
|
||||||
|
* @param $arrayofjs
|
||||||
|
* @param $arrayofcss
|
||||||
|
*/
|
||||||
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
|
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
|
||||||
{
|
{
|
||||||
global $db, $user, $conf, $langs;
|
global $db, $user, $conf, $langs;
|
||||||
@@ -44,10 +55,11 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||||||
// Entry for each bank account
|
// Entry for each bank account
|
||||||
if ($user->rights->banque->lire)
|
if ($user->rights->banque->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, label, courant";
|
$sql = "SELECT rowid, label, courant, rappro, courant";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
$sql.= " AND clos = 0";
|
$sql.= " AND clos = 0";
|
||||||
|
$sql.= " ORDER BY label";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@@ -55,12 +67,16 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||||||
$numr = $db->num_rows($resql);
|
$numr = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if ($numr > 0) $menu->add("/compta/bank/index.php",$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
if ($numr > 0) $menu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||||
|
|
||||||
while ($i < $numr)
|
while ($i < $numr)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$menu->add_submenu("/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
$menu->add_submenu('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||||
|
if ($objp->rappro && $objp->courant != 2) // If not cash account and can be reconciliate
|
||||||
|
{
|
||||||
|
$menu->add_submenu('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
$menu->add_submenu("/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
$menu->add_submenu("/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||||
$menu->add_submenu("/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
$menu->add_submenu("/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||||
@@ -69,6 +85,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else dol_print_error($db);
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ class Paiement
|
|||||||
if (! in_array($fac->thirdparty->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
if (! in_array($fac->thirdparty->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
||||||
{
|
{
|
||||||
$result=$acc->add_url_line($bank_line_id, $fac->thirdparty->id,
|
$result=$acc->add_url_line($bank_line_id, $fac->thirdparty->id,
|
||||||
DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->thirdparty->nom, 'company');
|
DOL_URL_ROOT.'/comm/fiche.php?socid=', $fac->thirdparty->nom, 'company');
|
||||||
if ($result <= 0) dol_print_error($this->db);
|
if ($result <= 0) dol_print_error($this->db);
|
||||||
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
|
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ print '<br>';
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
// Affiche lien sur autres annees
|
// Show link on other years
|
||||||
$linkforyear=array();
|
$linkforyear=array();
|
||||||
$found=0;
|
$found=0;
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
@@ -138,7 +138,7 @@ if (is_dir($dir))
|
|||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file))
|
if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file) && is_numeric($file))
|
||||||
{
|
{
|
||||||
$found=1;
|
$found=1;
|
||||||
$linkforyear[]=$file;
|
$linkforyear[]=$file;
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ if ($result)
|
|||||||
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">';
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">';
|
||||||
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
|
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
|
||||||
|
|
||||||
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ if ($result)
|
|||||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
|
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
|
||||||
|
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||||
|
|
||||||
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ if ($resql)
|
|||||||
|
|
||||||
print substr('000000'.$obj->rowid, -6);
|
print substr('000000'.$obj->rowid, -6);
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||||
|
|
||||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ if ($_GET["id"])
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
|
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
|
||||||
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
|
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
|
||||||
print '<input class="flat" type="file" name="userfile" size="80"><br>';
|
print '<input class="flat" type="file" name="userfile"><br>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Send").'">';
|
print '<center><input type="submit" class="button" value="'.$langs->trans("Send").'">';
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ if ($result)
|
|||||||
print substr('000000'.$obj->rowid, -6);
|
print substr('000000'.$obj->rowid, -6);
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||||
|
|
||||||
print '<td align="center">'.price($obj->amount)."</td>\n";
|
print '<td align="center">'.price($obj->amount)."</td>\n";
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ if ($result)
|
|||||||
|
|
||||||
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
||||||
|
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||||
|
|
||||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
|||||||
|
|
||||||
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Profit").'</td>';
|
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Profit").'</td>';
|
||||||
if ($modecompta == 'CREANCES-DETTES') print '<td class="border" align="right">'.price($total_ht).'</td>';
|
if ($modecompta == 'CREANCES-DETTES') print '<td class="border" align="right">'.price($total_ht).'</td>';
|
||||||
print '<td class="border" align="right">'.price($total_ttc).'</td>';
|
print '<td align="right">'.price($total_ttc).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|||||||
@@ -89,11 +89,16 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$html=new Form($db);
|
$html=new Form($db);
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$company_static=new Societe($db);
|
$company_static=new Societe($db);
|
||||||
|
|
||||||
|
$morequerystring='';
|
||||||
|
$listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
|
||||||
|
foreach($listofparams as $param)
|
||||||
|
{
|
||||||
|
if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
|
||||||
|
}
|
||||||
|
|
||||||
|
llxHeader('','','','',0,0,'','',$morequerystring);
|
||||||
|
|
||||||
$fsearch.='<br>';
|
$fsearch.='<br>';
|
||||||
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
|
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
|
||||||
@@ -131,7 +136,7 @@ if ($modetax==0) // Invoice for goods, payment for services
|
|||||||
$period=$html->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
$period=$html->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||||
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||||
$description=$langs->trans("RulesVATIn");
|
$description=$langs->trans("RulesVATIn");
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$description.=$fsearch;
|
$description.=$fsearch;
|
||||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
@@ -174,13 +179,13 @@ if (is_array($coll_list))
|
|||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($coll_list as $coll)
|
foreach($coll_list as $coll)
|
||||||
{
|
{
|
||||||
if($min == 0 or ($min>0 and $coll[2]>$min))
|
if($min == 0 or ($min > 0 && $coll->amount > $min))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$intra = str_replace($find,$replace,$coll[1]);
|
$intra = str_replace($find,$replace,$coll->tva_intra);
|
||||||
if(empty($intra))
|
if(empty($intra))
|
||||||
{
|
{
|
||||||
if($coll[4] == '1')
|
if($coll->assuj == '1')
|
||||||
{
|
{
|
||||||
$intra = $langs->trans('Unknown');
|
$intra = $langs->trans('Unknown');
|
||||||
}
|
}
|
||||||
@@ -191,15 +196,15 @@ if (is_array($coll_list))
|
|||||||
}
|
}
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td nowrap>".$i."</td>";
|
print "<td nowrap>".$i."</td>";
|
||||||
$company_static->id=$coll[5];
|
$company_static->id=$coll->socid;
|
||||||
$company_static->nom=$coll[0];
|
$company_static->nom=$coll->nom;
|
||||||
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
||||||
$find = array(' ','.');
|
$find = array(' ','.');
|
||||||
$replace = array('','');
|
$replace = array('','');
|
||||||
print "<td nowrap>".$intra."</td>";
|
print "<td nowrap>".$intra."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll[2])."</td>";
|
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll[3])."</td>";
|
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
||||||
$total = $total + $coll[3];
|
$total = $total + $coll->tva;
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@@ -246,13 +251,13 @@ if (is_array($coll_list))
|
|||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($coll_list as $coll)
|
foreach($coll_list as $coll)
|
||||||
{
|
{
|
||||||
if($min == 0 or ($min>0 and $coll[2]>$min))
|
if($min == 0 or ($min > 0 && $coll->amount > $min))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$intra = str_replace($find,$replace,$coll[1]);
|
$intra = str_replace($find,$replace,$coll->tva_intra);
|
||||||
if(empty($intra))
|
if(empty($intra))
|
||||||
{
|
{
|
||||||
if($coll[4] == '1')
|
if($coll->assuj == '1')
|
||||||
{
|
{
|
||||||
$intra = $langs->trans('Unknown');
|
$intra = $langs->trans('Unknown');
|
||||||
}
|
}
|
||||||
@@ -263,15 +268,15 @@ if (is_array($coll_list))
|
|||||||
}
|
}
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td nowrap>".$i."</td>";
|
print "<td nowrap>".$i."</td>";
|
||||||
$company_static->id=$coll[5];
|
$company_static->id=$coll->socid;
|
||||||
$company_static->nom=$coll[0];
|
$company_static->nom=$coll->nom;
|
||||||
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
||||||
$find = array(' ','.');
|
$find = array(' ','.');
|
||||||
$replace = array('','');
|
$replace = array('','');
|
||||||
print "<td nowrap>".$intra."</td>";
|
print "<td nowrap>".$intra."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll[2])."</td>";
|
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll[3])."</td>";
|
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
||||||
$total = $total + $coll[3];
|
$total = $total + $coll->tva;
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ if ($modetax==0) // Invoice for goods, payment for services
|
|||||||
else { $nextquarter=1; $nextyear++; }
|
else { $nextquarter=1; $nextyear++; }
|
||||||
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||||
$description=$langs->trans("RulesVATIn");
|
$description=$langs->trans("RulesVATIn");
|
||||||
if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$description.=$fsearch;
|
$description.=$fsearch;
|
||||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
|
|||||||
@@ -183,8 +183,7 @@ $dolibarr_main_authentication='dolibarr';
|
|||||||
|
|
||||||
# dolibarr_main_demo
|
# dolibarr_main_demo
|
||||||
# Login and pass to use in a demo mode
|
# Login and pass to use in a demo mode
|
||||||
# Default value: 0
|
# Default value: ''
|
||||||
# Possible values: 0 or 1
|
|
||||||
# Examples:
|
# Examples:
|
||||||
# $dolibarr_main_demo='autologin,autopass'
|
# $dolibarr_main_demo='autologin,autopass'
|
||||||
|
|
||||||
|
|||||||
@@ -107,16 +107,24 @@ class Contact extends CommonObject
|
|||||||
$this->name=trim($this->name);
|
$this->name=trim($this->name);
|
||||||
if (! $this->socid) $this->socid = 0;
|
if (! $this->socid) $this->socid = 0;
|
||||||
if (! $this->priv) $this->priv = 0;
|
if (! $this->priv) $this->priv = 0;
|
||||||
if (! $this->canvas) $this->canvas = 'default';
|
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user_creat, priv, canvas)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
|
||||||
$sql.= " VALUES ('".$this->db->idate($now)."',";
|
$sql.= " datec";
|
||||||
|
$sql.= ", fk_soc";
|
||||||
|
$sql.= ", name";
|
||||||
|
$sql.= ", fk_user_creat";
|
||||||
|
$sql.= ", priv";
|
||||||
|
$sql.= ", canvas";
|
||||||
|
$sql.= ", entity";
|
||||||
|
$sql.= ") VALUES (";
|
||||||
|
$sql.= "'".$this->db->idate($now)."',";
|
||||||
if ($this->socid > 0) $sql.= " ".$this->socid.",";
|
if ($this->socid > 0) $sql.= " ".$this->socid.",";
|
||||||
else $sql.= "null,";
|
else $sql.= "null,";
|
||||||
$sql.= "'".addslashes($this->name)."',";
|
$sql.= "'".$this->db->escape($this->name)."',";
|
||||||
$sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").",";
|
$sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").",";
|
||||||
$sql.= " ".$this->priv.",";
|
$sql.= " ".$this->priv.",";
|
||||||
$sql.= "'".$this->canvas."'";
|
$sql.= " ".($this->canvas?"'".$this->canvas."'":"null").",";
|
||||||
|
$sql.= " ".$conf->entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog("Contact::create sql=".$sql);
|
dol_syslog("Contact::create sql=".$sql);
|
||||||
@@ -205,24 +213,24 @@ class Contact extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
|
||||||
if ($this->socid > 0) $sql .= " fk_soc='".addslashes($this->socid)."',";
|
if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',";
|
||||||
if ($this->socid == -1) $sql .= " fk_soc=null,";
|
if ($this->socid == -1) $sql .= " fk_soc=null,";
|
||||||
$sql .= " civilite='".addslashes($this->civilite_id)."'";
|
$sql .= " civilite='".$this->db->escape($this->civilite_id)."'";
|
||||||
$sql .= ", name='".addslashes($this->name)."'";
|
$sql .= ", name='".$this->db->escape($this->name)."'";
|
||||||
$sql .= ", firstname='".addslashes($this->firstname)."'";
|
$sql .= ", firstname='".$this->db->escape($this->firstname)."'";
|
||||||
$sql .= ", address='".addslashes($this->address)."'";
|
$sql .= ", address='".$this->db->escape($this->address)."'";
|
||||||
$sql .= ", cp='".addslashes($this->cp)."'";
|
$sql .= ", cp='".$this->db->escape($this->cp)."'";
|
||||||
$sql .= ", ville='".addslashes($this->ville)."'";
|
$sql .= ", ville='".$this->db->escape($this->ville)."'";
|
||||||
$sql .= ", fk_pays=".($this->fk_pays>0?$this->fk_pays:'NULL');
|
$sql .= ", fk_pays=".($this->fk_pays>0?$this->fk_pays:'NULL');
|
||||||
$sql .= ", fk_departement=".($this->fk_departement>0?$this->fk_departement:'NULL');
|
$sql .= ", fk_departement=".($this->fk_departement>0?$this->fk_departement:'NULL');
|
||||||
$sql .= ", poste='".addslashes($this->poste)."'";
|
$sql .= ", poste='".$this->db->escape($this->poste)."'";
|
||||||
$sql .= ", fax='".addslashes($this->fax)."'";
|
$sql .= ", fax='".$this->db->escape($this->fax)."'";
|
||||||
$sql .= ", email='".addslashes($this->email)."'";
|
$sql .= ", email='".$this->db->escape($this->email)."'";
|
||||||
$sql .= ", note='".addslashes($this->note)."'";
|
$sql .= ", note='".$this->db->escape($this->note)."'";
|
||||||
$sql .= ", phone = '".addslashes($this->phone_pro)."'";
|
$sql .= ", phone = '".$this->db->escape($this->phone_pro)."'";
|
||||||
$sql .= ", phone_perso = '".addslashes($this->phone_perso)."'";
|
$sql .= ", phone_perso = '".$this->db->escape($this->phone_perso)."'";
|
||||||
$sql .= ", phone_mobile = '".addslashes($this->phone_mobile)."'";
|
$sql .= ", phone_mobile = '".$this->db->escape($this->phone_mobile)."'";
|
||||||
$sql .= ", jabberid = '".addslashes($this->jabberid)."'";
|
$sql .= ", jabberid = '".$this->db->escape($this->jabberid)."'";
|
||||||
$sql .= ", priv = '".$this->priv."'";
|
$sql .= ", priv = '".$this->priv."'";
|
||||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
|
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
|
||||||
$sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null");
|
$sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null");
|
||||||
@@ -458,17 +466,20 @@ class Contact extends CommonObject
|
|||||||
$this->civilite_id = $obj->civilite_id;
|
$this->civilite_id = $obj->civilite_id;
|
||||||
$this->name = $obj->name;
|
$this->name = $obj->name;
|
||||||
$this->firstname = $obj->firstname;
|
$this->firstname = $obj->firstname;
|
||||||
$this->nom = $obj->name;
|
$this->nom = $obj->name; // TODO deprecated
|
||||||
$this->prenom = $obj->firstname;
|
$this->prenom = $obj->firstname; // TODO deprecated
|
||||||
|
|
||||||
$this->address = $obj->address;
|
$this->address = $obj->address;
|
||||||
$this->adresse = $obj->address; // TODO obsolete
|
$this->adresse = $obj->address; // TODO deprecated
|
||||||
$this->cp = $obj->cp;
|
$this->cp = $obj->cp; // TODO deprecated
|
||||||
$this->ville = $obj->ville;
|
$this->zip = $obj->cp;
|
||||||
|
$this->ville = $obj->ville; // TODO deprecated
|
||||||
|
$this->town = $obj->ville;
|
||||||
|
|
||||||
$this->fk_departement = $obj->fk_departement;
|
$this->fk_departement = $obj->fk_departement;
|
||||||
$this->departement_code = $obj->departement_code;
|
$this->departement_code = $obj->departement_code;
|
||||||
$this->departement = $obj->departement;
|
$this->departement = $obj->departement; // TODO deprecated
|
||||||
|
$this->state = $obj->departement;
|
||||||
|
|
||||||
$this->fk_pays = $obj->fk_pays;
|
$this->fk_pays = $obj->fk_pays;
|
||||||
$this->pays_code = $obj->fk_pays?$obj->pays_code:'';
|
$this->pays_code = $obj->fk_pays?$obj->pays_code:'';
|
||||||
@@ -753,7 +764,7 @@ class Contact extends CommonObject
|
|||||||
{
|
{
|
||||||
$sql = "SELECT count(mc.email) as nb";
|
$sql = "SELECT count(mc.email) as nb";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||||
$sql.= " WHERE mc.email = '".addslashes($this->email)."'";
|
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
|
||||||
$sql.= " AND mc.statut=1"; // -1 erreur, 0 non envoye, 1 envoye avec succes
|
$sql.= " AND mc.statut=1"; // -1 erreur, 0 non envoye, 1 envoye avec succes
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@@ -801,8 +812,8 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le libelle de civilite du contact
|
* Return label of a civility contact
|
||||||
* \return string Nom traduit de la civilite
|
* @return string Translated name of civility
|
||||||
*/
|
*/
|
||||||
function getCivilityLabel()
|
function getCivilityLabel()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ $result = restrictedArea($user, 'contact', $contactid, 'socpeople');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Contact"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ $contact->fetch($_GET["id"], $user);
|
|||||||
|
|
||||||
$head = contact_prepare_head($contact);
|
$head = contact_prepare_head($contact);
|
||||||
|
|
||||||
dol_fiche_head($head, 'exportimport', $langs->trans("Contact"), 0, 'contact');
|
dol_fiche_head($head, 'exportimport', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
|||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
$langs->load("commercial");
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$socid = GETPOST("socid");
|
$socid = GETPOST("socid");
|
||||||
@@ -247,7 +248,7 @@ else
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
@@ -399,7 +400,7 @@ else
|
|||||||
*/
|
*/
|
||||||
$head = contact_prepare_head($object);
|
$head = contact_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Contact"), 0, 'contact');
|
dol_fiche_head($head, 'card', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->societe->contact->creer)
|
if ($user->rights->societe->contact->creer)
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ if ($search_priv < 0) $search_priv='';
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
@@ -136,19 +136,19 @@ else
|
|||||||
|
|
||||||
if ($search_nom) // filtre sur le nom
|
if ($search_nom) // filtre sur le nom
|
||||||
{
|
{
|
||||||
$sql .= " AND p.name like '%".addslashes($search_nom)."%'";
|
$sql .= " AND p.name like '%".$db->escape($search_nom)."%'";
|
||||||
}
|
}
|
||||||
if ($search_prenom) // filtre sur le prenom
|
if ($search_prenom) // filtre sur le prenom
|
||||||
{
|
{
|
||||||
$sql .= " AND p.firstname like '%".addslashes($search_prenom)."%'";
|
$sql .= " AND p.firstname like '%".$db->escape($search_prenom)."%'";
|
||||||
}
|
}
|
||||||
if ($search_societe) // filtre sur la societe
|
if ($search_societe) // filtre sur la societe
|
||||||
{
|
{
|
||||||
$sql .= " AND s.nom like '%".addslashes($search_societe)."%'";
|
$sql .= " AND s.nom like '%".$db->escape($search_societe)."%'";
|
||||||
}
|
}
|
||||||
if ($search_email) // filtre sur l'email
|
if ($search_email) // filtre sur l'email
|
||||||
{
|
{
|
||||||
$sql .= " AND p.email like '%".addslashes($search_email)."%'";
|
$sql .= " AND p.email like '%".$db->escape($search_email)."%'";
|
||||||
}
|
}
|
||||||
if ($type == "o") // filtre sur type
|
if ($type == "o") // filtre sur type
|
||||||
{
|
{
|
||||||
@@ -168,7 +168,7 @@ if ($type == "p") // filtre sur type
|
|||||||
}
|
}
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
$sql .= " AND (p.name like '%".addslashes($sall)."%' OR p.firstname like '%".addslashes($sall)."%' OR p.email like '%".addslashes($sall)."%') ";
|
$sql .= " AND (p.name like '%".$db->escape($sall)."%' OR p.firstname like '%".$db->escape($sall)."%' OR p.email like '%".$db->escape($sall)."%') ";
|
||||||
}
|
}
|
||||||
if ($socid)
|
if ($socid)
|
||||||
{
|
{
|
||||||
@@ -337,8 +337,10 @@ if ($result)
|
|||||||
// Private/Public
|
// Private/Public
|
||||||
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
|
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
|
||||||
|
|
||||||
// Link export vcard
|
// Links Add action and Export vcard
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&backtopage=1&contactid='.$obj->cidp.'&socid='.$obj->socid.'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
|
||||||
|
print ' ';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$obj->cidp.'">';
|
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$obj->cidp.'">';
|
||||||
print img_picto($langs->trans("VCard"),'vcard.png').' ';
|
print img_picto($langs->trans("VCard"),'vcard.png').' ';
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ $result = restrictedArea($user, 'contact',$contactid,'socpeople');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||||
|
|
||||||
|
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
@@ -51,7 +51,7 @@ $contact->fetch($_GET["id"], $user);
|
|||||||
|
|
||||||
$head = contact_prepare_head($contact);
|
$head = contact_prepare_head($contact);
|
||||||
|
|
||||||
dol_fiche_head($head, 'info', $langs->trans("Contact"), 0, 'contact');
|
dol_fiche_head($head, 'info', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
|
|||||||
@@ -79,13 +79,13 @@ if ($_GET["action"] == 'dolibarr2ldap')
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$head = contact_prepare_head($contact);
|
$head = contact_prepare_head($contact);
|
||||||
|
|
||||||
dol_fiche_head($head, 'ldap', $langs->trans("Contact"), 0, 'contact');
|
dol_fiche_head($head, 'ldap', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ if ($user->rights->societe->contact->creer)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ $contact->fetch($_GET["id"], $user);
|
|||||||
|
|
||||||
$head = contact_prepare_head($contact);
|
$head = contact_prepare_head($contact);
|
||||||
|
|
||||||
dol_fiche_head($head, 'perso', $langs->trans("Contact"), 0, 'contact');
|
dol_fiche_head($head, 'perso', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -351,6 +351,8 @@ class Contrat extends CommonObject
|
|||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
|
$this->lines=array();
|
||||||
|
|
||||||
// Selectionne les lignes contrats liees a un produit
|
// Selectionne les lignes contrats liees a un produit
|
||||||
$sql = "SELECT p.label, p.description as product_desc, p.ref,";
|
$sql = "SELECT p.label, p.description as product_desc, p.ref,";
|
||||||
$sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.remise_percent, d.subprice,";
|
$sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.remise_percent, d.subprice,";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@@ -42,13 +42,15 @@ $langs->load("bills");
|
|||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid = GETPOST("socid");
|
||||||
$contratid = isset($_GET["id"])?$_GET["id"]:'';
|
$contratid = GETPOST("id");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'contrat',$contratid,'contrat');
|
$result=restrictedArea($user,'contrat',$contratid,'contrat');
|
||||||
|
|
||||||
$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
|
$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
|
||||||
|
|
||||||
|
$object = new Contrat($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@@ -56,33 +58,31 @@ $usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
|
|||||||
|
|
||||||
if ($_REQUEST["action"] == 'confirm_active' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
|
if ($_REQUEST["action"] == 'confirm_active' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->fetch($_GET["id"]);
|
||||||
$contrat->fetch($_GET["id"]);
|
$result = $object->active_line($user, $_GET["ligne"], $_GET["date"], $_GET["dateend"], $_GET["comment"]);
|
||||||
$result = $contrat->active_line($user, $_GET["ligne"], $_GET["date"], $_GET["dateend"], $_GET["comment"]);
|
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$contrat->id);
|
Header("Location: fiche.php?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mesg=$contrat->error;
|
$mesg=$object->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST["action"] == 'confirm_closeline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
|
if ($_REQUEST["action"] == 'confirm_closeline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->fetch($_GET["id"]);
|
||||||
$contrat->fetch($_GET["id"]);
|
$result = $object->close_line($user, $_GET["ligne"], $_GET["dateend"], urldecode($_GET["comment"]));
|
||||||
$result = $contrat->close_line($user, $_GET["ligne"], $_GET["dateend"], urldecode($_GET["comment"]));
|
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$contrat->id);
|
Header("Location: fiche.php?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mesg=$contrat->error;
|
$mesg=$object->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,27 +145,25 @@ if ($_POST["remonth"] && $_POST["reday"] && $_POST["reyear"])
|
|||||||
|
|
||||||
if ($_POST["action"] == 'add')
|
if ($_POST["action"] == 'add')
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->socid = $_POST["socid"];
|
||||||
|
$object->date_contrat = $datecontrat;
|
||||||
|
|
||||||
$contrat->socid = $_POST["socid"];
|
$object->commercial_suivi_id = $_POST["commercial_suivi_id"];
|
||||||
$contrat->date_contrat = $datecontrat;
|
$object->commercial_signature_id = $_POST["commercial_signature_id"];
|
||||||
|
|
||||||
$contrat->commercial_suivi_id = $_POST["commercial_suivi_id"];
|
$object->note = trim($_POST["note"]);
|
||||||
$contrat->commercial_signature_id = $_POST["commercial_signature_id"];
|
$object->fk_project = trim($_POST["projectid"]);
|
||||||
|
$object->remise_percent = trim($_POST["remise_percent"]);
|
||||||
|
$object->ref = trim($_POST["ref"]);
|
||||||
|
|
||||||
$contrat->note = trim($_POST["note"]);
|
$result = $object->create($user,$langs,$conf);
|
||||||
$contrat->fk_project = trim($_POST["projectid"]);
|
|
||||||
$contrat->remise_percent = trim($_POST["remise_percent"]);
|
|
||||||
$contrat->ref = trim($_POST["ref"]);
|
|
||||||
|
|
||||||
$result = $contrat->create($user,$langs,$conf);
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$contrat->id);
|
Header("Location: fiche.php?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mesg='<div class="error">'.$contrat->error.'</div>';
|
$mesg='<div class="error">'.$object->error.'</div>';
|
||||||
}
|
}
|
||||||
$_GET["socid"]=$_POST["socid"];
|
$_GET["socid"]=$_POST["socid"];
|
||||||
$_GET["action"]='create';
|
$_GET["action"]='create';
|
||||||
@@ -174,23 +172,21 @@ if ($_POST["action"] == 'add')
|
|||||||
|
|
||||||
if ($_POST["action"] == 'classin')
|
if ($_POST["action"] == 'classin')
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->fetch($_GET["id"]);
|
||||||
$contrat->fetch($_GET["id"]);
|
$object->setProject($_POST["projectid"]);
|
||||||
$contrat->setProject($_POST["projectid"]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'addline' && $user->rights->contrat->creer)
|
if ($_POST["action"] == 'addline' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
if ($_POST["pqty"] && (($_POST["pu"] != '' && $_POST["desc"]) || $_POST["p_idprod"]))
|
if ($_POST["pqty"] && (($_POST["pu"] != '' && $_POST["desc"]) || $_POST["idprod"]))
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$ret=$object->fetch($_GET["id"]);
|
||||||
$ret=$contrat->fetch($_GET["id"]);
|
|
||||||
if ($ret < 0)
|
if ($ret < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$commande->error);
|
dol_print_error($db,$commande->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$ret=$contrat->fetch_thirdparty();
|
$ret=$object->fetch_thirdparty();
|
||||||
|
|
||||||
$date_start='';
|
$date_start='';
|
||||||
$date_end='';
|
$date_end='';
|
||||||
@@ -223,25 +219,27 @@ if ($_POST["action"] == 'addline' && $user->rights->contrat->creer)
|
|||||||
// Ecrase $desc par celui du produit
|
// Ecrase $desc par celui du produit
|
||||||
// Ecrase $txtva par celui du produit
|
// Ecrase $txtva par celui du produit
|
||||||
// Ecrase $base_price_type par celui du produit
|
// Ecrase $base_price_type par celui du produit
|
||||||
if ($_POST['p_idprod'])
|
if ($_POST['idprod'])
|
||||||
{
|
{
|
||||||
$prod = new Product($db, $_POST['p_idprod']);
|
$prod = new Product($db, $_POST['idprod']);
|
||||||
$prod->fetch($_POST['p_idprod']);
|
$prod->fetch($_POST['idprod']);
|
||||||
|
|
||||||
$tva_tx = get_default_tva($mysoc,$contrat->client,$prod->id);
|
$tva_tx = get_default_tva($mysoc,$object->client,$prod->id);
|
||||||
$tva_npr = get_default_npr($mysoc,$contrat->client,$prod->id);
|
$tva_npr = get_default_npr($mysoc,$object->client,$prod->id);
|
||||||
|
|
||||||
// On defini prix unitaire
|
// On defini prix unitaire
|
||||||
if ($conf->global->PRODUIT_MULTIPRICES && $contrat->client->price_level)
|
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level)
|
||||||
{
|
{
|
||||||
$pu_ht = $prod->multiprices[$contrat->client->price_level];
|
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||||
$pu_ttc = $prod->multiprices_ttc[$contrat->client->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$contrat->client->price_level];
|
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||||
|
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pu_ht = $prod->price;
|
$pu_ht = $prod->price;
|
||||||
$pu_ttc = $prod->price_ttc;
|
$pu_ttc = $prod->price_ttc;
|
||||||
|
$price_min = $prod->price_min;
|
||||||
$price_base_type = $prod->price_base_type;
|
$price_base_type = $prod->price_base_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,21 +270,28 @@ if ($_POST["action"] == 'addline' && $user->rights->contrat->creer)
|
|||||||
$desc=$_POST['desc'];
|
$desc=$_POST['desc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$localtax1_tx=get_localtax($tva_tx,1,$contrat->client);
|
$localtax1_tx=get_localtax($tva_tx,1,$object->client);
|
||||||
$localtax2_tx=get_localtax($tva_tx,2,$contrat->client);
|
$localtax2_tx=get_localtax($tva_tx,2,$object->client);
|
||||||
|
|
||||||
$info_bits=0;
|
$info_bits=0;
|
||||||
if ($tva_npr) $info_bits |= 0x01;
|
if ($tva_npr) $info_bits |= 0x01;
|
||||||
|
|
||||||
|
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||||
|
{
|
||||||
|
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)) ;
|
||||||
|
$result = -1 ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Insert line
|
// Insert line
|
||||||
$result = $contrat->addline(
|
$result = $object->addline(
|
||||||
$desc,
|
$desc,
|
||||||
$pu_ht,
|
$pu_ht,
|
||||||
$_POST["pqty"],
|
$_POST["pqty"],
|
||||||
$tva_tx,
|
$tva_tx,
|
||||||
$localtax1_tx,
|
$localtax1_tx,
|
||||||
$localtax2_tx,
|
$localtax2_tx,
|
||||||
$_POST["p_idprod"],
|
$_POST["idprod"],
|
||||||
$_POST["premise"],
|
$_POST["premise"],
|
||||||
$date_start,
|
$date_start,
|
||||||
$date_end,
|
$date_end,
|
||||||
@@ -294,6 +299,7 @@ if ($_POST["action"] == 'addline' && $user->rights->contrat->creer)
|
|||||||
$pu_ttc,
|
$pu_ttc,
|
||||||
$info_bits
|
$info_bits
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@@ -302,50 +308,52 @@ if ($_POST["action"] == 'addline' && $user->rights->contrat->creer)
|
|||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang='';
|
$newlang='';
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$contrat->client->default_lang;
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||||
if (! empty($newlang))
|
if (! empty($newlang))
|
||||||
{
|
{
|
||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
contrat_pdf_create($db, $contrat->id, $contrat->modelpdf, $outputlangs);
|
contrat_pdf_create($db, $object->id, $object->modelpdf, $outputlangs);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$contrat->error.'</div>';
|
$mesg='<div class="error">'.$object->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer && ! $_POST["cancel"])
|
if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer && ! $_POST["cancel"])
|
||||||
{
|
{
|
||||||
$contratline = new ContratLigne($db);
|
$objectline = new ContratLigne($db);
|
||||||
if ($contratline->fetch($_POST["elrowid"]))
|
if ($objectline->fetch($_POST["elrowid"]))
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
if ($date_start_real_update == '') $date_start_real_update=$contratline->date_ouverture;
|
if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture;
|
||||||
if ($date_end_real_update == '') $date_end_real_update=$contratline->date_cloture;
|
if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture;
|
||||||
|
|
||||||
$localtax1_tx=get_localtax($_POST["eltva_tx"],1,$contrat->client);
|
$localtax1_tx=get_localtax($_POST["eltva_tx"],1,$object->client);
|
||||||
$localtax2_tx=get_localtax($_POST["eltva_tx"],2,$contrat->client);
|
$localtax2_tx=get_localtax($_POST["eltva_tx"],2,$object->client);
|
||||||
|
|
||||||
$contratline->description=$_POST["eldesc"];
|
$objectline->description=$_POST["eldesc"];
|
||||||
$contratline->price_ht=$_POST["elprice"];
|
$objectline->price_ht=$_POST["elprice"];
|
||||||
$contratline->subprice=$_POST["elprice"];
|
$objectline->subprice=$_POST["elprice"];
|
||||||
$contratline->qty=$_POST["elqty"];
|
$objectline->qty=$_POST["elqty"];
|
||||||
$contratline->remise_percent=$_POST["elremise_percent"];
|
$objectline->remise_percent=$_POST["elremise_percent"];
|
||||||
$contratline->tva_tx=$_POST["eltva_tx"];
|
$objectline->tva_tx=$_POST["eltva_tx"];
|
||||||
$contratline->localtax1_tx=$localtax1_tx;
|
$objectline->localtax1_tx=$localtax1_tx;
|
||||||
$contratline->localtax2_tx=$localtax2_tx;
|
$objectline->localtax2_tx=$localtax2_tx;
|
||||||
$contratline->date_ouverture_prevue=$date_start_update;
|
$objectline->date_ouverture_prevue=$date_start_update;
|
||||||
$contratline->date_ouverture=$date_start_real_update;
|
$objectline->date_ouverture=$date_start_real_update;
|
||||||
$contratline->date_fin_validite=$date_end_update;
|
$objectline->date_fin_validite=$date_end_update;
|
||||||
$contratline->date_cloture=$date_end_real_update;
|
$objectline->date_cloture=$date_end_real_update;
|
||||||
$contratline->fk_user_cloture=$user->id;
|
$objectline->fk_user_cloture=$user->id;
|
||||||
|
|
||||||
$result=$contratline->update($user);
|
// TODO verifier price_min si fk_product et multiprix
|
||||||
|
|
||||||
|
$result=$objectline->update($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@@ -364,43 +372,39 @@ if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer && ! $_PO
|
|||||||
|
|
||||||
if ($_REQUEST["action"] == 'confirm_deleteline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
if ($_REQUEST["action"] == 'confirm_deleteline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->fetch($_GET["id"]);
|
||||||
$contrat->fetch($_GET["id"]);
|
$result = $object->deleteline($_GET["lineid"],$user);
|
||||||
$result = $contrat->deleteline($_GET["lineid"],$user);
|
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$contrat->id);
|
Header("Location: fiche.php?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg=$contrat->error;
|
$mesg=$object->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->fetch($_GET["id"]);
|
||||||
$contrat->fetch($_GET["id"]);
|
$result = $object->validate($user,$langs,$conf);
|
||||||
$result = $contrat->validate($user,$langs,$conf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close all lines
|
// Close all lines
|
||||||
if ($_REQUEST["action"] == 'confirm_close' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
if ($_REQUEST["action"] == 'confirm_close' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->fetch($_GET["id"]);
|
||||||
$contrat->fetch($_GET["id"]);
|
$result = $object->cloture($user,$langs,$conf);
|
||||||
$result = $contrat->cloture($user,$langs,$conf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes')
|
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes')
|
||||||
{
|
{
|
||||||
if ($user->rights->contrat->supprimer)
|
if ($user->rights->contrat->supprimer)
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$object->id = $_GET["id"];
|
||||||
$contrat->id = $_GET["id"];
|
$result=$object->delete($user,$langs,$conf);
|
||||||
$result=$contrat->delete($user,$langs,$conf);
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
Header("Location: index.php");
|
Header("Location: index.php");
|
||||||
@@ -408,7 +412,7 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$contrat->error.'</div>';
|
$mesg='<div class="error">'.$object->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -430,7 +434,7 @@ if ($_REQUEST["action"] == 'confirm_move' && $_REQUEST["confirm"] == 'yes')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$contrat->error.'</div>';
|
$mesg='<div class="error">'.$object->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -450,7 +454,7 @@ llxHeader('',$langs->trans("ContractCard"),"Contrat");
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
$contratlignestatic=new ContratLigne($db);
|
$objectlignestatic=new ContratLigne($db);
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
@@ -464,24 +468,10 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
|
|
||||||
$new_contrat = new Contrat($db);
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.prefix_comm, s.rowid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
$sql.= " WHERE s.rowid = ".$_GET["socid"];
|
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($obj->rowid);
|
$soc->fetch($socid);
|
||||||
|
|
||||||
print '<form name="contrat" action="fiche.php" method="post">';
|
print '<form name="contrat" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
@@ -492,7 +482,7 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td>'.$langs->trans("Ref").'</td>';
|
print '<tr><td>'.$langs->trans("Ref").'</td>';
|
||||||
print '<td><input type="text" maxlength="30" name="ref" size="20" value="'.$_REQUEST["ref"].'"></td></tr>';
|
print '<td><input type="text" maxlength="30" name="ref" size="20" value="'.GETPOST("ref").'"></td></tr>';
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
||||||
@@ -510,12 +500,12 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
// Commercial suivi
|
// Commercial suivi
|
||||||
print '<tr><td width="20%" nowrap><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>';
|
print '<tr><td width="20%" nowrap><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>';
|
||||||
print $form->select_users($_REQUEST["commercial_suivi_id"],'commercial_suivi_id',1,'');
|
print $form->select_users(GETPOST("commercial_suivi_id"),'commercial_suivi_id',1,'');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Commercial signature
|
// Commercial signature
|
||||||
print '<tr><td width="20%" nowrap><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>';
|
print '<tr><td width="20%" nowrap><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>';
|
||||||
print $form->select_users($_REQUEST["commercial_signature_id"],'commercial_signature_id',1,'');
|
print $form->select_users(GETPOST("commercial_signature_id"),'commercial_signature_id',1,'');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>';
|
||||||
@@ -525,34 +515,32 @@ if ($_GET["action"] == 'create')
|
|||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||||
select_projects($soc->id,$_REQUEST["projectid"],"projectid");
|
select_projects($soc->id,GETPOST("projectid"),"projectid");
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("NotePublic").'</td><td valign="top">';
|
print '<tr><td>'.$langs->trans("NotePublic").'</td><td valign="top">';
|
||||||
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
||||||
print $_REQUEST["note_public"];
|
print GETPOST("note_public");
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|
||||||
if (! $user->societe_id)
|
if (! $user->societe_id)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("NotePrivate").'</td><td valign="top">';
|
print '<tr><td>'.$langs->trans("NotePrivate").'</td><td valign="top">';
|
||||||
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
||||||
print $_REQUEST["note"];
|
print GETPOST("note");
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></td></tr>';
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
|
// TODO A quoi ca sert ?
|
||||||
|
/*
|
||||||
if ($propalid)
|
if ($propalid)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Produits
|
|
||||||
*/
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_titre($langs->trans("Products"));
|
print_titre($langs->trans("Products"));
|
||||||
|
|
||||||
@@ -618,12 +606,7 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
@@ -634,39 +617,38 @@ else
|
|||||||
/* */
|
/* */
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
{
|
{
|
||||||
$now=gmmktime();
|
$now=dol_now();
|
||||||
|
|
||||||
$id = $_GET["id"];
|
$id = $_GET["id"];
|
||||||
$ref= $_GET['ref'];
|
$ref= $_GET['ref'];
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
$contrat = new Contrat($db);
|
$result=$object->fetch($_GET['id'],$_GET['ref']);
|
||||||
$result=$contrat->fetch($_GET['id'],$_GET['ref']);
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$id = $contrat->id; // if $_GET['ref']
|
$id = $object->id; // if $_GET['ref']
|
||||||
$result=$contrat->fetch_lines();
|
$result=$object->fetch_lines();
|
||||||
}
|
}
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$contrat->error);
|
dol_print_error($db,$object->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
|
|
||||||
$nbofservices=sizeof($contrat->lines);
|
$nbofservices=sizeof($object->lines);
|
||||||
|
|
||||||
$author = new User($db);
|
$author = new User($db);
|
||||||
$author->fetch($contrat->user_author_id);
|
$author->fetch($object->user_author_id);
|
||||||
|
|
||||||
$commercial_signature = new User($db);
|
$commercial_signature = new User($db);
|
||||||
$commercial_signature->fetch($contrat->commercial_signature_id);
|
$commercial_signature->fetch($object->commercial_signature_id);
|
||||||
|
|
||||||
$commercial_suivi = new User($db);
|
$commercial_suivi = new User($db);
|
||||||
$commercial_suivi->fetch($contrat->commercial_suivi_id);
|
$commercial_suivi->fetch($object->commercial_suivi_id);
|
||||||
|
|
||||||
$head = contract_prepare_head($contrat);
|
$head = contract_prepare_head($object);
|
||||||
|
|
||||||
$hselected = 0;
|
$hselected = 0;
|
||||||
|
|
||||||
@@ -704,7 +686,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Contrat
|
* Contrat
|
||||||
*/
|
*/
|
||||||
if ($contrat->brouillon && $user->rights->contrat->creer)
|
if ($object->brouillon && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
print '<form action="fiche.php?id='.$id.'" method="post">';
|
print '<form action="fiche.php?id='.$id.'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
@@ -715,18 +697,18 @@ else
|
|||||||
|
|
||||||
// Ref du contrat
|
// Ref du contrat
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $html->showrefnav($contrat,'ref','',1,'ref','ref','');
|
print $html->showrefnav($object,'ref','',1,'ref','ref','');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
print "<tr><td>".$langs->trans("Customer")."</td>";
|
print "<tr><td>".$langs->trans("Customer")."</td>";
|
||||||
print '<td colspan="3">'.$contrat->societe->getNomUrl(1).'</td></tr>';
|
print '<td colspan="3">'.$object->societe->getNomUrl(1).'</td></tr>';
|
||||||
|
|
||||||
// Ligne info remises tiers
|
// Ligne info remises tiers
|
||||||
print '<tr><td>'.$langs->trans('Discount').'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans('Discount').'</td><td colspan="3">';
|
||||||
if ($contrat->societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$contrat->societe->remise_client);
|
if ($object->societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$object->societe->remise_client);
|
||||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||||
$absolute_discount=$contrat->societe->getAvailableDiscounts();
|
$absolute_discount=$object->societe->getAvailableDiscounts();
|
||||||
print '. ';
|
print '. ';
|
||||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||||
@@ -735,13 +717,13 @@ else
|
|||||||
|
|
||||||
// Statut contrat
|
// Statut contrat
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">';
|
||||||
if ($contrat->statut==0) print $contrat->getLibStatut(2);
|
if ($object->statut==0) print $object->getLibStatut(2);
|
||||||
else print $contrat->getLibStatut(4);
|
else print $object->getLibStatut(4);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||||
print '<td colspan="3">'.dol_print_date($contrat->date_contrat,"dayhour")."</td></tr>\n";
|
print '<td colspan="3">'.dol_print_date($object->date_contrat,"dayhour")."</td></tr>\n";
|
||||||
|
|
||||||
// Projet
|
// Projet
|
||||||
if ($conf->projet->enabled)
|
if ($conf->projet->enabled)
|
||||||
@@ -756,18 +738,18 @@ else
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($_GET["action"] == "classer")
|
if ($_GET["action"] == "classer")
|
||||||
{
|
{
|
||||||
$form->form_project("fiche.php?id=$id",$contrat->socid,$contrat->fk_project,"projectid");
|
$form->form_project("fiche.php?id=$id",$object->socid,$object->fk_project,"projectid");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form->form_project("fiche.php?id=$id",$contrat->socid,$contrat->fk_project,"none");
|
$form->form_project("fiche.php?id=$id",$object->socid,$object->fk_project,"none");
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
if ($contrat->brouillon == 1 && $user->rights->contrat->creer)
|
if ($object->brouillon == 1 && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@@ -777,7 +759,7 @@ else
|
|||||||
$servicepos=(isset($_REQUEST["servicepos"])?$_REQUEST["servicepos"]:1);
|
$servicepos=(isset($_REQUEST["servicepos"])?$_REQUEST["servicepos"]:1);
|
||||||
$colorb='666666';
|
$colorb='666666';
|
||||||
|
|
||||||
$arrayothercontracts=$contrat->getListOfContracts('others');
|
$arrayothercontracts=$object->getListOfContracts('others');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lines of contracts
|
* Lines of contracts
|
||||||
@@ -805,7 +787,7 @@ else
|
|||||||
$sql.= " p.ref, p.label";
|
$sql.= " p.ref, p.label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||||
$sql.= " WHERE cd.rowid = ".$contrat->lines[$cursorline-1]->id;
|
$sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -861,28 +843,28 @@ else
|
|||||||
}
|
}
|
||||||
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
|
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
|
||||||
print '<td align="right" nowrap="nowrap">';
|
print '<td align="right" nowrap="nowrap">';
|
||||||
if ($user->rights->contrat->creer && sizeof($arrayothercontracts) && ($contrat->statut >= 0))
|
if ($user->rights->contrat->creer && sizeof($arrayothercontracts) && ($object->statut >= 0))
|
||||||
{
|
{
|
||||||
print '<a href="fiche.php?id='.$contrat->id.'&action=move&rowid='.$objp->rowid.'">';
|
print '<a href="fiche.php?id='.$object->id.'&action=move&rowid='.$objp->rowid.'">';
|
||||||
print img_picto($langs->trans("MoveToAnotherContract"),'uparrow');
|
print img_picto($langs->trans("MoveToAnotherContract"),'uparrow');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
if ($user->rights->contrat->creer && ($contrat->statut >= 0))
|
if ($user->rights->contrat->creer && ($object->statut >= 0))
|
||||||
{
|
{
|
||||||
print '<a href="fiche.php?id='.$contrat->id.'&action=editline&rowid='.$objp->rowid.'">';
|
print '<a href="fiche.php?id='.$object->id.'&action=editline&rowid='.$objp->rowid.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
if ( $user->rights->contrat->creer && ($contrat->statut >= 0))
|
if ( $user->rights->contrat->creer && ($object->statut >= 0))
|
||||||
{
|
{
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a href="fiche.php?id='.$contrat->id.'&action=deleteline&rowid='.$objp->rowid.'">';
|
print '<a href="fiche.php?id='.$object->id.'&action=deleteline&rowid='.$objp->rowid.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@@ -941,7 +923,7 @@ else
|
|||||||
}
|
}
|
||||||
print '<textarea name="eldesc" cols="70" rows="1">'.$objp->description.'</textarea></td>';
|
print '<textarea name="eldesc" cols="70" rows="1">'.$objp->description.'</textarea></td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print $form->select_tva("eltva_tx",$objp->tva_tx,$mysoc,$contrat->societe);
|
print $form->select_tva("eltva_tx",$objp->tva_tx,$mysoc,$object->societe);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
|
print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
|
||||||
print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>';
|
print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>';
|
||||||
@@ -969,7 +951,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contrat->statut > 0)
|
if ($object->statut > 0)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr '.$bc[false].'>';
|
||||||
print '<td colspan="6"><hr></td>';
|
print '<td colspan="6"><hr></td>';
|
||||||
@@ -982,16 +964,16 @@ else
|
|||||||
/*
|
/*
|
||||||
* Confirmation to delete service line of contract
|
* Confirmation to delete service line of contract
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"] == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $contrat->lines[$cursorline-1]->id == $_GET["rowid"])
|
if ($_REQUEST["action"] == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == $_GET["rowid"])
|
||||||
{
|
{
|
||||||
$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&lineid=".$_GET["rowid"],$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1);
|
$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".$_GET["rowid"],$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1);
|
||||||
if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation to move service toward another contract
|
* Confirmation to move service toward another contract
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"] == 'move' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $contrat->lines[$cursorline-1]->id == $_GET["rowid"])
|
if ($_REQUEST["action"] == 'move' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == $_GET["rowid"])
|
||||||
{
|
{
|
||||||
$arraycontractid=array();
|
$arraycontractid=array();
|
||||||
foreach($arrayothercontracts as $contractcursor)
|
foreach($arrayothercontracts as $contractcursor)
|
||||||
@@ -1004,50 +986,50 @@ else
|
|||||||
'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"),
|
'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"),
|
||||||
array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
|
array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
|
||||||
|
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&lineid=".$_GET["rowid"],$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion);
|
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".$_GET["rowid"],$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion);
|
||||||
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la validation activation
|
* Confirmation de la validation activation
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"] == 'active' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $contrat->lines[$cursorline-1]->id == $_GET["ligne"])
|
if ($_REQUEST["action"] == 'active' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $object->lines[$cursorline-1]->id == $_GET["ligne"])
|
||||||
{
|
{
|
||||||
$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||||
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
||||||
$comment = $_POST["comment"];
|
$comment = $_POST["comment"];
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1);
|
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1);
|
||||||
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la validation fermeture
|
* Confirmation de la validation fermeture
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"] == 'closeline' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $contrat->lines[$cursorline-1]->id == $_GET["ligne"])
|
if ($_REQUEST["action"] == 'closeline' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $object->lines[$cursorline-1]->id == $_GET["ligne"])
|
||||||
{
|
{
|
||||||
$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||||
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
||||||
$comment = $_POST["comment"];
|
$comment = $_POST["comment"];
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1);
|
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1);
|
||||||
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Area with status and activation info of line
|
// Area with status and activation info of line
|
||||||
if ($contrat->statut > 0)
|
if ($object->statut > 0)
|
||||||
{
|
{
|
||||||
print '<table class="notopnoleft" width="100%">';
|
print '<table class="notopnoleft" width="100%">';
|
||||||
|
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr '.$bc[false].'>';
|
||||||
print '<td>'.$langs->trans("ServiceStatus").': '.$contrat->lines[$cursorline-1]->getLibStatut(4).'</td>';
|
print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).'</td>';
|
||||||
print '<td width="30" align="right">';
|
print '<td width="30" align="right">';
|
||||||
if ($user->societe_id == 0)
|
if ($user->societe_id == 0)
|
||||||
{
|
{
|
||||||
if ($contrat->statut > 0 && $_REQUEST["action"] != 'activateline' && $_REQUEST["action"] != 'unactivateline')
|
if ($object->statut > 0 && $_REQUEST["action"] != 'activateline' && $_REQUEST["action"] != 'unactivateline')
|
||||||
{
|
{
|
||||||
$action='activateline';
|
$action='activateline';
|
||||||
if ($objp->statut == 4) $action='unactivateline';
|
if ($objp->statut == 4) $action='unactivateline';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$contrat->id.'&ligne='.$contrat->lines[$cursorline-1]->id.'&action='.$action.'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.$object->lines[$cursorline-1]->id.'&action='.$action.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@@ -1086,12 +1068,12 @@ else
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->contrat->activer && $_REQUEST["action"] == 'activateline' && $contrat->lines[$cursorline-1]->id == $_GET["ligne"])
|
if ($user->rights->contrat->activer && $_REQUEST["action"] == 'activateline' && $object->lines[$cursorline-1]->id == $_GET["ligne"])
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Activer la ligne de contrat
|
* Activer la ligne de contrat
|
||||||
*/
|
*/
|
||||||
print '<form name="active" action="'.$_SERVER["PHP_SELF"].'?id='.$contrat->id.'&ligne='.$_GET["ligne"].'&action=active" method="post">';
|
print '<form name="active" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.$_GET["ligne"].'&action=active" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@@ -1136,12 +1118,12 @@ else
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->contrat->activer && $_REQUEST["action"] == 'unactivateline' && $contrat->lines[$cursorline-1]->id == $_GET["ligne"])
|
if ($user->rights->contrat->activer && $_REQUEST["action"] == 'unactivateline' && $object->lines[$cursorline-1]->id == $_GET["ligne"])
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Desactiver la ligne de contrat
|
* Desactiver la ligne de contrat
|
||||||
*/
|
*/
|
||||||
print '<form name="closeline" action="'.$_SERVER["PHP_SELF"].'?id='.$contrat->id.'&ligne='.$contrat->lines[$cursorline-1]->id.'&action=closeline" method="post">';
|
print '<form name="closeline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.$object->lines[$cursorline-1]->id.'&action=closeline" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@@ -1197,7 +1179,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Ajouter une ligne produit/service
|
* Ajouter une ligne produit/service
|
||||||
*/
|
*/
|
||||||
if ($user->rights->contrat->creer && ($contrat->statut >= 0))
|
if ($user->rights->contrat->creer && ($object->statut >= 0))
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">'; // Array with (n*2)+1 lines
|
print '<table class="noborder" width="100%">'; // Array with (n*2)+1 lines
|
||||||
@@ -1225,15 +1207,15 @@ else
|
|||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
// multiprix
|
// multiprix
|
||||||
if($conf->global->PRODUIT_MULTIPRICES)
|
if($conf->global->PRODUIT_MULTIPRICES)
|
||||||
$form->select_produits('','p_idprod',1,$conf->product->limit_size,$contrat->societe->price_level);
|
$form->select_produits('','idprod',1,$conf->product->limit_size,$object->societe->price_level);
|
||||||
else
|
else
|
||||||
$form->select_produits('','p_idprod',1,$conf->product->limit_size);
|
$form->select_produits('','idprod',1,$conf->product->limit_size);
|
||||||
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
||||||
print '<textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea>';
|
print '<textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>';
|
print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>';
|
||||||
print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="'.$contrat->societe->remise_client.'">%</td>';
|
print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="'.$object->societe->remise_client.'">%</td>';
|
||||||
print '<td align="center" colspan="2" rowspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<td align="center" colspan="2" rowspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
@@ -1261,11 +1243,11 @@ else
|
|||||||
print '<td><textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea></td>';
|
print '<td><textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea></td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$form->select_tva("tva_tx",$conf->defaulttx,$mysoc,$contrat->societe);
|
$form->select_tva("tva_tx",$conf->defaulttx,$mysoc,$object->societe);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right"><input type="text" class="flat" size="4" name="pu" value=""></td>';
|
print '<td align="right"><input type="text" class="flat" size="4" name="pu" value=""></td>';
|
||||||
print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>';
|
print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>';
|
||||||
print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="'.$contrat->societe->remise_client.'">%</td>';
|
print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="'.$object->societe->remise_client.'">%</td>';
|
||||||
print '<td align="center" rowspan="2" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<td align="center" rowspan="2" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
@@ -1301,20 +1283,20 @@ else
|
|||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($contrat->statut == 0 && $nbofservices)
|
if ($object->statut == 0 && $nbofservices)
|
||||||
{
|
{
|
||||||
if ($user->rights->contrat->creer) print '<a class="butAction" href="fiche.php?id='.$id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
if ($user->rights->contrat->creer) print '<a class="butAction" href="fiche.php?id='.$id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||||
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a>';
|
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->facture->enabled && $contrat->statut > 0)
|
if ($conf->facture->enabled && $object->statut > 0)
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
if ($user->rights->facture->creer) print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$contrat->element.'&originid='.$contrat->id.'&socid='.$contrat->societe->id.'">'.$langs->trans("CreateBill").'</a>';
|
if ($user->rights->facture->creer) print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->societe->id.'">'.$langs->trans("CreateBill").'</a>';
|
||||||
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateBill").'</a>';
|
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateBill").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contrat->nbofservicesclosed < $nbofservices)
|
if ($object->nbofservicesclosed < $nbofservices)
|
||||||
{
|
{
|
||||||
//if (! $numactive)
|
//if (! $numactive)
|
||||||
//{
|
//{
|
||||||
@@ -1329,7 +1311,7 @@ else
|
|||||||
// On peut supprimer entite si
|
// On peut supprimer entite si
|
||||||
// - Droit de creer + mode brouillon (erreur creation)
|
// - Droit de creer + mode brouillon (erreur creation)
|
||||||
// - Droit de supprimer
|
// - Droit de supprimer
|
||||||
if (($user->rights->contrat->creer && $contrat->statut == 0) || $user->rights->contrat->supprimer)
|
if (($user->rights->contrat->creer && $object->statut == 0) || $user->rights->contrat->supprimer)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?id='.$id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?id='.$id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
@@ -1341,17 +1323,17 @@ else
|
|||||||
/*
|
/*
|
||||||
* Linked object block
|
* Linked object block
|
||||||
*/
|
*/
|
||||||
$contrat->load_object_linked($contrat->id,$contrat->element);
|
$object->load_object_linked($object->id,$object->element);
|
||||||
|
|
||||||
if (! empty($contrat->linked_object))
|
if (! empty($object->linked_object))
|
||||||
{
|
{
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
foreach($contrat->linked_object as $linked_object => $linked_objectid)
|
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||||
{
|
{
|
||||||
if($conf->$linked_object->enabled && $linked_object != $contrat->element)
|
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
||||||
{
|
{
|
||||||
$somethingshown=$contrat->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ if ($mode == "0") $sql.= " AND cd.statut = 0";
|
|||||||
if ($mode == "4") $sql.= " AND cd.statut = 4";
|
if ($mode == "4") $sql.= " AND cd.statut = 4";
|
||||||
if ($mode == "5") $sql.= " AND cd.statut = 5";
|
if ($mode == "5") $sql.= " AND cd.statut = 5";
|
||||||
if ($filter == "expired") $sql.= " AND date_fin_validite < ".$db->idate($now);
|
if ($filter == "expired") $sql.= " AND date_fin_validite < ".$db->idate($now);
|
||||||
if ($search_nom) $sql.= " AND s.nom like '%".addslashes($search_nom)."%'";
|
if ($search_nom) $sql.= " AND s.nom like '%".$db->escape($search_nom)."%'";
|
||||||
if ($search_contract) $sql.= " AND c.rowid = '".addslashes($search_contract)."'";
|
if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'";
|
||||||
if ($search_service) $sql.= " AND (p.ref like '%".addslashes($search_service)."%' OR p.description like '%".addslashes($search_service)."%')";
|
if ($search_service) $sql.= " AND (p.ref like '%".$db->escape($search_service)."%' OR p.description like '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
|
||||||
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
|
||||||
$filter_date1=dol_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['op1year']);
|
$filter_date1=dol_mktime(0,0,0,$_REQUEST['op1month'],$_REQUEST['op1day'],$_REQUEST['op1year']);
|
||||||
$filter_date2=dol_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUEST['op2year']);
|
$filter_date2=dol_mktime(0,0,0,$_REQUEST['op2month'],$_REQUEST['op2day'],$_REQUEST['op2year']);
|
||||||
@@ -197,10 +197,18 @@ if ($resql)
|
|||||||
|
|
||||||
// Service
|
// Service
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
if ($obj->pid)
|
||||||
|
{
|
||||||
$productstatic->id=$obj->pid;
|
$productstatic->id=$obj->pid;
|
||||||
$productstatic->type=$obj->ptype;
|
$productstatic->type=$obj->ptype;
|
||||||
$productstatic->ref=$obj->label?$obj->label:$obj->pid;
|
$productstatic->ref=$obj-label?$obj->label:$obj->pid;
|
||||||
print $productstatic->getNomUrl(1,'',20);
|
print $productstatic->getNomUrl(1,'',20);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($obj->type == 0) print img_object($obj->description,'product').dol_trunc($obj->description,20);
|
||||||
|
if ($obj->type == 1) print img_object($obj->description,'service').dol_trunc($obj->description,20);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
|
|||||||
@@ -54,16 +54,8 @@ for ($i = 0 ; $i < $num ; $i++)
|
|||||||
<td align="right"> </td>
|
<td align="right"> </td>
|
||||||
<td align="right"><?php echo $linkedObjectBlock->getLibStatut(6); ?></td>
|
<td align="right"><?php echo $linkedObjectBlock->getLibStatut(6); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php } ?>
|
||||||
$total = $total + $linkedObjectBlock->total_ht;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr class="liste_total">
|
|
||||||
<td align="left" colspan="2"><?php echo $langs->trans('TotalHT'); ?></td>
|
|
||||||
<td align="right"><?php echo price($total); ?></td>
|
|
||||||
<td> </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- END PHP TEMPLATE -->
|
<!-- END PHP TEMPLATE -->
|
||||||
@@ -1118,7 +1118,7 @@ class CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load array of objects linked to current object. Links are loaded into this->linked_object array.
|
* Load array of objects linked to current object. Links are loaded into this->linked_object array.
|
||||||
*/
|
*/
|
||||||
function load_object_linked($sourceid='',$sourcetype='',$targetid='',$targettype='')
|
function load_object_linked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
|
||||||
{
|
{
|
||||||
$this->linked_object=array();
|
$this->linked_object=array();
|
||||||
|
|
||||||
@@ -1131,7 +1131,7 @@ class CommonObject
|
|||||||
$sql = 'SELECT fk_source, sourcetype, fk_target, targettype';
|
$sql = 'SELECT fk_source, sourcetype, fk_target, targettype';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_element';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_element';
|
||||||
$sql.= " WHERE (fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
|
$sql.= " WHERE (fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
|
||||||
$sql.= " OR (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
|
$sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
|
||||||
|
|
||||||
dol_syslog("CommonObject::load_object_linked sql=".$sql);
|
dol_syslog("CommonObject::load_object_linked sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@@ -1364,14 +1364,23 @@ class CommonObject
|
|||||||
$num = sizeof($this->objectid);
|
$num = sizeof($this->objectid);
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$classpath = $objecttype.'/class';
|
$element = $subelement = $objecttype;
|
||||||
$tplpath = $objecttype;
|
$tplpath = $element;
|
||||||
if ($objecttype == 'facture') { $tplpath = 'compta/'.$objecttype; $classpath = $tplpath.'/class'; } // To work with non standard path
|
|
||||||
if ($objecttype == 'propal') { $tplpath = 'comm/'.$objecttype; $classpath = $tplpath.'/class'; } // To work with non standard path
|
if (preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
|
||||||
|
{
|
||||||
|
$element = $regs[1];
|
||||||
|
$subelement = $regs[2];
|
||||||
|
$tplpath = $element.'/'.$subelement;
|
||||||
|
}
|
||||||
|
|
||||||
|
$classpath = $element.'/class';
|
||||||
|
if ($objecttype == 'facture') { $tplpath = 'compta/'.$element; $classpath = $tplpath.'/class'; } // To work with non standard path
|
||||||
|
if ($objecttype == 'propal') { $tplpath = 'comm/'.$element; $classpath = $tplpath.'/class'; } // To work with non standard path
|
||||||
if ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; $classpath = 'fourn/class'; } // To work with non standard path
|
if ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; $classpath = 'fourn/class'; } // To work with non standard path
|
||||||
if ($objecttype == 'order_supplier') { $tplpath = 'fourn/commande'; $classpath = 'fourn/class'; } // To work with non standard path
|
if ($objecttype == 'order_supplier') { $tplpath = 'fourn/commande'; $classpath = 'fourn/class'; } // To work with non standard path
|
||||||
|
|
||||||
$classfile = strtolower($objecttype); $classname = ucfirst($objecttype);
|
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
|
||||||
if ($objecttype == 'invoice_supplier') { $classfile='fournisseur.facture'; $classname='FactureFournisseur'; }
|
if ($objecttype == 'invoice_supplier') { $classfile='fournisseur.facture'; $classname='FactureFournisseur'; }
|
||||||
if ($objecttype == 'order_supplier') { $classfile='fournisseur.commande'; $classname='CommandeFournisseur'; }
|
if ($objecttype == 'order_supplier') { $classfile='fournisseur.commande'; $classname='CommandeFournisseur'; }
|
||||||
//print $classfile." - ".$classpath." - ".$tplpath;
|
//print $classfile." - ".$classpath." - ".$tplpath;
|
||||||
|
|||||||
@@ -137,10 +137,12 @@ class Form
|
|||||||
* @param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
|
* @param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
|
||||||
* @param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
|
* @param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
|
||||||
* @param img Code img du picto (use img_xxx() function to get it)
|
* @param img Code img du picto (use img_xxx() function to get it)
|
||||||
|
* @param extracss Add a CSS style to td tags
|
||||||
|
* @param notable Do not include table and tr tags
|
||||||
* @return string Code html du tooltip (texte+picto)
|
* @return string Code html du tooltip (texte+picto)
|
||||||
* @see Use function textwithpicto if you can.
|
* @see Use function textwithpicto if you can.
|
||||||
*/
|
*/
|
||||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='')
|
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -161,7 +163,7 @@ class Form
|
|||||||
$paramfortooltip.=' class="classfortooltip'.$extracss.'" title="'.$htmltext.'"'; // Attribut to put on td tag to store tooltip
|
$paramfortooltip.=' class="classfortooltip'.$extracss.'" title="'.$htmltext.'"'; // Attribut to put on td tag to store tooltip
|
||||||
|
|
||||||
$s="";
|
$s="";
|
||||||
$s.='<table class="nobordernopadding" summary=""><tr>';
|
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
||||||
if ($direction > 0)
|
if ($direction > 0)
|
||||||
{
|
{
|
||||||
if ($text != '')
|
if ($text != '')
|
||||||
@@ -182,7 +184,7 @@ class Form
|
|||||||
$s.=$text.'</td>';
|
$s.=$text.'</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$s.='</tr></table>';
|
if (empty($notabs)) $s.='</tr></table>';
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
@@ -678,6 +680,8 @@ class Form
|
|||||||
*/
|
*/
|
||||||
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='')
|
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='')
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
// Permettre l'exclusion de contacts
|
// Permettre l'exclusion de contacts
|
||||||
if (is_array($exclude))
|
if (is_array($exclude))
|
||||||
{
|
{
|
||||||
@@ -704,9 +708,17 @@ class Form
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
|
include_once(DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php');
|
||||||
|
$contactstatic=new Contact($this->db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
|
$contactstatic->id=$obj->rowid;
|
||||||
|
$contactstatic->name=$obj->name;
|
||||||
|
$contactstatic->firstname=$obj->firstname;
|
||||||
|
|
||||||
if ($htmlname != 'none')
|
if ($htmlname != 'none')
|
||||||
{
|
{
|
||||||
$disabled=0;
|
$disabled=0;
|
||||||
@@ -715,18 +727,25 @@ class Form
|
|||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'"';
|
print '<option value="'.$obj->rowid.'"';
|
||||||
if ($disabled) print ' disabled="true"';
|
if ($disabled) print ' disabled="true"';
|
||||||
print ' selected="selected">'.$obj->name.' '.$obj->firstname.'</option>';
|
print ' selected="selected">';
|
||||||
|
print $contactstatic->getFullName($langs);
|
||||||
|
print '</option>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'"';
|
print '<option value="'.$obj->rowid.'"';
|
||||||
if ($disabled) print ' disabled="true"';
|
if ($disabled) print ' disabled="true"';
|
||||||
print '>'.$obj->name.' '.$obj->firstname.'</option>';
|
print '>';
|
||||||
|
print $contactstatic->getFullName($langs);
|
||||||
|
print '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($selected == $obj->rowid) print $obj->name.' '.$obj->firstname;
|
if ($selected == $obj->rowid)
|
||||||
|
{
|
||||||
|
print $contactstatic->getFullName($langs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@@ -761,7 +780,7 @@ class Form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return select list of users
|
* \brief Return select list of users
|
||||||
* \param selected Id user preselected
|
* \param selected User id or user object of user preselected. If -1, we use id of current user.
|
||||||
* \param htmlname Field name in form
|
* \param htmlname Field name in form
|
||||||
* \param show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
* \param show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
|
||||||
* \param exclude Array list of users id to exclude
|
* \param exclude Array list of users id to exclude
|
||||||
@@ -771,7 +790,7 @@ class Form
|
|||||||
*/
|
*/
|
||||||
function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='')
|
function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
// Permettre l'exclusion d'utilisateurs
|
// Permettre l'exclusion d'utilisateurs
|
||||||
if (is_array($exclude)) $excludeUsers = implode("','",$exclude);
|
if (is_array($exclude)) $excludeUsers = implode("','",$exclude);
|
||||||
@@ -798,9 +817,16 @@ class Form
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
|
$userstatic=new User($this->db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
|
$userstatic->id=$obj->rowid;
|
||||||
|
$userstatic->nom=$obj->name;
|
||||||
|
$userstatic->prenom=$obj->firstname;
|
||||||
|
|
||||||
$disableline=0;
|
$disableline=0;
|
||||||
if (is_array($enableonly) && sizeof($enableonly) && ! in_array($obj->rowid,$enableonly)) $disableline=1;
|
if (is_array($enableonly) && sizeof($enableonly) && ! in_array($obj->rowid,$enableonly)) $disableline=1;
|
||||||
|
|
||||||
@@ -816,7 +842,8 @@ class Form
|
|||||||
if ($disableline) $out.= ' disabled="true"';
|
if ($disableline) $out.= ' disabled="true"';
|
||||||
$out.= '>';
|
$out.= '>';
|
||||||
}
|
}
|
||||||
$out.= $obj->name.($obj->name && $obj->firstname?' ':'').$obj->firstname;
|
$out.= $userstatic->getFullName($langs);
|
||||||
|
|
||||||
//if ($obj->admin) $out.= ' *';
|
//if ($obj->admin) $out.= ' *';
|
||||||
if ($conf->global->MAIN_SHOW_LOGIN) $out.= ' ('.$obj->login.')';
|
if ($conf->global->MAIN_SHOW_LOGIN) $out.= ' ('.$obj->login.')';
|
||||||
$out.= '</option>';
|
$out.= '</option>';
|
||||||
@@ -1806,7 +1833,7 @@ class Form
|
|||||||
* @param title title
|
* @param title title
|
||||||
* @param question question
|
* @param question question
|
||||||
* @param action action
|
* @param action action
|
||||||
* @param formquestion an array with forms complementary inputs
|
* @param formquestion an array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , ))
|
||||||
* @param selectedchoice "" or "no" or "yes"
|
* @param selectedchoice "" or "no" or "yes"
|
||||||
* @param useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No
|
* @param useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No
|
||||||
* @param height Force height of box
|
* @param height Force height of box
|
||||||
@@ -2206,6 +2233,7 @@ class Form
|
|||||||
function form_contacts($page, $societe, $selected='', $htmlname='contactidp')
|
function form_contacts($page, $societe, $selected='', $htmlname='contactidp')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($htmlname != "none")
|
if ($htmlname != "none")
|
||||||
{
|
{
|
||||||
print '<form method="post" action="'.$page.'">';
|
print '<form method="post" action="'.$page.'">';
|
||||||
@@ -3096,11 +3124,11 @@ class Form
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return HTML combo list of years
|
* \brief Return HTML combo list of years
|
||||||
* \param selected Preselected value
|
* \param selected Preselected value (''=current year, -1=none, year otherwise)
|
||||||
* \param htmlname Name of HTML select object
|
* \param htmlname Name of HTML select object
|
||||||
* \param useempty Affiche valeur vide dans liste
|
* \param useempty Affiche valeur vide dans liste
|
||||||
* \param $min_year Valeur minimum de l'annee dans la liste (par defaut annee courante -10)
|
* \param $min_year Offset of minimum year into list (by default current year -10)
|
||||||
* \param $max_year Valeur maximum de l'annee dans la liste (par defaut annee courante + 5)
|
* \param $max_year Offset of maximum year into list (by default current year + 5)
|
||||||
* TODO Move into html.formother
|
* TODO Move into html.formother
|
||||||
*/
|
*/
|
||||||
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5)
|
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5)
|
||||||
@@ -3113,19 +3141,14 @@ class Form
|
|||||||
print '<select class="flat" name="' . $htmlname . '">';
|
print '<select class="flat" name="' . $htmlname . '">';
|
||||||
if($useempty)
|
if($useempty)
|
||||||
{
|
{
|
||||||
if($selected == '')
|
if ($selected == '') $selected_html = ' selected="selected"';
|
||||||
$selected_html = 'selected="selected"';
|
print '<option value=""' . $selected_html . '> </option>';
|
||||||
print '<option value="" ' . $selected_html . ' > </option>';
|
|
||||||
}
|
}
|
||||||
for ($y = $max_year; $y >= $min_year; $y--)
|
for ($y = $max_year; $y >= $min_year; $y--)
|
||||||
{
|
{
|
||||||
$selected_html='';
|
$selected_html='';
|
||||||
if ($y == $selected)
|
if ($selected > 0 && $y == $selected) $selected_html = ' selected="selected"';
|
||||||
{
|
print '<option value="'.$y.'"'.$selected_html.' >'.$y.'</option>';
|
||||||
$selected_html = 'selected="selected"';
|
|
||||||
}
|
|
||||||
print "<option value=\"$y\" $selected_html >$y";
|
|
||||||
print "</option>";
|
|
||||||
}
|
}
|
||||||
print "</select>\n";
|
print "</select>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user