Merge branch 'develop' into dev_testdocker

This commit is contained in:
Florian HENRY 2020-08-28 12:14:05 +02:00
commit 9502478b7e
182 changed files with 5713 additions and 1058 deletions

View File

@ -0,0 +1,89 @@
Delivered-To: testldrdev@gmail.com
Received: by 2002:a2e:9b9a:0:0:0:0:0 with SMTP id z26csp1425223lji;
Thu, 20 Aug 2020 08:29:02 -0700 (PDT)
X-Received: by 2002:a05:620a:1292:: with SMTP id w18mr2938234qki.158.1597937342304;
Thu, 20 Aug 2020 08:29:02 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1597937342; cv=none;
d=google.com; s=arc-20160816;
b=FhT/+rJ/zNYgVQ5Nt/rLZJycGd/Ntkhm6LwI16YUfmEmxeGrP/cXXQULrqQ1LhBr9B
oRKweltTdnpyA14gm0kzbs1vUkf5HxLUuGk8IqqJWAPMUZoN8oUPkzq2BuKNQGxPiE+y
Hsg/fnYp8WzcAlZOLsEP2kcFIdA95Dyy5LkM8HgphI1jSS1d6gkx6nDGIMIpDD9D+w4X
ISxRUXp5JlDwFCUMOPoAvHIBUdJ3jpLsjesbMEnU4ssFqhxU21pBq+Fc+csSPeY5DL0M
HR1o+ChEAXIdDOrDqa0ohHfqR216juGCzH8YuEQ88LT0Qbst9IkOYWiAQv4TIh7vHtvQ
TMvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=to:subject:message-id:date:from:mime-version:dkim-signature;
bh=sojOjnIKAXmsZ9zvMk5MGvY3qyOaFgnpRe6YPMYutOI=;
b=CRlrRPfoGkfmz6iXKy4HdxKQ4SeJTiIxjC2jNkgQPSnIDFJgDkJcwASJVpcjTmlVmH
Z9WnHKVUPRIHGDEoMRlx6eUx9QfelWqPYu3BBQGFry9sgth0BR/1s6tmQ+P+bAj23ryo
aL3UkF6KCSx4GhEk3MfHA5Ex81YDFHvHL3BZ2kb3XCVSlPiBq2szw1ETmRAsDdS5Gbu+
ZlzBbl4pRtUWgi1fB5H4Wcv7e90F4Et1SBP8IKSCa23qu2nV9xefgjfMw2ndxCj1zgCL
c3l7Ul6pw32nqf6+vxfZTstwIwgu6dXZXCHDqJqesI2g8RGxeba+LfKZEDpBuSeINS9r
GMvw==
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@destailleur.fr header.s=google header.b=IPMz90Yj;
spf=pass (google.com: domain of contact@destailleur.fr designates 209.85.220.41 as permitted sender) smtp.mailfrom=contact@destailleur.fr;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=destailleur.fr
Return-Path: <contact@destailleur.fr>
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
by mx.google.com with SMTPS id w14sor2138230qtb.9.2020.08.20.08.29.00
for <testldrdev@gmail.com>
(Google Transport Security);
Thu, 20 Aug 2020 08:29:01 -0700 (PDT)
Received-SPF: pass (google.com: domain of contact@destailleur.fr designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
Authentication-Results: mx.google.com;
dkim=pass header.i=@destailleur.fr header.s=google header.b=IPMz90Yj;
spf=pass (google.com: domain of contact@destailleur.fr designates 209.85.220.41 as permitted sender) smtp.mailfrom=contact@destailleur.fr;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=destailleur.fr
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=destailleur.fr; s=google;
h=mime-version:from:date:message-id:subject:to;
bh=sojOjnIKAXmsZ9zvMk5MGvY3qyOaFgnpRe6YPMYutOI=;
b=IPMz90Yjw1Mf57/rYWUYGtpc+IazEWcy6/bqxf1j0h6rxDH/wjhxsCWzfARgqqlfVj
ACg4IbPpZZlKFIYDSCbfMlWF65rbKfNre56HldfQgy0Tq3LC434zHz2ZZMOVCM52w3J9
VGBpASUlSL1o+YRmzOpRtHVu7I9aNwGxHuA070Yka8XLV76vV3P0vdL8PcoHq0jUUEoi
+dCZ9NCPuAFtGK2IavNoM2qQrLdfYIi+RwgWBtqjTwzyvDEJR+p5fIPK142ynMbHgWYO
RVtMqAgxjvL4sfyKZ5KuzKXkQNM3zyzMinWK89scBl+QLFCcWA4Qqc0dJjqLCBhh8lmq
n67g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=sojOjnIKAXmsZ9zvMk5MGvY3qyOaFgnpRe6YPMYutOI=;
b=H0GsrFAi9JmRTKQ2budtDeLBqCaTisHKYCVVziyxmv+/tIcrSZBA4tdKwm+wR80r50
zMJXmyVS2DMDWfnIlOv39wcwQjYN3WK1aRJfV0bVuEWrQuzt5MMWbskf6xbzo201nhr9
ZlqATsEV7v1u5EHmfYwRhR8+AOmENdnm0g9RXPJVrFS58WNEJUSotS5Y5rZPjnT943y0
62Kf4Bd6uWvXhPFXWQoZLtWrPpkbcYPWIBmpftKhD0PD9c6rKaVduV0WhbigYsDoxb3F
iIafGPOyq91hiHR2gTLHiMmTDm+IDQ4n6gSkS7HKpZlLQhHoBMnpqJZYoxMJTxdpAbSy
mY+A==
X-Gm-Message-State: AOAM5325RcN4/ThWbYCO3vWRMFFBrfzJUHC1bd1Z9VB3/2Q3RuF9lmIJ +SjshEErhK68Of2pHDZQ3aPU4rzDfV8ozbvRsgChdfZg8aA=
X-Google-Smtp-Source: ABdhPJxUOUdurKEQfLldtiQGRkgC/h8gKQG1zhS+8k93p6N1SsOn517+GeRyT3E+/Uw536pmReO29la3EIAS6VT33SE=
X-Received: by 2002:aed:3e8e:: with SMTP id n14mr3191190qtf.67.1597937340509; Thu, 20 Aug 2020 08:29:00 -0700 (PDT)
MIME-Version: 1.0
From: John Tester <customer@customercompany.fr>
Date: Thu, 20 Aug 2020 17:28:34 +0200
Message-ID: <CALeEO_kij-ogXKzrjV_pTgqVbUB9j=287VkX34iVSWgDHFA8eg@mail.gmail.com>
Subject: Support besoin
To: testldrdev@gmail.com
Content-Type: multipart/alternative; boundary="0000000000008e099705ad50c772"
--0000000000008e099705ad50c772
Content-Type: text/plain; charset="UTF-8"
adfsdfsdfds
--
Laurent.
------------------------------------------------------------------------------------
Twitter: https://www.twitter.com/eldy10
--0000000000008e099705ad50c772
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">adfsdfsdfds<br clear=3D"all"><div><br></div>-- <br><div di=
r=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature">Laur=
ent.<br>-------------------------------------------------------------------=
-----------------<br>Twitter: <a href=3D"https://www.twitter.com/eldy10" ta=
rget=3D"_blank">https://www.twitter.com/eldy10</a></div></div>
--0000000000008e099705ad50c772--

View File

@ -0,0 +1,57 @@
Return-Path: <testldrdev@gmail.com>
Received: from smtp.gmail.com ([2a01:e0a:7e:4ae0:329c:23ff:feb8:dc8d])
by smtp.gmail.com with ESMTPSA id 32sm5811196wrh.18.2020.08.20.09.31.37
for <customer@customercompany.fr>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 20 Aug 2020 09:31:37 -0700 (PDT)
From: testldrdev@gmail.com
X-Google-Original-From: <aa@aa.comg>
To: customer@customercompany.fr
Subject: [MyBigCompany - Ticket #TS2008-0040] Nouveau message
Date: Thu, 20 Aug 2020 18:31:37 +0200
Message-ID: <1597941097.SMTPs-dolibarr-tic58@83b5bc91f83a56e458db71e0adac2b62>
References: <1597941097.SMTPs-dolibarr-tic58@83b5bc91f83a56e458db71e0adac2b62>
X-Dolibarr-TRACKID: tic58@83b5bc91f83a56e458db71e0adac2b62
X-RemoteAddr: 127.0.0.1
X-Mailer: Dolibarr version 13.0.0-alpha (using SMTPs Mailer)
X-Dolibarr-Option: MAIN_MAIL_USE_MULTI_PART
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="multipart_x.1597941097.x_boundary"
Content-Transfer-Encoding: 8bit
--multipart_x.1597941097.x_boundary
Content-Type: multipart/alternative; boundary="mul_872cdd6a64216735955664484832b075"
--mul_872cdd6a64216735955664484832b075
Content-Type: text/plain; charset=UTF-8
Bonjour
Une nouvelle réponse a été ajoutée à un ticket que vous suivez. Voici
le message :PredefinedMailContentTicket_send
Vous pouvez voir la progression du ticket en cliquant sur le lien
ci-dessus. : fr5uw2yospypn2rz
Cordialement,
--
--mul_872cdd6a64216735955664484832b075
Content-Type: text/html; charset=UTF-8
<html><head><title></title></head><body>Bonjour<br>
<br>
Une nouvelle réponse a été ajoutée à un ticket que vous suivez. Voici
le message :PredefinedMailContentTicket_send<br>
<br>
<br>
Vous pouvez voir la progression du ticket en cliquant sur le lien
ci-dessus. : <a
href="http://localhostgit/dolibarr_dev/htdocs/public/ticket/view.php?track_id=fr5uw2yospypn2rz">fr5uw2yospypn2rz</a><br>
<br>Cordialement,<br>
<br>
--</body></html>
--mul_872cdd6a64216735955664484832b075--
--multipart_x.1597941097.x_boundary--

View File

@ -0,0 +1,48 @@
MIME-Version: 1.0
Date: Thu, 20 Aug 2020 18:34:01 +0200
References: <CALeEO_kij-ogXKzrjV_pTgqVbUB9j=287VkX34iVSWgDHFA8eg@mail.gmail.com>
In-Reply-To: <CALeEO_kij-ogXKzrjV_pTgqVbUB9j=287VkX34iVSWgDHFA8eg@mail.gmail.com>
Message-ID: <CAC8+=32ccpEo12RR-juT=FW6+gNV-DcvNjxs_0s6Wn40xmfhug@mail.gmail.com>
Subject: Re: Support besoin
From: John Tester <testldrdev@gmail.com>
To: John Tester <customer@customercompany.fr>
Content-Type: multipart/alternative; boundary="0000000000001620dd05ad51b075"
--0000000000001620dd05ad51b075
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Merci pour votre question.
Voici la rep.
Le jeu. 20 ao=C3=BBt 2020 =C3=A0 17:29, John Tester <laurent@destai=
lleur.fr>
a =C3=A9crit :
> adfsdfsdfds
>
> --
> Laurent.
>
> -------------------------------------------------------------------------=
-----------
> Twitter: https://www.twitter.com/eldy10
>
--0000000000001620dd05ad51b075
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Merci pour votre question.<div>Voici la rep.</div></div><b=
r><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Le=C2=A0=
jeu. 20 ao=C3=BBt 2020 =C3=A0=C2=A017:29, John Tester &lt;<a href=
=3D"mailto:customer@customercompany.fr">customer@customercompany.fr</a>&gt; a =C3=A9c=
rit=C2=A0:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr">adfsdfsdfds<br clear=3D"all"><div><br></div>-- <br><div dir=3D"=
ltr">Laurent.<br>----------------------------------------------------------=
--------------------------<br>Twitter: <a href=3D"https://www.twitter.com/e=
ldy10" target=3D"_blank">https://www.twitter.com/eldy10</a></div></div>
</blockquote></div>
--0000000000001620dd05ad51b075--

View File

@ -0,0 +1,134 @@
Delivered-To: testldrdev@gmail.com
Received: by 2002:a2e:9b9a:0:0:0:0:0 with SMTP id z26csp1483607lji;
Thu, 20 Aug 2020 09:56:03 -0700 (PDT)
X-Received: by 2002:ac8:3868:: with SMTP id r37mr3301993qtb.95.1597942563252;
Thu, 20 Aug 2020 09:56:03 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1597942563; cv=none;
d=google.com; s=arc-20160816;
b=skUGL+keim3FdNXfKGgQokCfj85gnhYhuLbMM61qY5W6ixSH9s8I6uoNh3gzVy89XM
NGbZiajjDiPMBryl87PhD+ACBjv8WoZAQiojAga0ELPPmVDnhrtWKANLbRrkUI3Xtfoj
b1o2iHP2Q12Vqs6xiAy86yxURlIKGM3tw91WryWiIPiAL7bRZPn49N3XbO2ULE0QKTBq
BI5YnOxt9NfTj0xhKaLLIJ9M1qa4e1QyOHl56WuEv3Gx6uHDAQDYz+C5G0VgdjBvwRzH
pJaiAulc1uW/V9TcRMwvwIWtI7eWygvU2PiuI/c05G1KVKibAubHE55IjOJCn2O2UaH4
WMNQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:dkim-signature;
bh=j6+rsx5MBsg1/s7LIIfByV7u0jGK09n72bnK4XcN6ZQ=;
b=Ps5kk+tBGQzMP6ugDCwKf4hzn8fn3DU4AFz1dJvkHdDestLZWN99Qtr6iNMdslsHJm
ov378c+8oCfcV7shyBYjlAFfikFi7o4RM/evh3yqqjAnhyVfcYH7c9cexVvDo/AXUAZ7
N7Mh7EOvyDXXsaHK2l89XiAxZx/hZh/O+/HR2EoVEGre1eYRYwI/aEfPN8d4/fL2VtCD
0wzAwnUrINuXmcaUDT30Twjk9kwGjjTsM6Z531vKM6L3y48a7f3GTE7V+vo2QxHdUT54
fQVue9OO7b4VKTEj/x/dmNr+92sHRAMMS7dj/VXMmzM+WttUCAPNxZ27/bvt4bBc5oBp
QPEA==
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@destailleur.fr header.s=google header.b=SEYSmxbT;
spf=pass (google.com: domain of contact@destailleur.fr designates 209.85.220.41 as permitted sender) smtp.mailfrom=contact@destailleur.fr;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=destailleur.fr
Return-Path: <contact@destailleur.fr>
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
by mx.google.com with SMTPS id q3sor2285165qtn.34.2020.08.20.09.56.02
for <testldrdev@gmail.com>
(Google Transport Security);
Thu, 20 Aug 2020 09:56:03 -0700 (PDT)
Received-SPF: pass (google.com: domain of contact@destailleur.fr designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
Authentication-Results: mx.google.com;
dkim=pass header.i=@destailleur.fr header.s=google header.b=SEYSmxbT;
spf=pass (google.com: domain of contact@destailleur.fr designates 209.85.220.41 as permitted sender) smtp.mailfrom=contact@destailleur.fr;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=destailleur.fr
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=destailleur.fr; s=google;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=j6+rsx5MBsg1/s7LIIfByV7u0jGK09n72bnK4XcN6ZQ=;
b=SEYSmxbTKCuc1baQZzjIJwm7WXvgjt/nEGhMLqWxQCU3beM3qhH8wYlSeMyB8Z/9pi
tszZFZhZ3cjnIbbJnjzsMYJgBnYbkf6hz14+BsFwyPU030EkDjJy2i3DSXzYK7A+GbBn
G9I9foG/4+pcx0LnFsjchGsRhLFkTKJIsP2SVfOx0wlim3WHMIqIXvKsxY05PoPyf8Tp
IwQi7iNl/+nTyjNHl2DQh+ty3CRTmUw9uEbY+jRRvIg5i/7cfREekK98d7qi/5HQycr6
aptRDdCVHXpe47q+c7OPiMEEQWs+mFJhBqPXIlU54fwFApEEnLn/jwGbrPsrPYJaswgI
vd/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=j6+rsx5MBsg1/s7LIIfByV7u0jGK09n72bnK4XcN6ZQ=;
b=M6a4k1gKc4e7TwKncuNPy0b3KxutR1FLFJGWxd4NyW84b7f3LfIR94IeInLQIWmY8C
Ddus0upZJI4+NN9XBGvXCdsiiYlwFGBJRWwjv82XFKVAKL5DD94RJNQZJUiE39hgJ2aa
6V9gasiP+nUAX4ZV9bZmw21CgKEZrZVXh5unmW2ABrfcx8lHjp/DUw5XEkym1J92Wo1l
g0H3XrC2FL+aQuj+WpCynMNkY9ljw71oqyv3SP9pjnVNHArAdZiPMHkNxiuPdq7q41fg
eIbdRCQXYZL5O48QsjDdiXwaQzx+NcYtrKAH0RIVD1lG6zc9pxqDJsbGxP9VLs8jGDTT
mSdQ==
X-Gm-Message-State: AOAM532LuATWDKbo1HImMWshHVqb0kC0isehf3owfYUKq5J68o3juKbm kCgUMt25A2C7QoNMDXcjfJyteBNQD7ZhSh3yeYTGoLSvsD4=
X-Google-Smtp-Source: ABdhPJyQYCpCHSwA87x030i8YChySZqcNXxT1qVlZyEA+XM6DTyPZusa8gtbDUVcMyx7Jma/7toh+4EEE2bWg0bG+2E=
X-Received: by 2002:aed:3e8e:: with SMTP id n14mr3547383qtf.67.1597942562373; Thu, 20 Aug 2020 09:56:02 -0700 (PDT)
MIME-Version: 1.0
References: <CALeEO_kij-ogXKzrjV_pTgqVbUB9j=287VkX34iVSWgDHFA8eg@mail.gmail.com> <CAC8+=32ccpEo12RR-juT=FW6+gNV-DcvNjxs_0s6Wn40xmfhug@mail.gmail.com>
In-Reply-To: <CAC8+=32ccpEo12RR-juT=FW6+gNV-DcvNjxs_0s6Wn40xmfhug@mail.gmail.com>
From: John Tester <customer@customercompany.fr>
Date: Thu, 20 Aug 2020 18:55:36 +0200
Message-ID: <CALeEO_nLUY8Tk+o7WoaHtBkxvOy0dhvt+fL0MwPrApGty_AG_g@mail.gmail.com>
Subject: Re: Support besoin
To: John Tester <testldrdev@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000cd54be05ad51fe67"
--000000000000cd54be05ad51fe67
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Merci
Le jeu. 20 ao=C3=BBt 2020 =C3=A0 18:34, John Tester <testldrdev@gma=
il.com> a
=C3=A9crit :
> Merci pour votre question.
> Voici la rep.
>
> Le jeu. 20 ao=C3=BBt 2020 =C3=A0 17:29, John Tester <laurent@dest=
ailleur.fr>
> a =C3=A9crit :
>
>> adfsdfsdfds
>>
>> --
>> Laurent.
>>
>> ------------------------------------------------------------------------=
------------
>> Twitter: https://www.twitter.com/eldy10
>>
>
--=20
Laurent.
---------------------------------------------------------------------------=
---------
Twitter: https://www.twitter.com/eldy10
--000000000000cd54be05ad51fe67
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Merci</div><br><div class=3D"gmail_quote"><div dir=3D"ltr"=
class=3D"gmail_attr">Le=C2=A0jeu. 20 ao=C3=BBt 2020 =C3=A0=C2=A018:34, Lau=
rent Destailleur &lt;<a href=3D"mailto:testldrdev@gmail.com">testldrdev@gma=
il.com</a>&gt; a =C3=A9crit=C2=A0:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"ltr">Merci pour votre question.<div>Voici la=
rep.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"g=
mail_attr">Le=C2=A0jeu. 20 ao=C3=BBt 2020 =C3=A0=C2=A017:29, Laurent Destai=
lleur &lt;<a href=3D"mailto:customer@customercompany.fr" target=3D"_blank">laure=
nt@destailleur.fr</a>&gt; a =C3=A9crit=C2=A0:<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex"><div dir=3D"ltr">adfsdfsdfds<br clear=3D"all"=
><div><br></div>-- <br><div dir=3D"ltr">Laurent.<br>-----------------------=
-------------------------------------------------------------<br>Twitter: <=
a href=3D"https://www.twitter.com/eldy10" target=3D"_blank">https://www.twi=
tter.com/eldy10</a></div></div>
</blockquote></div>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
class=3D"gmail_signature">Laurent.<br>------------------------------------=
------------------------------------------------<br>Twitter: <a href=3D"htt=
ps://www.twitter.com/eldy10" target=3D"_blank">https://www.twitter.com/eldy=
10</a></div>
--000000000000cd54be05ad51fe67--

View File

@ -2,8 +2,8 @@
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -289,6 +290,7 @@ if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->suppri
*/
$formaccounting = new FormAccounting($db);
$formfile = new FormFile($db);
$formother = new FormOther($db);
$form = new Form($db);

View File

@ -488,7 +488,7 @@ class AccountingAccount extends CommonObject
{
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label = $langs->trans("ShowAccoutingAccount");
$label = $langs->trans("ShowAccountingAccount");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';

View File

@ -65,9 +65,9 @@ $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page < 0) $page = 0;
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$offset = $limit * $page;
if (!$sortfield)
$sortfield = "f.datef, f.ref, fd.rowid";
if (!$sortorder) {
@ -92,7 +92,7 @@ $formaccounting = new FormAccounting($db);
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
$search_societe='';
$search_societe = '';
$search_lineid = '';
$search_ref = '';
$search_invoice = '';
@ -176,7 +176,8 @@ print '<script type="text/javascript">
$sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
$sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell,";
$sql .= " aa.rowid as fk_compte, aa.account_number, aa.label, aa.labelshort,";
$sql .= " fd.situation_percent,";
$sql .= " co.code as country_code, co.label as country,";
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
@ -344,20 +345,18 @@ if ($result) {
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
$clickpicto = $form->showCheckAddButtons();
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
$checkpicto = $form->showCheckAddButtons();
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
print "</tr>\n";
$thirdpartystatic=new Societe($db);
$thirdpartystatic = new Societe($db);
$facturestatic = new Facture($db);
$productstatic = new Product($db);
$accountingaccountstatic = new AccountingAccount($db);
while ($objp = $db->fetch_object($result))
{
$accountingaccountstatic->account_number = $objp->account_number;
$accountingaccountstatic->label = $objp->label_account;
$accountingaccountstatic->labelshort = $objp->labelshort_account;
$i = 0;
while ($i < min($num_lines, $limit)) {
$objp = $db->fetch_object($result);
$facturestatic->ref = $objp->ref;
$facturestatic->id = $objp->facid;
@ -379,6 +378,11 @@ if ($result) {
$productstatic->label = $objp->product_label;
$productstatic->type = $objp->line_type;
$accountingaccountstatic->rowid = $objp->fk_compte;
$accountingaccountstatic->label = $objp->label;
$accountingaccountstatic->labelshort = $objp->labelshort;
$accountingaccountstatic->account_number = $objp->account_number;
print '<tr class="oddeven">';
// Line id
@ -391,7 +395,7 @@ if ($result) {
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
// Ref Product
print '<td>';
print '<td class="tdoverflowmax100">';
if ($productstatic->id > 0) print $productstatic->getNomUrl(1);
if ($productstatic->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
@ -424,17 +428,14 @@ if ($result) {
print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
print ' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print img_edit();
print '</a>';
print '</td>';
print '</a></td>';
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
print "</tr>";
print '</tr>';
$i++;
}
print "</table>";
print "</div>";
print '</table>';
print "</div>";
if ($nbtotalofrecords > $limit) {
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);

View File

@ -26,14 +26,13 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "productbatch", "hrm"));
@ -168,7 +167,7 @@ $sql = "SELECT er.ref, er.rowid as erid,";
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
$sql .= " u.rowid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
$sql .= " aa.label as label_account, aa.labelshort as labelshort_account, aa.account_number";
$sql .= " aa.label, aa.labelshort, aa.account_number";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
@ -278,7 +277,7 @@ if ($result) {
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" placeholder="%" value="'.dol_escape_htmltag($search_vat).'"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
print '<td class="liste_titre right">';
print '<td class="liste_titre center">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
@ -305,13 +304,10 @@ if ($result) {
$accountingaccountstatic = new AccountingAccount($db);
$userstatic = new User($db);
$i = 0;
while ($i < min($num_lines, $limit)) {
$objp = $db->fetch_object($result);
$accountingaccountstatic->account_number = $objp->account_number;
$accountingaccountstatic->label = $objp->label_account;
$accountingaccountstatic->labelshort = $objp->labelshort_account;
$expensereportstatic->ref = $objp->ref;
$expensereportstatic->id = $objp->erid;
@ -326,6 +322,11 @@ if ($result) {
$userstatic->employee = $objp->employee;
$userstatic->photo = $objp->photo;
$accountingaccountstatic->rowid = $objp->fk_compte;
$accountingaccountstatic->label = $objp->label;
$accountingaccountstatic->labelshort = $objp->labelshort;
$accountingaccountstatic->account_number = $objp->account_number;
print '<tr class="oddeven">';
// Login
@ -368,7 +369,6 @@ if ($result) {
print ' <a class="editfielda reposition marginleftonly marginrightonly" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print img_edit();
print '</a></td>';
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
print "</tr>";

View File

@ -33,7 +33,6 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
@ -178,7 +177,7 @@ print '<script type="text/javascript">
*/
$sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
$sql .= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql .= " aa.label, aa.account_number, ";
$sql .= " aa.label, aa.labelshort, aa.account_number,";
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type,";
$sql .= " co.code as country_code, co.label as country,";
$sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur";
@ -262,9 +261,8 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql .= $db->plimit($limit + 1, $offset);
dol_syslog('accountancy/supplier/lines.php');
dol_syslog("accountancy/supplier/lines.php", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
@ -272,7 +270,7 @@ if ($result) {
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($search_societe) $param .= "&search_societe=" . urlencode($search_societe);
if ($search_societe) $param .= "&search_societe=".urlencode($search_societe);
if ($search_invoice) $param .= "&search_invoice=".urlencode($search_invoice);
if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
if ($search_label) $param .= "&search_label=".urlencode($search_label);
@ -295,12 +293,11 @@ if ($result) {
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><br>';
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'" /></div>';
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
$moreforfilter = '';
@ -329,10 +326,9 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
print '<td class="liste_titre center">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print "</tr>\n";
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print "</td></tr>\n";
print '<tr class="liste_titre">';
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
@ -357,14 +353,11 @@ if ($result) {
$productstatic = new ProductFournisseur($db);
$accountingaccountstatic = new AccountingAccount($db);
$i = 0;
while ($i < min($num_lines, $limit))
{
$objp = $db->fetch_object($result);
$accountingaccountstatic->account_number = $objp->account_number;
$accountingaccountstatic->label = $objp->label_account;
$accountingaccountstatic->labelshort = $objp->labelshort_account;
$facturefournisseur_static->ref = $objp->ref;
$facturefournisseur_static->id = $objp->facid;
@ -384,6 +377,11 @@ if ($result) {
$productstatic->label = $objp->product_label;
$productstatic->type = $objp->line_type;
$accountingaccountstatic->rowid = $objp->fk_compte;
$accountingaccountstatic->label = $objp->label;
$accountingaccountstatic->labelshort = $objp->labelshort;
$accountingaccountstatic->account_number = $objp->account_number;
print '<tr class="oddeven">';
// Line id
@ -399,15 +397,14 @@ if ($result) {
// Date invoice
print '<td class="center">'.dol_print_date($db->jdate($objp->datef), 'day').'</td>';
// Ref product
// Ref Product
print '<td class="tdoverflowmax100">';
if ($productstatic->id > 0) print $productstatic->getNomUrl(1);
if ($productstatic->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
print '</td>';
// Description
print '<td>';
print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);

View File

@ -421,7 +421,8 @@ class Adherent extends CommonObject
'__PASSWORD__' => $msgishtml ? dol_htmlentitiesbr($this->pass) : ($this->pass ? $this->pass : ''),
'__PHONE__' => $msgishtml ? dol_htmlentitiesbr($this->phone) : ($this->phone ? $this->phone : ''),
'__PHONEPRO__' => $msgishtml ? dol_htmlentitiesbr($this->phone_perso) : ($this->phone_perso ? $this->phone_perso : ''),
'__PHONEMOBILE__' => $msgishtml ? dol_htmlentitiesbr($this->phone_mobile) : ($this->phone_mobile ? $this->phone_mobile : ''));
'__PHONEMOBILE__' => $msgishtml ? dol_htmlentitiesbr($this->phone_mobile) : ($this->phone_mobile ? $this->phone_mobile : ''),
'__TYPE__' => $msgishtml ? dol_htmlentitiesbr($this->type) : ($this->type ? $this->type : ''));
complete_substitutions_array($substitutionarray, $langs, $this);

View File

@ -165,6 +165,7 @@ if (!empty($triggers))
if ($module == 'member') $module = 'adherent';
if ($module == 'project') $module = 'projet';
if ($module == 'proposal_supplier') $module = 'supplier_proposal';
if ($module == 'contact') $module = 'societe';
// If 'element' value is myobject@mymodule instead of mymodule
$tmparray = explode('@', $module);
@ -172,7 +173,7 @@ if (!empty($triggers))
$module = $tmparray[1];
}
//print 'module='.$module.'<br>';
//print 'module='.$module.' code='.$trigger['code'].'<br>';
if (!empty($conf->$module->enabled))
{
// Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED

View File

@ -313,7 +313,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$object->fetchActions();
$head = emailcollectorPrepareHead($object);
dol_fiche_head($head, 'card', $langs->trans("EmailCollector"), -1, 'emailcollector');
dol_fiche_head($head, 'card', $langs->trans("EmailCollector"), -1, 'email');
$formconfirm = '';
@ -494,7 +494,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'larger'=>array('label'=>'LargerThan', 'data-placeholder'=>$langs->trans('NumberOfBytes')),
'X3'=>'---',
'withtrackingid'=>array('label'=>'WithDolTrackingID', 'data-noparam'=>1),
'withouttrackingid'=>array('label'=>'WithoutDolTrackingID', 'data-noparam'=>1)
'withouttrackingid'=>array('label'=>'WithoutDolTrackingID', 'data-noparam'=>1),
'X4'=>'---',
'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1),
'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1)
);
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', '', 0, '', 2);
@ -558,6 +561,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'recordevent'=>'RecordEvent');
if ($conf->projet->enabled) $arrayoftypes['project'] = 'CreateLeadAndThirdParty';
if ($conf->ticket->enabled) $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty';
if ($conf->recruitment->enabled) $arrayoftypes['candidature'] = 'CreateCandidature';
// support hook for add action
$parameters = array('arrayoftypes' => $arrayoftypes);
@ -572,11 +576,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300');
print '</td><td>';
print '<input type="text" name="operationparam">';
print '</td>';
print '<td>';
$htmltext = $langs->transnoentitiesnoconv("OperationParamDesc");
//var_dump($htmltext);
print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt');
print '</td>';
print '<td></td>';
print '<td class="right"><input type="submit" name="addoperation" id="addoperation" class="flat button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
// List operations
@ -656,12 +660,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook))
{
// Edit
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Edit").'</a></div>';
// Clone
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$object->socid.'&amp;action=clone&amp;object=order">'.$langs->trans("ToClone").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=collect">'.$langs->trans("CollectNow").'</a></div>';
// Collect now
if (count($object->actions) > 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=collect">'.$langs->trans("CollectNow").'</a></div>';
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoOperations")).'">'.$langs->trans("CollectNow").'</a></div>';
}
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>';
}

View File

@ -324,7 +324,7 @@ $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']));
//}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton.' '.$linkback, '', $limit);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'email', 0, $newcardbutton.' '.$linkback, '', $limit);
// Add code for pre mass action (confirmation or email presend form)
/*$topicmail="";
@ -333,12 +333,6 @@ $objecttmp=new EmailCollector($db);
$trackid='xxxx'.$object->id;*/
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
}
$moreforfilter = '';
/*$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';

View File

@ -43,6 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'alpha');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@ -122,6 +123,10 @@ $permissiontoread = $user->admin;
$permissiontoadd = $user->admin;
$permissiontodelete = $user->admin;
if ($id > 0) {
$object->fetch($id);
}
/*
* Actions
@ -191,7 +196,6 @@ $now = dol_now();
$help_url = '';
$title = $langs->trans("EMailsSetup");
llxHeader('', $title);
$linkback = '';
@ -230,7 +234,7 @@ foreach ($search as $key => $val)
{
if ($key == 'status' && $search[$key] == -1) continue;
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
if (strpos($object->fields[$key]['type'], 'integer:') === 0 || $key == 'active') {
if ($search[$key] == '-1') $search[$key] = '';
$mode_search = 2;
}
@ -347,15 +351,41 @@ print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'"
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="'.($action == 'create' ? 'add' : 'list').'">';
print '<input type="hidden" name="action" value="'.($action == 'create' ? 'add' : ($action == 'edit' ? 'update' : 'list')).'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = '';
if ($action != 'create') {
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER['PHP_SELF'].'?action=create', '', $permissiontoadd);
if ($action == 'edit') {
print '<table class="border centpercent tableforfield">';
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" value="'.(GETPOSTISSET('label') ? GETPOST('label', 'alphanohtml') : $object->label).'"></td></tr>';
print '<tr><td>'.$langs->trans("Email").'</td><td><input type="text" name="email" value="'.(GETPOSTISSET('email') ? GETPOST('email', 'alphanohtml') : $object->email).'"></td></tr>';
print '<tr><td>'.$langs->trans("Signature").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('signature', (GETPOSTISSET('signature') ? GETPOST('signature', 'restricthtml') : $object->signature), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
print $doleditor->Create(1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("User").'</td><td>';
print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id));
print '</td></tr>';
print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.(GETPOSTISSET('position') ? GETPOST('position', 'int') : $object->position).'"></td></tr>';
print '<tr><td>'.$langs->trans("Status").'</td><td>';
print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOST('active', 'int') : $object->active), 0, 0, 0, '', 1);
print '</td></tr>';
print '</table>';
print '<br>';
print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
}
} else {
/*print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -367,7 +397,7 @@ if ($action != 'create') {
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
*/
print '<table class="border centpercent tableforfield">';
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="label" value="'.GETPOST('label', 'alphanohtml').'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" value="'.GETPOST('label', 'alphanohtml').'"></td></tr>';
print '<tr><td>'.$langs->trans("Email").'</td><td><input type="text" name="email" value="'.GETPOST('email', 'alphanohtml').'"></td></tr>';
print '<tr><td>'.$langs->trans("Signature").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -531,7 +561,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
if (!empty($arrayfields['t.'.$key]['checked']))
{
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
if ($key == 'status') print $object->getLibStatut(5);
if ($key == 'status' || $key == 'active') print $object->getLibStatut(5);
else print $object->showOutputField($val, $key, $object->$key, '');
print '</td>';
if (!$i) $totalarray['nbfield']++;
@ -550,14 +580,14 @@ while ($i < ($limit ? min($num, $limit) : $num))
print $hookmanager->resPrint;
// Action column
print '<td class="nowrap center">';
$url = $_SERVER["PHP_SELF"].'?action=list&id='.$obj->rowid;
$url = $_SERVER["PHP_SELF"].'?id='.$obj->rowid;
if ($limit) $url .= '&limit='.urlencode($limit);
if ($page) $url .= '&page='.urlencode($page);
if ($sortfield) $url .= '&sortfield='.urlencode($sortfield);
if ($sortorder) $url .= '&page='.urlencode($sortorder);
//print '<a class="reposition" href="'.$url.'&action=edit">'.img_edit().'</a>';
print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&rowid='.$obj->rowid.'">'.img_edit().'</a>';
//print ' &nbsp; ';
print '<a href="'.$url.'&action=delete">'.img_delete().'</a> &nbsp; ';
print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete">'.img_delete().'</a> &nbsp; ';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected = 0;

View File

@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "mails", "languages"));
$action = GETPOST('action', 'alpha') ?GETPOST('action', 'alpha') : 'view';
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$id = GETPOST('id', 'int');
@ -167,6 +167,7 @@ if ($conf->adherent->enabled && $user->rights->adherent->lire) $element
if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementList['contract'] = $langs->trans('MailToSendContract');
if ($conf->projet->enabled) $elementList['project'] = $langs->trans('MailToProject');
if ($conf->ticket->enabled && $user->rights->ticket->read) $elementList['ticket_send'] = $langs->trans('MailToTicket');
if ($conf->recruitment->enabled && $user->rights->recruitment->recruitmentjobposition->read) $elementList['recruitmentcandidature_send'] = $langs->trans('RecruitmentCandidatures');
$elementList['user'] = $langs->trans('MailToUser');
$parameters = array('elementList'=>$elementList);
@ -409,13 +410,15 @@ if (empty($reshook))
$form = new Form($db);
$formadmin = new FormAdmin($db);
llxHeader();
$help_url = '';
$title = $langs->trans("EMailsSetup");
llxHeader('', $title);
$titre = $langs->trans("EMailsSetup");
$linkback = '';
$titlepicto = 'title_setup';
print load_fiche_titre($titre, $linkback, $titlepicto);
print load_fiche_titre($title, $linkback, $titlepicto);
$head = email_admin_prepare_head();

View File

@ -498,6 +498,12 @@ if ($virtualdiffersfromphysical)
print '<br>';
}
print '<form>';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="warehouse">';
/*
@ -648,9 +654,15 @@ foreach ($dirmodels as $reldir)
print '</table>';
print '</form>';
// Other
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="warehouse">';
print load_fiche_titre($langs->trans("Other"), '', '');
print '<table class="noborder centpercent">';

View File

@ -147,7 +147,7 @@ print '<td class="liste_titre">';
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
print '</td>';
print '</tr>';
print '<tr '.$bc[false].'><td style="padding-left: 8px">';
print '<tr class="oddeven"><td style="padding-left: 8px">';
print '<table class="centpercent">';
print '<tr>';
print '<td class="tdtop">';

View File

@ -331,7 +331,7 @@ class Asset extends CommonObject
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
$url = dol_buildpath('/assets/card.php', 1).'?id='.$this->id;
$url = dol_buildpath('/asset/card.php', 1).'?id='.$this->id;
if ($option != 'nolink')
{

View File

@ -271,7 +271,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
{
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/assets/card.php?id='.$id);
header("Location: ".DOL_URL_ROOT.'/asset/card.php?id='.$id);
exit;
}

View File

@ -77,6 +77,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x'
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('assettypecard', 'globalcard'));
$permissiontoadd = $user->rights->asset->setup_advance;
/*
* Actions
@ -211,14 +212,6 @@ if (!$rowid && $action != 'create' && $action != 'edit')
$param = '';
$newcardbutton = '';
if ($user->rights->asset->configurer)
{
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/asset/type.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewAssetType').'</span>';
$newcardbutton .= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton .= '</a>';
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -228,6 +221,8 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('NewAssetType'), '', 'fa fa-plus-circle', dol_buildpath('/asset/type.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'accountancy', 0, $newcardbutton, '', $limit);
$moreforfilter = '';
@ -238,9 +233,9 @@ if (!$rowid && $action != 'create' && $action != 'edit')
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Ref").'</th>';
print '<th>'.$langs->trans("Label").'</th>';
print '<th align="center">'.$langs->trans("AccountancyCodeAsset").'</th>';
print '<th align="center">'.$langs->trans("AccountancyCodeDepreciationAsset").'</th>';
print '<th align="center">'.$langs->trans("AccountancyCodeDepreciationExpense").'</th>';
print '<th class="center">'.$langs->trans("AccountancyCodeAsset").'</th>';
print '<th class="center">'.$langs->trans("AccountancyCodeDepreciationAsset").'</th>';
print '<th class="center">'.$langs->trans("AccountancyCodeDepreciationExpense").'</th>';
print '<th>&nbsp;</th>';
print "</tr>\n";
@ -267,7 +262,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('', $objp->accountancy_code_asset, 1);
print $accountingaccount->getNomUrl(0, 0, 0, '', 0);
print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
} else {
print $objp->accountancy_code_asset;
}
@ -279,7 +274,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
$accountingaccount2 = new AccountingAccount($db);
$accountingaccount2->fetch('', $objp->accountancy_code_depreciation_asset, 1);
print $accountingaccount2->getNomUrl(0, 0, 0, '', 0);
print $accountingaccount2->getNomUrl(0, 1, 1, '', 0);
} else {
print $objp->accountancy_code_depreciation_asset;
}
@ -291,7 +286,7 @@ if (!$rowid && $action != 'create' && $action != 'edit')
$accountingaccount3 = new AccountingAccount($db);
$accountingaccount3->fetch('', $objp->accountancy_code_depreciation_expense, 1);
print $accountingaccount3->getNomUrl(0, 0, 0, '', 0);
print $accountingaccount3->getNomUrl(0, 1, 1, '', 0);
} else {
print $objp->accountancy_code_depreciation_expense;
}

View File

@ -20,10 +20,12 @@ use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/api_members.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/api_products.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/api_contacts.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/api_thirdparties.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/api_projects.class.php';
/**
* API class for categories
@ -48,7 +50,7 @@ class Categories extends DolibarrApi
3 => 'member',
4 => 'contact',
5 => 'account',
//6 => 'project',
6 => 'project',
//7 => 'user',
//8 => 'bank_line',
//9 => 'warehouse',
@ -179,7 +181,8 @@ class Categories extends DolibarrApi
}
$i++;
}
} else {
}
else {
throw new RestException(503, 'Error when retrieve category list : '.$db->lasterror());
}
if (!count($obj_ret)) {
@ -239,10 +242,9 @@ class Categories extends DolibarrApi
$this->category->$field = $value;
}
if ($this->category->update(DolibarrApiAccess::$user) > 0)
{
if ($this->category->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id);
} else {
} else {
throw new RestException(500, $this->category->error);
}
}
@ -285,7 +287,7 @@ class Categories extends DolibarrApi
* Get the list of categories linked to an object
*
* @param int $id Object ID
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact')
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'project')
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Limit for list
@ -303,7 +305,8 @@ class Categories extends DolibarrApi
Categorie::TYPE_CONTACT,
Categorie::TYPE_CUSTOMER,
Categorie::TYPE_SUPPLIER,
Categorie::TYPE_MEMBER
Categorie::TYPE_MEMBER,
Categorie::TYPE_PROJECT
])) {
throw new RestException(401);
}
@ -318,6 +321,8 @@ class Categories extends DolibarrApi
throw new RestException(401);
} elseif ($type == Categorie::TYPE_MEMBER && !DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401);
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401);
}
$categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page);
@ -326,7 +331,7 @@ class Categories extends DolibarrApi
if ($categories == 0) {
throw new RestException(404, 'No category found for this object');
}
throw new RestException(500, 'Error when fetching object categories', array_merge(array($this->category->error), $this->category->errors));
throw new RestException(600, 'Error when fetching object categories', array_merge(array($this->category->error), $this->category->errors));
}
return $categories;
}
@ -727,7 +732,7 @@ class Categories extends DolibarrApi
* Get the list of objects in a category.
*
* @param int $id ID of category
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact')
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'project')
* @param int $onlyids Return only ids of objects (consume less memory)
*
* @return mixed
@ -772,9 +777,10 @@ class Categories extends DolibarrApi
$objects_api = new Products();
} elseif ($type == 'contact') {
$objects_api = new Contacts();
} elseif ($type == 'project') {
$objects_api = new Projects();
}
if (is_object($objects_api))
{
if (is_object($objects_api)) {
foreach ($objects as $obj) {
$cleaned_objects[] = $objects_api->_cleanObjectDatas($obj);
}

View File

@ -248,7 +248,7 @@ if (empty($reshook) && $action == 'add')
if (!$error)
{
// Initialisation objet actioncomm
$object->priority = GETPOST("priority") ?GETPOST("priority") : 0;
$object->priority = GETPOST("priority") ? GETPOST("priority") : 0;
$object->fulldayevent = (!empty($fulldayevent) ? 1 : 0);
$object->location = GETPOST("location");
$object->label = trim(GETPOST('label'));
@ -1706,6 +1706,7 @@ if ($id > 0)
}
print '</td></tr>';
}
// Categories
if ($conf->categorie->enabled) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">';
@ -1781,7 +1782,7 @@ if ($id > 0)
}
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3" class="wordbreak">';
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private));
print '</td></tr>';

View File

@ -492,7 +492,7 @@ class ActionComm extends CommonObject
$sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", ";
$sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", ";
$sql .= " '".$this->db->escape($this->note_private)."', ";
$sql .= ((isset($this->contact_id) && $this->contact_id > 0) ? $this->contact_id : "null").", ";
$sql .= ((isset($this->contact_id) && $this->contact_id > 0) ? $this->contact_id : "null").", "; // deprecated, use ->socpeopleassigned
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
@ -666,12 +666,13 @@ class ActionComm extends CommonObject
/**
* Load object from database
*
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @return int <0 if KO, >0 if OK
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @param string $email_msgid Email msgid
* @return int <0 if KO, >0 if OK
*/
public function fetch($id, $ref = '', $ref_ext = '')
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
{
global $langs;
@ -692,6 +693,7 @@ class ActionComm extends CommonObject
$sql .= " a.fk_contact, a.percent as percentage,";
$sql .= " a.fk_element as elementid, a.elementtype,";
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,";
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
$sql .= " s.nom as socname,";
$sql .= " u.firstname, u.lastname as lastname";
@ -700,9 +702,10 @@ class ActionComm extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
$sql .= " WHERE ";
if ($ref) $sql .= " a.id=".$ref; // No field ref, we use id
elseif ($ref_ext) $sql .= " a.ref_ext='".$this->db->escape($ref_ext)."'";
else $sql .= " a.id=".$id;
if ($ref) $sql .= " a.id = ".((int) $ref); // No field ref, we use id
elseif ($ref_ext) $sql .= " a.ref_ext = '".$this->db->escape($ref_ext)."'";
elseif ($email_msgid) $sql .= " a.email_msgid = '".$this->db->escape($email_msgid)."'";
else $sql .= " a.id = ".((int) $id);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -1141,8 +1144,17 @@ class ActionComm extends CommonObject
if (!empty($socid)) $sql .= " AND a.fk_soc = ".$socid;
if (!empty($elementtype))
{
if ($elementtype == 'project') $sql .= ' AND a.fk_project = '.$fk_element;
else $sql .= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
if ($elementtype == 'project') {
$sql .= ' AND a.fk_project = '.$fk_element;
}
elseif ($elementtype == 'contact') {
$sql .= ' AND a.id IN';
$sql .= " (SELECT fk_actioncomm FROM ".MAIN_DB_PREFIX."actioncomm_resources WHERE";
$sql .= " element_type = 'socpeople' AND fk_element = ".$fk_element.')';
}
else {
$sql .= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
}
}
if (!empty($filter)) $sql .= $filter;
if ($sortorder && $sortfield) $sql .= $db->order($sortfield, $sortorder);

View File

@ -1061,17 +1061,48 @@ if (count($listofextcals))
$event->id = $icalevent['UID'];
$event->ref = $event->id;
$userId = $userstatic->findUserIdByEmail($namecal);
if (!empty($userId) && $userId > 0)
{
$event->userassigned[$userId] = $userId;
$event->percentage = -1;
}
else {
$event->type_code = "ICALEVENT";
}
$event->icalname = $namecal;
$event->icalcolor = $colorcal;
$usertime = 0; // We dont modify date because we want to have date into memory datep and datef stored as GMT date. Compensation will be done during output.
$event->datep = $datestart + $usertime;
$event->datef = $dateend + $usertime;
$event->type_code = "ICALEVENT";
if ($icalevent['SUMMARY']) $event->label = $icalevent['SUMMARY'];
elseif ($icalevent['DESCRIPTION']) $event->label = dol_nl2br($icalevent['DESCRIPTION'], 1);
else $event->label = $langs->trans("ExtSiteNoLabel");
// Priority (see https://www.kanzaki.com/docs/ical/priority.html)
// LOW = 0 to 4
// MEDIUM = 5
// HIGH = 6 to 9
if ($icalevent['PRIORITY']) $event->priority = $icalevent['PRIORITY'];
// Transparency (see https://www.kanzaki.com/docs/ical/transp.html)
if ($icalevent['TRANSP'])
{
if ($icalevent['TRANSP'] == "TRANSPARENT") $event->transparency = 0; // 0 = available / free
if ($icalevent['TRANSP'] == "OPAQUE") $event->transparency = 1; // 1 = busy
// TODO: MS outlook states
// X-MICROSOFT-CDO-BUSYSTATUS:FREE + TRANSP:TRANSPARENT => Available / Free
// X-MICROSOFT-CDO-BUSYSTATUS:FREE + TRANSP:OPAQUE => Work another place
// X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE + TRANSP:OPAQUE => With reservations
// X-MICROSOFT-CDO-BUSYSTATUS:BUSY + TRANSP:OPAQUE => Busy
// X-MICROSOFT-CDO-BUSYSTATUS:OOF + TRANSP:OPAQUE => Away from the office / off-site
}
if ($icalevent['LOCATION']) $event->location = $icalevent['LOCATION'];
$event->date_start_in_calendar = $event->datep;
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar = $event->datef;

View File

@ -134,8 +134,8 @@ $arrayfields = array(
'a.datep'=>array('label'=>"DateStart", 'checked'=>1),
'a.datep2'=>array('label'=>"DateEnd", 'checked'=>1),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
'a.fk_contact'=>array('label'=>"Contact", 'checked'=>1),
'a.fk_element'=>array('label'=>"LinkedObject", 'checked'=>0, 'enabled'=>(!empty($conf->global->AGENDA_SHOW_LINKED_OBJECT))),
'a.fk_contact'=>array('label'=>"Contact", 'checked'=>0),
'a.fk_element'=>array('label'=>"LinkedObject", 'checked'=>1, 'enabled'=>(!empty($conf->global->AGENDA_SHOW_LINKED_OBJECT))),
'a.percent'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
'a.datec'=>array('label'=>'DateCreation', 'checked'=>0),
'a.tms'=>array('label'=>'DateModification', 'checked'=>0)
@ -694,7 +694,7 @@ if ($resql)
if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_EMAIL' || $actioncomm->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_other', '', false, 0, 0, '', 'paddingright').' ';
@ -706,7 +706,10 @@ if ($resql)
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH';
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
$labeltype = $langs->trans("Message");
} elseif (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
} else {
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
if ($obj->type_code == 'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) $labeltype .= ' - '.$arraylist[$obj->code]; // Use code in priority on type_code
}
print dol_trunc($labeltype, 28);
print '</td>';
}
@ -727,6 +730,7 @@ if ($resql)
}
$formatToUse = $obj->fulldayevent ? 'day' : 'dayhour';
// Start date
if (!empty($arrayfields['a.datep']['checked'])) {
print '<td class="center nowraponall">';

View File

@ -1556,12 +1556,12 @@ if ($action == 'create')
// Terms of payment
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
$form->select_conditions_paiements($soc->cond_reglement_id, 'cond_reglement_id', -1, 1);
$form->select_conditions_paiements((GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id), 'cond_reglement_id', -1, 1);
print '</td></tr>';
// Mode of payment
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
$form->select_types_paiements($soc->mode_reglement_id, 'mode_reglement_id');
$form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id');
print '</td></tr>';
// Bank Account

View File

@ -825,7 +825,6 @@ class Propal extends CommonObject
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new PropaleLigne($this->db);
$line->fetch($rowid);
$line->fetch_optionals();
$staticline = clone $line;

View File

@ -210,6 +210,7 @@ if (empty($reshook))
$search_total_ht = '';
$search_total_vat = '';
$search_total_ttc = '';
$search_warehouse = '';
$search_multicurrency_code = '';
$search_multicurrency_tx = '';
$search_multicurrency_montant_ht = '';

View File

@ -9,6 +9,7 @@
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -73,6 +74,8 @@ class Paiement extends CommonObject
public $amounts = array(); // array: invoice ID => amount for that invoice (in the main currency)>
public $multicurrency_amounts = array(); // array: invoice ID => amount for that invoice (in the invoice's currency)>
public $pos_change = 0; // Excess received in TakePOS cash payment
public $author;
public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement
public $paiementcode; // Code of payment.
@ -288,8 +291,9 @@ class Paiement extends CommonObject
$num_payment = ($this->num_payment ? $this->num_payment : $this->num_paiement);
$note = ($this->note_public ? $this->note_public : $this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)";
$sql .= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", '".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").", ".$user->id.")";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat, pos_change)";
$sql .= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", ";
$sql .= "'".$this->db->escape($num_payment)."', '".$this->db->escape($note)."', ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").", ".$user->id.", ".((int) $this->pos_change).")";
$resql = $this->db->query($sql);
if ($resql)

View File

@ -181,6 +181,7 @@ $limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.type = 'debit-order'";
$sql .= " AND entity IN (" . getEntity('prelevement') . ")";
$sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit);

View File

@ -1527,6 +1527,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print "</div>";
//Select mail models is same action as presend
if (GETPOST('modelselected')) {
$action = 'presend';
}
if ($action != 'presend')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
$MAXEVENT = 10;
$morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'contact', $object->socid, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for thirdparty
print '</div></div></div>';
}
// Presend form
$modelmail = 'contact';
$defaulttopic = 'Information';

View File

@ -199,7 +199,7 @@ $now = dol_now();
$form = new Form($db);
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut, c.ref_customer, c.ref_supplier,";
$sql .= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur,";
$sql .= " cd.rowid, cd.description, cd.statut,";
$sql .= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
@ -564,6 +564,8 @@ while ($i < min($num, $limit))
$contractstatic->id = $obj->cid;
$contractstatic->ref = $obj->ref ? $obj->ref : $obj->cid;
$contractstatic->ref_customer = $obj->ref_customer;
$contractstatic->ref_supplier = $obj->ref_supplier;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;

View File

@ -114,12 +114,11 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
$result = $object->fetch($id);
$sendtosocid = 0; // Id of related thirdparty
if (method_exists($object, "fetch_thirdparty") && !in_array($object->element, array('societe', 'member', 'user', 'expensereport', 'contact')))
if (method_exists($object, "fetch_thirdparty") && !in_array($object->element, array('member', 'user', 'expensereport', 'societe', 'contact')))
{
$result = $object->fetch_thirdparty();
if ($object->element == 'user' && $result == 0) $result = 1; // Even if not found, we consider ok
$resultthirdparty = $object->fetch_thirdparty();
$thirdparty = $object->thirdparty;
$sendtosocid = $thirdparty->id;
if (is_object($thirdparty)) $sendtosocid = $thirdparty->id;
} elseif ($object->element == 'member' || $object->element == 'user')
{
$thirdparty = $object;
@ -133,11 +132,15 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
} elseif ($object->element == 'societe')
{
$thirdparty = $object;
if ($thirdparty->id > 0) $sendtosocid = $thirdparty->id;
if (is_object($thirdparty) && $thirdparty->id > 0) $sendtosocid = $thirdparty->id;
} elseif ($object->element == 'contact')
{
$contact = $object;
if ($contact->id > 0) $sendtosocid = $contact->fetch_thirdparty()->id;
if ($contact->id > 0) {
$contact->fetch_thirdparty();
$thirdparty = $contact->thirdparty;
if (is_object($thirdparty) && $thirdparty->id > 0) $sendtosocid = $thirdparty->id;
}
} else dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported");
if (is_object($hookmanager))
@ -145,7 +148,9 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
$parameters = array();
$reshook = $hookmanager->executeHooks('initSendToSocid', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
}
} else $thirdparty = $mysoc;
} else {
$thirdparty = $mysoc;
}
if ($result > 0)
{
@ -170,23 +175,24 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
// Recipients are provided into free text
$tmparray[] = trim($_POST['sendto']);
}
if (count($receiver) > 0)
{
// Recipient was provided from combo list
foreach ($receiver as $key=>$val)
{
// Recipient was provided from combo list
if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too)
if ($val == 'thirdparty') // Key selected means current third party ('thirdparty' may be used for current member or current user too)
{
$tmparray[] = dol_string_nospecial($thirdparty->getFullName($langs), ' ', array(",")).' <'.$thirdparty->email.'>';
}
// Recipient was provided from combo list
elseif ($val == 'contact') // Key selected means current contact
{
$tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>';
$sendtoid[] = $contact->id;
} elseif ($val) // $val is the Id of a contact
{
$tmparray[] = $thirdparty->contact_get_property((int) $val, 'email');
$sendtoid[] = $val;
$sendtoid[] = ((int) $val);
}
}
}
@ -232,10 +238,11 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
elseif ($val == 'contact') // Key selected means current contact
{
$tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>';
//$sendtoid[] = $contact->id; TODO Add also id of contact in CC ?
} elseif ($val) // $val is the Id of a contact
{
$tmparray[] = $thirdparty->contact_get_property((int) $val, 'email');
//$sendtoid[] = $val; TODO Add also id of contact in CC ?
//$sendtoid[] = ((int) $val); TODO Add also id of contact in CC ?
}
}
}
@ -415,7 +422,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
if (empty($actiontypecode)) $actiontypecode = 'AC_OTH_AUTO'; // Event insert into agenda automatically
$object->socid = $sendtosocid; // To link to a company
$object->sendtoid = $sendtoid; // To link to contact addresses. This is an array.
$object->sendtoid = $sendtoid; // To link to contact-addresses. This is an array.
$object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$object->actionmsg = $actionmsg; // Long text (@todo Replace this with $message, we already have details of email in dedicated properties)
$object->actionmsg2 = $actionmsg2; // Short text ($langs->transnoentities('MailSentBy')...);
@ -486,7 +493,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
$action = 'presend';
}
} else {
$langs->load("other");
$langs->load("errors");
setEventMessages($langs->trans('ErrorFailedToReadObject', $object->element), null, 'errors');
dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element);
$action = 'presend';

View File

@ -180,41 +180,46 @@ if ($type == 'directory')
$sorting = (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC);
// Right area. If module is defined here, we are in automatic ecm.
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday', 'banque');
$automodules = array(
'company',
'invoice',
'invoice_supplier',
'propal',
'supplier_proposal',
'order',
'order_supplier',
'contract',
'product',
'tax',
'project',
'fichinter',
'user',
'expensereport',
'holiday',
'recruitment-recruitmentcandidature',
'banque',
'mrp-mo'
);
// TODO change for multicompany sharing
// Auto area for suppliers invoices
if ($module == 'company') $upload_dir = $conf->societe->dir_output;
// Auto area for suppliers invoices
elseif ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
// Auto area for suppliers invoices
elseif ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
// Auto area for customers proposal
elseif ($module == 'propal') $upload_dir = $conf->propal->dir_output;
// Auto area for suppliers proposal
elseif ($module == 'supplier_proposal') $upload_dir = $conf->supplier_proposal->dir_output;
// Auto area for customers orders
elseif ($module == 'order') $upload_dir = $conf->commande->dir_output;
// Auto area for suppliers orders
elseif ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
// Auto area for suppliers invoices
elseif ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
// Auto area for products
elseif ($module == 'product') $upload_dir = $conf->product->dir_output;
// Auto area for suppliers invoices
elseif ($module == 'tax') $upload_dir = $conf->tax->dir_output;
// Auto area for projects
elseif ($module == 'project') $upload_dir = $conf->projet->dir_output;
// Auto area for interventions
elseif ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output;
// Auto area for users
elseif ($module == 'user') $upload_dir = $conf->user->dir_output;
// Auto area for expense report
elseif ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
// Auto area for holiday
elseif ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
// Auto area for holiday
elseif ($module == 'recruitment-recruitmentcandidature') $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
elseif ($module == 'banque') $upload_dir = $conf->bank->dir_output;
elseif ($module == 'mrp-mo') $upload_dir = $conf->mrp->dir_output.'/mo';
// Automatic list
if (in_array($module, $automodules))

View File

@ -238,23 +238,29 @@ abstract class CommonObject
/**
* @var string
* @see getFullAddress(), state
* @see getFullAddress(), $state
*/
public $state_code;
/**
* @var string
* @see getFullAddress(), region
/**
* @var int
* @see getFullAddress(), $region_code, $region
*/
public $region;
public $region_id;
/**
* @var string
* @see getFullAddress(), region
* @see getFullAddress(), $region_id, $region
*/
public $region_code;
/**
/**
* @var string
* @see getFullAddress(), $region_id, $region_code
*/
public $region;
/**
* @var int
* @see fetch_barcode()
*/
@ -7757,11 +7763,11 @@ abstract class CommonObject
$sql = 'SELECT '.$fieldlist;
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
if (!empty($id)) $sql .= ' WHERE rowid = '.$id;
if (!empty($id)) $sql .= ' WHERE rowid = '.$id;
elseif (!empty($ref)) $sql .= " WHERE ref = ".$this->quote($ref, $this->fields['ref']);
else $sql .= ' WHERE 1 = 1'; // usage with empty id and empty ref is very rare
if (empty($id) && isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' AND entity IN ('.getEntity($this->table_element).')';
if ($morewhere) $sql .= $morewhere;
if ($morewhere) $sql .= $morewhere;
$sql .= ' LIMIT 1'; // This is a fetch, to be sure to get only one record
$res = $this->db->query($sql);

View File

@ -186,7 +186,7 @@ class dolReceiptPrinter extends Printer
'dol_value_month' => 'DOL_VALUE_MONTH',
'dol_value_day' => 'DOL_VALUE_DAY',
'dol_value_day_letters' => 'DOL_VALUE_DAY',
//'dol_print_payment',
'dol_print_payment' => 'DOL_PRINT_PAYMENT',
'dol_print_logo' => 'DOL_PRINT_LOGO',
'dol_print_logo_old' => 'DOL_PRINT_LOGO_OLD',
'dol_value_object_id' => 'InvoiceID',
@ -775,6 +775,35 @@ class dolReceiptPrinter extends Printer
}
}
break;
case 'DOL_PRINT_PAYMENT':
$sql = "SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
$sql .= " cp.code";
$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id";
$sql .= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id;
$sql .= " ORDER BY p.datep";
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$row = $this->db->fetch_object($resql);
$spacestoadd = $nbcharactbyline - strlen($langs->transnoentitiesnoconv("PaymentTypeShort".$row->code)) - 12;
$spaces = str_repeat(' ', $spacestoadd);
$amount_payment=($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
if ($row->code == "LIQ") $amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
$this->printer->text($spaces.$langs->transnoentitiesnoconv("PaymentTypeShort".$row->code).' '.str_pad(price($amount_payment), 10, ' ', STR_PAD_LEFT)."\n");
if ($row->code == "LIQ" && $row->pos_change>0) // Print change only in cash payments
{
$spacestoadd = $nbcharactbyline - strlen($langs->trans("Change")) - 12;
$spaces = str_repeat(' ', $spacestoadd);
$this->printer->text($spaces.$langs->trans("Change").' '.str_pad(price($row->pos_change), 10, ' ', STR_PAD_LEFT)."\n");
}
$i++;
}
}
break;
default:
$this->printer->text($vals[$tplline]['tag']);
$this->printer->text($vals[$tplline]['value']);

View File

@ -95,13 +95,12 @@ class EmailSenderProfile extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
//'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1, 'arrayofkeyval'=>array(0=>'Disabled', 1=>'Enabled')),
'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0=>'Disabled', 1=>'Enabled')),
);
/**
@ -331,7 +330,7 @@ class EmailSenderProfile extends CommonObject
*/
public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->status, $mode);
return $this->LibStatut($this->active, $mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -346,31 +345,16 @@ class EmailSenderProfile extends CommonObject
{
global $langs;
if ($mode == 0 || $mode == 1)
{
if ($status == 1) return $langs->trans('Enabled');
elseif ($status == 0) return $langs->trans('Disabled');
} elseif ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
} elseif ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4');
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5');
} elseif ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
} elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
} elseif ($mode == 6)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
if ($status == 1) {
$label = $labelshort = $langs->trans('Enabled');
} else {
$label = $labelshort = $langs->trans('Disabled');
}
$statusType = 'status'.$status;
if ($status == self::STATUS_ENABLED) $statusType = 'status4';
return dolGetStatus($label, $labelshort, '', $statusType, $mode);
}
/**

View File

@ -199,12 +199,12 @@ class Form
if (preg_match('/^(string|safehtmlstring|email)/', $typeofdata))
{
$tmp = explode(':', $typeofdata);
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').'>';
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
} elseif (preg_match('/^(numeric|amount)/', $typeofdata))
{
$tmp = explode(':', $typeofdata);
$valuetoshow = price2num($editvalue ? $editvalue : $value);
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').'>';
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) // if wysiwyg is enabled $typeofdata = 'ckeditor'
{
$tmp = explode(':', $typeofdata);
@ -217,7 +217,7 @@ class Form
}
$valuetoshow = ($editvalue ? $editvalue : $value);
$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1] ? $tmp[1] : '20').'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'">';
$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1] ? $tmp[1] : '20').'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
// textarea convert automatically entities chars into simple chars.
// So we convert & into &amp; so a string like 'a &lt; <b>b</b><br>é<br>&lt;script&gt;alert('X');&lt;script&gt;' stay a correct html and is not converted by textarea component when wysiwig is off.
$valuetoshow = str_replace('&', '&amp;', $valuetoshow);
@ -5772,7 +5772,7 @@ class Form
* @param int $disabled 1=Html component is disabled
* @param string $selected_input_value Value of preselected input text (for use with ajax)
* @return string Return HTML string
* @see selectForFormsList() select_thirdparty
* @see selectForFormsList() select_thirdparty()
*/
public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '')
{

View File

@ -157,7 +157,7 @@ class FormActions
* Show list of actions for element
*
* @param Object $object Object
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
* @param string $typeelement 'invoice', 'propal', 'order', 'invoice_supplier', 'order_supplier', 'fichinter'
* @param int $socid Socid of user
* @param int $forceshowtitle Show title even if there is no actions to show
* @param string $morecss More css on table

View File

@ -58,9 +58,10 @@ class FormContract
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $showempty Show empty line
* @param int $showRef Show customer and supplier reference on each contract (when found)
* @return int Nbr of project if OK, <0 if KO
*/
public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1)
public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0)
{
// phpcs:enable
global $db, $user, $conf, $langs;
@ -69,7 +70,8 @@ class FormContract
if (!empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true;
// Search all contacts
$sql = 'SELECT c.rowid, c.ref, c.fk_soc, c.statut';
$sql = 'SELECT c.rowid, c.ref, c.fk_soc, c.statut,';
$sql .= ' c.ref_customer, c.ref_supplier';
$sql .= ' FROM '.MAIN_DB_PREFIX.'contrat as c';
$sql .= " WHERE c.entity = ".$conf->entity;
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
@ -105,6 +107,13 @@ class FormContract
// Do nothing
} else {
$labeltoshow = dol_trunc($obj->ref, 18);
if ($showRef)
{
if ($obj->ref_customer) $labeltoshow = $labeltoshow." - ".$obj->ref_customer;
if ($obj->ref_supplier) $labeltoshow = $labeltoshow." - ".$obj->ref_supplier;
}
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
if (!empty($selected) && $selected == $obj->rowid && $obj->statut > 0)
@ -166,9 +175,10 @@ class FormContract
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $showempty Show empty line
* @param int $showRef Show customer and supplier reference on each contract (when found)
* @return int Nbr of project if OK, <0 if KO
*/
public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1)
public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0)
{
global $langs;
@ -176,7 +186,7 @@ class FormContract
print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="action" value="setcontract">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty);
$this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty, $showRef);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
}

View File

@ -1526,10 +1526,18 @@ class FormFile
{
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$object_instance = new Holiday($this->db);
} elseif ($modulepart == 'recruitment-recruitmentcandidature')
{
include_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
$object_instance = new RecruitmentCandidature($this->db);
} elseif ($modulepart == 'banque')
{
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$object_instance = new Account($this->db);
} elseif ($modulepart == 'mrp-mo')
{
include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
$object_instance = new Mo($this->db);
}
foreach ($filearray as $key => $file)
@ -1546,9 +1554,24 @@ class FormFile
$id = 0; $ref = ''; $label = '';
// To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); } elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) { $id = $ref; $ref = ''; } } // $ref may be also id with old supplier invoices
elseif ($modulepart == 'user' || $modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); } elseif (in_array($modulepart, array('invoice', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'project', 'fichinter', 'expensereport', 'banque')))
{
$reg = array();
if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); }
elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) { $id = $ref; $ref = ''; } } // $ref may be also id with old supplier invoices
elseif ($modulepart == 'user' || $modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); }
elseif (in_array($modulepart, array(
'invoice',
'propal',
'supplier_proposal',
'order',
'order_supplier',
'contract',
'product',
'project',
'fichinter',
'expensereport',
'recruitment-recruitmentcandidature',
'mrp-mo',
'banque'))) {
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : '');
} else {
//print 'Error: Value for modulepart = '.$modulepart.' is not yet implemented in function list_of_autoecmfiles'."\n";

View File

@ -418,7 +418,11 @@ class FormMail extends Form
}
foreach ($this->param as $key=>$value)
{
$out .= '<input type="hidden" id="'.$key.'" name="'.$key.'" value="'.$value.'" />'."\n";
if (is_array($value)) {
$out .= "<!-- param key=".$key." is array, we do not output input filed for it -->\n";
} else {
$out .= '<input type="hidden" id="'.$key.'" name="'.$key.'" value="'.$value.'" />'."\n";
}
}
$modelmail_array = array();
@ -459,7 +463,7 @@ class FormMail extends Form
} elseif (!empty($this->param['models']) && in_array($this->param['models'], array(
'propal_send', 'order_send', 'facture_send',
'shipping_send', 'fichinter_send', 'supplier_proposal_send', 'order_supplier_send',
'invoice_supplier_send', 'thirdparty', 'contract', 'user', 'all'
'invoice_supplier_send', 'thirdparty', 'contract', 'user', 'recruitmentcandidature_send', 'all'
)))
{
// If list of template is empty
@ -470,10 +474,11 @@ class FormMail extends Form
$out .= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" disabled="disabled" id="modelselected">';
$out .= ' &nbsp; ';
$out .= '</div>';
} else {
$out .= '<!-- No template available for $this->param["models"] = '.$this->param['models'].' -->';
}
$out .= '<table class="tableforemailform boxtablenotop" width="100%">'."\n";
// Substitution array/string
@ -920,6 +925,8 @@ class FormMail extends Form
$this->substit['__ONLINE_PAYMENT_URL__'] = '';
}
$this->substit['__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__'] = '';
// Add lines substitution key from each line
$lines = '';
$defaultlines = $arraydefaultmessage->content_lines;
@ -942,6 +949,9 @@ class FormMail extends Form
if (strpos($defaultmessage, '__ONLINE_PAYMENT_TEXT_AND_URL__') !== false && dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
$atleastonecomponentishtml++;
}
if (strpos($defaultmessage, '__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__') !== false && dol_textishtml($this->substit['__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__'])) {
$atleastonecomponentishtml++;
}
if (dol_textishtml($defaultmessage)) {
$atleastonecomponentishtml++;
}
@ -1243,12 +1253,8 @@ class FormMail extends Form
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendShipping");
} elseif ($type_template == 'fichinter_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendFichInter");
} elseif ($type_template == 'thirdparty') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentThirdparty");
} elseif ($type_template == 'user') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentUser");
} elseif (!empty($type_template)) {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContent".ucfirst($type_template));
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentGeneric");
}
$ret->label = 'default';

View File

@ -209,7 +209,7 @@ class FormTicket
print '</td></tr>';
// Group
print '<tr><td><span class="fieldrequired"><label for="selectcategory_code">'.$langs->trans("TicketGroup").'</span></label></td><td>';
print '<tr><td><span class="fieldrequired"><label for="selectcategory_code">'.$langs->trans("TicketCategory").'</span></label></td><td>';
$this->selectGroupTickets((GETPOST('category_code') ? GETPOST('category_code') : $this->category_code), 'category_code', '', '2');
print '</td></tr>';
@ -884,12 +884,12 @@ class FormTicket
$modelmail_array[$line->id] = $line->label;
}
print '<table class="border" width="'.$width.'">';
print '<table class="border" width="'.$width.'">';
// External users can't send message email
if ($user->rights->ticket->write && !$user->socid)
{
print '<tr><td width="30%"></td><td colspan="2">';
print '<tr><td></td><td>';
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : '');
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
print '<label for="send_msg_email">'.$langs->trans('SendMessageByEmail').'</label>';
@ -904,28 +904,27 @@ class FormTicket
}
print ' &nbsp; ';
print '<input class="button" type="submit" value="'.$langs->trans('Use').'" name="modelselected" id="modelselected">';
print ' &nbsp; ';
print '</div></td>';
}
// Private message (not visible by customer/external user)
if (!$user->socid) {
print '<tr><td width="30%"></td><td>';
print '<tr><td></td><td>';
$checkbox_selected = (GETPOST('private_message', 'alpha') == "1" ? ' checked' : '');
print '<input type="checkbox" name="private_message" value="1" id="private_message" '.$checkbox_selected.'/> ';
print '<label for="private_message">'.$langs->trans('MarkMessageAsPrivate').'</label>';
print '</td><td class="center">';
print $form->textwithpicto('', $langs->trans("TicketMessagePrivateHelp"), 1, 'help');
print ' '.$form->textwithpicto('', $langs->trans("TicketMessagePrivateHelp"), 1, 'help');
print '</td></tr>';
}
// Subject
print '<tr class="email_line"><td class="titlefieldcreate">'.$langs->trans('Subject').'</td>';
$label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
print '<td colspan="2"><input type="text" class="text" size="80" name="subject" value="['.$label_title.' - '.$langs->trans("Ticket").' #'.$this->ref.'] '.$langs->trans('TicketNewMessage').'" />';
print '<td><input type="text" class="text" size="80" name="subject" value="['.$label_title.' - '.$langs->trans("Ticket").' #'.$this->ref.'] '.$langs->trans('TicketNewMessage').'" />';
print '</td></tr>';
// Destinataires
print '<tr class="email_line"><td>'.$langs->trans('MailRecipients').'</td><td colspan="2">';
print '<tr class="email_line"><td>'.$langs->trans('MailRecipients').'</td><td>';
$ticketstat = new Ticket($this->db);
$res = $ticketstat->fetch('', '', $this->track_id);
if ($res) {
@ -973,7 +972,9 @@ class FormTicket
// External users can't send message email
if ($user->rights->ticket->write && !$user->socid) {
$mail_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKET_MESSAGE_MAIL_INTRO;
print '<tr class="email_line"><td><label for="mail_intro">'.$langs->trans("TicketMessageMailIntro").'</label>';
print '<tr class="email_line"><td><label for="mail_intro">';
print $form->textwithpicto($langs->trans("TicketMessageMailIntro"), $langs->trans("TicketMessageMailIntroHelp"), 1, 'help');
print '</label>';
print '</td><td>';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -982,8 +983,6 @@ class FormTicket
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '</td><td class="center">';
print $form->textwithpicto('', $langs->trans("TicketMessageMailIntroHelp"), 1, 'help');
print '</td></tr>';
}
@ -1009,17 +1008,16 @@ class FormTicket
$defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
}
print '<tr><td class="tdtop"><label for="message"><span class="fieldrequired">'.$langs->trans("Message").'</span></label></td><td>';
print '<tr><td class="tdtop"><label for="message"><span class="fieldrequired">'.$langs->trans("Message").'</span>';
if ($user->rights->ticket->write && !$user->socid) {
print $form->textwithpicto('', $langs->trans("TicketMessageHelp"), 1, 'help');
}
print '</label></td><td>';
//$toolbarname = 'dolibarr_details';
$toolbarname = 'dolibarr_notes';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70);
$doleditor->Create();
print '</td><td class="center">';
if ($user->rights->ticket->write && !$user->socid) {
print $form->textwithpicto('', $langs->trans("TicketMessageHelp"), 1, 'help');
}
print '</td></tr>';
// Signature
@ -1027,13 +1025,11 @@ class FormTicket
if ($user->rights->ticket->write && !$user->socid) {
$mail_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE;
print '<tr class="email_line"><td><label for="mail_intro">'.$langs->trans("TicketMessageMailSignature").'</label>';
print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help');
print '</td><td>';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '</td><td class="center">';
print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help');
print '</td></tr>';
}
@ -1041,7 +1037,7 @@ class FormTicket
if (!empty($this->withfile)) {
$out = '<tr>';
$out .= '<td width="180">'.$langs->trans("MailFile").'</td>';
$out .= '<td colspan="2">';
$out .= '<td>';
// TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
$out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";
$out .= '<script type="text/javascript" language="javascript">';

View File

@ -41,7 +41,7 @@ class InfoBox
{
return array(
0 => 'Home',
27 => 'Accountancy Home'
27 => 'AccountancyHome'
);
} else {
return array(
@ -72,7 +72,7 @@ class InfoBox
24 => 'expensereportindex',
25 => 'mailingindex',
26 => 'opensurveyindex',
27 => 'Accountancy Home'
27 => 'AccountancyHome'
);
}
}

View File

@ -88,10 +88,10 @@ function asset_prepare_head(Asset $object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
//$this->tabs = array(
// 'entity:+tabname:Title:@assets:/assets/mypage.php?id=__ID__'
// 'entity:+tabname:Title:@assets:/asset/mypage.php?id=__ID__'
//); // to add new tab
//$this->tabs = array(
// 'entity:-tabname:Title:@assets:/assets/mypage.php?id=__ID__'
// 'entity:-tabname:Title:@assets:/asset/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets');

View File

@ -1647,21 +1647,32 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
// Type
$out .= '<td>';
// TODO Code common with code into showactions
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
if ($actionstatic->type_picto) {
$imgpicto .= img_picto('', $actionstatic->type_picto);
}
else {
if ($actionstatic->type_code == 'AC_RDV') $out .= img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_TEL') $out .= img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_FAX') $out .= img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_EMAIL') $out .= img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_INT') $out .= img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) $out .= img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
if ($actionstatic->type_code == 'AC_RDV') $imgpicto .= img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_TEL') $imgpicto .= img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_FAX') $imgpicto .= img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_EMAIL' || $actionstatic->type_code == 'AC_EMAIL_IN') $imgpicto .= img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_INT') $imgpicto .= img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_OTH' && $actionstatic->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) $imgpicto .= img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
}
}
$out .= $imgpicto;
$labeltype = $actionstatic->type_code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH';
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
if ($actionstatic->type_code == 'AC_OTH' && $actionstatic->code == 'TICKET_MSG') {
$labeltype = $langs->trans("Message");
} else {
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labeltype && !empty($arraylist[$actionstatic->code])) $labeltype .= ' - '.$arraylist[$actionstatic->code]; // Use code in priority on type_code
}
$out .= dol_trunc($labeltype, 28);
$out .= '</td>';

View File

@ -58,6 +58,7 @@ function expedition_prepare_head(Expedition $object)
$h++;
}
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
@ -132,7 +133,7 @@ function expedition_admin_prepare_head()
$h++;
}
complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin', 'remove');

View File

@ -223,8 +223,8 @@ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $s
{
global $conf, $db;
$sql = " SELECT rowid, label, entity, filename, filepath, fullpath_orig, keywords, cover, gen_or_uploaded, extraparams, date_c, date_m, fk_user_c, fk_user_m,";
$sql .= " acl, position, share";
$sql = " SELECT rowid, label, entity, filename, filepath, fullpath_orig, keywords, cover, gen_or_uploaded, extraparams,";
$sql .= " date_c, tms as date_m, fk_user_c, fk_user_m, acl, position, share";
if ($mode) $sql .= ", description";
$sql .= " FROM ".MAIN_DB_PREFIX."ecm_files";
$sql .= " WHERE filepath = '".$db->escape($path)."'";
@ -2764,9 +2764,17 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
// If modulepart=module_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp
// If modulepart=module_user Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/iduser
// If modulepart=module Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart
// If modulepart=module-abc Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart
else {
//var_dump($modulepart);
//var_dump($original_file);
if (preg_match('/^specimen/i', $original_file)) $accessallowed = 1; // If link to a file called specimen. Test must be done before changing $original_file int full path.
if ($fuser->admin) $accessallowed = 1; // If user is admin
$tmpmodulepart = explode('-', $modulepart);
if (! empty($tmpmodulepart[1])) {
$modulepart = $tmpmodulepart[0];
$original_file = $tmpmodulepart[1].'/'.$original_file;
}
// Define $accessallowed
$reg = array();
@ -2822,6 +2830,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($partofdirinoriginalfile && ($fuser->rights->$modulepart->$partofdirinoriginalfile->{$lire} || $fuser->rights->$modulepart->$partofdirinoriginalfile->{$read})) $accessallowed = 1;
if ($fuser->rights->$modulepart->{$lire} || $fuser->rights->$modulepart->{$read}) $accessallowed = 1;
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
//var_dump($original_file);
}
// For modules who wants to manage different levels of permissions for documents

View File

@ -3009,7 +3009,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
}
} else {
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
if (empty($srconly) && in_array($pictowithouttext, array(
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cubes',
@ -3025,13 +3025,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal',
'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
'object_recruitmentjobposition',
'object_shipment', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
'object_recruitmentjobposition', 'object_recruitmentcandidature',
'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member',
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website',
'off', 'on', 'order',
'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip',
'setup', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'setup', 'share-alt', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
'home', 'hrm', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'members', 'ticket', 'generic',
@ -3070,7 +3070,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
'other'=>'square',
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
'recruitmentjobposition'=>'door-open', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'resource'=>'laptop-house',
'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
@ -3132,7 +3133,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
'holiday'=>'infobox-holiday', 'invoice'=>'infobox-commande',
'payment'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal',
'recruitmentjobposition'=>'infobox-adherent', 'resource'=>'infobox-action',
'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent',
'resource'=>'infobox-action',
'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier',
'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal',
'ticket'=>'infobox-contrat', 'title_accountancy'=>'infobox-bank_account', 'title_hrm'=>'infobox-holiday', 'trip'=>'infobox-expensereport', 'title_agenda'=>'infobox-action',
@ -5999,6 +6001,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
/*$substitutionarray['__MEMBER_NOTE_PUBLIC__'] = '__MEMBER_NOTE_PUBLIC__';
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
}
if (!empty($conf->recruitment->enabled))
{
$substitutionarray['__CANDIDATE_FULLNAME__'] = 'Candidate full name';
}
if (!empty($conf->projet->enabled))
{
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
@ -6080,8 +6086,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->last_subscription_date_end, 'dayrfc');
}
if (is_object($object) && $object->element == 'societe')
{
if (is_object($object) && $object->element == 'societe') {
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object) ? $object->id : '');
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object) ? $object->name : '');
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object) ? $object->name_alias : '');
@ -6104,8 +6109,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object) ? $object->tva_intra : '');
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object) ?dol_htmlentitiesbr($object->note_public) : '');
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object) ?dol_htmlentitiesbr($object->note_private) : '');
} elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0)
{
} elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0) {
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty) ? $object->thirdparty->id : '');
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty) ? $object->thirdparty->name : '');
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty) ? $object->thirdparty->name_alias : '');
@ -6126,8 +6130,14 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof5 : '');
$substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof6 : '');
$substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty) ? $object->thirdparty->tva_intra : '');
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object->thirdparty) ?dol_htmlentitiesbr($object->thirdparty->note_public) : '');
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object->thirdparty) ?dol_htmlentitiesbr($object->thirdparty->note_private) : '');
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object->thirdparty) ? dol_htmlentitiesbr($object->thirdparty->note_public) : '');
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object->thirdparty) ? dol_htmlentitiesbr($object->thirdparty->note_private) : '');
}
if (is_object($object) && $object->element == 'recruitmentcandidature') {
if ($object->id > 0) {
$substitutionarray['__CANDIDATE_FULLNAME__'] = $object->getFullName($outputlangs);
}
}
if (is_object($object->project) && $object->project->id > 0)

View File

@ -85,9 +85,9 @@ function hrm_admin_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'hrm_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
complete_head_from_modules($conf, $langs, '', $head, $h, 'hrm_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
return $head;
}

View File

@ -87,7 +87,9 @@ function ldap_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'ldap');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ldap');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ldap', 'remove');
return $head;
}

View File

@ -185,7 +185,7 @@ function member_admin_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'member_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'member_admin');
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsMember");
@ -202,7 +202,7 @@ function member_admin_prepare_head()
$head[$h][2] = 'website';
$h++;
complete_head_from_modules($conf, $langs, '', $head, $h, 'member_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'member_admin', 'remove');
return $head;
}

View File

@ -42,6 +42,8 @@ function multicurrencyAdminPrepareHead()
complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency');
complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency', 'remove');
return $head;
}

View File

@ -2068,7 +2068,7 @@ function pdf_getTotalQty($object, $type, $outputlangs)
*/
function pdf_getLinkedObjects($object, $outputlangs)
{
global $hookmanager;
global $db, $hookmanager;
$linkedobjects = array();
@ -2130,8 +2130,13 @@ function pdf_getLinkedObjects($object, $outputlangs)
// We concat this record info into fields xxx_value. title is overwrote.
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order
{
$elementobject->fetchObjectLinked();
if (!empty($elementobject->linkedObjects['commande'])) $order = reset($elementobject->linkedObjects['commande']);
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
if (! empty($elementobject->linkedObjectsIds['commande'])){
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$order = new Commande($db);
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
if ($ret < 1) { $order=null; }
}
}
if (!is_object($order))
{

View File

@ -47,8 +47,6 @@ function reception_prepare_head(Reception $object)
$head[$h][2] = 'reception';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$objectsrc = $object;
@ -65,6 +63,12 @@ function reception_prepare_head(Reception $object)
$h++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception');
$nbNote = 0;
if (!empty($object->note_private)) $nbNote++;
if (!empty($object->note_public)) $nbNote++;
@ -74,12 +78,7 @@ function reception_prepare_head(Reception $object)
$head[$h][2] = 'note';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'remove');
return $head;
}
@ -102,6 +101,7 @@ function reception_admin_prepare_head()
$head[$h][2] = 'reception';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'reception_admin');
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION))
{
@ -119,8 +119,6 @@ function reception_admin_prepare_head()
$h++;
}
complete_head_from_modules($conf, $langs, null, $head, $h, 'reception_admin', 'remove');
return $head;

View File

@ -37,7 +37,7 @@ function resource_prepare_head($object)
$head[$h][0] = dol_buildpath('/resource/card.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("ResourceCard");
$head[$h][2] = 'resource';
$head[$h][2] = 'resource';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && (empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_USER) || empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_THIPARTY)))

View File

@ -27,7 +27,6 @@
*/
function salaries_prepare_head($object)
{
global $db, $langs, $conf;
$h = 0;
@ -86,14 +85,14 @@ function salaries_admin_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, '', $head, $h, 'salaries_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'salaries_admin');
$head[$h][0] = DOL_URL_ROOT.'/salaries/admin/salaries_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSalaries");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, '', $head, $h, 'salaries_admin', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'salaries_admin', 'remove');
return $head;
}

View File

@ -26,7 +26,7 @@
*
* @return array Array of tabs
*/
function takepos_prepare_head()
function takepos_admin_prepare_head()
{
global $langs, $conf;
@ -67,7 +67,9 @@ function takepos_prepare_head()
$head[$h][2] = 'other';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos');
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos_admin', 'remove');
return $head;
}

View File

@ -62,6 +62,8 @@ function ticketAdminPrepareHead()
//); // to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'ticketadmin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ticketadmin', 'remove');
return $head;
}
@ -209,9 +211,9 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
print '<body id="mainbody" class="publicnewticketform">';
print '<div class="center">';
// Define urllogo
$width = 0;
if (!empty($conf->global->TICKET_SHOW_COMPANY_LOGO) || !empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC)) {
// Print logo
if (!empty($conf->global->TICKET_SHOW_COMPANY_LOGO))
@ -220,17 +222,14 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
$width = 150;
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 150;
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
}
}
}
print '<div class="center">';
// Output html code for logo
if ($urllogo || !empty($conf->global->TICKET_PUBLIC_INTERFACE_TOPIC))
{
@ -239,7 +238,6 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
if ($urllogo) {
print '<a href="'.($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticket/index.php', 1)).'">';
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
if ($width) print ' width="'.$width.'"';
print '>';
print '</a>';
}

View File

@ -316,7 +316,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&amp;leftmenu=asset&amp;action=create', 'MenuNewAsset', 2, 'assets', '$user->rights->asset->write', '', 0, 21, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&amp;leftmenu=asset', 'MenuListAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 22, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&amp;leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 23, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&amp;action=create', 'MenuNewTypeAssets', 3, 'assets', '$user->rights->asset->configurer', '', 0, 24, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&amp;action=create', 'MenuNewTypeAssets', 3, 'assets', '$user->rights->asset->setup_advance', '', 0, 24, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '$user->rights->asset->read', '', 0, 25, __ENTITY__);
-- Check deposit
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&amp;leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __ENTITY__);

View File

@ -1446,7 +1446,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/asset/list.php?leftmenu=asset&amp;mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read);
$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type');
if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/', $leftmenu)) {
$newmenu->add("/asset/type.php?leftmenu=asset_type&amp;action=create", $langs->trans("MenuNewTypeAssets"), 2, (empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->setup_advance));
$newmenu->add("/asset/type.php?leftmenu=asset_type&amp;action=create", $langs->trans("MenuNewTypeAssets"), 2, (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->setup_advance));
$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read);
}
}

View File

@ -81,7 +81,7 @@ class modAsset extends DolibarrModules
// Example: this->dirs = array("/asset/temp","/asset/subdir");
$this->dirs = array();
// Config pages. Put here list of php page, stored into assets/admin directory, to use to setup module.
// Config pages. Put here list of php page, stored into asset/admin directory, to use to setup module.
$this->config_page_url = array("setup.php@asset");
// Dependencies
@ -115,8 +115,8 @@ class modAsset extends DolibarrModules
// Array to add new pages in new tabs
$this->tabs = array();
// Example:
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@assets:$user->rights->assets->read:/assets/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@assets:$user->rights->othermodule->read:/assets/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@assets:$user->rights->assets->read:/asset/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@assets:$user->rights->othermodule->read:/asset/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
//
// Where objecttype can be
@ -146,7 +146,7 @@ class modAsset extends DolibarrModules
// Boxes/Widgets
// Add here list of php file(s) stored in assets/core/boxes that contains class to show a widget.
// Add here list of php file(s) stored in asset/core/boxes that contains class to show a widget.
$this->boxes = array(
//0=>array('file'=>'assetswidget1.php@asset','note'=>'Widget provided by Assets','enabledbydefaulton'=>'Home'),
//1=>array('file'=>'assetswidget2.php@asset','note'=>'Widget provided by Assets'),

View File

@ -278,38 +278,67 @@ class modEmailCollector extends DolibarrModules
$sql = array();
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity;
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity;
$tmpresql = $this->db->query($tmpsql);
if ($tmpresql) {
if ($this->db->num_rows($tmpresql) == 0) {
$descriptionA1 = 'This collector will scan your mailbox to find emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated.';
$descriptionA1 .= ' If the collector Collect_Responses is also enabled, when you send an email from the ticket, you may also see answers of your customers or partners directly on the ticket view.';
$sqlforexampleA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleA1 .= " VALUES (".$conf->entity.", 'Collect_Ticket_Requets', 'Example to collect ticket requests', '".$this->db->escape($descriptionA1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleA3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleA3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'to', 'support@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'isnotanswer', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterA3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'to', 'support@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleA4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleA4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'ticket', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sql[] = $sqlforexampleA1;
$sql[] = $sqlforexampleA2;
$sql[] = $sqlforexampleA3;
$sql[] = $sqlforexampleFilterA1;
$sql[] = $sqlforexampleFilterA2;
$sql[] = $sqlforexampleFilterA3;
$sql[] = $sqlforexampleA4;
}
} else dol_print_error($this->db);
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses' and entity = ".$conf->entity;
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Answers' and entity = ".$conf->entity;
$tmpresql = $this->db->query($tmpsql);
if ($tmpresql) {
if ($this->db->num_rows($tmpresql) == 0) {
$descriptionA1 = 'This collector will scan your mailbox "Sent" directory to find emails that was sent as an answer of a Ticket (Module Ticket must be enabled) directly from your email browser instead of from Dolibarr. If such an email is found, the event of answer is recorded into Dolibarr.';
$sqlforexampleA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleA1 .= " VALUES (".$conf->entity.", 'Collect_Ticket_Answers', 'Example to collect answers to tickets', '".$this->db->escape($descriptionA1)."', 'Sent', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
/*
$sqlforexampleA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleA3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleA3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'to', 'support@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleA4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleA4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'ticket', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
*/
$sql[] = $sqlforexampleA1;
}
}
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".$conf->entity;
$tmpresql = $this->db->query($tmpsql);
if ($tmpresql) {
if ($this->db->num_rows($tmpresql) == 0) {
$descriptionB1 = 'This collector will scan your mailbox to find all emails that are an answer of an email sent from your application. An event with the email response will be recorded at the good place (Module Agenda must be enabled). For example, if your send a commercial proposal, order or invoice by email and your customer answers your email, the system will automatically find the answer and add it into your ERP.';
$sqlforexampleB1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleB1 .= " VALUES (".$conf->entity.", 'Collect_Responses', 'Example to collect any email responses', '".$this->db->escape($descriptionB1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleB1 .= " VALUES (".$conf->entity.", 'Collect_Responses_In', 'Example to collect any input email responses', '".$this->db->escape($descriptionB1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleB2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleB2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses' and entity = ".$conf->entity."), 'withtrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleB2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".$conf->entity."), 'isanswer', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleB3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleB3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses' and entity = ".$conf->entity."), 'recordevent', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleB3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".$conf->entity."), 'recordevent', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sql[] = $sqlforexampleB1;
$sql[] = $sqlforexampleB2;
$sql[] = $sqlforexampleB3;
@ -323,17 +352,52 @@ class modEmailCollector extends DolibarrModules
$descriptionC1 = "This collector will scan your mailbox to find emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated.";
$descriptionC1 .= " If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.<br>";
$descriptionC1 .= "Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can't be found in database (new customer), the lead will be attached to the thirdparty with ID 1.";
$sqlforexampleC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleC1 .= " VALUES (".$conf->entity.", 'Collect_Leads', 'Example to collect leads', '".$this->db->escape($descriptionC1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleC3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'to', 'sales@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'isnotanswer', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterC3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'to', 'sales@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'project', 'tmp_from=EXTRACT:HEADER:^From:(.*);socid=SETIFEMPTY:1;usage_opportunity=SET:1;description=EXTRACT:BODY:(.*);title=SET:Lead or message from __tmp_from__ received by email', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sql[] = $sqlforexampleC1;
$sql[] = $sqlforexampleC2;
$sql[] = $sqlforexampleC3;
$sql[] = $sqlforexampleFilterC1;
$sql[] = $sqlforexampleFilterC2;
$sql[] = $sqlforexampleFilterC3;
$sql[] = $sqlforexampleC4;
}
} else dol_print_error($this->db);
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity;
$tmpresql = $this->db->query($tmpsql);
if ($tmpresql) {
if ($this->db->num_rows($tmpresql) == 0) {
$descriptionC1 = "This collector will scan your mailbox to find emails send for a recruitment (Module Recruitment must be enabled). You can complete this collector if you want to automaticallycreate a candidature for a job request.";
$descriptionC1 .= "Note: With this initial example, the title of the candidature is generated including the email.";
$sqlforexampleC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleC1 .= " VALUES (".$conf->entity.", 'Collect_Candidatures', 'Example to collect email for job candidatures', '".$this->db->escape($descriptionC1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleFilterC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'isnotanswer', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleFilterC3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'to', 'jobs@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sqlforexampleC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".$conf->entity."), 'candidature', 'tmp_from=EXTRACT:HEADER:^From:(.*)<.*>;fk_recruitmentjobposition=EXTRACT:HEADER:^To:[^\n]*\+([^\n]*);description=EXTRACT:BODY:(.*);lastname=SET:__tmp_from__', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
$sql[] = $sqlforexampleC1;
$sql[] = $sqlforexampleFilterC1;
$sql[] = $sqlforexampleFilterC2;
$sql[] = $sqlforexampleFilterC3;
$sql[] = $sqlforexampleC4;
}
} else dol_print_error($this->db);

View File

@ -43,6 +43,7 @@ class modHRM extends DolibarrModules
$this->rights_class = 'hrm';
$this->family = "hr";
$this->module_position = '50';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Management of employees carrier and feelings (department, employment contract)";

View File

@ -194,7 +194,7 @@ class modProduct extends DolibarrModules
);
if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly'] = 'NPR';
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
if (!empty($conf->stock->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
if (!empty($conf->stock->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('e.ref'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', 'p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
if (!empty($conf->barcode->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode'));
$keyforselect = 'product'; $keyforelement = 'product'; $keyforaliasextra = 'extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
@ -216,7 +216,7 @@ class modProduct extends DolibarrModules
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric',
'p.datec'=>'Date', 'p.tms'=>'Date'
);
if (!empty($conf->stock->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
if (!empty($conf->stock->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('e.ref'=>'Text', 'p.tobatch'=>'Numeric', 'p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
if (!empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
if (!empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text'));
@ -239,6 +239,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
if (!empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
if (!empty($conf->stock->enabled)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON e.rowid = p.fk_default_warehouse';
$this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')';
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_sql_order[$r] = ' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields"
@ -417,13 +418,6 @@ class modProduct extends DolibarrModules
'p.datec' => 'DateCreation',
'p.cost_price' => "CostPrice",
);
if (!empty($conf->stock->enabled)) {//if Stock module enabled
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.seuil_stock_alerte' => 'StockLimit', //lower limit for warning
'p.pmp' => 'PMPValue', //weighted average price
'p.desiredstock' => 'DesiredStock'//desired stock for replenishment feature
));
}
$this->import_convertvalue_array[$r] = array(
'p.weight_units' => array(
@ -483,12 +477,48 @@ class modProduct extends DolibarrModules
)
);
$this->import_regex_array[$r] = array(
'p.ref' => '[^ ]',
'p.price_base_type' => '\AHT\z|\ATTC\z',
'p.tosell' => '^[0|1]$',
'p.tobuy' => '^[0|1]$',
'p.fk_product_type' => '^[0|1]$',
'p.datec' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
'p.recuperableonly' => '^[0|1]$',
'p.finished' => '^[0|1]$'
);
if (!empty($conf->stock->enabled)) {//if Stock module enabled
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.fk_default_warehouse'=>'DefaultWarehouse',
'p.tobatch'=>'ManageLotSerial',
'p.seuil_stock_alerte' => 'StockLimit', //lower limit for warning
'p.pmp' => 'PMPValue', //weighted average price
'p.desiredstock' => 'DesiredStock'//desired stock for replenishment feature
));
$this->import_regex_array[$r] = array_merge($this->import_regex_array[$r], array(
'p.tobatch' => '^[0|1]$'
));
$this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array(
'p.fk_default_warehouse' => array(
'rule' => 'fetchidfromref',
'classfile' => '/product/stock/class/entrepot.class.php',
'class' => 'Entrepot',
'method' => 'fetch',
'element'=> 'Warehouse'
)
));
}
if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.cost_price'=>'CostPrice'));
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.recuperableonly'=>'NPR'));
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.localtax1_tx'=>'LT1', 'p.localtax1_type'=>'LT1Type'));
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.localtax2_tx'=>'LT2', 'p.localtax2_type'=>'LT2Type'));
if (!empty($conf->barcode->enabled)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('p.barcode'=>'BarCode'));
if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit';
// Add extra fields
$import_extrafield_sample = array();
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
@ -505,16 +535,6 @@ class modProduct extends DolibarrModules
}
// End add extra fields
$this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r] = array(
'p.ref' => '[^ ]',
'p.price_base_type' => '\AHT\z|\ATTC\z',
'p.tosell' => '^[0|1]$',
'p.tobuy' => '^[0|1]$',
'p.fk_product_type' => '^[0|1]$',
'p.datec' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
'p.recuperableonly' => '^[0|1]$',
'p.finished' => '^[0|1]$'
);
// field order as per structure of table llx_product
$import_sample = array(
@ -559,6 +579,7 @@ class modProduct extends DolibarrModules
);
//clauses copied from import_fields_array
if (!empty($conf->stock->enabled)) $import_sample = array_merge($import_sample, array(
'p.tobatch'=>"0 (don't use) / 1 (use batch/serial number)",
'p.seuil_stock_alerte' => '',
'p.pmp' => '0',
'p.desiredstock' => ''
@ -576,7 +597,6 @@ class modProduct extends DolibarrModules
)
);
if (!is_array($this->import_convertvalue_array[$r])) $this->import_convertvalue_array[$r] = array();
$this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array(
'p.fk_unit' => array(
'rule' => 'fetchidfromcodeorlabel',

View File

@ -2,7 +2,6 @@
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,6 +27,7 @@
*/
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
/**
* Description and activation class for module Recruitment
*/
@ -45,14 +45,14 @@ class modRecruitment extends DolibarrModules
// Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
$this->numero = 750; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module
$this->numero = 750;
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'recruitment';
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
// It is used to group modules by family in module setup page
$this->family = "hr";
// Module position in the family on 2 digits ('01', '10', '20', ...)
$this->module_position = '90';
$this->module_position = '51';
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
// Module label (no space allowed), used if translation string 'ModuleRecruitmentName' not found (Recruitment is name of module).
@ -243,17 +243,17 @@ class modRecruitment extends DolibarrModules
// Add here entries to declare new permissions
/* BEGIN MODULEBUILDER PERMISSIONS */
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Read job positions to fill'; // Permission label
$this->rights[$r][1] = 'Read job positions to fill and candidatures'; // Permission label
$this->rights[$r][4] = 'recruitmentjobposition'; // In php code, permission will be checked by test if ($user->rights->recruitment->level1->level2)
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->recruitment->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/Update job positions to fill'; // Permission label
$this->rights[$r][1] = 'Create/Update job positions to fill and candidatures'; // Permission label
$this->rights[$r][4] = 'recruitmentjobposition'; // In php code, permission will be checked by test if ($user->rights->recruitment->level1->level2)
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->recruitment->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Delete Job positions to fill'; // Permission label
$this->rights[$r][1] = 'Delete Job positions to fill and candidatures'; // Permission label
$this->rights[$r][4] = 'recruitmentjobposition'; // In php code, permission will be checked by test if ($user->rights->recruitment->level1->level2)
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->recruitment->level1->level2)
$r++;
@ -283,19 +283,19 @@ class modRecruitment extends DolibarrModules
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'PositionsToBeFilled',
'titre'=>'NewPositionToBeFilled',
'mainmenu'=>'hrm',
'leftmenu'=>'recruitment_recruitmentjobposition',
'url'=>'/recruitment/recruitmentjobposition_list.php',
'leftmenu'=>'recruitment_recruitmentjobposition_new',
'url'=>'/recruitment/recruitmentjobposition_card.php?action=create',
'langs'=>'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->recruitment->recruitmentjobposition->read', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
'perms'=>'$user->rights->recruitment->recruitmentjobposition->write', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=recruitment_recruitmentjobposition', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'ListOfPositionsToBeFilled',
'mainmenu'=>'hrm',
@ -309,12 +309,12 @@ class modRecruitment extends DolibarrModules
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=recruitment_recruitmentjobposition', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'NewPositionToBeFilled',
'titre'=>'NewCandidature',
'mainmenu'=>'hrm',
'leftmenu'=>'recruitment_recruitmentjobposition_new',
'url'=>'/recruitment/recruitmentjobposition_card.php?action=create',
'leftmenu'=>'recruitment_recruitmentcandidature_new',
'url'=>'/recruitment/recruitmentcandidature_card.php?action=create',
'langs'=>'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
@ -322,7 +322,20 @@ class modRecruitment extends DolibarrModules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
$this->menu[$r++]=array(
'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=recruitmentjobposition', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'ListOfCandidatures',
'mainmenu'=>'hrm',
'leftmenu'=>'recruitment_recruitmentcandidature_list',
'url'=>'/recruitment/recruitmentcandidature_list.php',
'langs'=>'recruitment', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->recruitment->enabled', // Define condition to show or hide menu entry. Use '$conf->recruitment->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->recruitment->recruitmentjobposition->read', // Use 'perms'=>'$user->rights->recruitment->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
/* END MODULEBUILDER LEFTMENU RECRUITMENTJOBPOSITION */
// Exports profiles provided by this module

View File

@ -56,7 +56,7 @@ class modSocialNetworks extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
$this->picto = 'email';
$this->picto = 'share-alt';
// Data directories to create when module is enabled
$this->dirs = array();

View File

@ -261,13 +261,15 @@ class modSociete extends DolibarrModules
$this->export_icon[$r] = 'company';
$this->export_permission[$r] = array(array("societe", "export"));
$this->export_fields_array[$r] = array(
's.rowid'=>"Id", 's.nom'=>"Name", 's.name_alias'=>"AliasNameShort", 's.status'=>"Status", 's.client'=>"Customer", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification",
's.rowid'=>"Id", 's.nom'=>"Name", 's.name_alias'=>"AliasNameShort", 'ps.nom'=>"ParentCompany",
's.status'=>"Status", 's.client'=>"Customer", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification",
's.code_client'=>"CustomerCode", 's.code_fournisseur'=>"SupplierCode", 's.code_compta'=>"AccountancyCode", 's.code_compta_fournisseur'=>"SupplierAccountancyCode",
's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'd.nom'=>'State', 'r.nom' => 'Region', 'c.label'=>"Country", 'c.code'=>"CountryCode", 's.phone'=>"Phone", 's.fax'=>"Fax",
's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'd.nom'=>'State', 'r.nom'=>'Region', 'c.label'=>"Country", 'c.code'=>"CountryCode", 's.phone'=>"Phone", 's.fax'=>"Fax",
's.url'=>"Url", 's.email'=>"Email", 's.default_lang'=>"DefaultLang", 's.siren'=>"ProfId1", 's.siret'=>"ProfId2", 's.ape'=>"ProfId3", 's.idprof4'=>"ProfId4",
's.idprof5'=>"ProfId5", 's.idprof6'=>"ProfId6", 's.tva_intra'=>"VATIntraShort", 's.capital'=>"Capital", 's.note_private'=>"NotePrivate", 's.note_public'=>"NotePublic",
't.libelle'=>"ThirdPartyType", 'ce.code'=>"Staff", "cfj.libelle"=>"JuridicalStatus", 's.fk_prospectlevel'=>'ProspectLevel',
'st.code'=>'ProspectStatus', 'payterm.libelle'=>'PaymentConditions', 'paymode.libelle'=>'PaymentMode'
'st.code'=>'ProspectStatus', 'payterm.libelle'=>'PaymentConditions', 'paymode.libelle'=>'PaymentMode',
's.outstanding_limit'=>'OutstandingBill', 'pbacc.ref'=>'PaymentBankAccount', 'incoterm.code'=>'IncotermLabel'
);
if (!empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix'] = 'Prefix';
if (!empty($conf->global->PRODUIT_MULTIPRICES)) $this->export_fields_array[$r]['s.price_level'] = 'PriceLevel';
@ -280,6 +282,7 @@ class modSociete extends DolibarrModules
$keyforselect = 'societe'; $keyforelement = 'company'; $keyforaliasextra = 'extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
$this->export_fields_array[$r] += array('u.login'=>'SaleRepresentativeLogin', 'u.firstname'=>'SaleRepresentativeFirstname', 'u.lastname'=>'SaleRepresentativeLastname');
//$this->export_TypeFields_array[$r]=array(
// 's.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",
// 's.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",
@ -289,15 +292,17 @@ class modSociete extends DolibarrModules
// 's.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'
//);
$this->export_TypeFields_array[$r] = array(
's.rowid'=>"Numeric", 's.nom'=>"Text", 's.name_alias'=>"Text", 's.status'=>"Numeric", 's.client'=>"Numeric", 's.fournisseur'=>"Boolean", 's.datec'=>"Date", 's.tms'=>"Date",
's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text", 's.address'=>"Text", 's.zip'=>"Text",
's.town'=>"Text", 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text",
's.default_lang'=>"Text", 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.idprof5'=>"Text", 's.idprof6'=>"Text",
's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_private'=>"Text", 's.note_public'=>"Text", 't.libelle'=>"Text",
'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text", 's.fk_prospectlevel'=>'List:c_prospectlevel:label:code',
'st.code'=>'List:c_stcomm:libelle:code', 'd.nom'=>'Text', 'r.nom' => 'Text', 'u.login'=>'Text', 'u.firstname'=>'Text', 'u.lastname'=>'Text', 'payterm.libelle'=>'Text',
'paymode.libelle'=>'Text', 's.entity'=>'Numeric',
's.price_level'=>'Numeric'
's.rowid'=>"Numeric", 's.nom'=>"Text", 's.name_alias'=>"Text", 'ps.nom'=>"Text",
's.status'=>"Numeric", 's.client'=>"Numeric", 's.fournisseur'=>"Boolean", 's.datec'=>"Date", 's.tms'=>"Date",
's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text",
's.address'=>"Text", 's.zip'=>"Text",'s.town'=>"Text", 'd.nom'=>'Text', 'r.nom'=>'Text', 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", 's.phone'=>"Text", 's.fax'=>"Text",
's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text",
's.idprof5'=>"Text", 's.idprof6'=>"Text", 's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_private'=>"Text", 's.note_public'=>"Text",
't.libelle'=>"Text", 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text", 's.fk_prospectlevel'=>'List:c_prospectlevel:label:code',
'st.code'=>'List:c_stcomm:libelle:code', 'payterm.libelle'=>'Text', 'paymode.libelle'=>'Text',
's.outstanding_limit'=>'Numeric', 'pbacc.ref'=>'Text', 'incoterm.code'=>'Text',
'u.login'=>'Text', 'u.firstname'=>'Text', 'u.lastname'=>'Text',
's.entity'=>'Numeric', 's.price_level'=>'Numeric'
);
$this->export_entities_array[$r] = array('u.login'=>'user', 'u.firstname'=>'user', 'u.lastname'=>'user'); // We define here only fields that use another picto
@ -305,16 +310,19 @@ class modSociete extends DolibarrModules
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra ON s.rowid = extra.fk_object';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as ps ON s.parent = ps.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_regions as r ON r.code_region = d.fk_region AND r.fk_pays = s.fk_pays';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_regions as r ON r.code_region = d.fk_region AND r.fk_pays = s.fk_pays';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sc.fk_user = u.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as pbacc ON s.fk_account = pbacc.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as incoterm ON s.fk_incoterms = incoterm.rowid';
$this->export_sql_end[$r] .= ' WHERE s.entity IN ('.getEntity('societe').')';
if (is_object($user) && empty($user->rights->societe->client->voir)) {
$this->export_sql_end[$r] .= ' AND (sc.fk_user = '.$user->id.' ';
@ -334,7 +342,7 @@ class modSociete extends DolibarrModules
$this->export_fields_array[$r] = array(
'c.rowid'=>"IdContact", 'c.civility'=>"CivilityCode", 'c.lastname'=>'Lastname', 'c.firstname'=>'Firstname', 'c.poste'=>'PostOrFunction',
'c.datec'=>"DateCreation", 'c.tms'=>"DateLastModification", 'c.priv'=>"ContactPrivate", 'c.address'=>"Address", 'c.zip'=>"Zip", 'c.town'=>"Town",
'd.nom'=>'State', 'r.nom' => 'Region', 'co.label'=>"Country", 'co.code'=>"CountryCode", 'c.phone'=>"Phone", 'c.fax'=>"Fax", 'c.phone_mobile'=>"Mobile", 'c.email'=>"EMail",
'd.nom'=>'State', 'r.nom'=>'Region', 'co.label'=>"Country", 'co.code'=>"CountryCode", 'c.phone'=>"Phone", 'c.fax'=>"Fax", 'c.phone_mobile'=>"Mobile", 'c.email'=>"EMail",
'c.statut'=>"Status",
's.rowid'=>"IdCompany", 's.nom'=>"CompanyName", 's.status'=>"Status", 's.code_client'=>"CustomerCode", 's.code_fournisseur'=>"SupplierCode",
's.code_compta'=>"AccountancyCode", 's.code_compta_fournisseur'=>"SupplierAccountancyCode",
@ -345,7 +353,7 @@ class modSociete extends DolibarrModules
$this->export_examplevalues_array[$r] = array('s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)', 's.fournisseur'=>'0 (not a supplier) or 1 (supplier)');
$this->export_TypeFields_array[$r] = array(
'c.civility'=>"List:c_civility:label:code", 'c.lastname'=>'Text', 'c.firstname'=>'Text', 'c.poste'=>'Text', 'c.datec'=>"Date", 'c.priv'=>"Boolean",
'c.address'=>"Text", 'c.zip'=>"Text", 'c.town'=>"Text", 'd.nom'=>'Text', 'r.nom' => 'Text', 'co.label'=>"List:c_country:label:rowid", 'co.code'=>"Text", 'c.phone'=>"Text",
'c.address'=>"Text", 'c.zip'=>"Text", 'c.town'=>"Text", 'd.nom'=>'Text', 'r.nom'=>'Text', 'co.label'=>"List:c_country:label:rowid", 'co.code'=>"Text", 'c.phone'=>"Text",
'c.fax'=>"Text", 'c.email'=>"Text",
'c.statut'=>"Status",
's.rowid'=>"List:societe:nom::thirdparty", 's.nom'=>"Text", 's.status'=>"Status", 's.code_client'=>"Text", 's.code_fournisseur'=>"Text",
@ -376,7 +384,7 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object';
if (is_object($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_regions as r ON r.code_region = d.fk_region AND r.fk_pays = c.fk_pays';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_regions as r ON r.code_region = d.fk_region AND r.fk_pays = c.fk_pays';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id';
@ -409,6 +417,7 @@ class modSociete extends DolibarrModules
$this->import_fields_array[$r] = array(//field order as per structure of table llx_societe
's.nom' => "Name*",
's.name_alias' => "AliasNameShort",
's.parent' => "ParentCompany",
's.status' => "Status",
's.code_client' => "CustomerCode",
's.code_fournisseur' => "SupplierCode",
@ -445,6 +454,9 @@ class modSociete extends DolibarrModules
's.cond_reglement' => "PaymentTermsCustomer",
's.mode_reglement_supplier' => 'PaymentTypeSupplier',
's.cond_reglement_supplier' => "PaymentTermsSupplier",
's.outstanding_limit'=>'OutstandingBill',
's.fk_account'=>'PaymentBankAccount',
's.fk_incoterms'=>'IncotermLabel',
's.tva_assuj' => 'VATIsUsed',
's.barcode' => 'BarCode',
's.default_lang' => 'DefaultLanguage',
@ -498,6 +510,29 @@ class modSociete extends DolibarrModules
),
's.capital' => array('rule' => 'numeric'),
's.fk_stcomm' => array('rule' => 'zeroifnull'),
's.parent' => array(
'rule' => 'fetchidfromref',
'file' => '/societe/class/societe.class.php',
'class' => 'Societe',
'method' => 'fetch',
'element' => 'ThirdParty'
),
's.outstanding_limit' => array('rule' => 'numeric'),
's.fk_account' => array(
'rule' => 'fetchidfromcodeid',
'classfile' => '/compta/bank/class/account.class.php',
'class' => 'Account',
'method' => 'fetch',
'element' => 'BankAccount'
// ),
// TODO
// 's.fk_incoterms' => array(
// 'rule' => 'fetchidfromcodeid',
// 'classfile' => '/core/class/cincoterm.class.php',
// 'class' => 'Cincoterm',
// 'method' => 'fetch',
// 'dict' => 'IncotermLabel'
)
);
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r] = array(//field order as per structure of table llx_societe
@ -509,6 +544,7 @@ class modSociete extends DolibarrModules
's.cond_reglement' => 'rowid@'.MAIN_DB_PREFIX.'c_payment_term',
's.mode_reglement_supplier' => 'id@'.MAIN_DB_PREFIX.'c_paiement',
's.cond_reglement_supplier' => 'rowid@'.MAIN_DB_PREFIX.'c_payment_term',
's.fk_incoterms' => 'rowid@'.MAIN_DB_PREFIX.'c_incoterms',
's.tva_assuj' => '^[0|1]',
's.fk_multicurrency' => '^[0|1]',
's.datec' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$',
@ -518,6 +554,7 @@ class modSociete extends DolibarrModules
$this->import_examplevalues_array[$r] = array(//field order as per structure of table llx_societe
's.nom' => "TPBigCompany",
's.name_alias' => "Alias for TPBigCompany",
's.parent' => "TPMotherCompany",
's.status' => "0 (closed) / 1 (active)",
's.code_client' => 'eg. CU01-0001 / empty / "auto"',
's.code_fournisseur' => 'eg. SU01-0001 / empty / "auto"',
@ -554,6 +591,9 @@ class modSociete extends DolibarrModules
's.cond_reglement' => '1/2/3...matches field "rowid" in table "'.MAIN_DB_PREFIX.'c_payment_term"',
's.mode_reglement_supplier' => '1/2/3...matches field "id" in table "'.MAIN_DB_PREFIX.'c_paiement"',
's.cond_reglement_supplier' => '1/2/3...matches field "rowid" in table "'.MAIN_DB_PREFIX.'c_payment_term"',
's.outstanding_limit' => "5000",
's.fk_account' => "rowid or ref",
's.fk_incoterms' => '1/2/3...matches field "rowid" in table "'.MAIN_DB_PREFIX.'c_incoterms"',
's.tva_assuj' => '0 (VAT not used) / 1 (VAT used)',
's.barcode' => '123456789',
's.default_lang' => 'en_US / es_ES etc...matches a language directory in htdocs/langs/',

View File

@ -163,7 +163,7 @@ class doc_generic_stock_odt extends ModelePDFStock
//$texte.=$nbofiles?'</a>':'';
$texte .= '</b>';
}
if ($nbofiles)
{
$texte .= '<div id="div_'.get_class($this).'" class="hidden">';

View File

@ -154,21 +154,17 @@ if ($action == 'presend')
// Fill list of recipient with email inside <>.
$liste = array();
if ($object->element == 'expensereport')
{
if ($object->element == 'expensereport') {
$fuser = new User($db);
$fuser->fetch($object->fk_user_author);
$liste['thirdparty'] = $fuser->getFullName($outputlangs)." <".$fuser->email.">";
} elseif ($object->element == 'societe')
{
} elseif ($object->element == 'societe') {
foreach ($object->thirdparty_and_contact_email_array(1) as $key => $value) {
$liste[$key] = $value;
}
} elseif ($object->element == 'contact')
{
} elseif ($object->element == 'contact') {
$liste['contact'] = $object->getFullName($outputlangs)." <".$object->email.">";
} elseif ($object->element == 'user' || $object->element == 'member')
{
} elseif ($object->element == 'user' || $object->element == 'member') {
$liste['thirdparty'] = $object->getFullName($outputlangs)." <".$object->email.">";
} else {
if (is_object($object->thirdparty))
@ -279,10 +275,10 @@ if ($action == 'presend')
}
}
// Tableau des substitutions
// Array of substitutions
$formmail->substit = $substitutionarray;
// Tableau des parametres complementaires
// Array of other parameters
$formmail->param['action'] = 'send';
$formmail->param['models'] = $modelmail;
$formmail->param['models_id'] = GETPOST('modelmailselected', 'int');

View File

@ -91,7 +91,7 @@ print '<div class="tagtr table-border-row">'."\n";
print '<div class="tagtd tagtdnote tdtop sensiblehtmlcontent table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd table-val-border-col sensiblehtmlcontent">'."\n";
print '<div class="tagtd wordbreak table-val-border-col sensiblehtmlcontent">'."\n";
print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n";
print '</div>'."\n";
print '</div>'."\n";
@ -101,7 +101,7 @@ if (empty($user->socid)) {
print '<div class="tagtd tagtdnote tdtop sensiblehtmlcontent table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd table-val-border-col sensiblehtmlcontent">'."\n";
print '<div class="tagtd wordbreak table-val-border-col sensiblehtmlcontent">'."\n";
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
print '</div>'."\n";
print '</div>'."\n";

View File

@ -56,13 +56,14 @@ class InterfaceActionsAuto extends DolibarrTriggers
* $object->actiontypecode (translation action code: AC_OTH, ...)
* $object->actionmsg (note, long text)
* $object->actionmsg2 (label, short text)
* $object->sendtoid (id of contact or array of ids)
* $object->sendtoid (id of contact or array of ids of contacts)
* $object->socid (id of thirdparty)
* $object->fk_project
* $object->fk_element
* $object->elementtype
* $object->fk_element (ID of object to link action event to)
* $object->elementtype (->element of object to link action to)
* $object->module (if defined, elementtype in llx_actioncomm will be elementtype@module)
*
* @param string $action Event action code
* @param string $action Event action code ('CONTRACT_MODIFY', 'RECRUITMENTCANDIDATURE_MODIFIY', ...)
* @param Object $object Object
* @param User $user Object user
* @param Translate $langs Object langs
@ -71,9 +72,10 @@ class InterfaceActionsAuto extends DolibarrTriggers
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing
if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing
$key = 'MAIN_AGENDA_ACTIONAUTO_'.$action;
//var_dump($action.' - '.$conf->global->$key);exit;
// Do not log events not enabled for this action
if (empty($conf->global->$key)) {
@ -92,7 +94,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities("NewCompanyToDolibarr", $object->name);
$object->actionmsg = $langs->transnoentities("NewCompanyToDolibarr", $object->name);
if (!empty($object->prefix)) $object->actionmsg .= " (".$object->prefix.")";
$object->sendtoid = 0;
$object->socid = $object->id;
@ -105,7 +106,17 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid=0;
} elseif ($action == 'CONTRACT_VALIDATE')
} elseif ($action == 'CONTACT_CREATE')
{
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities("CONTACT_CREATEInDolibarr", $object->getFullName($langs));
$object->actionmsg = $langs->transnoentities("CONTACT_CREATEInDolibarr", $object->getFullName($langs));
$object->sendtoid = array($object->id => $object->id);
$object->socid = $object->socid;
} elseif ($action == 'CONTRACT_VALIDATE')
{
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "contracts"));
@ -769,17 +780,33 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = 0;
}
// TODO Merge all previous cases into this generic one
else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, ...
else // $action = BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, CONTACT_SENTBYMAIL, RECRUITMENTCANDIDATURE_MODIFY, ...
{
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function).
// Note that these key can be set in agenda setup, only if defined into c_action_trigger
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other"));
if (empty($object->actionmsg2)) {
$langs->loadLangs(array("agenda", "other"));
if ($langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref)) != $action."InDolibarr") { // specific translation key
$object->actionmsg2 = $langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref));
} else { // generic translation key
$tmp = explode('_', $action);
$object->actionmsg2 = $langs->transnoentities($tmp[count($tmp)-1]."InDolibarr", ($object->newref ? $object->newref : $object->ref));
}
}
if (empty($object->actionmsg)) {
$langs->loadLangs(array("agenda", "other"));
if ($langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref)) != $action."InDolibarr") { // specific translation key
$object->actionmsg = $langs->transnoentities($action."InDolibarr", ($object->newref ? $object->newref : $object->ref));
} else { // generic translation key
$tmp = explode('_', $action);
$object->actionmsg = $langs->transnoentities($tmp[count($tmp)-1]."InDolibarr", ($object->newref ? $object->newref : $object->ref));
}
}
if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities($action."InDolibarr", $object->ref);
if (empty($object->actionmsg)) $object->actionmsg = $langs->transnoentities($action."InDolibarr", $object->ref);
$object->sendtoid = 0;
if (! isset($object->sendtoid) || ! is_array($object->sendtoid)) {
$object->sendtoid = 0;
}
}
$object->actionmsg = $langs->transnoentities("Author").': '.$user->login."\n".$object->actionmsg;
@ -797,12 +824,12 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg = dol_concatdesc($object->actionmsg, "\n".$langs->transnoentities("AttachedFiles").': '.$attachs);
}
}
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$contactforaction = new Contact($this->db);
$societeforaction = new Societe($this->db);
// Set contactforaction if there is only 1 contact.
if (is_array($object->sendtoid))
{
if (count($object->sendtoid) == 1) $contactforaction->fetch(reset($object->sendtoid));
@ -816,14 +843,15 @@ class InterfaceActionsAuto extends DolibarrTriggers
$projectid = isset($object->fk_project) ? $object->fk_project : 0;
if ($object->element == 'project') $projectid = $object->id;
$elementid = $object->id;
$elementid = $object->id; // id of object
$elementtype = $object->element;
$elementmodule = $object->module;
if ($object->element == 'subscription')
{
$elementid = $object->fk_adherent;
$elementtype = 'member';
}
//var_dump($societeforaction);var_dump($contactforaction);exit;
//var_dump($societeforaction);var_dump($contactforaction);var_dump($elementid);var_dump($elementtype);exit;
// Insertion action
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
@ -838,7 +866,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->durationp = 0;
$actioncomm->percentage = -1; // Not applicable
$actioncomm->socid = $societeforaction->id;
$actioncomm->contact_id = $contactforaction->id;
$actioncomm->contact_id = $contactforaction->id; // deprecated, use ->socpeopleassigned instead
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
// Fields defined when action is an email (content should be into object->actionmsg to be added into note, subject into object->actionms2 to be added into label)
@ -852,11 +880,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->errors_to = $object->errors_to;
// Object linked (if link is for thirdparty, contact, project it is a recording error. We should not have links in link table
// for such objects because there is already a dedicated field into table llx_actioncomm.
// for such objects because there is already a dedicated field into table llx_actioncomm or llx_actioncomm_resources.
if (!in_array($elementtype, array('societe', 'contact', 'project')))
{
$actioncomm->fk_element = $elementid;
$actioncomm->elementtype = $elementtype;
$actioncomm->elementtype = $elementtype.($elementmodule ? '@'.$elementmodule : '');
}
if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
@ -865,6 +893,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
if (property_exists($object, 'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
$actioncomm->userassigned = $object->sendtouserid;
}
if (property_exists($object, 'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
foreach ($object->sendtoid as $val) {
$actioncomm->socpeopleassigned[$val] = $val;
}
}
$ret = $actioncomm->create($user); // User creating action

View File

@ -347,7 +347,7 @@ if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text .= $langs->trans("War
print info_admin($text);
print '<br>';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
//$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = '';
//$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
@ -358,7 +358,7 @@ print '<table class="noborder">';
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_label" value="'.$search_label.'" size="10">';
print '<input type="text" class="flat" name="search_label" value="'.$search_label.'">';
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
@ -371,7 +371,6 @@ print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="center">';
print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled")), $search_status, 1);
print '</td><td class="liste_titre right">';
@ -388,7 +387,6 @@ print_liste_field_titre("CronTask", '', '', "", $param, '', $sortfield, $sortord
print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("CronMaxRun", $_SERVER["PHP_SELF"], "t.maxrun", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
@ -432,11 +430,11 @@ if ($num > 0)
print '</td>';
// Label
print '<td>';
print '<td class="tdoverflowmax300">';
if (!empty($obj->label))
{
$object->ref = $langs->trans($obj->label);
print $object->getNomUrl(0, '', 1);
print '<span title="'.dol_escape_htmltag($langs->trans($obj->label)).'">'.$object->getNomUrl(0, '', 1).'</span>';
$object->ref = $obj->rowid;
} else {
//print $langs->trans('CronNone');
@ -476,24 +474,21 @@ if ($num > 0)
print '</td>';
print '<td class="center">';
if (!empty($obj->datestart)) {print dol_print_date($db->jdate($obj->datestart), 'dayhour'); }
if (!empty($obj->datestart)) { print dol_print_date($db->jdate($obj->datestart), 'dayhour'); }
print '</td>';
print '<td class="center">';
if (!empty($obj->dateend)) {print dol_print_date($db->jdate($obj->dateend), 'dayhour'); }
if (!empty($obj->dateend)) { print dol_print_date($db->jdate($obj->dateend), 'dayhour'); }
print '</td>';
print '<td class="right">';
if (!empty($obj->maxrun)) {print $obj->maxrun; }
print '</td>';
print '<td class="right">';
if (!empty($obj->nbrun)) {print $obj->nbrun; } else {print '0'; }
if (!empty($obj->nbrun)) { print $obj->nbrun; } else {print '0'; }
if (!empty($obj->maxrun)) { print ' <span class="'.$langs->trans("Max").'">/ '.$obj->maxrun.'</span>'; }
print '</td>';
// Date start last run
print '<td class="center">';
if (!empty($datelastrun)) {print dol_print_date($datelastrun, 'dayhoursec'); }
if (!empty($datelastrun)) { print dol_print_date($datelastrun, 'dayhoursec'); }
print '</td>';
// Duration

View File

@ -173,6 +173,7 @@ $check_access = dol_check_secure_access_document($modulepart, $original_file, $e
$accessallowed = $check_access['accessallowed'];
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name
//var_dump($fullpath_original_file);exit;
if (!empty($hashp))
{

View File

@ -321,7 +321,7 @@ class EcmDirectory // extends CommonObject
$sql .= " t.fk_user_c,";
$sql .= " t.fk_user_m,";
$sql .= " t.date_c as date_c,";
$sql .= " t.date_m as date_m";
$sql .= " t.tms as date_m";
$sql .= " FROM ".MAIN_DB_PREFIX."ecm_directories as t";
$sql .= " WHERE t.rowid = ".$id;

View File

@ -235,7 +235,7 @@ class EcmFiles extends CommonObject
$sql .= 'gen_or_uploaded,';
$sql .= 'extraparams,';
$sql .= 'date_c,';
$sql .= 'date_m,';
$sql .= 'tms,';
$sql .= 'fk_user_c,';
$sql .= 'fk_user_m,';
$sql .= 'acl,';
@ -333,7 +333,7 @@ class EcmFiles extends CommonObject
$sql .= " t.gen_or_uploaded,";
$sql .= " t.extraparams,";
$sql .= " t.date_c,";
$sql .= " t.date_m,";
$sql .= " t.tms as date_m,";
$sql .= " t.fk_user_c,";
$sql .= " t.fk_user_m,";
$sql .= " t.acl,";
@ -455,7 +455,7 @@ class EcmFiles extends CommonObject
$sql .= " t.gen_or_uploaded,";
$sql .= " t.extraparams,";
$sql .= " t.date_c,";
$sql .= " t.date_m,";
$sql .= " t.tms as date_m,";
$sql .= " t.fk_user_c,";
$sql .= " t.fk_user_m,";
$sql .= " t.acl,";
@ -612,7 +612,7 @@ class EcmFiles extends CommonObject
$sql .= ' gen_or_uploaded = '.(isset($this->gen_or_uploaded) ? "'".$this->db->escape($this->gen_or_uploaded)."'" : "null").',';
$sql .= ' extraparams = '.(isset($this->extraparams) ? "'".$this->db->escape($this->extraparams)."'" : "null").',';
$sql .= ' date_c = '.(!isset($this->date_c) || dol_strlen($this->date_c) != 0 ? "'".$this->db->idate($this->date_c)."'" : 'null').',';
//$sql .= ' date_m = '.(! isset($this->date_m) || dol_strlen($this->date_m) != 0 ? "'".$this->db->idate($this->date_m)."'" : 'null').','; // Field automatically updated
//$sql .= ' tms = '.(! isset($this->date_m) || dol_strlen($this->date_m) != 0 ? "'".$this->db->idate($this->date_m)."'" : 'null').','; // Field automatically updated
$sql .= ' fk_user_m = '.($this->fk_user_m > 0 ? $this->fk_user_m : $user->id).',';
$sql .= ' acl = '.(isset($this->acl) ? "'".$this->db->escape($this->acl)."'" : "null").',';
$sql .= ' src_object_id = '.($this->src_object_id > 0 ? $this->src_object_id : "null").',';

View File

@ -284,7 +284,7 @@ dol_banner_tab($object, '', $linkback, 0, '', '', $s);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefield">'.$langs->trans("ECMCreationDate").'</td><td>';
print dol_print_date(dol_filemtime($fullpath), 'dayhour');
print '</td></tr>';

View File

@ -315,7 +315,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED))
if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
if (!empty($conf->commande->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
if (!empty($conf->facture->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
if (!empty($conf->supplier_proposal->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBySupplierProposals")); }
if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBySupplierProposals")); }
if (!empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
if (!empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
@ -324,6 +324,8 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED))
if (!empty($conf->expensereport->enabled)) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsByExpenseReports")); }
if (!empty($conf->holiday->enabled)) { $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsByHolidays")); }
if (!empty($conf->banque->enabled)) { $langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsByBankAccount")); }
if (!empty($conf->mrp->enabled)) { $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsByMO")); }
if (!empty($conf->recruitment->enabled)) { $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsByCandidature")); }
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers"));
}

File diff suppressed because it is too large Load Diff

View File

@ -165,11 +165,11 @@ class EmailCollectorFilter extends CommonObject
$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
return -1;
}
if (!in_array($this->type, array('seen', 'unseen', 'unanswered', 'answered', 'withtrackingid', 'withouttrackingid')) && empty($this->rulevalue))
if (!in_array($this->type, array('seen', 'unseen', 'unanswered', 'answered', 'withtrackingid', 'withouttrackingid', 'isanswer', 'isnotanswer')) && empty($this->rulevalue))
{
$langs->load("errors");
$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("SearchString"));
return -1;
return -2;
}
return $this->createCommon($user, $notrigger);

View File

@ -1042,6 +1042,7 @@ if ($action == 'create')
while ($i < $numAsked)
{
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
if (!empty($conf->productbatch->enabled)) print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
$i++;
}
print '});
@ -1050,6 +1051,7 @@ if ($action == 'create')
while ($i < $numAsked)
{
print 'jQuery("#qtyl'.$i.'").val(0);'."\n";
if (!empty($conf->productbatch->enabled)) print 'jQuery("#qtyl'.$i.'_'.$i.'").val(0);'."\n";
$i++;
}
print '});
@ -1072,9 +1074,12 @@ if ($action == 'create')
print '<td class="center">'.$langs->trans("QtyToShip");
if (empty($conf->productbatch->enabled))
{
print ' <br>(<a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
print ' / <a href="#" id="autoreset">'.$langs->trans("Reset").'</a>)';
print '<br><a href="#" id="autofill">'.$langs->trans("Fill").'</a>';
print ' / ';
} else {
print '<br>';
}
print '<a href="#" id="autoreset">'.$langs->trans("Reset").'</a>';
print '</td>';
if (!empty($conf->stock->enabled))
{

View File

@ -573,7 +573,7 @@ if (empty($reshook))
}
$object->fetch_thirdparty();
$desc = GETPOST('np_desc','alpha');
$desc = GETPOST('np_desc', 'alpha');
$date_inter = dol_mktime(GETPOST('dihour', 'int'), GETPOST('dimin', 'int'), 0, GETPOST('dimonth', 'int'), GETPOST('diday', 'int'), GETPOST('diyear', 'int'));
$duration = convertTime2Seconds(GETPOST('durationhour', 'int'), GETPOST('durationmin', 'int'));
@ -906,7 +906,7 @@ if ($action == 'create')
{
$langs->load("contracts");
print '<tr><td>'.$langs->trans("Contract").'</td><td>';
$numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1);
$numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1, 1);
if ($numcontrat == 0)
{
print ' &nbsp; <a href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$soc->id.'&action=create"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddContract").'"></span></a>';
@ -1238,7 +1238,7 @@ if ($action == 'create')
if ($action == 'contrat')
{
$formcontract = new Formcontract($db);
$formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1);
$formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1, 1);
} else {
if ($object->fk_contrat)
{

View File

@ -768,7 +768,7 @@ class CommandeFournisseur extends CommonOrder
global $langs, $conf, $user;
$result = '';
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
$label = '<u>'.$langs->trans("PurchaseOrder").'</u>';
if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_supplier))

View File

@ -652,7 +652,9 @@ if (empty($reshook))
*/
if ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha'))
{
$vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0);
$db->begin();
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
if ($lineid)
{
@ -780,7 +782,11 @@ if (empty($reshook))
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db, $result);
}
$db->commit();
} else {
$db->rollback();
dol_print_error($db, $object->error);
exit;
}
@ -789,6 +795,8 @@ if (empty($reshook))
// Remove a product line
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate)
{
$db->begin();
$result = $object->deleteline($lineid);
if ($result > 0)
{
@ -807,19 +815,28 @@ if (empty($reshook))
$ret = $object->fetch($object->id); // Reload to get new records
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
// Reset action to avoid asking again confirmation on failure
$action = '';
}
if (!$error) {
$db->commit();
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');
/* Fix bug 1485 : Reset action to avoid asking again confirmation on failure */
$action = '';
$db->rollback();
}
}
// Validate
if ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate)
{
$db->begin();
$object->date_commande = dol_now();
$result = $object->valid($user);
if ($result >= 0)
@ -839,21 +856,33 @@ if (empty($reshook))
$ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db, $result);
if ($result < 0) {
$error++;
dol_print_error($db, $result);
}
}
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $usercanapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
if (!$error && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $usercanapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
{
$action = 'confirm_approve'; // can make standard or first level approval also if permission is set
}
if (! $error) {
$db->commit();
} else {
$db->rollback();
}
}
if (($action == 'confirm_approve' || $action == 'confirm_approve2') && $confirm == 'yes' && $usercanapprove)
{
$db->begin();
$idwarehouse = GETPOST('idwarehouse', 'int');
$qualified_for_stock_change = 0;
@ -891,12 +920,20 @@ if (empty($reshook))
}
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
if (!$error) {
$db->commit();
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
} else {
$db->rollback();
}
}
if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove)
@ -923,6 +960,8 @@ if (empty($reshook))
if ($action == 'confirm_commande' && $confirm == 'yes' && $usercanorder)
{
$db->begin();
$result = $object->commande($user, GETPOST("datecommande"), GETPOST("methode", 'int'), GETPOST('comment', 'alphanohtml'));
if ($result > 0)
{
@ -939,10 +978,18 @@ if (empty($reshook))
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
$action = '';
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
if (!$error) {
$db->commit();
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
}
@ -987,6 +1034,8 @@ if (empty($reshook))
// Set status of reception (complete, partial, ...)
if ($action == 'livraison' && $usercanreceived)
{
$db->begin();
if (GETPOST("type") != '')
{
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
@ -999,13 +1048,22 @@ if (empty($reshook))
$action = '';
} elseif ($result == -3)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors');
}
if (! $error) {
$db->commit();
} else {
$db->rollback();
}
}
if ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanorder)
@ -1907,7 +1965,7 @@ if ($action == 'create')
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {

View File

@ -1771,7 +1771,9 @@ if ($action == 'create')
print '</td></tr>';
// Ref supplier
print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.(isset($_POST['ref_supplier']) ? $_POST['ref_supplier'] : $objectsrc->ref_supplier).'" type="text"></td>';
print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.(isset($_POST['ref_supplier']) ? $_POST['ref_supplier'] : $objectsrc->ref_supplier).'" type="text"';
if ($societe->id > 0) print ' autofocus';
print '></td>';
print '</tr>';
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Type').'</td><td>';

View File

@ -40,6 +40,7 @@ static $tmpstatus2label = array(
$status2label = array('');
foreach ($tmpstatus2label as $key => $val) $status2label[$key] = $langs->trans($val);
/*
* Actions
*/
@ -51,11 +52,14 @@ foreach ($tmpstatus2label as $key => $val) $status2label[$key] = $langs->trans($
* View
*/
$form = new Form($db);
$establishmenttmp = new Establishment($db);
llxHeader('', $langs->trans("Establishments"));
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST("sortorder");
$sortfield = GETPOST("sortfield");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", 'alpha');
if (!$sortorder) $sortorder = "DESC";
if (!$sortfield) $sortfield = "e.rowid";
@ -68,11 +72,6 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$form = new Form($db);
$establishmenttmp = new Establishment($db);
dol_htmloutput_mesg($mesg);
// Subheader
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
@ -81,7 +80,7 @@ print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
$head = hrm_admin_prepare_head();
dol_fiche_head($head, 'establishments', $langs->trans("HRM"), -1, "user");
$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status";
$sql = "SELECT e.rowid, e.label, e.address, e.zip, e.town, e.status";
$sql .= " FROM ".MAIN_DB_PREFIX."establishment as e";
$sql .= " WHERE e.entity IN (".getEntity('establishment').')';
$sql .= $db->order($sortfield, $sortorder);
@ -96,9 +95,10 @@ if ($result)
// Load attribute_label
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "e.name", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "e.label", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Address", $_SERVER["PHP_SELF"], "e.address", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Zipcode", $_SERVER["PHP_SELF"], "e.zip", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Zip", $_SERVER["PHP_SELF"], "e.zip", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "e.town", "", "", "", $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.status", "", "", '', $sortfield, $sortorder, 'right ');
print "</tr>\n";
@ -112,16 +112,17 @@ if ($result)
$obj = $db->fetch_object($result);
$establishmentstatic->id = $obj->rowid;
$establishmentstatic->name = $obj->name;
$establishmentstatic->ref = $obj->ref;
$establishmentstatic->label = $obj->label;
$establishmentstatic->status = $obj->status;
print '<tr class="oddeven">';
print '<td>'.$establishmentstatic->getNomUrl(1).'</td>';
print '<td class="left">'.$obj->address.'</td>';
print '<td>'.$obj->label.'</td>';
print '<td class="left">'.$obj->address.'</td>';
print '<td class="left">'.$obj->zip.'</td>';
print '<td class="left">'.$obj->town.'</td>';
print '<td class="right">';
print $establishmentstatic->getLibStatut(5);
print '</td>';
@ -130,7 +131,7 @@ if ($result)
$i++;
}
} else {
print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print '</table>';
@ -142,7 +143,7 @@ dol_fiche_end();
// Buttons
print '<div class="tabsAction">';
print '<a class="butAction" href="../establishment/card.php?action=create">'.$langs->trans("NewEstablishment").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/hrm/establishment/card.php?action=create">'.$langs->trans("NewEstablishment").'</a>';
print '</div>';
// End of page

View File

@ -34,7 +34,7 @@ $action = GETPOST('action', 'alpha');
// Other parameters HRM_*
$list = array(
'HRM_EMAIL_EXTERNAL_SERVICE' // To prevent your public accountant for example
// 'HRM_EMAIL_EXTERNAL_SERVICE' // To prevent your public accountant for example
);
/*
@ -82,7 +82,7 @@ dol_fiche_head($head, 'parameters', $langs->trans("HRM"), -1, "user");
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans('Journaux').'</td>';
print '<td colspan="3">'.$langs->trans('Parameters').'</td>';
print "</tr>\n";
foreach ($list as $key) {

View File

@ -75,7 +75,7 @@ class Establishment extends CommonObject
*/
public $rowid;
public $name;
public $label;
/**
* @var string Address
@ -97,11 +97,31 @@ class Establishment extends CommonObject
public $country_id;
public $statuts = array();
public $statuts_short = array();
const STATUS_OPEN = 0;
const STATUS_CLOSED = 1;
const STATUS_OPEN = 1;
const STATUS_CLOSED = 0;
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20),
'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>22),
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>35),
'fk_state' =>array('type'=>'integer', 'label'=>'Fkstate', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
'fk_country' =>array('type'=>'integer', 'label'=>'Fkcountry', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'profid1' =>array('type'=>'varchar(20)', 'label'=>'Profid1', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
'profid2' =>array('type'=>'varchar(20)', 'label'=>'Profid2', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'profid3' =>array('type'=>'varchar(20)', 'label'=>'Profid3', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkuserauthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70),
'fk_user_mod' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkusermod', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85),
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
);
/**
@ -112,9 +132,6 @@ class Establishment extends CommonObject
public function __construct($db)
{
$this->db = $db;
$this->statuts_short = array(0 => 'Closed', 1 => 'Open');
$this->statuts = array(0 => 'Closed', 1 => 'Open');
}
/**
@ -128,7 +145,6 @@ class Establishment extends CommonObject
global $conf, $langs;
$error = 0;
$ret = 0;
$now = dol_now();
// Clean parameters
@ -137,11 +153,13 @@ class Establishment extends CommonObject
$this->town = ($this->town > 0 ? $this->town : $this->town);
$this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
if (empty($this->ref)) $this->ref = '(PROV)';
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."establishment (";
$sql .= "ref";
$sql .= ", name";
$sql .= ", label";
$sql .= ", address";
$sql .= ", zip";
$sql .= ", town";
@ -152,7 +170,8 @@ class Establishment extends CommonObject
$sql .= ", fk_user_author";
$sql .= ", fk_user_mod";
$sql .= ") VALUES (";
$sql .= " '".$this->db->escape($this->name)."'";
$sql .= "'".$this->db->escape($this->ref)."'";
$sql .= ", '".$this->db->escape($this->label)."'";
$sql .= ", '".$this->db->escape($this->address)."'";
$sql .= ", '".$this->db->escape($this->zip)."'";
$sql .= ", '".$this->db->escape($this->town)."'";
@ -184,6 +203,12 @@ class Establishment extends CommonObject
$this->db->rollback();
return -1 * $error;
} else {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'establishment');
$sql = 'UPDATE '.MAIN_DB_PREFIX."establishment SET ref = '".$this->db->escape($this->id)."'";
$sql .= " WHERE rowid = ".$this->id;
$this->db->query($sql);
$this->db->commit();
return $this->id;
}
@ -200,7 +225,7 @@ class Establishment extends CommonObject
global $langs;
// Check parameters
if (empty($this->name))
if (empty($this->label))
{
$this->error = 'ErrorBadParameter';
return -1;
@ -209,7 +234,8 @@ class Establishment extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."establishment";
$sql .= " SET ref = '".$this->db->escape($this->ref)."', name = '".$this->db->escape($this->name)."'";
$sql .= " SET ref = '".$this->db->escape($this->ref)."'";
$sql .= ", label = '".$this->db->escape($this->label)."'";
$sql .= ", address = '".$this->db->escape($this->address)."'";
$sql .= ", zip = '".$this->db->escape($this->zip)."'";
$sql .= ", town = '".$this->db->escape($this->town)."'";
@ -239,7 +265,7 @@ class Establishment extends CommonObject
*/
public function fetch($id)
{
$sql = "SELECT e.rowid, e.ref, e.name, e.address, e.zip, e.town, e.status, e.fk_country as country_id, e.entity,";
$sql = "SELECT e.rowid, e.ref, e.label, e.address, e.zip, e.town, e.status, e.fk_country as country_id, e.entity,";
$sql .= ' c.code as country_code, c.label as country';
$sql .= " FROM ".MAIN_DB_PREFIX."establishment as e";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON e.fk_country = c.rowid';
@ -253,7 +279,7 @@ class Establishment extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->ref;
$this->name = $obj->name;
$this->label = $obj->label;
$this->address = $obj->address;
$this->zip = $obj->zip;
$this->town = $obj->town;
@ -329,7 +355,7 @@ class Establishment extends CommonObject
}
$statusType = 'status'.$status;
//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
if ($status == self::STATUS_OPEN) $statusType = 'status4';
if ($status == self::STATUS_CLOSED) $statusType = 'status6';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
@ -397,11 +423,12 @@ class Establishment extends CommonObject
$picto = 'building';
$label = $langs->trans("Show").': '.$this->name;
$label = '<u>'.$langs->trans("Establishment").'</u>';
$label .= '<br>'.$langs->trans("Label").': '.$this->label;
if ($withpicto) $result .= ($link.img_object($label, $picto).$linkend);
if ($withpicto && $withpicto != 2) $result .= ' ';
if ($withpicto != 2) $result .= $link.$this->name.$linkend;
if ($withpicto != 2) $result .= $link.$this->label.$linkend;
return $result;
}
@ -432,6 +459,7 @@ class Establishment extends CommonObject
public function initAsSpecimen()
{
$this->id = 0;
$this->ref = 'DEP-AAA';
$this->ref = '0';
$this->label = 'Department AAA';
}
}

View File

@ -72,10 +72,10 @@ if ($action == 'confirm_delete' && $confirm == "yes")
{
$error = 0;
$object->name = GETPOST('name', 'alpha');
if (empty($object->name))
$object->label = GETPOST('label', 'alpha');
if (empty($object->label))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
$error++;
}
@ -114,15 +114,15 @@ elseif ($action == 'update')
$error = 0;
if (!$cancel) {
$name = GETPOST('name', 'alpha');
$name = GETPOST('label', 'alpha');
if (empty($name)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Name')), null, 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Label')), null, 'errors');
$error++;
}
if (empty($error))
{
$object->name = GETPOST('name', 'alpha');
$object->label = GETPOST('label', 'alphanohtml');
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
@ -173,8 +173,8 @@ if ($action == 'create')
// Name
print '<tr>';
print '<td>'.$form->editfieldkey('Name', 'name', '', $object, 0, 'string', '', 1).'</td>';
print '<td><input name="name" id="name" size="32" value="'.GETPOST("name", "alpha").'"></td>';
print '<td>'.$form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).'</td>';
print '<td><input name="label" id="label" value="'.GETPOST("label", "alphanohtml").'"></td>';
print '</tr>';
// Entity
@ -192,7 +192,7 @@ if ($action == 'create')
print '<tr>';
print '<td>'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
print '<td>';
print '<input name="address" id="address" class="qutrevingtpercent" value="'.GETPOST('address', 'alpha').'">';
print '<input name="address" id="address" class="qutrevingtpercent" value="'.GETPOST('address', 'alphanohtml').'">';
print '</td>';
print '</tr>';
@ -273,13 +273,13 @@ if (($id || $ref) && $action == 'edit')
// Ref
print "<tr>";
print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print $object->id;
print '</td></tr>';
// Name
print '<tr><td>'.$form->editfieldkey('Name', 'name', '', $object, 0, 'string', '', 1).'</td><td>';
print '<input name="name" id="name" class="flat" size="32" value="'.$object->name.'">';
print '<tr><td>'.$form->editfieldkey('Label', 'label', '', $object, 0, 'string', '', 1).'</td><td>';
print '<input name="label" id="label" class="flat" value="'.$object->label.'">';
print '</td></tr>';
// Entity
@ -294,7 +294,7 @@ if (($id || $ref) && $action == 'edit')
// Address
print '<tr><td>'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
print '<td>';
print '<input name="address" id="address" size="32" value="'.$object->address.'">';
print '<input name="address" id="address" value="'.$object->address.'">';
print '</td></tr>';
// Zipcode / Town
@ -369,8 +369,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Name
print '<tr>';
print '<td class="titlefield">'.$langs->trans("Name").'</td>';
print '<td>'.$object->name.'</td>';
print '<td class="titlefield">'.$langs->trans("Label").'</td>';
print '<td>'.$object->label.'</td>';
print '</tr>';
// Entity
@ -390,7 +390,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Zipcode
print '<tr>';
print '<td>'.$langs->trans("Zipcode").'</td>';
print '<td>'.$langs->trans("Zip").'</td>';
print '<td>'.$object->zip.'</td>';
print '</tr>';

View File

@ -242,7 +242,7 @@ class DoliStorage implements TokenStorageInterface
$sql.= " WHERE service='".$this->db->escape($service)."'";
$resql = $this->db->query($sql);
$result = $this->db->fetch_array($resql);
$states[$service] = $result[state];
$states[$service] = $result['state'];
$this->states[$service] = $states[$service];
return is_array($states)

View File

@ -124,11 +124,25 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','bom',660);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','bom',661);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','bom',662);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','bom',663);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','mrp',660);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','mrp',661);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','mrp',662);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','mrp',663);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact address record','contact',51);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516);
-- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...)
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152);

View File

@ -36,6 +36,7 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2,'AC_FAX','system','Send Fax',NULL, 1, 3);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 4,'AC_EMAIL','system','Send Email',NULL, 1, 4);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5,'AC_RDV','system','Rendez-vous',NULL, 1, 1);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4);
-- Code kept for backward compatibility < 3.3
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3,'AC_PROP','systemauto', 'Send commercial proposal by email','propal',0,10);

View File

@ -30,3 +30,5 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,<br><br>\n\n__(YourMembershipWasCanceled)__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br>\n__(Lastname)__ : __MEMBER_LASTNAME__<br>\n__(Fullname)__ : __MEMBER_FULLNAME__<br>\n__(Company)__ : __MEMBER_COMPANY__<br>\n__(Address)__ : __MEMBER_ADDRESS__<br>\n__(Zip)__ : __MEMBER_ZIP__<br>\n__(Town)__ : __MEMBER_TOWN__<br>\n__(Country)__ : __MEMBER_COUNTRY__<br>\n__(Email)__ : __MEMBER_EMAIL__<br>\n__(Birthday)__ : __MEMBER_BIRTH__<br>\n__(Photo)__ : __MEMBER_PHOTO__<br>\n__(Login)__ : __MEMBER_LOGIN__<br>\n__(Password)__ : __MEMBER_PASSWORD__<br>\n__(Phone)__ : __MEMBER_PHONE__<br>\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br>\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,<br><br>\n\n__(YourCandidatureAnswerMessage)__<br>__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);

View File

@ -74,7 +74,11 @@ create table llx_mrp_mo_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_mrp_mo_extrafields DROP INDEX idx_fk_object;
ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_mrp_mo_fk_object(fk_object);
-- This var is per entity now, so we remove const if global if exists
delete from llx_const where name in ('PROJECT_HIDE_TASKS', 'MAIN_BUGTRACK_ENABLELINK', 'MAIN_HELP_DISABLELINK') and entity = 0;

View File

@ -35,11 +35,33 @@ ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-orde
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture);
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn);
ALTER TABLE llx_document_model MODIFY COLUMN type varchar(64);
ALTER TABLE llx_bom_bom MODIFY COLUMN duration double(24,8);
ALTER TABLE llx_bom_bom_extrafields ADD INDEX idx_bom_bom_extrafields_fk_object (fk_object);
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_mrp_mo_extrafields DROP INDEX idx_fk_object;
ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_mrp_mo_fk_object(fk_object);
-- For v13
ALTER TABLE llx_bom_bom ADD COLUMN bomtype integer DEFAULT 0;
UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Ticket_Requests' WHERE ref = 'Collect_Ticket_Requets';
UPDATE llx_emailcollector_emailcollector SET ref = 'Collect_Responses_In' WHERE ref = 'Collect_Responses';
UPDATE llx_document_model set nom = 'standard' where nom = 'Standard' and type ='stock';
UPDATE llx_document_model set nom = 'stdmovement', type = 'movement' where nom = 'StdMouvement' and type ='mouvement';
@ -52,10 +74,10 @@ ALTER TABLE llx_commande MODIFY COLUMN date_livraison DATETIME;
ALTER TABLE llx_website ADD COLUMN position integer DEFAULT 0;
ALTER TABLE llx_establishment ADD COLUMN ref varchar(30);
ALTER TABLE llx_establishment ADD COLUMN name varchar(128);
ALTER TABLE llx_establishment ADD COLUMN label varchar(128);
UPDATE llx_establishment SET ref = rowid WHERE ref IS NULL;
ALTER TABLE llx_establishment MODIFY COLUMN ref varchar(30) NOT NULL;
ALTER TABLE llx_establishment MODIFY COLUMN name varchar(128);
ALTER TABLE llx_establishment MODIFY COLUMN label varchar(128);
INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PRODUCT_PRICE_BASE_TYPE', 0, 'HT', 'string', 0);
@ -130,14 +152,15 @@ create table llx_recruitment_recruitmentjobposition_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_recruitment_recruitmentjobposition_extrafields ADD INDEX idx_recruitmentjobposition_fk_object(fk_object);
CREATE TABLE llx_recruitment_recruitmentcandidature(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
fk_recruitmentjobposition INTEGER NOT NULL,
entity integer NOT NULL DEFAULT 1,
fk_recruitmentjobposition INTEGER NULL,
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
description text,
note_public text,
@ -150,13 +173,18 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
model_pdf varchar(255),
status smallint NOT NULL,
firstname varchar(128),
lastname varchar(128),
lastname varchar(128),
email varchar(255),
phone varchar(64),
remuneration_requested integer,
remuneration_proposed integer,
email_msgid varchar(255),
fk_recruitment_origin INTEGER NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_recruitment_recruitmentcandidature ADD COLUMN entity integer NOT NULL DEFAULT 1;
ALTER TABLE llx_recruitment_recruitmentcandidature ADD COLUMN email_msgid varchar(255);
ALTER TABLE llx_recruitment_recruitmentcandidature ADD COLUMN fk_recruitment_origin INTEGER NULL;
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_rowid (rowid);
@ -164,8 +192,6 @@ ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_rec
ALTER TABLE llx_recruitment_recruitmentcandidature ADD CONSTRAINT llx_recruitment_recruitmentcandidature_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_recruitmentcandidature_status (status);
create table llx_recruitment_recruitmentcandidature_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
@ -174,7 +200,9 @@ create table llx_recruitment_recruitmentcandidature_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_recruitment_recruitmentcandidature_extrafields ADD INDEX idx_recruitmentcandidature_fk_object(fk_object);
ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitmentcandidature_email_msgid(email_msgid);
@ -235,8 +263,37 @@ create table llx_c_recruitment_origin
)ENGINE=innodb;
ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitmentcandidature_email_msgid(email_msgid);
ALTER TABLE llx_product MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
ALTER TABLE llx_projet ADD COLUMN email_msgid varchar(255);
ALTER TABLE llx_ticket ADD COLUMN email_msgid varchar(255);
ALTER TABLE llx_actioncomm ADD COLUMN reply_to varchar(255);
ALTER TABLE llx_paiement ADD pos_change DOUBLE(24,8) DEFAULT 0 AFTER fk_export_compta;
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52);
ALTER TABLE llx_ecm_directories CHANGE COLUMN date_m tms timestamp;
ALTER TABLE llx_ecm_files CHANGE COLUMN date_m tms timestamp;
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,<br><br>\n\n__(YourCandidatureAnswer)__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(64) NOT NULL;
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516);

View File

@ -66,6 +66,7 @@ create table llx_actioncomm
email_tocc varchar(255), -- when event was an email, we store here the email_tocc
email_tobcc varchar(255), -- when event was an email, we store here the email_tobcc
errors_to varchar(255), -- when event was an email, we store here the erros_to
reply_to varchar(255), -- when event was an email, we store here the reply_to
recurid varchar(128), -- used to store event id to link each other all the repeating event record. It can be the 'iCalUID' as in RFC5545 (an id similar for all the same serie)
recurrule varchar(128), -- contains string with ical format recurring rule like 'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19' or 'FREQ=WEEKLY;BYDAY=MO'

View File

@ -18,7 +18,8 @@ CREATE TABLE llx_bom_bom(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity integer DEFAULT 1 NOT NULL,
ref varchar(128) NOT NULL,
ref varchar(128) NOT NULL,
bomtype integer DEFAULT 0, -- 0 for a BOM to manufacture, 1 for a BOM to dismantle
label varchar(255),
fk_product integer,
description text,

View File

@ -0,0 +1,21 @@
-- ===================================================================
-- Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_bom_bom_extrafields ADD INDEX idx_bom_bom_extrafields_fk_object (fk_object);

View File

@ -23,7 +23,7 @@ create table llx_c_action_trigger
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
elementtype varchar(64) NOT NULL,
code varchar(32) NOT NULL,
code varchar(64) NOT NULL,
label varchar(128) NOT NULL,
description varchar(255),
rang integer DEFAULT 0

View File

@ -15,5 +15,5 @@
-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_mrp_myobject_extrafields ADD INDEX idx_fk_object(fk_object);
ALTER TABLE llx_mrp_mo_extrafields ADD INDEX idx_mrp_mo_fk_object(fk_object);
-- END MODULEBUILDER INDEXES

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