Exemplo n.º 1
0
        foreach ($ArAttached as $IDAttach) {
            if (!F1DeskUtils::isAttached($IDTicket, $IDAttach)) {
                $ObjTicket->attachTicket($IDTicket, $IDAttach);
            }
        }
    }
} elseif (!empty($_POST) && $_POST['StAction'] == 'addSupporters') {
    $ArSupporters = F1DeskUtils::getAllSupporters();
    if ($ArSupporters[0]['IDSupporter'] == 0) {
        array_shift($ArSupporters);
    }
}
/***************************************
 *           Create Data               *
****************************************/
if (F1DeskUtils::isSupporter()) {
    $BoCreate = F1DeskUtils::getPermission('BoCreateTicket', getSessionProp('IDSupporter'));
    if ($BoCreate) {
        $ArDepartments = F1DeskUtils::getPublicDepartments(false);
    } else {
        $ArDepartments = F1DeskUtils::getDepartmentsFormatted(getSessionProp('IDSupporter'));
    }
} else {
    $ArDepartments = F1DeskUtils::getPublicDepartments();
}
$ArTypes = F1DeskUtils::listTicketTypes();
$ArPriorities = F1DeskUtils::listPriorities();
$ArCategories = F1DeskUtils::listCategories();
if (F1DeskUtils::IsSupporter()) {
    $ArSub = F1DeskUtils::getSubDepartments(getSessionProp('IDSupporter'));
}
Exemplo n.º 2
0
if ($ObjTicket->ticketExists($IDTicket)) {
    if ($isSupporter || $ObjTicket->isVisible($IDTicket, $IDUser)) {
        $isVisible = true;
    }
}
if ($isVisible) {
    $ObjTicket->setAsRead(getSessionProp('IDUser'), $IDTicket);
    $ArHeaders = $ObjTicket->getTicketHeaders($IDTicket);
    $ArAttachments = $ObjTicket->getAttachments($IDTicket);
    if ($isSupporter) {
        $ArSupporters = $ObjUser->listSupporters($IDTicket);
        $BoCreate = F1DeskUtils::getPermission('BoCreateTicket', $IDSupporter);
        if ($BoCreate) {
            $ArDepartments = F1DeskUtils::getPublicDepartments(false);
        } else {
            $ArDepartments = F1DeskUtils::getDepartmentsFormatted($IDSupporter);
        }
    } else {
        $ArDepartments = F1DeskUtils::getPublicDepartments();
    }
    #
    # Ticket Header
    #
    $StTitle = $ArHeaders['StTitle'];
    $IDTicket = $ArHeaders['IDTicket'];
    if (array_key_exists('IDDepartment', $ArHeaders)) {
        $IDDepartment = $ArHeaders['IDDepartment'];
    } elseif (array_key_exists('IDDepartment', $_POST)) {
        $IDDepartment = $_POST['IDDepartment'];
    } else {
        $IDDepartment = 'single';