<?php
/*=====================================================================*\
|| ###################################################################
|| # Bugdar [#]version[#]
|| # Copyright ©2002-[#]year[#] Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
|| # the Free Software Foundation; version [#]gpl[#] of the License.
|| #
|| # This program is distributed in the hope that it will be useful, but
|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|| # more details.
|| #
|| # You should have received a copy of the GNU General Public License along
|| # with this program; if not, write to the Free Software Foundation, Inc.,
|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|| ###################################################################
\*=====================================================================*/
$GLOBALS['isso:callback']->load('api', null);
require_once('./includes/functions_datastore.php');
/**
* API: Status
*
* @author Blue Static
* @copyright Copyright ©2002 - [#]year[#], Blue Static
* @version $Revision$
* @package Bugdar
*
*/
class StatusAPI extends API
{
/**
* Fields
* @var array
* @access private
*/
var $fields = array(
'statusid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
'status' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
'color' => array(TYPE_STR, REQ_NO),
'displayorder' => array(TYPE_INT, REQ_NO)
);
/**
* Database table
* @var string
* @access private
*/
var $table = 'status';
/**
* Table prefix
* @var string
* @access private
*/
var $prefix = TABLE_PREFIX;
// ###################################################################
/**
* Post-insert
*
* @access protected
*/
function post_insert()
{
build_statuses();
}
// ###################################################################
/**
* Post-update
*
* @access protected
*/
function post_update()
{
build_statuses();
}
// ###################################################################
/**
* Post-delete
*
* @access protected
*/
function post_delete()
{
build_statuses();
$this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . $this->registry->options['defaultstatus'] . " WHERE status = " . $this->values['statusid']);
}
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>