本文整理汇总了PHP中Release::isAssignable方法的典型用法代码示例。如果您正苦于以下问题:PHP Release::isAssignable方法的具体用法?PHP Release::isAssignable怎么用?PHP Release::isAssignable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Release
的用法示例。
在下文中一共展示了Release::isAssignable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDetails
//.........这里部分代码省略.........
LEFT JOIN
{{%project_category}}
ON
iss_prc_id=prc_id
LEFT JOIN
{{%project_release}}
ON
iss_pre_id=pre_id
WHERE
iss_id=? AND
iss_prj_id=prj_id';
try {
$res = DB_Helper::getInstance()->getRow($stmt, array($issue_id));
} catch (DbException $e) {
return '';
}
if (empty($res)) {
return '';
}
$created_date_ts = Date_Helper::getUnixTimestamp($res['iss_created_date'], Date_Helper::getDefaultTimezone());
// get customer information, if any
if (!empty($res['iss_customer_id']) && CRM::hasCustomerIntegration($res['iss_prj_id'])) {
$crm = CRM::getInstance($res['iss_prj_id']);
try {
$customer = $crm->getCustomer($res['iss_customer_id']);
$contract = $crm->getContract($res['iss_customer_contract_id']);
$res['contact_local_time'] = Date_Helper::getFormattedDate(Date_Helper::getCurrentDateGMT(), $res['iss_contact_timezone']);
$res['customer'] = $customer;
$res['contract'] = $contract;
$res['contact'] = $crm->getContact($res['iss_customer_contact_id']);
// TODOCRM: Deal with incidents
// $res['redeemed_incidents'] = Customer::getRedeemedIncidentDetails($res['iss_prj_id'], $res['iss_id']);
$max_first_response_time = $contract->getMaximumFirstResponseTime($issue_id);
$res['max_first_response_time'] = Misc::getFormattedTime($max_first_response_time / 60);
if (empty($res['iss_first_response_date'])) {
$first_response_deadline = $created_date_ts + $max_first_response_time;
if (time() <= $first_response_deadline) {
$res['max_first_response_time_left'] = Date_Helper::getFormattedDateDiff($first_response_deadline, time());
} else {
$res['overdue_first_response_time'] = Date_Helper::getFormattedDateDiff(time(), $first_response_deadline);
}
}
} catch (CRMException $e) {
// TODOCRM: Log exception?
}
}
$res['iss_original_description'] = $res['iss_description'];
$res['iss_original_percent_complete'] = $res['iss_percent_complete'];
$res['iss_description'] = nl2br(htmlspecialchars($res['iss_description']));
$res['iss_resolution'] = Resolution::getTitle($res['iss_res_id']);
$res['iss_impact_analysis'] = nl2br(htmlspecialchars($res['iss_impact_analysis']));
$res['iss_created_date_ts'] = $created_date_ts;
$res['assignments'] = @implode(', ', array_values(self::getAssignedUsers($res['iss_id'])));
list($res['authorized_names'], $res['authorized_repliers']) = Authorized_Replier::getAuthorizedRepliers($res['iss_id']);
$temp = self::getAssignedUsersStatus($res['iss_id']);
$res['has_inactive_users'] = 0;
$res['assigned_users'] = array();
$res['assigned_inactive_users'] = array();
foreach ($temp as $usr_id => $usr_status) {
if (!User::isActiveStatus($usr_status)) {
$res['assigned_inactive_users'][] = $usr_id;
$res['has_inactive_users'] = 1;
} else {
$res['assigned_users'][] = $usr_id;
}
}
if (@in_array(Auth::getUserID(), $res['assigned_users'])) {
$res['is_current_user_assigned'] = 1;
} else {
$res['is_current_user_assigned'] = 0;
}
$res['associated_issues_details'] = self::getAssociatedIssuesDetails($res['iss_id']);
$res['associated_issues'] = self::getAssociatedIssues($res['iss_id']);
$res['reporter'] = User::getFullName($res['iss_usr_id']);
if (empty($res['iss_updated_date'])) {
$res['iss_updated_date'] = $res['iss_created_date'];
}
$res['estimated_formatted_time'] = Misc::getFormattedTime($res['iss_dev_time']);
if (Release::isAssignable($res['iss_pre_id'])) {
$release = Release::getDetails($res['iss_pre_id']);
$res['pre_title'] = $release['pre_title'];
$res['pre_status'] = $release['pre_status'];
}
// need to return the list of issues that are duplicates of this one
$res['duplicates'] = self::getDuplicateList($res['iss_id']);
$res['duplicates_details'] = self::getDuplicateDetailsList($res['iss_id']);
// also get the issue title of the duplicated issue
if (!empty($res['iss_duplicated_iss_id'])) {
$res['duplicated_issue'] = self::getDuplicatedDetails($res['iss_duplicated_iss_id']);
}
// get group information
if (!empty($res['iss_grp_id'])) {
$res['group'] = Group::getDetails($res['iss_grp_id']);
}
// get quarantine issue
$res['quarantine'] = self::getQuarantineInfo($res['iss_id']);
$res['products'] = Product::getProductsByIssue($res['iss_id']);
$returns[$issue_id] = $res;
return $res;
}
示例2: getDetails
/**
* Method used to get the details for a specific issue.
*
* @access public
* @param integer $issue_id The issue ID
* @param boolean $force_refresh If the cache should not be used.
* @return array The details for the specified issue
*/
function getDetails($issue_id, $force_refresh = false)
{
global $HTTP_SERVER_VARS;
static $returns;
$issue_id = Misc::escapeInteger($issue_id);
if (empty($issue_id)) {
return '';
}
if (!empty($returns[$issue_id]) && $force_refresh != true) {
return $returns[$issue_id];
}
$stmt = "SELECT\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue.*,\n prj_title,\n prc_title,\n pre_title,\n pri_title,\n sta_title,\n sta_abbreviation,\n sta_color status_color,\n sta_is_closed,\n\t\t\t\t\tsup_id as last_sup_id,\n\t\t\t\t\tseb_body as last_seb_body,\n\t\t\t\t\tema_id,\n\t\t\t\t\ten_email as reporter_email\n FROM\n (\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project\n )\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority\n ON\n iss_pri_id=pri_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status\n ON\n iss_sta_id=sta_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category\n ON\n iss_prc_id=prc_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release\n ON\n iss_pre_id=pre_id\n LEFT JOIN\n " . ETEL_USER_TABLE_NOSUB . "\n ON\n iss_usr_id=en_ID\n LEFT JOIN\n (\n\t\t\t\t\t\tSelect sup_id,sup_iss_id,seb_body\n\t\t\t\t\t\tfrom " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email\n\t\t\t\t\t\tleft join " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email_body on seb_sup_id = sup_id \n\t\t\t\t\t\twhere sup_iss_id = {$issue_id} order by sup_date desc\n\t\t\t\t\t) as sup\n ON\n sup_iss_id = iss_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "email_account\n ON\n ema_prj_id = iss_prj_id\n WHERE\n iss_id={$issue_id} AND\n iss_prj_id=prj_id";
$res = $GLOBALS["db_api"]->dbh->getRow($stmt, DB_FETCHMODE_ASSOC);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return "";
} else {
if (empty($res)) {
return "";
} else {
$created_date_ts = Date_API::getUnixTimestamp($res['iss_created_date'], Date_API::getDefaultTimezone());
// get customer information, if any
if (!empty($res['iss_customer_id']) && Customer::hasCustomerIntegration($res['iss_prj_id'])) {
$res['customer_business_hours'] = Customer::getBusinessHours($res['iss_prj_id'], $res['iss_customer_id']);
$res['contact_local_time'] = Date_API::getFormattedDate(Date_API::getCurrentDateGMT(), $res['iss_contact_timezone']);
$res['customer_info'] = Customer::getDetails($res['iss_prj_id'], $res['iss_customer_id']);
$res['redeemed_incidents'] = Customer::getRedeemedIncidentDetails($res['iss_prj_id'], $res['iss_id']);
$max_first_response_time = Customer::getMaximumFirstResponseTime($res['iss_prj_id'], $res['iss_customer_id']);
$res['max_first_response_time'] = Misc::getFormattedTime($max_first_response_time / 60);
if (empty($res['iss_first_response_date'])) {
$first_response_deadline = $created_date_ts + $max_first_response_time;
if (Date_API::getCurrentUnixTimestampGMT() <= $first_response_deadline) {
$res['max_first_response_time_left'] = Date_API::getFormattedDateDiff($first_response_deadline, Date_API::getCurrentUnixTimestampGMT());
} else {
$res['overdue_first_response_time'] = Date_API::getFormattedDateDiff(Date_API::getCurrentUnixTimestampGMT(), $first_response_deadline);
}
}
}
$res['iss_original_description'] = $res["iss_description"];
if (!strstr($HTTP_SERVER_VARS["PHP_SELF"], 'update.php')) {
$res["iss_description"] = nl2br(htmlspecialchars($res["iss_description"]));
$res["iss_resolution"] = Resolution::getTitle($res["iss_res_id"]);
}
$res["iss_impact_analysis"] = nl2br(htmlspecialchars($res["iss_impact_analysis"]));
$res["iss_created_date"] = Date_API::getFormattedDate($res["iss_created_date"]);
$res['iss_created_date_ts'] = $created_date_ts;
$res["assignments"] = @implode(", ", array_values(Issue::getAssignedUsers($res["iss_id"])));
list($res['authorized_names'], $res['authorized_repliers']) = Authorized_Replier::getAuthorizedRepliers($res["iss_id"]);
$temp = Issue::getAssignedUsersStatus($res["iss_id"]);
$res["has_inactive_users"] = 0;
$res["assigned_users"] = array();
$res["assigned_inactive_users"] = array();
foreach ($temp as $usr_id => $usr_status) {
if (!User::isActiveStatus($usr_status)) {
$res["assigned_inactive_users"][] = $usr_id;
$res["has_inactive_users"] = 1;
} else {
$res["assigned_users"][] = $usr_id;
}
}
if (@in_array(Auth::getUserID(), $res["assigned_users"])) {
$res["is_current_user_assigned"] = 1;
} else {
$res["is_current_user_assigned"] = 0;
}
$res["associated_issues_details"] = Issue::getAssociatedIssuesDetails($res["iss_id"]);
$res["associated_issues"] = Issue::getAssociatedIssues($res["iss_id"]);
$res["reporter"] = User::getFullName($res["iss_usr_id"]);
$res["email_list_details"] = Support::getFirstEmailer($issue_id);
if (!$res["reporter"]) {
$first_emailer = Support::getFirstEmailer($issue_id);
$res["reporter"] = $first_emailer . " (No Account)";
$res["reporter_email"] = preg_replace('/.*<|>/', '', $first_emailer);
}
if (empty($res["iss_updated_date"])) {
$res["iss_updated_date"] = 'not updated yet';
} else {
$res["iss_updated_date"] = Date_API::getFormattedDate($res["iss_updated_date"]);
}
$res["estimated_formatted_time"] = Misc::getFormattedTime($res["iss_dev_time"]);
if (Release::isAssignable($res["iss_pre_id"])) {
$release = Release::getDetails($res["iss_pre_id"]);
$res["pre_title"] = $release["pre_title"];
$res["pre_status"] = $release["pre_status"];
}
// need to return the list of issues that are duplicates of this one
$res["duplicates"] = Issue::getDuplicateList($res["iss_id"]);
$res["duplicates_details"] = Issue::getDuplicateDetailsList($res["iss_id"]);
// also get the issue title of the duplicated issue
if (!empty($res['iss_duplicated_iss_id'])) {
$res['duplicated_issue'] = Issue::getDuplicatedDetails($res['iss_duplicated_iss_id']);
}
//.........这里部分代码省略.........