Exemplo n.º 1
0
        $inc = 'ticket-edit.inc.php';
    } elseif ($_REQUEST['a'] == 'print' && !$ticket->pdfExport($_REQUEST['psize'], $_REQUEST['notes'])) {
        $errors['err'] = 'Internal error: Unable to export the ticket to PDF for print.';
    }
} else {
    $inc = 'tickets.inc.php';
    if ($_REQUEST['a'] == 'open' && $thisstaff->canCreateTickets()) {
        $inc = 'ticket-open.inc.php';
    } elseif ($_REQUEST['a'] == 'export') {
        require_once INCLUDE_DIR . 'class.export.php';
        $ts = strftime('%Y%m%d');
        if (!($token = $_REQUEST['h'])) {
            $errors['err'] = 'Query token required';
        } elseif (!($query = $_SESSION['search_' . $token])) {
            $errors['err'] = 'Query token not found';
        } elseif (!Export::saveTickets($query, "tickets-{$ts}.csv", 'csv')) {
            $errors['err'] = 'Internal error: Unable to dump query results';
        }
    }
    //Clear active submenu on search with no status
    if ($_REQUEST['a'] == 'search' && !$_REQUEST['status']) {
        $nav->setActiveSubMenu(-1);
    }
    //set refresh rate if the user has it configured
    if (!$_POST && $_REQUEST['a'] != 'search' && ($min = $thisstaff->getRefreshRate())) {
        $ost->addExtraHeader('<meta http-equiv="refresh" content="' . $min * 60 . '" />');
    }
}
require_once STAFFINC_DIR . 'header.inc.php';
require_once STAFFINC_DIR . $inc;
require_once STAFFINC_DIR . 'footer.inc.php';