/**
* Builds a search result bit
*
* @param	array	Issue info
*
* @return	string	Search result bit HTML
*/
function build_pt_search_resultbit($issue)
{
    global $vbulletin, $db, $show, $stylevar, $vbphrase, $template_hook;
    static $projectperms = array();
    if (!isset($projectperms["{$issue['projectid']}"])) {
        $projectperms["{$issue['projectid']}"] = fetch_project_permissions($vbulletin->userinfo, $issue['projectid']);
    }
    $project = $vbulletin->pt_projects["{$issue['projectid']}"];
    $issueperms = $projectperms["{$issue['projectid']}"]["{$issue['issuetypeid']}"];
    $posting_perms = prepare_issue_posting_pemissions($issue, $issueperms);
    $show['edit_issue'] = $posting_perms['issue_edit'];
    $show['status_edit'] = $posting_perms['status_edit'];
    $issue = prepare_issue($issue);
    ($hook = vBulletinHook::fetch_hook('projectsearch_results_bit')) ? eval($hook) : false;
    eval('$resultbits .= "' . fetch_template('pt_searchresultbit') . '";');
    return $resultbits;
}
/**
* Builds an issue bit for an issue list
*
* @param	array	Issue information
* @param	array	Project information
* @param	array	Array of issue permissions
*
* @return	string	Issue bit HTML
*/
function build_issue_bit($issue, $project, $issueperms)
{
    global $vbulletin, $vbphrase, $stylevar, $show, $template_hook;
    $posting_perms = prepare_issue_posting_pemissions($issue, $issueperms);
    $show['edit_issue'] = $posting_perms['issue_edit'];
    $show['status_edit'] = $posting_perms['status_edit'];
    $issue = prepare_issue($issue);
    $template_name = $issue['visible'] == 'deleted' ? 'pt_issuebit_deleted' : 'pt_issuebit';
    ($hook = vBulletinHook::fetch_hook('project_issuebit')) ? eval($hook) : false;
    eval('$return = "' . fetch_template($template_name) . '";');
    return $return;
}
Exemple #3
0
if (!($vbulletin->userinfo['permissions']['ptpermissions'] & $vbulletin->bf_ugp_ptpermissions['canviewprojecttools'])) {
    print_no_permission();
}
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$vbulletin->input->clean_array_gpc('p', array('issueid' => TYPE_UINT, 'field' => TYPE_NOHTML, 'value' => TYPE_NOCLEAN));
if (is_string($vbulletin->GPC['value'])) {
    $vbulletin->GPC['value'] = convert_urlencoded_unicode($vbulletin->GPC['value']);
}
$issue = verify_issue($vbulletin->GPC['issueid']);
$project = verify_project($issue['projectid']);
verify_issuetypeid($issue['issuetypeid'], $project['projectid']);
$projectperms = fetch_project_permissions($vbulletin->userinfo, $project['projectid']);
$issueperms = $projectperms["{$issue['issuetypeid']}"];
$posting_perms = prepare_issue_posting_pemissions($issue, $issueperms);
$can_edit_issue = $posting_perms['issue_edit'];
($hook = vBulletinHook::fetch_hook('projectajax_start')) ? eval($hook) : false;
// #######################################################################
function throw_ajax_error($text = '')
{
    global $vbulletin;
    $xml =& new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_tag('error', $text);
    $xml->print_xml();
}
// #######################################################################
if ($_POST['do'] == 'save') {
    $issuedata =& datamanager_init('Pt_Issue', $vbulletin, ERRTYPE_STANDARD);
    $issuedata->set_existing($issue);
    ($hook = vBulletinHook::fetch_hook('projectajax_save_start')) ? eval($hook) : false;