Пример #1
0
}
if (!$text) {
    $ERRORS->Add("Please describe the bug as much detail as possible.");
}
if (!$category) {
    $ERRORS->Add("Please select a category.");
} else {
    //validate the category
    if (!in_array($mainCategory, $validMainCategories)) {
        $ERRORS->Add("Please select valid category.");
    }
}
$ERRORS->Check('/index.php?page=bugtracker_submit');
####################################################################
## The actual unstuck script begins here
$CategoryStore = new BTCategories();
$CategoryData = $CategoryStore->getMainCategory($mainCategory)->getCategory($category);
//free memory
unset($CategoryStore);
//Do more checks
if ($CategoryData === false) {
    $ERRORS->Add("Please select valid sub-category.");
} else {
    if ($CategoryData->hasSubCategories() and !$subcategory) {
        $ERRORS->Add("Please select specifics.");
    } else {
        if ($subcategory) {
            //try getting the sub-category name
            if (!($SubCategoryName = $CategoryData->getSubCategoryName($subcategory))) {
                $ERRORS->Add("Please select valid specifics.");
            }
Пример #2
0
$page = isset($_GET['page']) ? (int) $_GET['page'] : false;
$perPage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : false;
//calculate the offset
$offsetStart = ($page - 1) * $perPage;
if ($page and $perPage) {
    if ($CURUSER->isOnline()) {
        $res = $DB->prepare("SELECT * FROM `bugtracker` WHERE `account` = :acc ORDER BY id DESC LIMIT " . $offsetStart . "," . $perPage);
        $res->bindParam(':acc', $CURUSER->get('id'), PDO::PARAM_STR);
        $res->execute();
        //get the count
        $count = $res->rowCount();
        //save the count to the data
        $data['count'] = $count;
        if ($count > 0) {
            //get the categories
            $CategoryStore = new BTCategories();
            //setup empty array
            $data['issues'] = array();
            //loop the issues found
            while ($arr = $res->fetch()) {
                //Translate the status
                switch ($arr['status']) {
                    case BT_STATUS_NEW:
                        $status = 'New';
                        break;
                    case BT_STATUS_OPEN:
                        $status = 'Open';
                        break;
                    case BT_STATUS_ONHOLD:
                        $status = 'On hold';
                        break;
Пример #3
0
		    <tbody>
		
		    <?php 
//Filters
$where = "";
if ($filter !== false) {
    $where = "WHERE `bugtracker`.`status` = :status";
}
$res = $DB->prepare("SELECT `bugtracker`.`id`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`status`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`approval`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`priority`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`maincategory`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`category`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`subcategory`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`title`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`content`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`added`, \n\t\t\t\t\t\t\t\t\t\t`bugtracker`.`account`, \n\t\t\t\t\t\t\t\t\t\t`account_data`.`displayName` \n\t\t\t\t\t\t\t\tFROM `bugtracker`\n\t\t\t\t\t\t\t\tLEFT JOIN `account_data` \n\t\t\t\t\t\t\t\tON `bugtracker`.`account` = `account_data`.`id`\n\t\t\t\t\t\t\t\t" . $where . "\n\t\t\t\t\t\t\t\tORDER BY `bugtracker`.`id` DESC;");
if ($filter !== false) {
    $res->bindParam(':status', $filter, PDO::PARAM_INT);
}
$res->execute();
if ($res->rowCount() > 0) {
    //get the categories
    $CategoryStore = new BTCategories();
    while ($arr = $res->fetch()) {
        //Translate the status
        switch ($arr['status']) {
            case BT_STATUS_NEW:
                $status = 'New';
                break;
            case BT_STATUS_OPEN:
                $status = 'Open';
                break;
            case BT_STATUS_ONHOLD:
                $status = 'On hold';
                break;
            case BT_STATUS_DUPLICATE:
                $status = 'Duplicate';
                break;
Пример #4
0
<?php

if (!defined('init_ajax')) {
    header('HTTP/1.0 404 not found');
    exit;
}
$category = isset($_GET['category']) ? (int) $_GET['category'] : false;
if ($category) {
    $data = new BTCategories();
    $catData = $data->getMainCategory($category)->data;
    unset($data);
    $encoded = json_encode($catData);
    unset($catData);
    echo $encoded;
} else {
    header('HTTP/1.0 404 not found');
    exit;
}
exit;