本文整理汇总了PHP中Issue::setStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::setStatus方法的具体用法?PHP Issue::setStatus怎么用?PHP Issue::setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue::setStatus方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$tpl->assign('remove_checkin_result', $res);
} elseif ($cat == 'unassign') {
$res = Issue::deleteUserAssociation($iss_id, $usr_id);
Workflow::handleAssignmentChange($prj_id, $iss_id, Auth::getUserID(), Issue::getDetails($iss_id), Issue::getAssignedUserIDs($iss_id));
$tpl->assign('unassign_result', $res);
} elseif ($cat == 'remove_email') {
$res = Support::removeEmails();
$tpl->assign('remove_email_result', $res);
} elseif ($cat == 'clear_duplicate') {
$res = Issue::clearDuplicateStatus($iss_id);
$tpl->assign('clear_duplicate_result', $res);
} elseif ($cat == 'delete_phone') {
$res = Phone_Support::remove($id);
$tpl->assign('delete_phone_result', $res);
} elseif ($cat == 'new_status') {
$res = Issue::setStatus($iss_id, $status_id, true);
if ($res == 1) {
History::add($iss_id, $usr_id, 'status_changed', "Issue manually set to status '{status}' by {user}", array('status' => Status::getStatusTitle($status_id), 'user' => User::getFullName($usr_id)));
}
$tpl->assign('new_status_result', $res);
} elseif ($cat == 'authorize_reply') {
$res = Authorized_Replier::addUser($iss_id, $usr_id);
$tpl->assign('authorize_reply_result', $res);
} elseif ($cat == 'remove_quarantine') {
if (Auth::getCurrentRole() > User::getRoleID('Developer')) {
$res = Issue::setQuarantine($iss_id, 0);
$tpl->assign('remove_quarantine_result', $res);
}
} elseif ($cat == 'selfnotify') {
if (Issue::canAccess($iss_id, $usr_id)) {
$res = Notification::subscribeUser($usr_id, $iss_id, $usr_id, Notification::getDefaultActions($iss_id));
示例2: elseif
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$prj_id = Auth::getCurrentProject();
$usr_id = Auth::getUserID();
@($issue_id = $HTTP_GET_VARS["issue_id"] ? $HTTP_GET_VARS["issue_id"] : $HTTP_POST_VARS["issue_id"]);
$details = Issue::getDetails($issue_id);
$tpl->assign("issue_id", $issue_id);
$tpl->assign("issue", $details);
if (!Issue::canAccess($issue_id, $usr_id)) {
$tpl->setTemplate("permission_denied.tpl.html");
$tpl->displayTemplate();
exit;
}
if (@$HTTP_POST_VARS["cat"] == "post_note") {
// change status
if (!@empty($HTTP_POST_VARS['new_status'])) {
$res = Issue::setStatus($issue_id, $HTTP_POST_VARS['new_status']);
if ($res != -1) {
$new_status = Status::getStatusTitle($HTTP_POST_VARS['new_status']);
History::add($issue_id, $usr_id, History::getTypeID('status_changed'), "Status changed to '{$new_status}' by " . User::getFullName($usr_id));
}
}
$res = Note::insert($usr_id, $issue_id);
$tpl->assign("post_result", $res);
// enter the time tracking entry about this phone support entry
if (!empty($HTTP_POST_VARS['time_spent'])) {
$HTTP_POST_VARS['issue_id'] = $issue_id;
$HTTP_POST_VARS['category'] = $HTTP_POST_VARS['time_category'];
$HTTP_POST_VARS['summary'] = 'Time entry inserted when sending an internal note.';
Time_Tracking::insertEntry();
}
} elseif (@$HTTP_GET_VARS["cat"] == "reply") {
示例3: Issue
<?php
/**
* @author Jaco Ruit
*/
require '../startOrongo.php';
startOrongo();
if (isset($_SESSION['auth-sub-token']) || isset($_POST['issue_author']) || isset($_POST['issue_title']) || isset($_POST['issue_labels']) || isset($_POST['issue_content'])) {
$issue = new Issue($_POST['issue_title']);
$issue->setStatus("New");
$issue->setAuthor($_POST['issue_author']);
$issue->setContent($_POST['issue_content']);
if (!empty($_POST['issue_labels'])) {
$labels = explode(",", trim($_POST['issue_labels']));
foreach ($labels as &$label) {
trim($label);
}
$issue->setLabels($labels);
}
$issueTracker = new IssueTracker($_SESSION['auth-sub-token']);
unset($_SESSION['auth-sub-token']);
try {
$issueTracker->postIssue($issue);
header("Location: " . orongoURL("orongo-admin/post-issue.php?msg=0"));
} catch (Exception $e) {
header("Location: " . orongoURL("orongo-admin/post-issue.php?error=" . $e->getMessage()));
}
} else {
header("Location: " . orongoURL("orongo-admin/post-issue.php"));
}
示例4: array
if (!Issue::canAccess($issue_id, $usr_id)) {
$tpl->setTemplate('permission_denied.tpl.html');
$tpl->displayTemplate();
exit;
}
Workflow::prePage($prj_id, 'send_email');
// since emails associated with issues are sent to the notification list, not the to: field, set the to field to be blank
// this field should already be blank, but may also be unset.
if ($issue_id) {
$_POST['to'] = '';
}
if ($cat == 'send_email') {
$res = Support::sendEmailFromPost($_POST['parent_id']);
$tpl->assign('send_result', $res);
if (Access::canChangeStatus($issue_id, $usr_id) && isset($_POST['new_status']) && !empty($_POST['new_status'])) {
$res = Issue::setStatus($issue_id, $_POST['new_status']);
if ($res != -1) {
$new_status = Status::getStatusTitle($_POST['new_status']);
History::add($issue_id, $usr_id, 'status_changed', "Status changed to '{status}' by {user} when sending an email", array('status' => $new_status, 'user' => User::getFullName($usr_id)));
}
}
// remove the existing email draft, if appropriate
if (!empty($_POST['draft_id'])) {
Draft::remove($_POST['draft_id']);
}
// enter the time tracking entry about this new email
if (!empty($_POST['time_spent'])) {
$date = (array) $_POST['date'];
$ttc_id = Time_Tracking::getCategoryId($prj_id, 'Email Discussion');
$time_spent = (int) $_POST['time_spent'];
$summary = 'Time entry inserted when sending outgoing email.';
示例5: elseif
} elseif (@$HTTP_GET_VARS['cat'] == 'unassign') {
$res = Issue::deleteUserAssociation($HTTP_GET_VARS["iss_id"], $usr_id);
Workflow::handleAssignmentChange($prj_id, $HTTP_GET_VARS["iss_id"], Auth::getUserID(), Issue::getDetails($HTTP_GET_VARS["iss_id"]), Issue::getAssignedUserIDs($HTTP_GET_VARS["iss_id"]));
$tpl->assign('unassign_result', $res);
} elseif (@$HTTP_POST_VARS["cat"] == "remove_email") {
$res = Support::removeEmails();
$tpl->assign("remove_email_result", $res);
} elseif (@$HTTP_GET_VARS["cat"] == "clear_duplicate") {
$res = Issue::clearDuplicateStatus($HTTP_GET_VARS["iss_id"]);
$tpl->assign("clear_duplicate_result", $res);
} elseif (@$HTTP_GET_VARS["cat"] == "delete_phone") {
$res = Phone_Support::remove($HTTP_GET_VARS["id"]);
$tpl->assign("delete_phone_result", $res);
} elseif (@$HTTP_GET_VARS["cat"] == "new_status") {
// XXX: need to call the workflow api in the following function?
$res = Issue::setStatus($HTTP_GET_VARS["iss_id"], $HTTP_GET_VARS["new_sta_id"], true);
if ($res == 1) {
History::add($HTTP_GET_VARS["iss_id"], $usr_id, History::getTypeID('status_changed'), "Issue manually set to status '" . Status::getStatusTitle($HTTP_GET_VARS["new_sta_id"]) . "' by " . User::getFullName($usr_id));
}
$tpl->assign("new_status_result", $res);
} elseif (@$HTTP_GET_VARS["cat"] == "new_category") {
$res = Issue::setCategory($HTTP_GET_VARS["iss_id"], $HTTP_GET_VARS["iss_prc_id"], true);
if ($res == 1) {
History::add($HTTP_GET_VARS["iss_id"], $usr_id, History::getTypeID('status_changed'), "Issue manually set to category '" . Category::getTitle($HTTP_GET_VARS["iss_prc_id"]) . "' by " . User::getFullName($usr_id));
}
$tpl->assign("new_status_result", $res);
} elseif (@$HTTP_GET_VARS["cat"] == "new_project") {
$res = Issue::setProject($HTTP_GET_VARS["iss_id"], $HTTP_GET_VARS["iss_prj_id"], true);
if ($res == 1) {
History::add($HTTP_GET_VARS["iss_id"], $usr_id, History::getTypeID('status_changed'), "Issue manually set to project '" . Project::getName($HTTP_GET_VARS["iss_prj_id"]) . "' by " . User::getFullName($usr_id));
}
示例6: bulkUpdate
/**
* Method used to bulk update a list of issues
*
* @access public
* @return boolean
*/
function bulkUpdate()
{
global $HTTP_POST_VARS;
// check if user performing this chance has the proper role
if (Auth::getCurrentRole() < User::getRoleID('Manager')) {
return -1;
}
$items = Misc::escapeInteger($HTTP_POST_VARS['item']);
$new_status_id = Misc::escapeInteger($_POST['status']);
$new_release_id = Misc::escapeInteger($_POST['release']);
$new_priority_id = Misc::escapeInteger($_POST['priority']);
$new_category_id = Misc::escapeInteger($_POST['category']);
$new_project_id = Misc::escapeInteger($_POST['project']);
for ($i = 0; $i < count($items); $i++) {
if (!Issue::canAccess($items[$i], Auth::getUserID())) {
continue;
} elseif (Issue::getProjectID($HTTP_POST_VARS['item'][$i]) != Auth::getCurrentProject()) {
// make sure issue is not in another project
continue;
}
$updated_fields = array();
// update assignment
if (count(@$HTTP_POST_VARS['users']) > 0) {
$users = Misc::escapeInteger($HTTP_POST_VARS['users']);
// get who this issue is currently assigned too
$stmt = "SELECT\n isu_usr_id,\n CONCAT(en_firstname,' ', en_lastname) as usr_full_name\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user,\n " . ETEL_USER_TABLE_NOSUB . "\n WHERE\n isu_usr_id = en_ID AND\n isu_iss_id = " . $items[$i];
$current_assignees = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
if (PEAR::isError($current_assignees)) {
Error_Handler::logError(array($current_assignees->getMessage(), $current_assignees->getDebugInfo()), __FILE__, __LINE__);
return -1;
}
foreach ($current_assignees as $usr_id => $usr_name) {
if (!in_array($usr_id, $users)) {
Issue::deleteUserAssociation($items[$i], $usr_id, false);
}
}
$new_user_names = array();
$new_assignees = array();
foreach ($users as $usr_id) {
$new_user_names[$usr_id] = User::getFullName($usr_id);
// check if the issue is already assigned to this person
$stmt = "SELECT\n COUNT(*) AS total\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n WHERE\n isu_iss_id=" . $items[$i] . " AND\n isu_usr_id=" . $usr_id;
$total = $GLOBALS["db_api"]->dbh->getOne($stmt);
if ($total > 0) {
continue;
} else {
$new_assignees[] = $usr_id;
// add the assignment
Issue::addUserAssociation(Auth::getUserID(), $items[$i], $usr_id, false);
Notification::subscribeUser(Auth::getUserID(), $items[$i], $usr_id, Notification::getAllActions());
Workflow::handleAssignment(Auth::getCurrentProject(), $items[$i], Auth::getUserID());
}
}
Notification::notifyNewAssignment($new_assignees, $items[$i]);
$updated_fields['Assignment'] = History::formatChanges(join(', ', $current_assignees), join(', ', $new_user_names));
}
// update status
if (!empty($new_status_id)) {
$old_status_id = Issue::getStatusID($items[$i]);
$res = Issue::setStatus($items[$i], $new_status_id, false);
if ($res == 1) {
$updated_fields['Status'] = History::formatChanges(Status::getStatusTitle($old_status_id), Status::getStatusTitle($new_status_id));
}
}
// update release
if (!empty($new_release_id)) {
$old_release_id = Issue::getRelease($items[$i]);
$res = Issue::setRelease($items[$i], $new_release_id);
if ($res == 1) {
$updated_fields['Release'] = History::formatChanges(Release::getTitle($old_release_id), Release::getTitle($new_release_id));
}
}
// update priority
if (!empty($new_priority_id)) {
$old_priority_id = Issue::getPriority($items[$i]);
$res = Issue::setPriority($items[$i], $new_priority_id);
if ($res == 1) {
$updated_fields['Priority'] = History::formatChanges(Priority::getTitle($old_priority_id), Priority::getTitle($new_priority_id));
}
}
// update category
if (!empty($new_category_id)) {
$old_category_id = Issue::getCategory($items[$i]);
$res = Issue::setCategory($items[$i], $new_category_id);
if ($res == 1) {
$updated_fields['Category'] = History::formatChanges(Category::getTitle($old_category_id), Category::getTitle($new_category_id));
}
}
// update project
if (!empty($new_project_id)) {
$old_project_id = Issue::getProjectID($items[$i]);
$res = Issue::setProject($items[$i], $new_project_id);
if ($res == 1) {
$updated_fields['Project'] = History::formatChanges(Category::getTitle($old_project_id), Category::getTitle($new_project_id));
//.........这里部分代码省略.........
示例7: subdate
include_once "../config.inc.php";
include_once APP_INC_PATH . "class.support.php";
include_once APP_INC_PATH . "class.project.php";
include_once APP_INC_PATH . "class.issue.php";
include_once APP_INC_PATH . "class.status.php";
include_once APP_INC_PATH . "class.notification.php";
include_once APP_INC_PATH . "class.note.php";
include_once APP_INC_PATH . "db_access.php";
$day_limit = 4;
$sql = "SELECT \n\t\t\tiss_id,iss_prj_id\n\t\tFROM \n\t\t\t`ev_issue` \n\t\t\tleft join ev_status on sta_id = `iss_sta_id` \n\t\twhere \n\t\t\tsta_is_closed = 0 \n\t\t\tand `iss_control_status` = 'Answered' \n\t\t\tand iss_last_response_date < subdate(now(),interval {$day_limit} day);\n\t\t";
$issues = $GLOBALS["db_api"]->dbh->getAll($sql);
$closed_id = Status::getStatusID('Closed');
$c = 0;
$k = 0;
foreach ($issues as $issue) {
$res = Issue::setStatus($issue[0], $closed_id);
if ($res == 1) {
History::add($HTTP_GET_VARS["iss_id"], 0, History::getTypeID('status_changed'), "Issue automatically set to status '" . Status::getStatusTitle(7) . "' due to ({$day_limit}) day inactivity ");
Notification::notify($issue[0], 'closed');
}
$c++;
}
$killed_id = Status::getStatusID('Killed');
$sql = "SELECT \n\t\t\tiss_id\n\t\tFROM \n\t\t\t`ev_issue` \n\t\t\tleft join ev_status on sta_id = `iss_sta_id` \n\t\twhere \n\t\t\tsta_is_closed = 1\n\t\t\tand `iss_sta_id` = '{$killed_id}'\n\t\t";
$issues = $GLOBALS["db_api"]->dbh->getCol($sql);
foreach ($issues as $issue) {
$GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue` where iss_id = '" . $issue . "'");
$GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_subscription` where sub_iss_id = '" . $issue . "'");
$GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue_user` where isu_iss_id = '" . $issue . "'");
$GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue_history` where his_iss_id = '" . $issue . "'");
$GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue_user_replier` where iur_iss_id = '" . $issue . "'");
示例8:
$info = $GLOBALS["db_api"]->dbh->getOne($stmt);
if (PEAR::isError($info)) {
Error_Handler::logError(array($info->getMessage(), $info->getDebugInfo()), __FILE__, __LINE__);
return false;
} else {
$target_usr_id = $info;
$newstatus = 8;
$_REQUEST["target"] = "replace";
}
}
}
// check if issue is assigned to someone else and if so, confirm change.
$assigned_user_ids = Issue::getAssignedUserIDs($issue_id);
if (count($assigned_user_ids) > 0 && empty($_REQUEST["target"]) && !$_REQUEST['assigntomerc']) {
$tpl->assign(array("prompt_override" => 1, "assigned_users" => Issue::getAssignedUsers($issue_id)));
} else {
// force assignment change
if (@$_REQUEST["target"] == "replace") {
// remove current user(s) first
Issue::deleteUserAssociations($issue_id, $usr_id);
}
$res = Issue::addUserAssociation($usr_id, $issue_id, $target_usr_id);
$tpl->assign("self_assign_result", $res);
if ($newstatus) {
$res = Issue::setStatus($issue_id, $newstatus, true);
}
Notification::subscribeUser($usr_id, $issue_id, $target_usr_id, Notification::getDefaultActions());
Workflow::handleAssignment($prj_id, $issue_id, $target_usr_id);
}
$tpl->assign("current_user_prefs", Prefs::get($usr_id));
$tpl->displayTemplate();
示例9: elseif
$tpl->assign('issue_id', $issue_id);
$tpl->assign('issue', $details);
if (!Issue::canAccess($issue_id, $usr_id) || Auth::getCurrentRole() <= User::getRoleID('Customer')) {
$tpl->setTemplate('permission_denied.tpl.html');
$tpl->displayTemplate();
exit;
}
Workflow::prePage($prj_id, 'post_note');
if ($cat == 'post_result' && !empty($_GET['post_result'])) {
$res = (int) $_GET['post_result'];
$tpl->assign('post_result', $res);
} elseif ($cat == 'post_note') {
// change status
$status = isset($_POST['new_status']) ? (int) $_POST['new_status'] : null;
if ($status) {
$res = Issue::setStatus($issue_id, $status);
if ($res != -1) {
$new_status = Status::getStatusTitle($status);
History::add($issue_id, $usr_id, 'status_changed', "Status changed to '{status}' by {user} when sending a note", array('status' => $new_status, 'user' => User::getFullName($usr_id)));
}
}
$res = Note::insertFromPost($usr_id, $issue_id);
Issue_Field::updateValues($issue_id, 'post_note', @$_REQUEST['issue_field']);
if ($res == -1) {
Misc::setMessage(ev_gettext('An error occurred while trying to run your query'), Misc::MSG_ERROR);
} else {
Misc::setMessage(ev_gettext('Thank you, the internal note was posted successfully.'), Misc::MSG_INFO);
}
$tpl->assign('post_result', $res);
// enter the time tracking entry about this phone support entry
if (!empty($_POST['time_spent'])) {