Hi. I have a status called "In Progress" which I created.
I want to modify class.ticket.php to NOT mark tickets that are "In Progress" as Overdue.
I am not experienced in PHP, but for what i understand, i would have to change one of these 2 functions in class.ticket.php:

static function checkOverdue() {
        $overdue = static::objects()
            ->filter(array(
                'isoverdue' => 0,
                'status__state' => 'open',
                Q::any(array(
                    Q::all(array(
                        'duedate__isnull' => true,
                        'est_duedate__isnull' => false,
                        'est_duedate__lt' => SqlFunction::NOW())
                        ),
                    Q::all(array(
                        'duedate__isnull' => false,
                        'duedate__lt' => SqlFunction::NOW())
                        )
                    ))
                ))
            ->limit(100);
        foreach ($overdue as $ticket)
            $ticket->markOverdue();
    }

or


    function markOverdue($whine=true) {
        global $cfg;

        // Only open tickets can be marked overdue
        if (!$this->isOpen())
            return false;

        if ($this->isOverdue())
            return true;

        $this->isoverdue = 1;
        if (!$this->save())
            return false;

        $this->logEvent('overdue');
        $this->onOverdue($whine);

        return true;
    }`

Can someone PLEASE tell me which one would be best to change, and how to do it? I assume it's just a simple add of an extra test "if status != "In Progress", but i'm not sure how to do this in php

6 months later

Did you create a new state for the status?
The state that comes from default are:
open, closed, archived, and delete. You will need to create a new state to apply a different behavior.

Write a Reply...