Search code examples
phpwhmcs

WHMCS server's screen - adding custom fields


I'm developing a WHMCS provisioning module for a client. Its mostly standard stuff but they have a requirement to have some custom fields in the server's config screen.

I know how to add custom fields in the products config screen, but I can't find any details on how to do that in the server's screen...

Anyone done anything like that?

Thanks,

enter image description here

John


Solution

  • The server modules were not really designed to do this. I have seen your goal accomplished two ways:

    1) You can overload the AccessHash field to store json or some other kind of structured data. This is easiest for the module implementor but is going to be a challenge for users of the module if they are not comfortable with the format you use.

    2) You can write an addon module with an interface to allow you to store extra metadata for the server module. This allows you to present an interface to the end user and do much more input validation, however it requires they copy files to two locations and activate two modules to fully use the service.

    Unless this is a quick / dirty hack that will only be maintained in a single installation, I would go with the second options.