kaos
July 19, 2024, 9:33am
1
I want to run a task (maybe daily) that generates a new subscription for member whose one is going to expire in the next n days.
Another option that this task is executed manually by clicking on a button.
In each case, where is the best practice for placing for the file with the code. Should I create a new module for this?
Thanks a lot.
eldy
July 20, 2024, 9:08am
2
Best is to create module with 1 scheduled task.
kaos
July 20, 2024, 11:45am
3
Thanks eldy,
Just to be sure, what you propose is to use the standard module template, or create a new module with module builder, and then place a file in ¿class? folder, with a new class with a method that is called from scheduled task. Is that?
It is possible for a module to expand an existing class (in this case adherents) with a new method?
Thanks for your help.
I think the name would change based on these lines
* \brief File of the superclass of orders classes (customer and supplier)
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
/**
* Superclass for orders classes
*/
abstract class CommonOrder extends CommonObject
{
use CommonIncoterm;
/**
* Return clickable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param ?array<string,mixed> $arraydata Array of data
* @return string HTML Code for Kanban thumb.
And if that module has 1 schedule tasks as @eldy suggests, why could that not just use the new extended class name?