コード例 #1
0
/**
* Fetches issue info and throws an error if it's not valid
*
* @param	integer	Issue ID
* @param	boolean	Do additional perm check for browsing user?
* @param	array	Array of extra info to fetch. See fetch_issue_info() for more information.
*
* @return	array	Issue info
*/
function verify_issue($issueid, $perm_check = true, $extra_fetch_info = array())
{
    global $vbulletin, $vbphrase;
    $issue = fetch_issue_info($issueid, $extra_fetch_info);
    if (!$issue) {
        standard_error(fetch_error('invalidid', $vbphrase['issue'], $vbulletin->options['contactuslink']));
    }
    if ($perm_check) {
        if (verify_issue_perms($issue, $vbulletin->userinfo) === false) {
            standard_error(fetch_error('invalidid', $vbphrase['issue'], $vbulletin->options['contactuslink']));
        }
    }
    ($hook = vBulletinHook::fetch_hook('project_issue_verify')) ? eval($hook) : false;
    return $issue;
}
コード例 #2
0
/**
* Sends assignment notification when a user is assigned
*
* @param	integer	Issueid to send notification for
* @param	integer	User who is being assigned this issue
* @param	integer	User who assigned this issue
*/
function send_issue_assignment_notification($issueid, $assignee, $assigner)
{
    global $vbulletin, $vbphrase;
    $issue = fetch_issue_info($issueid);
    // invalid issue
    if (!$issue) {
        return;
    }
    // no need for notification to yourself
    if ($assignee == $assigner) {
        return;
    }
    $project = fetch_project_info($issue['projectid']);
    $assignee_userinfo = fetch_userinfo($assignee);
    if (verify_issue_perms($issue, $assignee_userinfo) === false) {
        return;
    }
    $assigner_userinfo = fetch_userinfo($assigner);
    $issue['title'] = unhtmlspecialchars($issue['title']);
    $project['title'] = unhtmlspecialchars($project['title']);
    $assignee_userinfo['username'] = unhtmlspecialchars($assignee_userinfo['username']);
    $assigner_userinfo['username'] = unhtmlspecialchars($assigner_userinfo['username']);
    eval(fetch_email_phrases('pt_issueassignment', $assignee_userinfo['languageid']));
    vbmail($assignee_userinfo['email'], $subject, $message, true);
}