Menu

TTO/TTR deadline based on a time in the past

2020-12-10
2020-12-11
  • edouard OUEKISSONE

    Have you planned to set up SLTs like TTO and TTR but based on a time in the past (prior to the create / start date) while managing the working days and hours as well as the pending times?

     
  • Vincent @ Combodo

    I am wondering if I have not already answered that one...
    Let's imagine you would like the TTO to start from the real beginning of a UserRequest as define in a “real_date” attribute of the UserRequest. To do this, within method OnInsert, add:

    ~~~
    $oStartDate = new DateTime($this->Get('real_date'));
    $oTTO = $this->Get('tto');
    $oAttDef = MetaModel::GetAttributeDef(get_class($this), 'tto');
    $oTTO->Start($this, $oAttDef, $oStartDate->format('U'));
    $oTTO->ComputeDeadlines($this, $oAttDef);
    $this->Set('tto', $oTTO);
    ~~~

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.