Beispiel #1
0
function data_history($pData, $pParams)
{
    global $gBitSystem, $gContent, $gBitSmarty;
    //check package
    if (!$gBitSystem->isPackageActive('tickets')) {
        return '<div class=error>' . tra('Tickets Package Deactivated.') . '</div>';
    }
    //check if all parameters are given
    $field = "id";
    if (!array_key_exists($field, $pParams) || !is_numeric($pParams[$field])) {
        return '<div class=error>' . tra('Parameter is wrong or not given: ') . $field . '. </div>';
    }
    require_once TICKETS_PKG_PATH . 'BitTicket.php';
    //field $pParams with field names
    $contextTicket = new BitTicket();
    $contextTicket->getHistoryFieldNames($pParams[$field], $pParams);
    $gBitSmarty->assign('def_title', $pParams['def_title']);
    $gBitSmarty->assign('old_value', $pParams['old_value']);
    $gBitSmarty->assign('new_value', $pParams['new_value']);
    return $gBitSmarty->fetch('bitpackage:tickets/ticket_history.tpl');
}
<?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'));
<?php

// $Header$
require_once '../../kernel/setup_inc.php';
include_once TICKETS_PKG_PATH . 'BitTicket.php';
include_once TICKETS_PKG_PATH . 'lookup_tickets_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('tickets');
$gBitSystem->verifyPermission('p_tickets_admin');
$ticket = new BitTicket();
$fieldDefinitions = $ticket->getFieldDefinitions();
$gBitSmarty->assign_by_ref('fieldDefinitions', $fieldDefinitions);
$fieldValues = $ticket->getFieldValues();
$gBitSmarty->assign_by_ref('fieldValues', $fieldValues);
$gBitSystem->display('bitpackage:tickets/admin_definitions.tpl', tra('Edit Field Definitions'), array('display_mode' => 'admin'));
Beispiel #4
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'));
Beispiel #5
0
 /**
  * load Load the data from the database
  * 
  * @access public
  * @return boolean TRUE on success, FALSE on failure - mErrors will contain reason for failure
  */
 function load()
 {
     if ($this->verifyId($this->mMilestoneId) || $this->verifyId($this->mContentId)) {
         // LibertyContent::load()assumes you have joined already, and will not execute any sql!
         // This is a significant performance optimization
         $lookupColumn = $this->verifyId($this->mMilestoneId) ? 'milestone_id' : 'content_id';
         $bindVars = array();
         $selectSql = $joinSql = $whereSql = '';
         array_push($bindVars, $lookupId = @BitBase::verifyId($this->mMilestoneId) ? $this->mMilestoneId : $this->mContentId);
         $this->getServicesSql('content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars);
         $query = "\n\t\t\t\tSELECT tm.*, lc.*,\n\t\t\t\tuue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name,\n\t\t\t\tuuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name\n\t\t\t\t{$selectSql}\n\t\t\t\tFROM `" . BIT_DB_PREFIX . "ticket_milestone` tm\n\t\t\t\t\tINNER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON( lc.`content_id` = tm.`content_id` ) {$joinSql}\n\t\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uue ON( uue.`user_id` = lc.`modifier_user_id` )\n\t\t\t\t\tLEFT JOIN `" . BIT_DB_PREFIX . "users_users` uuc ON( uuc.`user_id` = lc.`user_id` )\n\t\t\t\tWHERE tm.`{$lookupColumn}`=? {$whereSql}";
         $ticketQuery = "SELECT t.ticket_id\n                FROM `" . BIT_DB_PREFIX . "tickets` t \n                WHERE t.`milestone_id`=?";
         $result = $this->mDb->query($query, $bindVars);
         if ($result && $result->numRows()) {
             $this->mInfo = $result->fields;
             $this->mContentId = $result->fields['content_id'];
             $this->mMilestoneId = $result->fields['milestone_id'];
             $date = new BitDate();
             $this->mDateFrom = $result->fields['date_from'];
             $this->mDateTo = $result->fields['date_to'];
             $this->mInfo['creator'] = !empty($result->fields['creator_real_name']) ? $result->fields['creator_real_name'] : $result->fields['creator_user'];
             $this->mInfo['editor'] = !empty($result->fields['modifier_real_name']) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user'];
             $this->mInfo['display_name'] = BitUser::getTitleFromHash($this->mInfo);
             $this->mInfo['display_url'] = $this->getDisplayUrl();
             $this->mInfo['parsed_data'] = $this->parseData();
             $ticketResult = $this->mDb->getCol($ticketQuery, array($this->mMilestoneId));
             $ticket = new BitTicket();
             $pParamHash = array();
             $this->mTickets = $ticket->getList($pParamHash, $ticketResult);
             LibertyMime::load();
         }
     }
     return count($this->mInfo);
 }
<?php

// $Header$
// Copyright (c) 2005 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.
// is this used?
//if (isset($_REQUEST["ticketsset"]) && isset($_REQUEST["homeTickets"])) {
//	$gBitSystem->storeConfig("home_tickets", $_REQUEST["homeTickets"]);
//	$gBitSmarty->assign('home_tickets', $_REQUEST["homeTickets"]);
//}
require_once TICKETS_PKG_PATH . 'BitTicket.php';
$formTicketsLists = array("tickets_list_ticket_id" => array('label' => 'Id', 'note' => 'Display the tickets id.'), "tickets_list_title" => array('label' => 'Title', 'note' => 'Display the title.'), "tickets_list_data" => array('label' => 'Text', 'note' => 'Display the text.'));
$gBitSmarty->assign('formTicketsLists', $formTicketsLists);
$processForm = set_tab();
if ($processForm) {
    $ticketsToggles = array_merge($formTicketsLists);
    foreach ($ticketsToggles as $item => $data) {
        simple_set_toggle($item, 'tickets');
    }
}
$ticket = new BitTicket();
$tickets = $ticket->getList($_REQUEST);
$gBitSmarty->assign_by_ref('tickets', $tickets['data']);
Beispiel #7
0
            $tmpPage = new BitTicket($del);
            if ($tmpPage->load() && !empty($tmpPage->mInfo['title'])) {
                $info = $tmpPage->mInfo['title'];
            } else {
                $info = $del;
            }
            $formHash['input'][] = '<input type="hidden" name="checked[]" value="' . $del . '"/>' . $info;
        }
        $gBitSystem->confirmDialog($formHash, array('warning' => tra('Are you sure you want to delete ') . count($_REQUEST["checked"]) . ' tickets?', 'error' => tra('This cannot be undone!')));
    } else {
        foreach ($_REQUEST["checked"] as $deleteId) {
            $tmpPage = new BitTicket($deleteId);
            if (!$tmpPage->load() || !$tmpPage->expunge()) {
                array_merge($errors, array_values($tmpPage->mErrors));
            }
        }
        if (!empty($errors)) {
            $gBitSmarty->assign_by_ref('errors', $errors);
        }
    }
}
// Create new tickets object
$tickets = new BitTicket();
$ticketsList = $tickets->getList($_REQUEST);
$gBitSmarty->assign_by_ref('ticketsList', $ticketsList);
$fieldDefinitions = $tickets->getFieldDefinitions();
$gBitSmarty->assign_by_ref('fieldDefinitions', $fieldDefinitions);
// getList() has now placed all the pagination information in $_REQUEST['listInfo']
$gBitSmarty->assign_by_ref('listInfo', $_REQUEST['listInfo']);
// Display the template
$gBitSystem->display('bitpackage:tickets/list_tickets.tpl', tra('Tickets'), array('display_mode' => 'list'));
<?php

global $gContent;
require_once TICKETS_PKG_PATH . 'BitTicket.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
if (empty($gContent) || !is_object($gContent) || !$gContent->isValid()) {
    // if ticket_id supplied, use that
    if (@BitBase::verifyId($_REQUEST['ticket_id'])) {
        $gContent = new BitTicket($_REQUEST['ticket_id']);
        // if content_id supplied, use that
    } elseif (@BitBase::verifyId($_REQUEST['content_id'])) {
        $gContent = new BitTicket(NULL, $_REQUEST['content_id']);
    } elseif (@BitBase::verifyId($_REQUEST['ticket']['ticket_id'])) {
        $gContent = new BitTicket($_REQUEST['ticket']['ticket_id']);
        // otherwise create new object
    } else {
        $gContent = new BitTicket();
    }
    $gContent->load();
    $gBitSmarty->assign_by_ref("gContent", $gContent);
}