本文整理汇总了PHP中Notifier::ticket方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifier::ticket方法的具体用法?PHP Notifier::ticket怎么用?PHP Notifier::ticket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifier
的用法示例。
在下文中一共展示了Notifier::ticket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: open
/**
* Open specific ticket
*
* @access public
* @param void
* @return null
*/
function open()
{
$ticket = ProjectTickets::findById(get_id());
if (!$ticket instanceof ProjectTicket) {
flash_error(lang('ticket dnx'));
$this->redirectTo('tickets');
}
// if
if (!$ticket->canChangeStatus(logged_user())) {
flash_error(lang('no access permissions'));
$this->redirectToReferer(get_url('tickets'));
}
// if
$status = $ticket->isClosed() ? 'closed' : 'open';
try {
DB::beginWork();
$ticket->openTicket();
ApplicationLogs::createLog($ticket, active_project(), ApplicationLogs::ACTION_OPEN);
DB::commit();
if ($status != 'open') {
$change = new ProjectTicketChange();
$change->setTicketId($ticket->getId());
$change->setType('status');
$change->setFromData($status);
$change->setToData('open');
$change->save();
}
try {
Notifier::ticket($ticket, $ticket->getSubscribers(), 'open_ticket', logged_user());
} catch (Exception $e) {
// nothing here, just suppress error...
}
// try
flash_success(lang('success open ticket'));
} catch (Exception $e) {
flash_error(lang('error open ticket'));
DB::rollback();
}
// try
$this->redirectToUrl(ProjectTickets::getIndexUrl());
}