本文整理汇总了PHP中Notification::notifyIssueUpdated方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::notifyIssueUpdated方法的具体用法?PHP Notification::notifyIssueUpdated怎么用?PHP Notification::notifyIssueUpdated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::notifyIssueUpdated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateFromPost
/**
* Updates custom field values from the $_POST array.
*/
public static function updateFromPost($send_notification = false)
{
if (isset($_POST['custom_fields'])) {
$updated_fields = self::updateValues($_POST['issue_id'], $_POST['custom_fields']);
if ($send_notification) {
Notification::notifyIssueUpdated($_POST['issue_id'], array(), array(), $updated_fields);
}
return $updated_fields;
}
}
示例2: update
//.........这里部分代码省略.........
Workflow::handleSeverityChange($prj_id, $issue_id, $usr_id, $current, $_POST);
}
if (isset($_POST['scheduled_release']) && $current['iss_pre_id'] != $_POST['scheduled_release']) {
$updated_fields['Scheduled Release'] = History::formatChanges(Release::getTitle($current['iss_pre_id']), Release::getTitle($_POST['scheduled_release']));
}
if (isset($_POST['status']) && $current['iss_sta_id'] != $_POST['status']) {
// clear out the last-triggered-reminder flag when changing the status of an issue
Reminder_Action::clearLastTriggered($issue_id);
// if old status was closed and new status is not, clear closed data from issue.
$old_status_details = Status::getDetails($current['iss_sta_id']);
if ($old_status_details['sta_is_closed'] == 1) {
$new_status_details = Status::getDetails($_POST['status']);
if ($new_status_details['sta_is_closed'] != 1) {
self::clearClosed($issue_id);
}
}
$updated_fields['Status'] = History::formatChanges(Status::getStatusTitle($current['iss_sta_id']), Status::getStatusTitle($_POST['status']));
}
if (isset($_POST['resolution']) && $current['iss_res_id'] != $_POST['resolution']) {
$updated_fields['Resolution'] = History::formatChanges(Resolution::getTitle($current['iss_res_id']), Resolution::getTitle($_POST['resolution']));
}
if (isset($_POST['estimated_dev_time']) && $current['iss_dev_time'] != $_POST['estimated_dev_time']) {
$updated_fields['Estimated Dev. Time'] = History::formatChanges(Misc::getFormattedTime($current['iss_dev_time'] * 60), Misc::getFormattedTime($_POST['estimated_dev_time'] * 60));
}
if ($current['iss_summary'] != $_POST['summary']) {
$updated_fields['Summary'] = '';
}
if (isset($_POST['percentage_complete']) && $current['iss_original_percent_complete'] != $_POST['percentage_complete']) {
$updated_fields['Percentage complete'] = History::formatChanges($current['iss_original_percent_complete'], $_POST['percentage_complete']);
}
if ($current['iss_original_description'] != $_POST['description']) {
$updated_fields['Description'] = '';
}
if (isset($_POST['private']) && $_POST['private'] != $current['iss_private']) {
$updated_fields['Private'] = History::formatChanges(Misc::getBooleanDisplayValue($current['iss_private']), Misc::getBooleanDisplayValue($_POST['private']));
}
if (isset($_POST['product']) && count($product_changes) > 0) {
$updated_fields['Product'] = implode('; ', $product_changes);
}
if (isset($_POST['custom_fields']) && count($_POST['custom_fields']) > 0) {
$updated_custom_fields = Custom_Field::updateValues($issue_id, $_POST['custom_fields']);
} else {
$updated_custom_fields = array();
}
if (count($updated_fields) > 0) {
// log the changes
$changes = '';
$i = 0;
foreach ($updated_fields as $key => $value) {
if ($i > 0) {
$changes .= '; ';
}
if ($key != 'Summary' && $key != 'Description') {
$changes .= "{$key}: {$value}";
} else {
$changes .= "{$key}";
}
$i++;
}
History::add($issue_id, $usr_id, 'issue_updated', 'Issue updated ({changes}) by {user}', array('changes' => $changes, 'user' => User::getFullName($usr_id)));
}
if (count($updated_fields) > 0 || count($updated_custom_fields) > 0) {
// send notifications for the issue being updated
Notification::notifyIssueUpdated($issue_id, $current, $_POST, $updated_custom_fields);
}
// record group change as a separate change
if (isset($_POST['group']) && $current['iss_grp_id'] != (int) $_POST['group']) {
History::add($issue_id, $usr_id, 'group_changed', 'Group changed ({changes}) by {user}', array('changes' => History::formatChanges(Group::getName($current['iss_grp_id']), Group::getName($_POST['group'])), 'user' => User::getFullName($usr_id)));
}
// now update any duplicates, if any
$update_dupe = array('Category', 'Release', 'Priority', 'Release', 'Resolution');
$intersect = array_intersect($update_dupe, array_keys($updated_fields));
if ($current['duplicates'] != '' && count($intersect) > 0) {
self::updateDuplicates($issue_id);
}
// if there is customer integration, mark last customer action
if (CRM::hasCustomerIntegration($prj_id) && User::getRoleByUser($usr_id, $prj_id) == User::ROLE_CUSTOMER) {
self::recordLastCustomerAction($issue_id);
}
if ($assignments_changed) {
// XXX: we may want to also send the email notification for those "new" assignees
Workflow::handleAssignmentChange(self::getProjectID($issue_id), $issue_id, $usr_id, self::getDetails($issue_id), @$_POST['assignments'], false);
}
Workflow::handleIssueUpdated($prj_id, $issue_id, $usr_id, $current, $_POST);
// Move issue to another project
if (isset($_POST['move_issue']) and User::getRoleByUser($usr_id, $prj_id) >= User::ROLE_DEVELOPER) {
$new_prj_id = (int) @$_POST['new_prj'];
if ($prj_id != $new_prj_id && array_key_exists($new_prj_id, Project::getAssocList($usr_id))) {
if (User::getRoleByUser($usr_id, $new_prj_id) >= User::ROLE_REPORTER) {
$res = self::moveIssue($issue_id, $new_prj_id);
if ($res == -1) {
return $res;
}
} else {
return -1;
}
}
}
return 1;
}
示例3: update
//.........这里部分代码省略.........
if (@$HTTP_POST_VARS["keep"] == "no") {
$stmt .= "iss_pre_id=" . Misc::escapeInteger($HTTP_POST_VARS["release"]) . ",";
}
if (!empty($HTTP_POST_VARS['expected_resolution_date'])) {
$stmt .= "iss_expected_resolution_date='" . Misc::escapeString($HTTP_POST_VARS['expected_resolution_date']) . "',";
} else {
$stmt .= "iss_expected_resolution_date=null,";
}
$stmt .= "\n iss_pre_id=" . Misc::escapeInteger($HTTP_POST_VARS["release"]) . ",\n iss_pri_id=" . Misc::escapeInteger($HTTP_POST_VARS["priority"]) . ",\n iss_sta_id=" . Misc::escapeInteger($HTTP_POST_VARS["status"]) . ",\n iss_res_id=" . Misc::escapeInteger($HTTP_POST_VARS["resolution"]) . ",\n iss_summary='" . Misc::escapeString($HTTP_POST_VARS["summary"]) . "',\n iss_description='" . Misc::escapeString($HTTP_POST_VARS["description"]) . "',\n iss_dev_time='" . Misc::escapeString($HTTP_POST_VARS["estimated_dev_time"]) . "',\n iss_percent_complete= '" . Misc::escapeString($HTTP_POST_VARS["percent_complete"]) . "',\n iss_trigger_reminders=" . Misc::escapeInteger($HTTP_POST_VARS["trigger_reminders"]) . ",\n iss_grp_id ='" . Misc::escapeInteger($HTTP_POST_VARS["group"]) . "'";
if (isset($HTTP_POST_VARS['private'])) {
$stmt .= ",\n iss_private = " . Misc::escapeInteger($HTTP_POST_VARS['private']);
}
$stmt .= "\n WHERE\n iss_id={$issue_id}";
$res = $GLOBALS["db_api"]->dbh->query($stmt);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return -1;
} else {
// add change to the history (only for changes on specific fields?)
$updated_fields = array();
if ($current["iss_expected_resolution_date"] != $HTTP_POST_VARS['expected_resolution_date']) {
$updated_fields["Expected Resolution Date"] = History::formatChanges($current["iss_expected_resolution_date"], $HTTP_POST_VARS['expected_resolution_date']);
}
if ($current["iss_prc_id"] != $HTTP_POST_VARS["category"]) {
$updated_fields["Category"] = History::formatChanges(Category::getTitle($current["iss_prc_id"]), Category::getTitle($HTTP_POST_VARS["category"]));
}
if ($current["iss_pre_id"] != $HTTP_POST_VARS["release"]) {
$updated_fields["Release"] = History::formatChanges(Release::getTitle($current["iss_pre_id"]), Release::getTitle($HTTP_POST_VARS["release"]));
}
if ($current["iss_pri_id"] != $HTTP_POST_VARS["priority"]) {
$updated_fields["Priority"] = History::formatChanges(Priority::getTitle($current["iss_pri_id"]), Priority::getTitle($HTTP_POST_VARS["priority"]));
Workflow::handlePriorityChange($prj_id, $issue_id, $usr_id, $current, $HTTP_POST_VARS);
}
if ($current["iss_sta_id"] != $HTTP_POST_VARS["status"]) {
// clear out the last-triggered-reminder flag when changing the status of an issue
Reminder_Action::clearLastTriggered($issue_id);
// if old status was closed and new status is not, clear closed data from issue.
$old_status_details = Status::getDetails($current['iss_sta_id']);
if ($old_status_details['sta_is_closed'] == 1) {
$new_status_details = Status::getDetails($HTTP_POST_VARS["status"]);
if ($new_status_details['sta_is_closed'] != 1) {
Issue::clearClosed($issue_id);
}
}
$updated_fields["Status"] = History::formatChanges(Status::getStatusTitle($current["iss_sta_id"]), Status::getStatusTitle($HTTP_POST_VARS["status"]));
}
if ($current["iss_res_id"] != $HTTP_POST_VARS["resolution"]) {
$updated_fields["Resolution"] = History::formatChanges(Resolution::getTitle($current["iss_res_id"]), Resolution::getTitle($HTTP_POST_VARS["resolution"]));
}
if ($current["iss_dev_time"] != $HTTP_POST_VARS["estimated_dev_time"]) {
$updated_fields["Estimated Dev. Time"] = History::formatChanges(Misc::getFormattedTime($current["iss_dev_time"] * 60), Misc::getFormattedTime($HTTP_POST_VARS["estimated_dev_time"] * 60));
}
if ($current["iss_summary"] != $HTTP_POST_VARS["summary"]) {
$updated_fields["Summary"] = '';
}
if ($current["iss_description"] != $HTTP_POST_VARS["description"]) {
$updated_fields["Description"] = '';
}
if (count($updated_fields) > 0) {
// log the changes
$changes = '';
$i = 0;
foreach ($updated_fields as $key => $value) {
if ($i > 0) {
$changes .= "; ";
}
if ($key != "Summary" && $key != "Description") {
$changes .= "{$key}: {$value}";
} else {
$changes .= "{$key}";
}
$i++;
}
History::add($issue_id, $usr_id, History::getTypeID('issue_updated'), "Issue updated ({$changes}) by " . User::getFullName($usr_id));
// send notifications for the issue being updated
Notification::notifyIssueUpdated($issue_id, $current, $HTTP_POST_VARS);
}
// record group change as a seperate change
if ($current["iss_grp_id"] != $HTTP_POST_VARS["group"]) {
History::add($issue_id, $usr_id, History::getTypeID('group_changed'), "Group changed (" . History::formatChanges(Group::getName($current["iss_grp_id"]), Group::getName($HTTP_POST_VARS["group"])) . ") by " . User::getFullName($usr_id));
}
// now update any duplicates, if any
$update_dupe = array('Category', 'Release', 'Priority', 'Release', 'Resolution');
// COMPAT: the following line requires PHP > 4.0.4
$intersect = array_intersect($update_dupe, array_keys($updated_fields));
if ($current["duplicates"] != '' && count($intersect) > 0) {
Issue::updateDuplicates($issue_id);
}
// if there is customer integration, mark last customer action
if (Customer::hasCustomerIntegration($prj_id) && User::getRoleByUser($usr_id, $prj_id) == User::getRoleID('Customer')) {
Issue::recordLastCustomerAction($issue_id);
}
if ($assignments_changed) {
// XXX: we may want to also send the email notification for those "new" assignees
Workflow::handleAssignmentChange(Issue::getProjectID($issue_id), $issue_id, $usr_id, Issue::getDetails($issue_id), @$HTTP_POST_VARS['assignments'], false);
}
Workflow::handleIssueUpdated($prj_id, $issue_id, $usr_id, $current, $HTTP_POST_VARS);
return 1;
}
}