本文整理汇总了PHP中Status::getStatusTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::getStatusTitle方法的具体用法?PHP Status::getStatusTitle怎么用?PHP Status::getStatusTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::getStatusTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bulkUpdate
/**
* Method used to bulk update a list of issues
*
* @return boolean
*/
public static function bulkUpdate()
{
// check if user performing this chance has the proper role
if (Auth::getCurrentRole() < User::ROLE_MANAGER) {
return -1;
}
$items = (array) $_POST['item'];
$new_status_id = (int) $_POST['status'];
$new_release_id = (int) $_POST['release'];
$new_priority_id = (int) $_POST['priority'];
$new_category_id = (int) $_POST['category'];
foreach ($items as $issue_id) {
$issue_id = (int) $issue_id;
if (!self::canAccess($issue_id, Auth::getUserID())) {
continue;
}
if (self::getProjectID($issue_id) != Auth::getCurrentProject()) {
// make sure issue is not in another project
continue;
}
$issue_details = self::getDetails($issue_id);
$updated_fields = array();
// update assignment
if (count(@$_POST['users']) > 0) {
$users = (array) $_POST['users'];
// get who this issue is currently assigned too
$stmt = 'SELECT
isu_usr_id,
usr_full_name
FROM
{{%issue_user}},
{{%user}}
WHERE
isu_usr_id = usr_id AND
isu_iss_id = ?';
try {
$current_assignees = DB_Helper::getInstance()->getPair($stmt, array($issue_id));
} catch (DbException $e) {
return -1;
}
foreach ($current_assignees as $usr_id => $usr_name) {
if (!in_array($usr_id, $users)) {
self::deleteUserAssociation($issue_id, $usr_id, false);
}
}
$new_user_names = array();
$new_assignees = array();
foreach ($users as $usr_id) {
$usr_id = (int) $usr_id;
$new_user_names[$usr_id] = User::getFullName($usr_id);
// check if the issue is already assigned to this person
$stmt = 'SELECT
COUNT(*) AS total
FROM
{{%issue_user}}
WHERE
isu_iss_id=? AND
isu_usr_id=?';
$total = DB_Helper::getInstance()->getOne($stmt, array($issue_id, $usr_id));
if ($total > 0) {
continue;
} else {
$new_assignees[] = $usr_id;
// add the assignment
self::addUserAssociation(Auth::getUserID(), $issue_id, $usr_id, false);
Notification::subscribeUser(Auth::getUserID(), $issue_id, $usr_id, Notification::getAllActions());
}
}
$prj_id = Auth::getCurrentProject();
$usr_ids = self::getAssignedUserIDs($issue_id);
Workflow::handleAssignmentChange($prj_id, $issue_id, Auth::getUserID(), $issue_details, $usr_ids, false);
Notification::notifyNewAssignment($new_assignees, $issue_id);
$updated_fields['Assignment'] = History::formatChanges(implode(', ', $current_assignees), implode(', ', $new_user_names));
}
// update status
if ($new_status_id) {
$old_status_id = self::getStatusID($issue_id);
$res = self::setStatus($issue_id, $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 ($new_release_id) {
$old_release_id = self::getRelease($issue_id);
$res = self::setRelease($issue_id, $new_release_id);
if ($res == 1) {
$updated_fields['Release'] = History::formatChanges(Release::getTitle($old_release_id), Release::getTitle($new_release_id));
}
}
// update priority
if ($new_priority_id) {
$old_priority_id = self::getPriority($issue_id);
$res = self::setPriority($issue_id, $new_priority_id);
if ($res == 1) {
//.........这里部分代码省略.........
示例2: elseif
$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") {
if (!@empty($HTTP_GET_VARS["id"])) {
$note = Note::getDetails($HTTP_GET_VARS["id"]);
示例3: array
$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.';
Time_Tracking::addTimeEntry($issue_id, $ttc_id, $time_spent, $date, $summary);
}
示例4: elseif
$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));
$tpl->assign('selfnotify_result', $res);
}
示例5: getAdminList
/**
* Method used to get the list of reminder actions to be displayed in the
* administration section.
*
* @access public
* @param integer $rem_id The reminder ID
* @return array The list of reminder actions
*/
function getAdminList($rem_id)
{
$stmt = "SELECT\n rma_rem_id,\n rma_id,\n rma_title,\n rmt_title,\n rma_rank,\n rma_alert_irc,\n rma_alert_group_leader\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_action,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_action_type\n WHERE\n rma_rmt_id=rmt_id AND\n rma_rem_id=" . Misc::escapeInteger($rem_id) . "\n ORDER BY\n rma_rank ASC";
$res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return array();
} else {
for ($i = 0; $i < count($res); $i++) {
$conditions = Reminder_Condition::getList($res[$i]['rma_id']);
$res[$i]['total_conditions'] = count($conditions);
foreach ($conditions as $condition) {
if ($condition['rmf_sql_field'] == 'iss_sta_id') {
$res[$i]['status'] = Status::getStatusTitle($condition['rlc_value']);
}
}
}
return $res;
}
}
示例6: elseif
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));
}
$tpl->assign("new_status_result", $res);
} elseif (@$HTTP_GET_VARS['cat'] == 'authorize_reply') {
示例7:
$show_category = 0;
}
$cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE);
if (!empty($auto_switched_from)) {
$tpl->assign(array("project_auto_switched" => 1, "old_project" => Project::getName($auto_switched_from)));
}
$setup = Setup::load();
$tpl->assign("allow_unassigned_issues", @$setup["allow_unassigned_issues"]);
$tpl->assign(array('next_issue' => @$sides['next'], 'previous_issue' => @$sides['previous'], 'subscribers' => Notification::getSubscribers($issue_id), 'custom_fields' => Custom_Field::getListByIssue($prj_id, $issue_id), 'files' => Attachment::getList($issue_id), 'emails' => Support::getEmailsByIssue($issue_id), 'zones' => Date_API::getTimezoneList(), 'users' => Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')), 'ema_id' => Email_Account::getEmailAccount(), 'max_attachment_size' => Attachment::getMaxAttachmentSize(), 'show_releases' => $show_releases, 'show_category' => $show_category, 'categories' => Category::getAssocList($prj_id), 'quarantine' => Issue::getQuarantineInfo($issue_id)));
if ($role_id != User::getRoleID('customer')) {
if (@$_REQUEST['show_all_drafts'] == 1) {
$show_all_drafts = true;
} else {
$show_all_drafts = false;
}
if (Workflow::hasWorkflowIntegration($prj_id)) {
$statuses = Workflow::getAllowedStatuses($prj_id, $issue_id);
// if currently selected release is not on list, go ahead and add it.
} else {
$statuses = Status::getAssocStatusList($prj_id);
}
if (!empty($details['iss_sta_id']) && empty($statuses[$details['iss_sta_id']])) {
$statuses[$details['iss_sta_id']] = Status::getStatusTitle($details['iss_sta_id']);
}
$time_entries = Time_Tracking::getListing($issue_id);
$tpl->assign(array('notes' => Note::getListing($issue_id), 'is_user_assigned' => Issue::isAssignedToUser($issue_id, $usr_id), 'is_user_authorized' => Authorized_Replier::isUserAuthorizedReplier($issue_id, $usr_id), 'phone_entries' => Phone_Support::getListing($issue_id), 'phone_categories' => Phone_Support::getCategoryAssocList($prj_id), 'checkins' => SCM::getCheckinList($issue_id), 'time_categories' => Time_Tracking::getAssocCategories(), 'time_entries' => $time_entries['list'], 'total_time_spent' => $time_entries['total_time_spent'], 'impacts' => Impact_Analysis::getListing($issue_id), 'statuses' => $statuses, 'drafts' => Draft::getList($issue_id, $show_all_drafts), 'groups' => Group::getAssocList($prj_id)));
}
}
}
}
$tpl->displayTemplate();
示例8: getAdminList
/**
* Method used to get the list of reminder conditions to be displayed in the
* administration section.
*
* @access public
* @param integer $rma_id The reminder action ID
* @return array The list of reminder conditions
*/
function getAdminList($rma_id)
{
$stmt = "SELECT\n rlc_id,\n rlc_value,\n rlc_comparison_rmf_id,\n rmf_title,\n rmo_title\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_level_condition,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_field,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "reminder_operator\n WHERE\n rlc_rmf_id=rmf_id AND\n rlc_rmo_id=rmo_id AND\n rlc_rma_id=" . Misc::escapeInteger($rma_id) . "\n ORDER BY\n rlc_id ASC";
$res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return array();
} else {
for ($i = 0; $i < count($res); $i++) {
if (!empty($res[$i]['rlc_comparison_rmf_id'])) {
$res[$i]['rlc_value'] = 'Field: ' . Reminder_Condition::getFieldTitle($res[$i]['rlc_comparison_rmf_id']);
} elseif (strtolower($res[$i]['rmf_title']) == 'status') {
$res[$i]['rlc_value'] = Status::getStatusTitle($res[$i]['rlc_value']);
} elseif (strtolower($res[$i]['rmf_title']) == 'category') {
$res[$i]['rlc_value'] = Category::getTitle($res[$i]['rlc_value']);
} elseif (strtoupper($res[$i]['rlc_value']) != 'NULL') {
$res[$i]['rlc_value'] .= ' hours';
}
}
return $res;
}
}
示例9: 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));
//.........这里部分代码省略.........
示例10: getAdminList
/**
* Method used to get the list of reminder actions to be displayed in the
* administration section.
*
* @param integer $rem_id The reminder ID
* @return array The list of reminder actions
*/
public static function getAdminList($rem_id)
{
$stmt = 'SELECT
rma_rem_id,
rma_id,
rma_title,
rmt_title,
rma_rank,
rma_alert_irc,
rma_alert_group_leader
FROM
{{%reminder_action}},
{{%reminder_action_type}}
WHERE
rma_rmt_id=rmt_id AND
rma_rem_id=?
ORDER BY
rma_rank ASC';
try {
$res = DB_Helper::getInstance()->getAll($stmt, array($rem_id));
} catch (DbException $e) {
return array();
}
foreach ($res as &$row) {
$conditions = Reminder_Condition::getList($row['rma_id']);
$row['total_conditions'] = count($conditions);
foreach ($conditions as $condition) {
if ($condition['rmf_sql_field'] == 'iss_sta_id') {
$row['status'] = Status::getStatusTitle($condition['rlc_value']);
}
}
}
return $res;
}
示例11: subdate
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 . "'");
$k++;
}
示例12: getAdminList
/**
* Method used to get the list of reminder conditions to be displayed in the
* administration section.
*
* @param integer $rma_id The reminder action ID
* @return array The list of reminder conditions
*/
public static function getAdminList($rma_id)
{
$stmt = 'SELECT
rlc_id,
rlc_value,
rlc_comparison_rmf_id,
rmf_title,
rmo_title
FROM
{{%reminder_level_condition}},
{{%reminder_field}},
{{%reminder_operator}}
WHERE
rlc_rmf_id=rmf_id AND
rlc_rmo_id=rmo_id AND
rlc_rma_id=?
ORDER BY
rlc_id ASC';
try {
$res = DB_Helper::getInstance()->getAll($stmt, array($rma_id));
} catch (DbException $e) {
return array();
}
foreach ($res as &$row) {
if (!empty($row['rlc_comparison_rmf_id'])) {
$row['rlc_value'] = ev_gettext('Field') . ': ' . self::getFieldTitle($row['rlc_comparison_rmf_id']);
} elseif (strtolower($row['rmf_title']) == 'status') {
$row['rlc_value'] = Status::getStatusTitle($row['rlc_value']);
} elseif (strtolower($row['rmf_title']) == 'category') {
$row['rlc_value'] = Category::getTitle($row['rlc_value']);
} elseif (strtolower($row['rmf_title']) == 'group' || strtolower($row['rmf_title']) == 'active group') {
$row['rlc_value'] = Group::getName($row['rlc_value']);
} elseif (strtoupper($row['rlc_value']) != 'NULL') {
$row['rlc_value'] .= ' ' . ev_gettext('hours');
}
}
return $res;
}
示例13: notifyStatusChange
/**
* Method used to send a diff-style notification email to the issue
* subscribers about status changes
*
* @param integer $issue_id The issue ID
* @param int $old_status The old issue status
* @param int $new_status The new issue status
* @return bool
*/
public static function notifyStatusChange($issue_id, $old_status, $new_status)
{
$diffs = array();
if ($old_status != $new_status) {
$diffs[] = '-Status: ' . Status::getStatusTitle($old_status);
$diffs[] = '+Status: ' . Status::getStatusTitle($new_status);
}
if (count($diffs) < 1) {
return false;
}
$prj_id = Issue::getProjectID($issue_id);
$emails = array();
$users = self::getUsersByIssue($issue_id, 'updated');
foreach ($users as $user) {
if (empty($user['sub_usr_id'])) {
$email = $user['sub_email'];
} else {
$prefs = Prefs::get($user['sub_usr_id']);
if (Auth::getUserID() == $user['sub_usr_id'] && (empty($prefs['receive_copy_of_own_action'][$prj_id]) || $prefs['receive_copy_of_own_action'][$prj_id] == false)) {
continue;
}
$email = User::getFromHeader($user['sub_usr_id']);
}
// now add it to the list of emails
if (!empty($email) && !in_array($email, $emails)) {
$emails[] = $email;
}
}
$data = Issue::getDetails($issue_id);
$data['diffs'] = implode("\n", $diffs);
$data['updated_by'] = User::getFullName(Auth::getUserID());
self::notifySubscribers($issue_id, $emails, 'updated', $data, 'Status Change', false);
}
示例14: notifyStatusChange
/**
* Method used to send a diff-style notification email to the issue
* subscribers about status changes
*
* @access public
* @param integer $issue_id The issue ID
* @param array $old_status The old issue status
* @param array $new_status The new issue status
*/
function notifyStatusChange($issue_id, $old_status, $new_status)
{
$diffs = array();
if ($old_status != $new_status) {
$diffs[] = '-Status: ' . Status::getStatusTitle($old_status);
$diffs[] = '+Status: ' . Status::getStatusTitle($new_status);
}
if (count($diffs) < 1) {
return false;
}
$emails = array();
$users = Notification::getUsersByIssue($issue_id, 'updated');
$user_emails = Project::getUserEmailAssocList(Issue::getProjectID($issue_id), 'active', User::getRoleID('Customer'));
$user_emails = array_map('strtolower', $user_emails);
for ($i = 0; $i < count($users); $i++) {
if (empty($users[$i]["sub_usr_id"])) {
$email = $users[$i]["sub_email"];
} else {
$email = User::getFromHeader($users[$i]["sub_usr_id"]);
}
// now add it to the list of emails
if (!empty($email) && !in_array($email, $emails)) {
$emails[] = $email;
}
}
$data = Notification::getIssueDetails($issue_id);
$data['diffs'] = implode("\n", $diffs);
$data['updated_by'] = User::getFullName(Auth::getUserID());
Notification::notifySubscribers($issue_id, $emails, 'updated', $data, 'Status Change', FALSE);
}
示例15: elseif
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'])) {
if (isset($_POST['time_summary']) && !empty($_POST['time_summary'])) {
$summary = (string) $_POST['time_summary'];