From 16e6450e82a4ceacf23c95ee7e5868bf9a2aff03 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 30 Apr 2006 16:48:16 +0000 Subject: [PATCH] r792: - Add a relation on bug.assignedto - Finish adding methods for the bug API --- includes/api_bug.php | 129 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/includes/api_bug.php b/includes/api_bug.php index 25666b4..fe32d95 100644 --- a/includes/api_bug.php +++ b/includes/api_bug.php @@ -49,7 +49,7 @@ class BugAPI extends API 'severity' => array(TYPE_UINT, REQ_NO, ':self'), 'status' => array(TYPE_UINT, REQ_NO, ':self'), 'resolution' => array(TYPE_UINT, REQ_NO, ':self'), - 'assignedto' => array(TYPE_UINT, REQ_NO), + 'assignedto' => array(TYPE_UINT, REQ_NO, ':self', array('includes/api_user.php', 'UserAPI'), 'duplicateof' => array(TYPE_STR, REQ_NO), 'dependency' => array(TYPE_STR, REQ_NO), 'hidden' => array(TYPE_BOOL, REQ_NO), @@ -73,6 +73,133 @@ class BugAPI extends API * @access private */ var $prefix = TABLE_PREFIX; + + // ################################################################### + /** + * Set field: dateline + * + * @access private + */ + function set_dateline() + { + $this->set('dateline', time()); + } + + // ################################################################### + /** + * Verify: productid + * + * @access private + */ + function verify_productid() + { + if (!$this->registry->datastore['product'][ $this->values['productid'] ]) + { + return false; + } + return true; + } + + // ################################################################### + /** + * Verify: componentid + * + * @access private + */ + function verify_componentid() + { + + } + + // ################################################################### + /** + * Verify: versionid + * + * @access private + */ + function verify_versionid() + { + if (!$this->registry->datastore['version'][ $this->values['versionid'] ]) + { + return false; + } + return true; + } + + // ################################################################### + /** + * Verify: priority + * + * @access private + */ + function verify_priority() + { + if (!$this->registry->datastore['priority'][ $this->values['priority'] ]) + { + return false; + } + return true; + } + + // ################################################################### + /** + * Verify: severity + * + * @access private + */ + function verify_severity() + { + if (!$this->registry->datastore['severity'][ $this->values['severity'] ]) + { + return false; + } + return true; + } + + // ################################################################### + /** + * Verify: status + * + * @access private + */ + function verify_status() + { + if (!$this->registry->datastore['status'][ $this->values['status'] ]) + { + return false; + } + return true; + } + + // ################################################################### + /** + * Verify: resolution + * + * @access private + */ + function verify_resolution() + { + if (!$this->registry->datastore['resolution'][ $this->values['resolution'] ]) + { + return false; + } + return true; + } + + // ################################################################### + /** + * Verify: assignedto + * + * @access private + */ + function verify_assignedto() + { + if (!$this->registry->datastore['assignedto'][ $this->values['assignedto'] ]['userid']) + { + return false; + } + return true; + } } /*=====================================================================*\ -- 2.22.5