コード例 #1
0
ファイル: ticket.php プロジェクト: carriercomm/atikit
 private function showTicketDetails(&$ticket)
 {
     $tabs = [];
     $crumbs = base::crumbs([['url' => '#', 'text' => "({$ticket['id']}) {$ticket['ticket_title']}"]]);
     // Tab #1 is going to be split. So lets create the span6 that we will need.
     // Update Active Queue
     $_SESSION['activeQueue'] = $ticket['queue_id'];
     $replyContent = "\n\t\t\t\t<div class='row-fluid'>\n\t\t\t\t\t\t\t<div class='span6'>" . $this->getTicketReplies($ticket) . "</div>\n\t\t\t\t\t\t\t<div class='span6'>" . $this->getFiles($ticket) . $this->getCompanyNotes($ticket) . $this->getTicketBilled($ticket) . $this->getIncidentStanding($ticket) . "</div>\n\t\t\t\t\t\t</div>";
     // Counter Init
     $maincount = $this->returnCountFromTable("replies", "ticket_id='{$ticket['id']}' AND reply_isinternal = false");
     $subcount = $this->returnCountFromTable("subtickets", "ticket_id='{$ticket['id']}' AND subticket_isclosed = false");
     $ttlcount = $this->returnCountFromTable("tickets", "company_id='{$ticket['company_id']}'");
     // Tab Creation
     $tabs[] = ['class' => 'active', 'id' => 'ticketTrail', 'title' => "<i class='icon-comments'></i> <span class='badge badge-success'>{$maincount}</span> Main Communication", 'content' => $replyContent];
     if ($this->isProvidingCompany()) {
         $tabs[] = ['id' => 'subTickets', 'title' => "<i class='icon-tasks'></i> <span class='badge badge-warning'>{$subcount}</span> Ticket Tasks", 'content' => $this->getSubTickets($ticket)];
     }
     $tabs[] = ['id' => 'history', 'title' => "<i class='icon-calendar'></i> <span class='badge badge-inverse'>{$ttlcount}</span> History", 'content' => $this->getHistory($ticket)];
     if ($this->canSeeBilling() || !$this->isProvidingCompany()) {
         $tabs[] = ['id' => 'sow', 'title' => "<i class='icon-bookmark'></i> Statement of Work", 'content' => $this->getStatementOfWork($ticket)];
     }
     if ($this->canSeeBilling() && $this->isProvidingCompany()) {
         $tabs[] = ['id' => 'billing', 'title' => "<i class='icon-money'></i> Billing", 'content' => $this->getBillingTab($ticket)];
     }
     $buttons = button::init()->text('Add Reply')->isModalLauncher()->url('#createReplyModal')->addStyle('btn-inverse')->icon('comment')->render();
     $buttons .= button::init()->text('Upload File')->isModalLauncher()->url('#uploadFile')->addStyle('btn-info')->icon('arrow-up')->render();
     $buttons .= button::init()->text('Close Ticket')->url("/close/{$ticket['id']}/")->addStyle('btn-danger')->addStyle('get')->icon('remove')->render();
     $fbuttons = $buttons;
     $fbuttons .= button::init()->text('Back to Top')->url("#")->addStyle('btn-warning')->addStyle('top')->icon('arrow-up')->render();
     $fbuttons .= button::init()->text('Ticket List')->url("/")->addStyle('btn-primary')->icon('arrow-left')->render();
     $widget = widget::init()->span(12)->icon('edit')->header($ticket['ticket_title'])->isTabs($tabs)->rightHeader($buttons)->footer($fbuttons)->render();
     $data = base::row($widget);
     $save = button::init()->formid('newReplyForm')->addStyle('mpost')->postVar('createReply')->text('Add Reply')->addStyle('btn-success')->icon('ok')->message('Submitting..')->id($ticket['id'])->render();
     $this->exportModal(modal::init()->id('createReplyModal')->header('Add Reply')->content($this->createReplyForm($ticket))->footer($save)->render());
     $saveFile = button::init()->formid('newUploadForm')->addStyle('mpost')->postVar('createAttachment')->text('Save Attachment')->addStyle('btn-success')->icon('ok')->message('Submitting..')->id($ticket['id'])->render();
     $this->exportModal(modal::init()->id('uploadFile')->header('Upload Attachment')->content($this->createUploadForm($ticket))->footer($saveFile)->render());
     $this->export($data);
     $this->exportjs(js::scrollBottom());
     $this->exportjs(js::scrollTop('top'));
 }