/** * Marks the next user in the round robin list as the next assignee in the * round robin queue. * * @access public * @param integer $prj_id The project ID * @param integer $usr_id The assignee's user ID * @return boolean */ function markNextAssignee($prj_id, $usr_id) { $prr_id = Round_Robin::getID($prj_id); $stmt = "UPDATE\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "round_robin_user\n SET\n rru_next=0\n WHERE\n rru_prr_id={$prr_id}"; $res = $GLOBALS["db_api"]->dbh->query($stmt); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return false; } else { $stmt = "UPDATE\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "round_robin_user\n SET\n rru_next=1\n WHERE\n rru_usr_id=" . Misc::escapeInteger($usr_id) . " AND\n rru_prr_id={$prr_id}"; $res = $GLOBALS["db_api"]->dbh->query($stmt); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return false; } else { return true; } } }