本文整理汇总了PHP中Ticket::isOpen方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::isOpen方法的具体用法?PHP Ticket::isOpen怎么用?PHP Ticket::isOpen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::isOpen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
} elseif (!$cfg->canUploadFileType($_FILES['attachment']['name'][$i])) {
$errors['attachment'] = _('Invalid file type') . ' [ ' . Format::htmlchars($_FILES['attachment']['name'][$i]) . ' ]';
} elseif ($_FILES['attachment']['size'][$i] > $cfg->getMaxFileSize()) {
$errors['attachment'] = _('File is too big') . ': ' . $_FILES['attachment']['size'][$i] . ' bytes';
}
$i++;
}
//Make sure the email is not banned
if (!$errors && BanList::isbanned($ticket->getEmail())) {
$errors['err'] = _('Email is in banlist. Must be removed to reply');
}
//If no error...do the do.
if (!$errors && ($respId = $ticket->postResponse($_POST['response'], $_POST['signature'], $_FILES['attachment']))) {
$msg = _('Response Posted Successfully');
//Set status if any.
$wasOpen = $ticket->isOpen();
if (isset($_POST['ticket_status']) && $_POST['ticket_status']) {
if ($ticket->setStatus($_POST['ticket_status']) && $ticket->reload()) {
$note = sprintf(_('%s %s the ticket on reply'), $thisuser->getName(), $ticket->isOpen() ? _('reopened') : _('closed'));
$ticket->logActivity(sprintf(_('Ticket status changed to %s'), $ticket->isOpen() ? _('Open') : _('Closed')), $note);
}
}
//Finally upload attachment if any
if ($_FILES['attachment'] && $_FILES['attachment']['size']) {
$ticket->uploadAttachment($_FILES['attachment'], $respId, 'R');
}
$ticket->reload();
//Mark the ticket answered if OPEN.
if ($ticket->isopen()) {
$ticket->markAnswered();
} elseif ($wasOpen) {
示例2: elseif
} elseif (!$cfg->canUploadFiles()) {
//TODO: saved vs emailed attachments...admin config??
$errors['attachment'] = 'upload dir invalid. Contact admin.';
} elseif (!$cfg->canUploadFileType($_FILES['attachment']['name'])) {
$errors['attachment'] = 'Invalid file type';
}
}
//Make sure the email is not banned
if (!$errors && BanList::isbanned($ticket->getEmail())) {
$errors['err'] = 'Email is in banlist. Must be removed to reply';
}
//If no error...do the do.
if (!$errors && ($respId = $ticket->postResponse($_POST['msg_id'], $_POST['response'], $_POST['signature'], $_FILES['attachment']))) {
$msg = 'Response Posted Successfully';
//Set status if any.
$wasOpen = $ticket->isOpen();
if (isset($_POST['ticket_status']) && $_POST['ticket_status']) {
if ($ticket->setStatus($_POST['ticket_status']) && $ticket->reload()) {
$note = sprintf('%s %s the ticket on reply', $thisuser->getName(), $ticket->isOpen() ? 'reopened' : 'closed');
$ticket->logActivity('Ticket status changed to ' . ($ticket->isOpen() ? 'Open' : 'Closed'), $note);
}
}
//Finally upload attachment if any
if ($_FILES['attachment'] && $_FILES['attachment']['size']) {
$ticket->uploadAttachment($_FILES['attachment'], $respId, 'R');
}
$ticket->reload();
//Mark the ticket answered if OPEN.
if ($ticket->isopen()) {
$ticket->markAnswered();
} elseif ($wasOpen) {
示例3: elseif
if ($ticket->markOverdue()) {
$msg = 'Ticket flagged as overdue';
if ($_POST['ticket_priority']) {
$ticket->setPriority($_POST['ticket_priority']);
}
} else {
$errors['err'] = 'Problems marking the the ticket overdue. Try again';
}
}
break;
case 'banemail':
if (!$thisuser->isadmin() && !$thisuser->canManageBanList()) {
$errors['err'] = 'Perm. Denied. You are not allowed to ban emails';
} elseif (Banlist::add($ticket->getEmail(), $thisuser->getName())) {
$msg = 'Email added to banlist';
if ($ticket->isOpen() && $ticket->close()) {
$msg .= ' & ticket status set to closed';
}
} else {
$errors['err'] = 'Unable to add the email to banlist';
}
break;
case 'unbanemail':
if (!$thisuser->isadmin() && !$thisuser->canManageBanList()) {
$errors['err'] = 'Perm. Denied. You are not allowed to remove emails from banlist.';
} elseif (Banlist::remove($ticket->getEmail())) {
$msg = 'Email removed from banlist';
} else {
$errors['err'] = 'Unable to remove the email from banlist. Try again.';
}
break;
示例4: previewTicket
function previewTicket($tid)
{
global $thisstaff;
$ticket = new Ticket($tid);
$resp = sprintf('<div style="width:500px;">
<strong>Ticket #%d Preview</strong><br>INFO HERE!!', $ticket->getExtId());
$options[] = array('action' => 'Thread (' . $ticket->getThreadCount() . ')', 'url' => "tickets.php?id={$tid}");
if ($ticket->getNumNotes()) {
$options[] = array('action' => 'Notes (' . $ticket->getNumNotes() . ')', 'url' => "tickets.php?id={$tid}#notes");
}
if ($ticket->isOpen()) {
$options[] = array('action' => 'Reply', 'url' => "tickets.php?id={$tid}#reply");
}
if ($thisstaff->canAssignTickets()) {
$options[] = array('action' => $ticket->isAssigned() ? 'Reassign' : 'Assign', 'url' => "tickets.php?id={$tid}#assign");
}
if ($thisstaff->canTransferTickets()) {
$options[] = array('action' => 'Transfer', 'url' => "tickets.php?id={$tid}#transfer");
}
$options[] = array('action' => 'Post Note', 'url' => "tickets.php?id={$tid}#note");
if ($options) {
$resp .= '<ul class="tip_menu">';
foreach ($options as $option) {
$resp .= sprintf('<li><a href="%s">%s</a></li>', $option['url'], $option['action']);
}
$resp .= '</ul>';
}
$resp .= '</div>';
return $resp;
}