Skip to content
Snippets Groups Projects
class.list.php 27 KiB
Newer Older
Peter Rotich's avatar
Peter Rotich committed
        return $this->toString();
    }

    static function create($ht) {

        if (!isset($ht['mode']))
            $ht['mode'] = 1;

        $ht['created'] = new SqlFunction('NOW');

        return  parent::create($ht);
    }

    static function lookup($var, $list= false) {

        if (!($item = parent::lookup($var)))
            return null;

        $item->_list = $list;

        return $item;
    }


Peter Rotich's avatar
Peter Rotich committed
    static function __create($ht, &$error=false) {
        global $ost;

        $properties = JsonDataEncoder::encode($ht['properties']);
        unset($ht['properties']);
        if ($status = TicketStatus::create($ht)) {
            $status->save(true);
            $status->_config = new Config('TS.'.$status->getId());
            $status->_config->set('properties', $properties);
        }

        return $status;
    }

    static function status_options() {
Peter Rotich's avatar
Peter Rotich committed
        include(STAFFINC_DIR . 'templates/status-options.tmpl.php');
    }
}

TicketStatus::_inspect();