Jump to content

Server module - function automation


sketch

Recommended Posts

does anyone know if you can have a function in a module called when certain tasks occur, for example when an invoice is automatically generated, without using action hooks?

 

also, it seems to me that the only way to call functionality within server modules is to have a button in the customButtonArray that references the function you want to call, is this correct?

 

further more, when you do click a button that triggers a module function, e.g. Change Password, it takes the data saved in the database, not the data from the form, effectively meaning you have to change password, click save, then click "change password". again, am i doing something horribly wrong?

 

Since there is no action hook for invoice creation (and even if there was, you'd then have to put code in the hook to determine if it was the right server module etc etc), i don't see an easy way to automatically call module functions.

 

has anyone found a way around this problem, or have some documentation i could read?

 

Thanks in advance

Link to comment
Share on other sites

Sketch.

 

You can't trigger on actions unless its in the action hooks file.

And you can only trigger on actions provided in that file.

 

As for saving the password, that is a round about way to do it but thats correct.

Link to comment
Share on other sites

Sorry to hijack this thread but it seemed relevant.

 

I am trying to build a function that will add the clients details to each invoice in a separate linked table when the invoice is created. I thought I would be able to do it via an action hook but as you've mentioned (And I have just found out) there does not seem to be one for when an invoice is created.

 

It may be possible to run a script from the pdf generator and have the PDF sent attached to the invoice email which would in effect run the script on invoice generation I believe.

 

All this would be irrelevant if WHMCS would kindly save customers data to the invoice. A simple (extensible) XML list in a text field would be perfect and allow it to accommodate unlimited custom user fields. We can then iterate through this list when we display the invoice.

 

I believe is it illegal (in Europe at least) for the Invoice details to be changeable once the invoice has been created. At the moment it looks like in WHMCS it is.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated