public function view($arguments) { if (empty($arguments[0])) { return Error::set('No bug ID found.'); } if (!empty($arguments[1])) { $page = (int) array_pop($arguments); if ($page < 1) { $this->view['commentPage'] = 1; } else { $this->view['commentPage'] = $page; } } else { $this->view['commentPage'] = 1; } $this->view['commentPageLoc'] = 'bugs/view/' . $arguments[0] . '/'; $bugs = new bugs(ConnectionFactory::get('mongo')); $this->view['bug'] = $bugs->get($arguments[0], true, true); if (is_string($this->view['bug'])) { return Error::set($this->view['bug']); } if (!bugs::canView($this->view['bug'])) { return Error::set('You are not allowed to view this bug.'); } $this->view['valid'] = true; Layout::set('title', $this->view['bug']['title']); if ($this->view['bug']['flagged'] == true && CheckAcl::can('unflagBug')) { $bugs->alter($this->view['bug']['_id'], array('flagged' => false)); } }
if (!empty($bugs)) { ?> <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th style="width: 1%"> </th> <th style="width: 5%">Category</th> <th style="width: 20%">Updated</th> <th style="width: 5%">Status</th> <th>Title</th> </tr> </thead> <tbody> <?php foreach ($bugs as $bug) { if (!bugs::canView($bug)) { continue; } ?> <tr> <td><?php echo $bug['flagged'] ? '<i class="icon-exclamation-sign"></i>' : ' '; ?> </td> <td><?php echo ucwords(bugs::$category[$bug['category']]); ?> </td> <td><?php echo Date::dayFormat($bug['lastUpdate']); ?>