本文整理匯總了PHP中Flyspray::getTaskDetails方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::getTaskDetails方法的具體用法?PHP Flyspray::getTaskDetails怎麽用?PHP Flyspray::getTaskDetails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flyspray
的用法示例。
在下文中一共展示了Flyspray::getTaskDetails方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generate_message
//.........這裏部分代碼省略.........
foreach ($data['changes'] as $change) {
if ($change[0] == 'assigned_to_name') {
$change[1] = implode(', ', $change[1]);
$change[2] = implode(', ', $change[2]);
}
if ($change[0] == 'detailed_desc') {
$body .= $change[3] . ":\n-------\n" . $change[2] . "\n-------\n";
} else {
$body .= $change[3] . ': ' . ($change[1] ? $change[1] : '[-]') . ' -> ' . ($change[2] ? $change[2] : '[-]') . "\n";
}
}
$body .= "\n" . L('moreinfo') . "\n";
$body .= CreateURL(array('details', 'task' . $data['task_id'])) . "\n\n";
break;
case NOTIFY_TASK_CLOSED:
$body .= L('notify.taskclosed') . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $data['task']['prefix_id'] . ' - ' . $data['task']['item_summary'] . "\n";
$body .= L('userwho') . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ")\n\n";
$body .= L('reasonforclosing') . ' ' . $data['task']['resolution_name'] . "\n";
if (!empty($data['task']['closure_comment'])) {
$body .= L('closurecomment') . ' ' . $data['task']['closure_comment'] . "\n\n";
}
$body .= L('moreinfo') . "\n";
$body .= CreateURL(array('details', 'task' . $data['task_id'])) . "\n\n";
break;
case NOTIFY_TASK_REOPENED:
$body .= L('notify.taskreopened') . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $data['task']['prefix_id'] . ' - ' . $data['task']['item_summary'] . "\n";
$body .= L('userwho') . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ")\n\n";
$body .= L('moreinfo') . "\n";
$body .= CreateURL(array('details', 'task' . $data['task_id'])) . "\n\n";
break;
case NOTIFY_DEP_ADDED:
$depend_task = Flyspray::getTaskDetails($data['dep_task']);
$body .= L('newdep') . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $data['task']['prefix_id'] . ' - ' . $data['task']['item_summary'] . "\n";
$body .= L('userwho') . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ")\n";
$body .= CreateURL(array('details', 'task' . $data['task_id'])) . "\n\n\n";
$body .= L('newdepis') . ':' . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $depend_task['prefix_id'] . ' - ' . $depend_task['item_summary'] . "\n";
$body .= CreateURL(array('details', 'task' . $depend_task['task_id'])) . "\n\n";
break;
case NOTIFY_DEP_REMOVED:
$depend_task = Flyspray::getTaskDetails($data['dep_task']);
$body .= L('notify.depremoved') . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $data['task']['prefix_id'] . ' - ' . $data['task']['item_summary'] . "\n";
$body .= L('userwho') . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ")\n";
$body .= CreateURL(array('details', 'task' . $data['task_id'])) . "\n\n\n";
$body .= L('removeddepis') . ':' . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $depend_task['prefix_id'] . ' - ' . $depend_task['item_summary'] . "\n";
$body .= CreateURL(array('details', 'task' . $depend_task['task_id'])) . "\n\n";
break;
case NOTIFY_COMMENT_ADDED:
// Get the comment information
$comment = $db->x->getRow('SELECT comment_text FROM {comments} WHERE comment_id = ?', null, $data['cid']);
$body .= L('notify.commentadded') . "\n\n";
$body .= $data['task']['project_prefix'] . '#' . $data['task']['prefix_id'] . ' - ' . $data['task']['item_summary'] . "\n";
$body .= L('userwho') . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ")\n\n";
$body .= "----------\n";
$body .= $comment['comment_text'] . "\n";
$body .= "----------\n\n";
if (isset($data['files'])) {
$body .= L('fileaddedtoo') . "\n\n";
$subject .= ' (' . L('attachmentadded') . ')';
}
$body .= L('moreinfo') . "\n";
示例2: GenerateMsg
function GenerateMsg($type, $task_id, $arg1 = '0', $lang)
{
global $db, $fs, $user, $proj;
// Get the task details
$task_details = Flyspray::getTaskDetails($task_id);
if ($task_id) {
$proj = new Project($task_details['project_id']);
}
// Set the due date correctly
if ($task_details['due_date'] == '0') {
$due_date = tL('undecided', $lang);
} else {
$due_date = formatDate($task_details['due_date']);
}
// Set the due version correctly
if ($task_details['closedby_version'] == '0') {
$task_details['due_in_version_name'] = tL('undecided', $lang);
}
// Get the string of modification
$notify_type_msg = array(0 => tL('none'), NOTIFY_TASK_OPENED => tL('taskopened', $lang), NOTIFY_TASK_CHANGED => tL('pm.taskchanged', $lang), NOTIFY_TASK_CLOSED => tL('taskclosed', $lang), NOTIFY_TASK_REOPENED => tL('pm.taskreopened', $lang), NOTIFY_DEP_ADDED => tL('pm.depadded', $lang), NOTIFY_DEP_REMOVED => tL('pm.depremoved', $lang), NOTIFY_COMMENT_ADDED => tL('commentadded', $lang), NOTIFY_ATT_ADDED => tL('attachmentadded', $lang), NOTIFY_REL_ADDED => tL('relatedadded', $lang), NOTIFY_OWNERSHIP => tL('ownershiptaken', $lang), NOTIFY_PM_REQUEST => tL('pmrequest', $lang), NOTIFY_PM_DENY_REQUEST => tL('pmrequestdenied', $lang), NOTIFY_NEW_ASSIGNEE => tL('newassignee', $lang), NOTIFY_REV_DEP => tL('revdepadded', $lang), NOTIFY_REV_DEP_REMOVED => tL('revdepaddedremoved', $lang), NOTIFY_ADDED_ASSIGNEES => tL('assigneeadded', $lang));
// Generate the nofication message
if (isset($proj->prefs['notify_subject']) && !$proj->prefs['notify_subject']) {
$proj->prefs['notify_subject'] = '[%p][#%t] %s';
}
if (!isset($proj->prefs['notify_subject']) || $type == NOTIFY_CONFIRMATION || $type == NOTIFY_ANON_TASK || $type == NOTIFY_PW_CHANGE || $type == NOTIFY_NEW_USER || $type == NOTIFY_OWN_REGISTRATION) {
$subject = tL('notifyfromfs', $lang);
} else {
$subject = strtr($proj->prefs['notify_subject'], array('%p' => $proj->prefs['project_title'], '%s' => $task_details['item_summary'], '%t' => $task_id, '%a' => $notify_type_msg[$type], '%u' => $user->infos['user_name']));
}
$subject = strtr($subject, "\n", '');
/* -------------------------------
| List of notification types: |
| 1. Task opened |
| 2. Task details changed |
| 3. Task closed |
| 4. Task re-opened |
| 5. Dependency added |
| 6. Dependency removed |
| 7. Comment added |
| 8. Attachment added |
| 9. Related task added |
|10. Taken ownership |
|11. Confirmation code |
|12. PM request |
|13. PM denied request |
|14. New assignee |
|15. Reversed dep |
|16. Reversed dep removed |
|17. Added to assignees list |
|18. Anon-task opened |
|19. Password change |
|20. New user |
|21. User registration |
-------------------------------
*/
$body = tL('donotreply', $lang) . "\n\n";
$online = '';
// {{{ New task opened
if ($type == NOTIFY_TASK_OPENED) {
$body .= tL('newtaskopened', $lang) . " \n\n";
$body .= tL('userwho', $lang) . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ") \n\n";
$body .= tL('attachedtoproject', $lang) . ' - ' . $task_details['project_title'] . "\n";
$body .= tL('summary', $lang) . ' - ' . $task_details['item_summary'] . "\n";
$body .= tL('tasktype', $lang) . ' - ' . $task_details['tasktype_name'] . "\n";
$body .= tL('category', $lang) . ' - ' . $task_details['category_name'] . "\n";
$body .= tL('status', $lang) . ' - ' . $task_details['status_name'] . "\n";
$body .= tL('assignedto', $lang) . ' - ' . implode(', ', $task_details['assigned_to_name']) . "\n";
$body .= tL('operatingsystem', $lang) . ' - ' . $task_details['os_name'] . "\n";
$body .= tL('severity', $lang) . ' - ' . $task_details['severity_name'] . "\n";
$body .= tL('priority', $lang) . ' - ' . $task_details['priority_name'] . "\n";
$body .= tL('reportedversion', $lang) . ' - ' . $task_details['reported_version_name'] . "\n";
$body .= tL('dueinversion', $lang) . ' - ' . $task_details['due_in_version_name'] . "\n";
$body .= tL('duedate', $lang) . ' - ' . $due_date . "\n";
$body .= tL('details', $lang) . ' - ' . $task_details['detailed_desc'] . "\n\n";
if ($arg1 == 'files') {
$body .= tL('fileaddedtoo', $lang) . "\n\n";
$subject .= ' (' . tL('attachmentadded', $lang) . ')';
}
$body .= tL('moreinfo', $lang) . "\n";
$body .= CreateURL('details', $task_id);
$online .= tL('newtaskopened', $lang) . ". ";
$online .= tL('userwho', $lang) . ' - ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . "). ";
$online .= tL('attachedtoproject', $lang) . ' - ' . $task_details['project_title'] . ". ";
$online .= tL('summary', $lang) . ' - ' . $task_details['item_summary'];
}
// }}}
// {{{ Task details changed
if ($type == NOTIFY_TASK_CHANGED) {
$translation = array('priority_name' => tL('priority', $lang), 'severity_name' => tL('severity', $lang), 'status_name' => tL('status', $lang), 'assigned_to_name' => tL('assignedto', $lang), 'due_in_version_name' => tL('dueinversion', $lang), 'reported_version_name' => tL('reportedversion', $lang), 'tasktype_name' => tL('tasktype', $lang), 'os_name' => tL('operatingsystem', $lang), 'category_name' => tL('category', $lang), 'due_date' => tL('duedate', $lang), 'percent_complete' => tL('percentcomplete', $lang), 'mark_private' => tL('visibility', $lang), 'item_summary' => tL('summary', $lang), 'detailed_desc' => tL('taskedited', $lang), 'project_title' => tL('attachedtoproject', $lang), 'estimated_effort' => tL('estimatedeffort', $lang));
$body .= tL('taskchanged', $lang) . "\n\n";
$body .= 'FS#' . $task_id . ' - ' . $task_details['item_summary'] . "\n";
$body .= tL('userwho', $lang) . ': ' . $user->infos['real_name'] . ' (' . $user->infos['user_name'] . ")\n";
$online .= tL('taskchanged', $lang) . ". ";
$online .= 'FS#' . $task_id . ' - ' . $task_details['item_summary'];
foreach ($arg1 as $change) {
if ($change[0] == 'assigned_to_name') {
$change[1] = implode(', ', $change[1]);
$change[2] = implode(', ', $change[2]);
}
if ($change[0] == 'detailed_desc') {
//.........這裏部分代碼省略.........