예제 #1
0
/**
* Prepares issue data for display.
*
* @param	array	Issue data without any processing
*
* @return	array	Processed issue data
*/
function prepare_issue($issue)
{
    global $vbulletin, $vbphrase, $stylevar;
    if ($vbulletin->options['wordwrap'] != 0) {
        $issue['title'] = fetch_word_wrapped_string($issue['title']);
        $issue['summary'] = fetch_word_wrapped_string($issue['summary']);
    }
    $issue['title'] = fetch_censored_text($issue['title']);
    $issue['summary'] = fetch_censored_text($issue['summary']);
    $issue['lastposttime'] = vbdate($vbulletin->options['timeformat'], $issue['lastpost']);
    $issue['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $issue['lastpost'], true);
    // post reply date/time (for search results as posts mainly)
    if ($issue['submitdate']) {
        $issue['submittime'] = vbdate($vbulletin->options['timeformat'], $issue['submitdate']);
        $issue['submitdate'] = vbdate($vbulletin->options['dateformat'], $issue['submitdate'], true);
    } else {
        $issue['submitdate'] = '';
        $issue['submittime'] = '';
    }
    $issue['replycount'] = vb_number_format($issue['replycount']);
    $issue['attachcount'] = vb_number_format($issue['attachcount']);
    if ($typeicon = $vbulletin->pt_issuetype["{$issue['issuetypeid']}"]['iconfile']) {
        $issue['typeicon'] = $typeicon;
    }
    $issue['issuetype'] = $vbphrase["issuetype_{$issue['issuetypeid']}_singular"];
    $issue['status'] = $vbphrase["issuestatus{$issue['issuestatusid']}"];
    $issue = fetch_issue_version_text($issue);
    if (!$issue['projectcategoryid']) {
        $issue['categorytitle'] = $vbphrase['unknown'];
    }
    $issue['priority_text'] = $vbphrase["priority_{$issue['priority']}"];
    if (!$issue['milestoneid']) {
        $issue['milestonetitle'] = $vbphrase['none_meta'];
    }
    $issue['lastread'] = issue_lastview($issue);
    $issue['newflag'] = $issue['lastpost'] > $issue['lastread'];
    ($hook = vBulletinHook::fetch_hook('project_issue_prepare')) ? eval($hook) : false;
    return $issue;
}
예제 #2
0
         $optionselected = $issue['appliesversionid'] == $optionvalue ? ' selected="selected"' : '';
         eval('$group_applies .= "' . fetch_template('option') . '";');
         $optionselected = ($issue['isaddressed'] and $issue['addressedversionid'] == $optionvalue) ? ' selected="selected"' : '';
         eval('$group_addressed .= "' . fetch_template('option') . '";');
     }
     $optgroup_options = $group_applies;
     eval('$applies_versions .= "' . fetch_template('optgroup') . '";');
     $optgroup_options = $group_addressed;
     eval('$addressed_versions .= "' . fetch_template('optgroup') . '";');
 }
 $applies_unknown_selected = $issue['appliesversionid'] == 0 ? ' selected="selected"' : '';
 if ($posting_perms['status_edit']) {
     $addressed_unaddressed_selected = $issue['isaddressed'] == 0 ? ' selected="selected"' : '';
     $addressed_next_selected = ($issue['isaddressed'] == 1 and $issue['addressedversionid'] == 0) ? ' selected="selected"' : '';
 }
 $issue = fetch_issue_version_text($issue);
 // set up appliable tags
 $unapplied_tags = '';
 $applied_tags = '';
 $tag_data = $db->query_read("\r\n\t\tSELECT tag.tagtext, IF(issuetag.tagid IS NOT NULL, 1, 0) AS isapplied\r\n\t\tFROM " . TABLE_PREFIX . "pt_tag AS tag\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "pt_issuetag AS issuetag ON (issuetag.tagid = tag.tagid AND issuetag.issueid = {$issue['issueid']})\r\n\t\tORDER BY tag.tagtext\r\n\t");
 $optionselected = '';
 $optionclass = '';
 while ($tag = $db->fetch_array($tag_data)) {
     $optionvalue = $optiontitle = $tag['tagtext'];
     if (!defined('IS_PREVIEW') and $tag['isapplied'] or defined('IS_PREVIEW') and isset($preview_tags["{$tag['tagtext']}"])) {
         unset($preview_tags["{$tag['tagtext']}"]);
         eval('$applied_tags .= "' . fetch_template('option') . '";');
     } else {
         eval('$unapplied_tags .= "' . fetch_template('option') . '";');
     }
 }