Пример #1
0
/**
* Shows the new subscribed PT issues in the user CP
*
* @return	string	Printable issue bits
*/
function process_new_subscribed_issues()
{
    global $vbulletin, $show, $stylevar, $vbphrase, $template_hook, $vbcollapse;
    if (!($vbulletin->userinfo['permissions']['ptpermissions'] & $vbulletin->bf_ugp_ptpermissions['canviewprojecttools'])) {
        return '';
    }
    $perms_query = build_issue_permissions_query($vbulletin->userinfo);
    if (!$perms_query) {
        return '';
    }
    $marking = ($vbulletin->options['threadmarking'] and $vbulletin->userinfo['userid']);
    if ($marking) {
        $issueview_sql = "IF(issueread IS NOT NULL, issueread, " . intval(TIMENOW - $vbulletin->options['markinglimit'] * 86400) . ")";
        $issueview_sql2 = "IF(projectread IS NOT NULL, projectread, " . intval(TIMENOW - $vbulletin->options['markinglimit'] * 86400) . ")";
    } else {
        $issueview = max(intval(fetch_bbarray_cookie('issue_lastview', $issue['issueid'])), intval(fetch_bbarray_cookie('issue_lastview', $issue['projectid'] . $issue['issuetypeid'])));
        if (!$issueview) {
            $issueview = $vbulletin->userinfo['lastvisit'];
        }
        $issueview_sql = intval($issueview);
        $issueview_sql2 = '';
    }
    build_issue_private_lastpost_sql_all($vbulletin->userinfo, $private_lastpost_join, $private_lastpost_fields);
    $replycount_clause = fetch_private_replycount_clause($vbulletin->userinfo);
    $subscriptions = $vbulletin->db->query_read("\r\n\t\tSELECT issue.*, issuesubscribe.subscribetype,\r\n\t\t\tproject.title_clean\r\n\t\t\t" . ($marking ? ", issueread.readtime AS issueread, projectread.readtime AS projectread" : '') . "\r\n\t\t\t" . ($private_lastpost_fields ? ", {$private_lastpost_fields}" : '') . "\r\n\t\t\t" . ($replycount_clause ? ", {$replycount_clause} AS replycount" : '') . "\r\n\t\tFROM " . TABLE_PREFIX . "pt_issuesubscribe AS issuesubscribe\r\n\t\tINNER JOIN " . TABLE_PREFIX . "pt_issue AS issue ON (issue.issueid = issuesubscribe.issueid)\r\n\t\tINNER JOIN " . TABLE_PREFIX . "pt_project AS project ON (project.projectid = issue.projectid)\r\n\t\t" . ($marking ? "\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "pt_issueread AS issueread ON (issueread.issueid = issue.issueid AND issueread.userid = " . $vbulletin->userinfo['userid'] . ")\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "pt_projectread as projectread ON (projectread.projectid = issue.projectid AND projectread.userid = " . $vbulletin->userinfo['userid'] . " AND projectread.issuetypeid = issue.issuetypeid)\r\n\t\t" : '') . "\r\n\t\t{$private_lastpost_join}\r\n\t\tWHERE issuesubscribe.userid = " . $vbulletin->userinfo['userid'] . "\r\n\t\t\tAND (" . implode(' OR ', $perms_query) . ")\r\n\t\tHAVING lastpost > " . intval(TIMENOW - $vbulletin->options['markinglimit'] * 86400) . "\r\n\t\t\tAND lastpost > " . $issueview_sql . "\r\n\t\t\t" . (!empty($issueview_sql2) ? " AND lastpost > " . $issueview_sql2 : '') . "\r\n\t\tORDER BY lastpost DESC\r\n\t");
    $show['issuebit_project_title'] = true;
    $subscriptionbits = '';
    while ($issue = $vbulletin->db->fetch_array($subscriptions)) {
        $issue = prepare_issue($issue);
        eval('$subscriptionbits .= "' . fetch_template('pt_issuebit') . '";');
    }
    if (!$subscriptionbits) {
        return '';
    }
    eval('$return = "' . fetch_template('pt_usercp_subscriptions') . '";');
    return $return;
}
Пример #2
0
    if ($show['search_options']) {
        $assignable_users = fetch_assignable_users_select($project['projectid']);
        $search_status_options = fetch_issue_status_search_select($projectperms);
    }
    // navbar and output
    $navbits = construct_navbits(array('project.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['projects'], "project.php?" . $vbulletin->session->vars['sessionurl'] . "projectid={$project['projectid']}" => $project['title_clean'], "projectmilestone.php?" . $vbulletin->session->vars['sessionurl'] . "milestoneid={$milestone['milestoneid']}" => $milestone['title_clean'], '' => $vbphrase['issue_list']));
    eval('$navbar = "' . fetch_template('navbar') . '";');
    eval('print_output("' . fetch_template('pt_milestone_issuelist') . '");');
}
// #######################################################################
if ($_REQUEST['do'] == 'milestone') {
    $vbulletin->input->clean_array_gpc('r', array('milestoneid' => TYPE_UINT));
    $milestone = verify_milestone($vbulletin->GPC['milestoneid']);
    $project = verify_project($milestone['projectid']);
    $projectperms = fetch_project_permissions($vbulletin->userinfo, $project['projectid']);
    $perms_query = build_issue_permissions_query($vbulletin->userinfo);
    if (empty($perms_query["{$project['projectid']}"])) {
        print_no_permission();
    }
    $milestone_types = fetch_viewable_milestone_types($projectperms);
    if (!$milestone_types) {
        print_no_permission();
    }
    $counts = fetch_milestone_count_data("\r\n\t\tmilestonetypecount.milestoneid = {$milestone['milestoneid']}\r\n\t\tAND milestonetypecount.issuetypeid IN ('" . implode("','", $milestone_types) . "')\r\n\t");
    $raw_counts = fetch_milestone_counts($counts["{$milestone['milestoneid']}"], $projectperms);
    $stats = prepare_milestone_stats($milestone, $raw_counts);
    require_once DIR . '/includes/class_pt_issuelist.php';
    $issue_list =& new vB_Pt_IssueList($project, $vbulletin);
    $issue_list->calc_total_rows = false;
    $list_criteria = $perms_query["{$project['projectid']}"] . "\r\n\t\tAND issue.milestoneid = {$milestone['milestoneid']}\r\n\t\tAND issue.issuetypeid IN ('" . implode("','", $milestone_types) . "')\r\n\t\tAND issue.visible IN ('visible', 'private')\r\n\t";
    $issue_list->exec_query($list_criteria, 1, $vbulletin->options['pt_project_recentissues']);
Пример #3
0
    foreach ($projectperms as $issuetypeid => $issueperms) {
        if ($issueperms['generalpermissions'] & $vbulletin->pt_bitfields['general']['canview'] and $issueperms['generalpermissions'] & $vbulletin->pt_bitfields['general']['canviewothers']) {
            $viewable["{$issuetypeid}"] = "'" . $db->escape_string($issuetypeid) . "'";
        }
    }
    if ($viewable) {
        $projects["{$project['projectid']}"] = $project;
        $project_viewing["{$project['projectid']}"] = $viewable;
    }
}
if (empty($projects)) {
    // no access to view selected forums
    exit;
}
if ($vbulletin->GPC['issuereportid']) {
    if (!($search_perms = build_issue_permissions_query($vbulletin->userinfo, 'cansearch'))) {
        exit;
    }
    $report = $db->query_first_slave("\r\n\t\tSELECT issuereport.*, IF(issuereportsubscribe.issuesearchid IS NOT NULL, 1, 0) AS issubscribed,\r\n\t\t\tissuesearch.issuesearchid\r\n\t\tFROM " . TABLE_PREFIX . "pt_issuereport AS issuereport\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "pt_issuereportsubscribe AS issuereportsubscribe ON\r\n\t\t\t(issuereportsubscribe.issuereportid = issuereport.issuereportid AND issuereportsubscribe.userid = " . $vbulletin->userinfo['userid'] . ")\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "pt_issuesearch AS issuesearch ON\r\n\t\t\t(issuesearch.issuesearchid = issuereportsubscribe.issuesearchid)\r\n\t\tWHERE issuereport.issuereportid = " . $vbulletin->GPC['issuereportid'] . "\r\n\t\t\tAND issuereport.public = 1\r\n\t");
    if (!$report) {
        exit;
    }
}
if (!$vbulletin->options['externalcount']) {
    $vbulletin->options['externalcount'] = 15;
}
$count = $vbulletin->options['externalcount'];
if (!intval($vbulletin->options['externalcache']) or $vbulletin->options['externalcache'] > 1440) {
    $externalcache = 60;
} else {
    $externalcache = $vbulletin->options['externalcache'];