[aur-dev] [PATCH 1/4] Add an option to filter by user to pkgreq_list()
When a user is specified, the function only returns package requests
which are either opened by the given user or affecting packages
maintained by the given user.
Signed-off-by: Lukas Fleischer
Do not include the wrapper div container in the template.
Signed-off-by: Lukas Fleischer Introduce a new boolean flag that can be used to disable extended
headers, pagination and forms.
Signed-off-by: Lukas Fleischer Add a new table which shows all package requests affecting the currently
logged in user.
Signed-off-by: Lukas Fleischer
<?= date("Y-m-d H:i", intval($row['RequestTS'])) ?></td>
- <?php if ($row['Open']): ?>
- <td>
- <?php if ($row['BaseID']): ?>
- <?php if ($row['Type'] == 'deletion'): ?>
- <a href="<?= get_pkgbase_uri($row['Name']) ?>delete/?via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
-
- <?php elseif ($row['Type'] == 'merge'): ?>
- <a href="<?= get_pkgbase_uri($row['Name']) ?>merge/?into=<?= urlencode($row['MergeInto']) ?>&via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
- <br />
- <?php elseif ($row['Type'] == 'orphan' && $due): ?>
- <form action="<?= get_pkgbase_uri($row['Name']) . 'disown/'; ?>" method="post">
- <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
- <input type="hidden" name="via" value="<?= intval($row['ID']) ?>" />
- <input type="submit" class="button text-button" name="do_Disown" value="<?= __('Accept') ?>" />
- </form>
- <?php elseif ($row['Type'] == 'orphan' && !$due): ?>
- <?= __('Locked') ?> (<?= $time_left_fmt ?>)
- <br />
- <?php endif; ?>
- <?php endif; ?>
- <a href="<?= get_pkgreq_route() . '/' . intval($row['ID']) ?>/close/"><?= __('Close') ?></a>
- </td>
- <?php else: ?>
- <?php if ($row['Status'] == 1): ?>
- <td><?= __("Closed") ?></td>
- <?php elseif ($row['Status'] == 2): ?>
- <td><?= __("Accepted") ?></td>
- <?php elseif ($row['Status'] == 3): ?>
- <td><?= __("Rejected") ?></td>
- <?php else: ?>
- <td><?= __("unknown") ?></td>
+ </td>
+ <?php else: ?>
+ <td><?= htmlspecialchars(ucfirst($row['Type']), ENT_QUOTES); ?></td>
+ <?php endif; ?>
+ <td class="wrap"><?= htmlspecialchars($row['Comments'], ENT_QUOTES); ?></td>
+ <td>
+ <a href="<?= get_uri('/account/') . htmlspecialchars($row['User'], ENT_QUOTES) ?>" title="<?= __('View account information for %s', htmlspecialchars($row['User'])) ?>"><?= htmlspecialchars($row['User']) ?></a>
+ </td>
+ <?= date("Y-m-d H:i", intval($row['RequestTS'])) ?></td>
+ <?php if ($row['Open']): ?>
+ <td>
+ <?php if ($row['BaseID']): ?>
+ <?php if ($row['Type'] == 'deletion'): ?>
+ <a href="<?= get_pkgbase_uri($row['Name']) ?>delete/?via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
+
+ <?php elseif ($row['Type'] == 'merge'): ?>
+ <a href="<?= get_pkgbase_uri($row['Name']) ?>merge/?into=<?= urlencode($row['MergeInto']) ?>&via=<?= intval($row['ID']) ?>"><?= __('Accept') ?></a>
+ <br />
+ <?php elseif ($row['Type'] == 'orphan' && $due): ?>
+ <form action="<?= get_pkgbase_uri($row['Name']) . 'disown/'; ?>" method="post">
+ <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
+ <input type="hidden" name="via" value="<?= intval($row['ID']) ?>" />
+ <input type="submit" class="button text-button" name="do_Disown" value="<?= __('Accept') ?>" />
+ </form>
+ <?php elseif ($row['Type'] == 'orphan' && !$due): ?>
+ <?= __('Locked') ?> (<?= $time_left_fmt ?>)
+ <br />
<?php endif; ?>
<?php endif; ?>
- </tr>
- <?php endwhile; ?>
+ <a href="<?= get_pkgreq_route() . '/' . intval($row['ID']) ?>/close/"><?= __('Close') ?></a>
+ </td>
+ <?php else: ?>
+ <?php if ($row['Status'] == 1): ?>
+ <td><?= __("Closed") ?></td>
+ <?php elseif ($row['Status'] == 2): ?>
+ <td><?= __("Accepted") ?></td>
+ <?php elseif ($row['Status'] == 3): ?>
+ <td><?= __("Rejected") ?></td>
+ <?php else: ?>
+ <td><?= __("unknown") ?></td>
+ <?php endif; ?>
+ <?php endif; ?>
+ </tr>
+ <?php endwhile; ?>
- </tbody>
- </table>
+</tbody>
+</table>
- <div class="pkglist-stats">
- <p>
- <?= _n('%d package request found.', '%d package requests found.', $total) ?>
- <?= __('Page %d of %d.', $current, $pages) ?>
- </p>
- <?php if (count($templ_pages) > 1): ?>
- <p class="pkglist-nav">
- <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
- <?php if ($pagestart === false): ?>
- <span class="page"><?= $pagenr ?></span>
- <?php elseif ($pagestart + 1 == $first): ?>
- <span class="page"><?= $pagenr ?></span>
- <?php else: ?>
- <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
- <?php endif; ?>
- <?php endforeach; ?>
- </p>
- <?php endif; ?>
- </div>
+<div class="pkglist-stats">
+ <p>
+ <?= _n('%d package request found.', '%d package requests found.', $total) ?>
+ <?= __('Page %d of %d.', $current, $pages) ?>
+ </p>
+ <?php if (count($templ_pages) > 1): ?>
+ <p class="pkglist-nav">
+ <?php foreach ($templ_pages as $pagenr => $pagestart): ?>
+ <?php if ($pagestart === false): ?>
+ <span class="page"><?= $pagenr ?></span>
+ <?php elseif ($pagestart + 1 == $first): ?>
+ <span class="page"><?= $pagenr ?></span>
+ <?php else: ?>
+ <a class="page" href="<?= get_uri('/requests/'); ?>?<?= mkurl('O=' . $pagestart) ?>"><?= $pagenr ?></a>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </p>
+ <?php endif; ?>
</div>
--
2.11.1
<?= date("Y-m-d H:i", intval($row['RequestTS'])) ?></td>
- <?php if ($row['Open']): ?>
+ <?php if ($row['Open'] && $show_headers): ?>
<td>
<?php if ($row['BaseID']): ?>
<?php if ($row['Type'] == 'deletion'): ?>
@@ -89,8 +91,9 @@
<?php endif; ?>
<a href="<?= get_pkgreq_route() . '/' . intval($row['ID']) ?>/close/"><?= __('Close') ?></a>
</td>
- <?php else: ?>
- <?php if ($row['Status'] == 1): ?>
+ <?php elseif ($row['Open'] && !$show_headers): ?>
+ <td><?= __("Pending") ?></td>
+ <?php elseif ($row['Status'] == 1): ?>
<td><?= __("Closed") ?></td>
<?php elseif ($row['Status'] == 2): ?>
<td><?= __("Accepted") ?></td>
@@ -99,13 +102,13 @@
<?php else: ?>
<td><?= __("unknown") ?></td>
<?php endif; ?>
- <?php endif; ?>
</tr>
<?php endwhile; ?>
</tbody>
</table>
+<?php if ($show_headers): ?>
<div class="pkglist-stats">
<p>
<?= _n('%d package request found.', '%d package requests found.', $total) ?>
@@ -125,3 +128,4 @@
</p>
<?php endif; ?>
</div>
+<?php endif; ?>
--
2.11.1
participants (1)