Example #1
0
<?php

// $Header$
// Copyright (c) 2004 bitweaver Tickets
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('tickets');
// Look up the content
require_once TICKETS_PKG_PATH . 'lookup_milestone_inc.php';
if (!$gContent->isValid()) {
    $gBitSystem->setHttpStatus(404);
    $gBitSystem->fatalError("The milestones you requested could not be found.");
}
// Now check permissions to access this content
$gContent->verifyViewPermission();
// Add a hit to the counter
$gContent->addHit();
// Get field definitions for listing tickets.
$ticket = new BitTicket();
$fieldDefinitions = $ticket->getFieldDefinitions();
$gBitSmarty->assign_by_ref('fieldDefinitions', $fieldDefinitions);
// Display the template
$gBitSystem->display('bitpackage:tickets/milestone_display.tpl', tra('Tickets'), array('display_mode' => 'display'));
Example #2
0
if (!$gContent->isValid()) {
    $gBitSystem->setHttpStatus(404);
    $gBitSystem->fatalError("The tickets you requested could not be found.");
}
// Now check permissions to access this content
$gContent->verifyViewPermission();
// Add a hit to the counter
$gContent->addHit();
if (is_object($gContent) && $gContent->isCommentable()) {
    $commentsParentId = $gContent->mContentId;
    $comments_vars = array(BITTICKET_CONTENT_TYPE_GUID);
    $comments_prefix_var = BITTICKET_CONTENT_TYPE_GUID . ':';
    $comments_object_var = BITTICKET_CONTENT_TYPE_GUID;
    $comments_return_url = $gContent->getDisplayUrl();
    $comments_sort_mode = "commentDate_asc";
    $gBitSmarty->assign('item_display_comments', TRUE);
    include_once LIBERTY_PKG_PATH . 'comments_inc.php';
}
// Get necessary lists.
$contextTicket = new BitTicket();
$fieldDefinitions = $contextTicket->getFieldDefinitions();
$gBitSmarty->assign('fieldDefinitions', $fieldDefinitions);
$fieldValues = $contextTicket->getFieldValues();
$gBitSmarty->assign('fieldValues', $fieldValues);
$milestone = new BitMilestone();
$pParamHash = array();
$milestones = $milestone->getList($pParamHash);
$gBitSmarty->assign('milestones', $milestones);
$gBitThemes->loadJavascript(TICKETS_PKG_PATH . 'scripts/BitTicket.js', TRUE);
// Display the template
$gBitSystem->display('bitpackage:tickets/ticket_display.tpl', tra('Tickets'), array('display_mode' => 'display'));