Esempio n. 1
0
        if (!empty($_FILES['Attachment']['name'])) {
            $IDTicket = $ObjTicket->createSupporterTicket(getSessionProp('IDSupporter'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment, $IDDepartmentReader, $ArUsers, $ArReaders, true, $_FILES);
        } else {
            $IDTicket = $ObjTicket->createSupporterTicket(getSessionProp('IDSupporter'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment, $IDDepartmentReader, $ArUsers, $ArReaders, true);
        }
    } else {
        if (!empty($_FILES['Attachment']['name'])) {
            $IDTicket = $ObjTicket->createUserTicket(getSessionProp('IDClient'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment, $_FILES);
        } else {
            $IDTicket = $ObjTicket->createUserTicket(getSessionProp('IDClient'), $IDCategory, $IDPriority, $StTitle, $TxMessage, $IDDepartment);
        }
    }
    if (!empty($ArAttached)) {
        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) {
Esempio n. 2
0
             }
         }
     }
     break;
 case 'attach':
     if (!$isSupporter) {
         throw new ErrorHandler(INVALID_OPTION);
     }
     if (!is_numeric($_POST['IDAttached'])) {
         ErrorHandler::setNotice('ticket', EXC_GLOBAL_EXPPARAM, 'error');
     } else {
         $IDAttached = $_POST['IDAttached'];
         if (F1DeskUtils::isAttached($_POST['IDTicket'], $IDAttached)) {
             ErrorHandler::setNotice('ticket', ALREADY_ATTACHED, 'error');
         } else {
             $ObjTicket->attachTicket($_POST['IDTicket'], $IDAttached);
             ErrorHandler::setNotice('ticket', SUCESS_ATTACHING, 'ok');
         }
     }
     break;
 case 'changeDepartment':
     if (!$isSupporter) {
         throw new ErrorHandler(INVALID_OPTION);
     }
     if (!is_numeric($_POST['IDTicket']) || !is_numeric($_POST['IDDepartment'])) {
         ErrorHandler::setNotice('ticket', EXC_GLOBAL_EXPPARAM, 'error');
     } else {
         $BoReturn = $ObjTicket->changeDepartment($_POST['IDTicket'], $_POST['IDDepartment']);
         if (!$BoReturn) {
             ErrorHandler::setNotice('ticket', EXC_ERR_CHANGE, 'error');
         } else {