RE: [otrs] Customer Info in Ticket Zoom

Shawn Holland: I've been wanting to add additional information to the customers... Keith adds: Hi, we) - after much striving - finally figured it out. I'll post a version of this to otrs mail as well. Comments welcome. First add your fields to the database using whatever DB utility you want. Then you have to add the fields to the customer map. To do this look for the CustomerUser object in the default.pm config file, and copy it to the config.pm file (leave the default.pm alone and make all your config changes in the config.pm file - the config file is read after the default one, so it overwrites any values in the prior) Inside the CustomerUser object is a map object that starts "Map => [" which has an array of arrays for each customer user field. Here's my complete CustomerUser map: Map => [ # note: Login, Email and CustomerID needed! # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly [ 'UserSalutation', 'Salutation', 'salutation', 1, 0, 'var', '', 0 ], [ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ], [ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ], [ 'UserLogin', 'Username', 'login', 1, 1, 'var', '', 0 ], [ 'UserPassword', 'Password', 'pw', 0, 1, 'var', '', 0 ], [ 'UserEmail', 'Email', 'email', 0, 1, 'var', '', 0 ], [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ], [ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ], [ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int', '', 0 ], # Added by Cloud Systems. [ 'CustomerCompany', 'Company', 'company', 1, 1, 'var', '', 0 ], [ 'CustomerTelephone', 'Telephone', 'telephone', 1, 1, 'int', '', 0 ], ], We then added Company and Telephone fields to the creation of a customer account and also put in some front end JavaScript validation to make some fields required as well before a submit - as this currently required a server call. Be sure to add your new fields to the end of the list, as some internal function calls seem to use magic numbers to get the right elements so order here is important. To make the added fields show up in the customer information area of the pages we wanted, we simply needed to change the "shown" parameter as listed into the top comment a 1 instead of a 0. Hope this helps. Feel free to ask more questions if this isn't clear, though I'm still fighting with a lot of this myself. We also looked at using the freetext fields, but to us they looked like they were too tied into the freekeys and all their unwanted associated functionality. We'd looked at this for a long time, and no answers to this simple question despite multiple posts to both mail lists. Ah, well - learned a lot. Keith

Kieth; On Thu, Dec 01, 2005 at 02:56:55PM -0800, Keith Turner wrote:
Shawn Holland: I've been wanting to add additional information to the customers...
Keith adds: Hi, we) - after much striving - finally figured it out. I'll post a version of this to otrs mail as well. Comments welcome.
<SNIP>
To make the added fields show up in the customer information area of the pages we wanted, we simply needed to change the "shown" parameter as listed into the top comment a 1 instead of a 0.
Doh! I had this all done. I just didn't have the field filled in with a value, so I figured it would still display the heading of "Phone:" but it didn't. As soon as I placed a phone number in there, both the heading and the number appeared! HOORAY! -=cj -- Chris Jones Developer/Consultant (604)738-8254

Thanks for sharing your experience with the list, Keith. Much appreciated. Special thanks for going on to mention your impression of using the free fields... a feature that I'm having a tough time understanding conceptually(you'd think their use would be straightforward but alas, not to me). That's a clarification question I'll have to submit to the list after a bit more exploration. -- jt Keith Turner wrote:
Shawn Holland: I've been wanting to add additional information to the customers...
Keith adds: Hi, we) - after much striving - finally figured it out. I'll post a version of this to otrs mail as well. Comments welcome.
First add your fields to the database using whatever DB utility you want.
Then you have to add the fields to the customer map. To do this look for the CustomerUser object in the default.pm config file, and copy it to the config.pm file (leave the default.pm alone and make all your config changes in the config.pm file - the config file is read after the default one, so it overwrites any values in the prior)
Inside the CustomerUser object is a map object that starts "Map => [" which has an array of arrays for each customer user field.
Here's my complete CustomerUser map: Map => [ # note: Login, Email and CustomerID needed! # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly [ 'UserSalutation', 'Salutation', 'salutation', 1, 0, 'var', '', 0 ], [ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ], [ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ], [ 'UserLogin', 'Username', 'login', 1, 1, 'var', '', 0 ], [ 'UserPassword', 'Password', 'pw', 0, 1, 'var', '', 0 ], [ 'UserEmail', 'Email', 'email', 0, 1, 'var', '', 0 ], [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ], [ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ], [ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int', '', 0 ], # Added by Cloud Systems. [ 'CustomerCompany', 'Company', 'company', 1, 1, 'var', '', 0 ], [ 'CustomerTelephone', 'Telephone', 'telephone', 1, 1, 'int', '', 0 ], ],
We then added Company and Telephone fields to the creation of a customer account and also put in some front end JavaScript validation to make some fields required as well before a submit - as this currently required a server call. Be sure to add your new fields to the end of the list, as some internal function calls seem to use magic numbers to get the right elements so order here is important.
To make the added fields show up in the customer information area of the pages we wanted, we simply needed to change the "shown" parameter as listed into the top comment a 1 instead of a 0.
Hope this helps. Feel free to ask more questions if this isn't clear, though I'm still fighting with a lot of this myself. We also looked at using the freetext fields, but to us they looked like they were too tied into the freekeys and all their unwanted associated functionality.
We'd looked at this for a long time, and no answers to this simple question despite multiple posts to both mail lists.
Ah, well - learned a lot.
Keith
_______________________________________________ OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs Support oder Consulting für Ihr OTRS System? =http://www.otrs.de/
participants (3)
-
Chris Jones
-
Jason Turner
-
Keith Turner