Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions BugzillaOutput.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,19 @@ protected function setup_template_data() {
$this->response->fields = array();

// Set the bug data for the templates
if(isset($this->query->data['bugs']) && count($this->query->data['bugs']) > 0) {
$this->response->bugs = $this->query->data['bugs'];
if(isset($this->query->data['bugs']) &&
count($this->query->data['bugs']) > 0) {
$bugs = $this->query->data['bugs'];
// Randomize the bugs, if requested.
if(isset($this->config['randomize'])) {
shuffle($bugs);
}

// If a limit has been set, use it.
if(isset($this->config['limit'])) {
$bugs = array_slice($bugs, 0, (int)$this->config['limit']);
}
$this->response->bugs = $bugs;
}

// Set the field data for the templates
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ and b) display those columns.

![Screenshot of the above](http://i.imgur.com/p3u7r.png "Screenshot of the above")

You may also limit the total number of results displayed and/or randomize the order of the results:

<bugzilla limit="5" randomize>
{
"whiteboard": "EasyHack",
"status": "NEW"
}
</bugzilla>


Charting
================================
Expand Down