Re: Config.pm question
"Finetti, Stefano" <[email protected]> Thu, 10 Mar 2016 15:59:26 +0100
| Newsgroups | gmane.comp.otrs.devel |
|---|---|
| Message-ID | <CADp4ddS2mnwWJ5bUfDGiQyc-zgG_jpEMOAwrqUD_4cdJVBLVnA@mail.gmail.com> |
--===============2145160638==
Content-Type: multipart/alternative; boundary=001a11431e76b4f6ac052db310d7
--001a11431e76b4f6ac052db310d7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi Martin,
I just tried to do as you suggested, creating a file called AS400.pm into
Kernel/Config/Files with this:
package Kernel::Config::Files::AS400;
use strict;
use warnings;
no warnings 'redefine';
use utf8;
sub Load {
my ($File, $Self) =3D @_;
$Self->{CustomerCompany} =3D {
CustomerCompanySearchFields =3D> ['customer_id', 'name', 'as400',
'brand'],
Map =3D> [
# var, frontend, storage, shown (1=3Dalways,2=3Dlite), required, storage-ty=
pe,
http-link, readonly
[ 'CustomerTypeID', 'Customer Type',
'customer_company_types_id', 0, 0, 'int', '', 0 ],
[ 'CustomerCompanyAS400', 'System', 'as400', 1,
0, 'var', '', 0 ],
[ 'CustomerCompanyBrand', 'Brand', 'brand', 1,
0, 'var', '', 0 ],
[ 'CustomerCompanyParentCustID', 'Main Dealer Code',
'parent_custid', 1, 0, 'var', '', 0 ],
[ 'CustomerCompanyParentCompName', 'Main Dealer Name',
'parent_compname', 1, 0, 'var', '', 0 ],
[ 'PaymentsID', 'Payments', 'payments_id', 0,
0, 'int', '', 0 ],
[ 'ValidID', 'Valid', 'valid_id', 0,
1, 'int', '', 0 ],
],
};
}
1;
Unfortunately, even after a RebuildConfig and DeleteCache those fields does
not show up in Customer Company creation.
Do I need to put the whole Self->{CustomerCompany} object here or only my
customization should be put in?
2016-03-10 15:27 GMT+01:00 Martin Gruner <[email protected]>:
> Hi Stefano,
>
> this is possible. Just place a file in Kernel/Config/Files/*.pm that look=
s
> like ZZZAAuto.pm (implementing a Load method). $Self in there is the
> ConfigObject that you can modify as you wish.
>
> Best regards,
>
> Martin Gruner
> Team Lead R&D
>
> OTRS AG
> Bahnhofplatz 1a
> 94315 Straubing
>
> T: +49 (0)6172 681988 0
> F: +49 (0)9421 56818 18
> I: www.otrs.com/
>
> Gesch=C3=A4ftssitz: Bad Homburg, Amtsgericht: Bad Homburg, HRB 10751, USt=
-Nr.:
> DE256610065
> Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: Andr=C3=A9 Minde=
rmann
> (Vorsitzender), Christopher Kuhn, Sabine Riedel
>
> Mobile Kommunikation und transparente Prozesse - Mit der OTRS Business
> Solution=E2=84=A2 Managed 5 schnell und ohne eigene IT-Ressourcen starten=
- Jetzt
> neue Features entdecken und bestellen
>
> https://www.otrs.com/neu-in-otrs-business-solution-5-mobile-kommunikation=
-transparente-prozesse/?lang=3Dde
>
> > Am 01.03.2016 um 12:27 schrieb Finetti, Stefano <
> [email protected]>:
> >
> > Hi,
> >
> > a simple question (I think). Is it possible to move CustomerCompany
> configurations that are stored into main Config.pm file into a different
> file?
> >
> > What I'd like to achieve is a module that adds some option to the
> Customer Company management in OTRS (for example, type of customer, the e=
rp
> system they use, and stuff like that. I can easily add this fields in the
> customer_company table and mapping fields in Config.pm, but this prevents
> me from creating an installable module, because I can't (or at least, I
> think I shouldn't) change Config.pm file during the installation of an OT=
RS
> module.
> >
> > It would be great to create a - let's say - CustomerCompanyConfig.pm in
> /Kernel/Config/ or Kernel/Config/Files/ storing details from
> CustomerCompany, to avoid tampering with Config.pm file.
> >
> > I think this is not possible now, am I wrong?
> > --
> > Lynx International Srl
> > Stefano Finetti
> > http://www.lynx-international.com
> >
> > Lynx International Srl is a part of AXED Group
> > Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina
> >
> >
> > This e-mail and any files transmitted contain documentation which is
> highly confidential and intended solely for the use of the individual or
> entity to whom they are addressed. All written data and other information
> in the documentation is and shall remain the property of the disclosing
> party. If you are not the intended recipient you are hereby formally
> notified that any disclosure, dissemination, forwarding, storing, copying
> or use of any of the information is strictly prohibited and will be legal=
ly
> pursued. If you received this in error, please contact the sender and
> destroy the documentation including deletion of the same from any compute=
r.
> Thank you._______________________________________________
> > OTRS mailing list: dev - Webpage: http://otrs.org/
> > Archive: http://lists.otrs.org/pipermail/dev
> > To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
>
> _______________________________________________
> OTRS mailing list: dev - Webpage: http://otrs.org/
> Archive: http://lists.otrs.org/pipermail/dev
> To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
--=20
*Lynx International Srl*
*Stefano Finetti*
*http://www.lynx-international.com <http://www.lynx-international.com>*
*Lynx International Srl is a part of AXED Group*
Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina
--=20
This e-mail and any files transmitted contain documentation which is highly=
=20
confidential and intended solely for the use of the individual or entity to=
=20
whom they are addressed. All written data and other information in the=20
documentation is and shall remain the property of the disclosing party. If=
=20
you are not the intended recipient you are hereby formally notified that=20
any disclosure, dissemination, forwarding, storing, copying or use of any=
=20
of the information is strictly prohibited and will be legally pursued. If=
=20
you received this in error, please contact the sender and destroy the=20
documentation including deletion of the same from any computer. Thank you.
--001a11431e76b4f6ac052db310d7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi Martin,<div><br></div><div>I just tried to do as you su=
ggested, creating a file called AS400.pm into Kernel/Config/Files with this=
:</div><div><br></div><div><div>package Kernel::Config::Files::AS400;</div>=
<div>use strict;</div><div>use warnings;</div><div>no warnings 'redefin=
e';</div><div>use utf8;</div><div>sub Load {</div><div>=C2=A0 =C2=A0 my=
($File, $Self) =3D @_;</div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0$Self-=
>{CustomerCompany} =3D {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 CustomerC=
ompanySearchFields =3D> ['customer_id', 'name', 'as4=
00', 'brand'],</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 Map =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D&=
gt; [</div><div><br></div><div># var, frontend, storage, shown (1=3Dalways,=
2=3Dlite), required, storage-type, http-link, readonly</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'CustomerTypeID', =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 'Customer Type', =C2=A0 =C2=A0 =C2=A0 =C2=A0'cust=
omer_company_types_id', =C2=A0 =C2=A00, 0, 'int', '', 0=
],</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'CustomerComp=
anyAS400', =C2=A0 'System', =C2=A0 =C2=A0 =C2=A0 'as400'=
;, =C2=A0 =C2=A0 =C2=A0 =C2=A01, 0, 'var', '', 0 ],</div><d=
iv>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'CustomerCompanyBrand=
9;, =C2=A0 'Brand', =C2=A0 =C2=A0 =C2=A0 =C2=A0'brand', =C2=
=A0 =C2=A0 =C2=A0 =C2=A01, 0, 'var', '', 0 ],</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'CustomerCompanyParentCustID&#=
39;, =C2=A0 =C2=A0'Main Dealer Code', =C2=A0 =C2=A0 'parent_cus=
tid', =C2=A0 =C2=A0 =C2=A0 =C2=A01, 0, 'var', '', 0 ],<=
/div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'CustomerCompanyP=
arentCompName', =C2=A0'Main Dealer Name', =C2=A0 =C2=A0 'pa=
rent_compname', =C2=A0 =C2=A0 =C2=A01, 0, 'var', '', 0 =
],</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'PaymentsID=
9;, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'Payments', =C2=A0 =
=C2=A0 'payments_id', =C2=A00, 0, 'int', '', 0 ],</=
div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [ 'ValidID', =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'Valid', =C2=A0=
=C2=A0 =C2=A0 =C2=A0'valid_id', =C2=A0 =C2=A0 0, 1, 'int',=
'', 0 ],</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ],</div><div>=C2=A0=
=C2=A0 };</div><div><br></div><div>}</div><div>1;</div></div><div><br></di=
v><div>Unfortunately, even after a RebuildConfig and DeleteCache those fiel=
ds does not show up in Customer Company creation.</div><div>Do I need to pu=
t the whole Self->{CustomerCompany} object here or only my customization=
should be put in?</div><div><br></div></div><div class=3D"gmail_extra"><br=
><div class=3D"gmail_quote">2016-03-10 15:27 GMT+01:00 Martin Gruner <span =
dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>></span>:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">H=
i Stefano,<br>
<br>
this is possible. Just place a file in Kernel/Config/Files/*.pm that looks =
like ZZZAAuto.pm (implementing a Load method). $Self in there is the Config=
Object that you can modify as you wish.<br>
<br>
Best regards,<br>
<br>
Martin Gruner<br>
Team Lead R&D<br>
<br>
OTRS AG<br>
Bahnhofplatz 1a<br>
94315 Straubing<br>
<br>
T: <a href=3D"tel:%2B49%20%280%296172%20681988%200" value=3D"+4961726819880=
">+49 (0)6172 681988 0</a><br>
F: <a href=3D"tel:%2B49%20%280%299421%2056818%2018" value=3D"+4994215681818=
">+49 (0)9421 56818 18</a><br>
I:=C2=A0 <a href=3D"http://www.otrs.com/" rel=3D"noreferrer" target=3D"_bla=
nk">www.otrs.com/</a><br>
<br>
Gesch=C3=A4ftssitz: Bad Homburg, Amtsgericht: Bad Homburg, HRB 10751, USt-N=
r.: DE256610065<br>
Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: Andr=C3=A9 Minderm=
ann (Vorsitzender), Christopher Kuhn, Sabine Riedel<br>
<br>
Mobile Kommunikation und transparente Prozesse - Mit der OTRS Business Solu=
tion=E2=84=A2 Managed 5 schnell und ohne eigene IT-Ressourcen starten=C2=A0=
- Jetzt neue Features entdecken und bestellen<br>
<a href=3D"https://www.otrs.com/neu-in-otrs-business-solution-5-mobile-komm=
unikation-transparente-prozesse/?lang=3Dde" rel=3D"noreferrer" target=3D"_b=
lank">https://www.otrs.com/neu-in-otrs-business-solution-5-mobile-kommunika=
tion-transparente-prozesse/?lang=3Dde</a><br>
<div><div class=3D"h5"><br>
> Am <a href=3D"tel:01.03.2016" value=3D"+3901032016">01.03.2016</a> um =
12:27 schrieb Finetti, Stefano <<a href=3D"mailto:sfinetti@lynx-internat=
ional.com">[email protected]</a>>:<br>
><br>
> Hi,<br>
><br>
> a simple question (I think). Is it possible to move CustomerCompany co=
nfigurations that are stored into main Config.pm file into a different file=
?<br>
><br>
> What I'd like to achieve is a module that adds some option to the =
Customer Company management in OTRS (for example, type of customer, the erp=
system they use, and stuff like that. I can easily add this fields in the =
customer_company table and mapping fields in Config.pm, but this prevents m=
e from creating an installable module, because I can't (or at least, I =
think I shouldn't) change Config.pm file during the installation of an =
OTRS module.<br>
><br>
> It would be great to create a - let's say - CustomerCompanyConfig.=
pm in /Kernel/Config/ or Kernel/Config/Files/ storing details from Customer=
Company, to avoid tampering with Config.pm file.<br>
><br>
> I think this is not possible now, am I wrong?<br>
> --<br>
> Lynx International Srl<br>
> Stefano Finetti<br>
> <a href=3D"http://www.lynx-international.com" rel=3D"noreferrer" targe=
t=3D"_blank">http://www.lynx-international.com</a><br>
><br>
> Lynx International Srl is a part of AXED Group<br>
> Via Pier Luigi Nervi e/3 - Torre 6 - 04100 Latina<br>
><br>
><br>
</div></div>> This e-mail and any files transmitted contain documentatio=
n which is highly confidential and intended solely for the use of the indiv=
idual or entity to whom they are addressed. All written data and other info=
rmation in the documentation is and shall remain the property of the disclo=
sing party. If you are not the intended recipient you are hereby formally n=
otified that any disclosure, dissemination, forwarding, storing, copying or=
use of any of the information is strictly prohibited and will be legally p=
ursued. If you received this in error, please contact the sender and destro=
y the documentation including deletion of the same from any computer. Thank=
you._______________________________________________<br>
> OTRS mailing list: dev - Webpage: <a href=3D"http://otrs.org/" rel=3D"=
noreferrer" target=3D"_blank">http://otrs.org/</a><br>
> Archive: <a href=3D"http://lists.otrs.org/pipermail/dev" rel=3D"norefe=
rrer" target=3D"_blank">http://lists.otrs.org/pipermail/dev</a><br>
> To unsubscribe: <a href=3D"http://lists.otrs.org/cgi-bin/listinfo/dev"=
rel=3D"noreferrer" target=3D"_blank">http://lists.otrs.org/cgi-bin/listinf=
o/dev</a><br>
<br>
_______________________________________________<br>
OTRS mailing list: dev - Webpage: <a href=3D"http://otrs.org/" rel=3D"noref=
errer" target=3D"_blank">http://otrs.org/</a><br>
Archive: <a href=3D"http://lists.otrs.org/pipermail/dev" rel=3D"noreferrer"=
target=3D"_blank">http://lists.otrs.org/pipermail/dev</a><br>
To unsubscribe: <a href=3D"http://lists.otrs.org/cgi-bin/listinfo/dev" rel=
=3D"noreferrer" target=3D"_blank">http://lists.otrs.org/cgi-bin/listinfo/de=
v</a></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div cl=
ass=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div dir=3D"=
ltr"><span style=3D"color:rgb(50,100,246);font-family:'Courier New'=
;font-size:18px"><b>Lynx International Srl</b><span style=3D"font-size:12px=
;font-family:Times;color:rgb(0,0,0)">=C2=A0</span></span><span style=3D"bor=
der-collapse:separate;border-spacing:0px"><div style=3D"word-wrap:break-wor=
d"><span style=3D"border-collapse:separate;border-spacing:0px"><div style=
=3D"word-wrap:break-word"><div style=3D"margin:0px;font-size:16px;font-fami=
ly:'Courier New';color:rgb(119,119,119)"><b>Stefano Finetti</b></di=
v><div style=3D"margin:0px;font-size:16px;font-family:'Courier New'=
;color:rgb(119,119,119)"><b><a href=3D"http://www.lynx-international.com" t=
arget=3D"_blank">http://www.lynx-international.com</a></b></div><div style=
=3D"margin:0px;font-size:16px;font-family:'Courier New';color:rgb(1=
19,119,119);min-height:18px"><br></div><div style=3D"margin:0px;font-size:1=
6px;font-family:'Courier New';color:rgb(119,119,119)"><b>Lynx Inter=
national Srl is a part of AXED Group</b></div><div style=3D"margin:0px;font=
-size:16px;font-family:'Courier New';color:rgb(119,119,119)">Via Pi=
er Luigi Nervi e/3 - Torre 6 - 04100 Latina</div><div style=3D"margin:0px;f=
ont-size:16px;font-family:'Courier New';color:rgb(119,119,119)"><br=
></div></div></span></div></span></div></div></div></div></div>
</div>
<br>
<span style=3D"color:rgb(153,153,153);font-family:'Courier New';fon=
t-size:12px">This e-mail and any files transmitted contain documentation wh=
ich is highly confidential and intended solely for the use of the individua=
l or entity to whom they are addressed. All written data and other informat=
ion in the documentation is and shall remain the property of the disclosing=
party. If you are not the intended recipient you are hereby formally notif=
ied that any disclosure, dissemination, forwarding, storing, copying or use=
of any of the information is strictly prohibited and will be legally pursu=
ed. If you received this in error, please contact the sender and destroy th=
e documentation including deletion of the same from any computer. Thank you=
.</span>
--001a11431e76b4f6ac052db310d7--
--===============2145160638==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
--===============2145160638==--