Arrange Customer Edit form

Moderator: crythias

Locked
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Arrange Customer Edit form

Post by HervE »

Hello,

When you add a column to Customer User (or Customer Company), it's easy to have it in the Edit form: you just need to map it in Config.pm.

But now I have to add many columns to Customer Company, and I'd like to arrange the Edit form myself with subpanes, buttons, a better way to fill in dates, and so on...

How can I do that? I'm afraid changing AdminCustomercompany.dtl may be useless?

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Arrange Customer Edit form

Post by crythias »

copy the information from Defaults.pm into Config.pm:

Code: Select all

    $Self->{CustomerCompany} = {
        Params => {
            # if you want to use an external database, add the
            # required settings
#            DSN => 'DBI:odbc:yourdsn',
#            DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#            User => '',
#            Password => '',
            Table => 'customer_company',
        },

        # customer uniq id
        CustomerCompanyKey          => 'customer_id',
        CustomerCompanyValid        => 'valid_id',
        CustomerCompanyListFields   => [ 'customer_id', 'name' ],
        CustomerCompanySearchFields => ['customer_id', 'name'],
        CustomerCompanySearchPrefix => '',
        CustomerCompanySearchSuffix => '*',
        CustomerCompanySearchListLimit => 250,
        Map                       => [

# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
            [ 'CustomerID',             'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
            [ 'CustomerCompanyName',    'Company',       'name',        1, 1, 'var', '', 0 ],
            [ 'CustomerCompanyStreet',  'Street',     'street',      1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyZIP',     'Zip',        'zip',         1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyCity',    'City',       'city',        1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyCountry', 'Country',    'country',     1, 0, 'var', '', 0 ],
            [ 'CustomerCompanyURL', 'URL', 'url', 1, 0, 'var', '$Data{"CustomerCompanyURL"}', 0 ],
            [ 'CustomerCompanyComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
            [ 'ValidID',                'Valid',   'valid_id', 0, 1, 'int', '', 0 ],
        ],

        # default selections
        Selections => {
              CustomerCompanyCountry => { 
                  '-'  => '-',
                  'United States' => 'United States',
              },
        },
  };

http://forums.otrs.org/viewtopic.php?f=60&t=7787

I don't have hints on subpanes or buttons, though. As for dates, I have an idea to extend the http-link, but that shows up everywhere.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Arrange Customer Edit form

Post by crythias »

Interestingly, I just figured out something...

CustomerCompany can be a selection list in Config.pm for a customer. It may or may not apply to anyone, but I wanted to post it just in case someone asks again.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: Arrange Customer Edit form

Post by HervE »

Thank you crythias for your answers.
crythias wrote:copy the information from Defaults.pm into Config.pm: (...)
http://forums.otrs.org/viewtopic.php?f=60&t=7787
Yes, I know that, and did it a long time ago already, and also tried to add an image thanks to your fantastic how-to (although I have no business application for it at the moment).
crythias wrote:I don't have hints on subpanes or buttons, though. As for dates, I have an idea to extend the http-link, but that shows up everywhere.
http-link is perfect to do a hyperlink to an external URL (like googlemaps for instance) or internal - but not inside an Edit form.
I added some dates to Customer Company, and I'd like to make them easy to be filled in in the Edit form. If I could have the same thing as the pending date in the articles, I would be happy. And I can't figure out how http-link would help on this?

Then, since I added many columns, I'd like to organize the new fields in the Edit form layout.
For instance, display them in 2 columns. Reduce the width of the textboxes. Add a button to hide/show all these new fields. Add a button to empty all these new fields. Etc.

HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
Locked