<?php

$fixVersion = '3.0.10-RC1';

$query = 'project = PHPBB3 AND resolution = Fixed AND fixVersion = "'.$fixVersion.'" AND status in ("Unverified Fix", Closed)';
$url = 'http://tracker.phpbb.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery='.urlencode($query).'&tempMax=1000';
$xml = simplexml_load_string(file_get_contents($url));

foreach ($xml->xpath('//item') as $item) {
    $key = (string) $item->key;
    $keyUrl = 'http://tracker.phpbb.com/browse/'.$key;
    $keyLink = '<a href="'.$keyUrl.'">'.$key.'</a>';
    $value = str_replace($key, $keyLink, htmlspecialchars($item->title));
    $value = str_replace(']', '] - ', $value);
    $types[(string)$item->type][$key] = $value;
}

ksort($types);
foreach ($types as $type => $tickets) {
    echo "<h4>$type</h4>\n";
    echo "<ul>\n";
    uksort($tickets, 'strnatcasecmp');
    foreach ($tickets as $ticket) {
        echo "<li>$ticket</li>\n";
    }
    echo "</ul>\n";
}
