diff options
Diffstat (limited to 'web/template')
-rw-r--r-- | web/template/header.php | 3 | ||||
-rw-r--r-- | web/template/pkg_details.php | 1 | ||||
-rw-r--r-- | web/template/pkgbase_details.php | 1 | ||||
-rw-r--r-- | web/template/pkgreq_form.php | 52 | ||||
-rw-r--r-- | web/template/pkgreq_results.php | 101 |
5 files changed, 158 insertions, 0 deletions
diff --git a/web/template/header.php b/web/template/header.php index df839950..03ce536c 100644 --- a/web/template/header.php +++ b/web/template/header.php @@ -57,6 +57,9 @@ <li><a href="<?= get_uri('/packages/'); ?>"><?= __("Packages"); ?></a></li> <?php if (isset($_COOKIE['AURSID'])): ?> <li><a href="<?= get_uri('/packages/'); ?>?SeB=m&K=<?= username_from_sid($_COOKIE["AURSID"]); ?>"><?= __("My Packages"); ?></a></li> + <?php if (check_user_privileges()): ?> + <li><a href="<?= get_uri('/requests/') ; ?>"><?= __("Requests"); ?></a></li> + <?php endif; ?> <li><a href="<?= get_uri('/submit/'); ?>"><?= __("Submit"); ?></a></li> <?php if (check_user_privileges()): ?> <li><a href="<?= get_uri('/accounts/') ; ?>"><?= __("Accounts"); ?></a></li> diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 6326d4e3..065057a8 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -106,6 +106,7 @@ $sources = pkg_sources($row["ID"]); </form> </li> <?php endif; ?> + <li><a href="<?= get_pkgbase_uri($row['BaseName']) . 'request/'; ?>"><?= __('File Request'); ?></a></li> <?php if ($atype == "Trusted User" || $atype == "Developer"): ?> <li><a href="<?= get_pkgbase_uri($row['BaseName']) . 'delete/'; ?>"><?= __('Delete Package'); ?></a></li> <li><a href="<?= get_pkgbase_uri($row['BaseName']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li> diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php index 6c617bf5..1b40b846 100644 --- a/web/template/pkgbase_details.php +++ b/web/template/pkgbase_details.php @@ -81,6 +81,7 @@ $pkgs = pkgbase_get_pkgnames($base_id); </form> </li> <?php endif; ?> + <li><a href="<?= get_pkgbase_uri($row['BaseName']) . 'request/'; ?>"><?= __('File Request'); ?></a></li> <?php if ($atype == "Trusted User" || $atype == "Developer"): ?> <li><a href="<?= get_pkgbase_uri($row['Name']) . 'delete/'; ?>"><?= __('Delete Package'); ?></a></li> <li><a href="<?= get_pkgbase_uri($row['Name']) . 'merge/'; ?>"><?= __('Merge Package'); ?></a></li> diff --git a/web/template/pkgreq_form.php b/web/template/pkgreq_form.php new file mode 100644 index 00000000..cc45f298 --- /dev/null +++ b/web/template/pkgreq_form.php @@ -0,0 +1,52 @@ +<div class="box"> + <h2><?= __('File Request: %s', htmlspecialchars($pkgbase_name)) ?></h2> + <p> + <?= __('Use this form to file a request against package base %s%s%s which includes the following packages:', + '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?> + </p> + <ul> + <?php foreach(pkgbase_get_pkgnames($base_id) as $pkgname): ?> + <li><?= htmlspecialchars($pkgname) ?></li> + <?php endforeach; ?> + </ul> + <form action="<?= get_uri('/pkgbase/'); ?>" method="post"> + <fieldset> + <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" /> + <input type="hidden" name="ID" value="<?= $base_id ?>" /> + <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> + <p> + <label for="id_type"><?= __("Request type") ?>:</label> + <select name="type" id="id_type" onchange="showHideMergeSection()"> + <option value="deletion"><?= __('Deletion') ?></option> + <option value="merge"><?= __('Merge') ?></option> + <option value="orphan"><?= __('Orphan') ?></option> + </select> + </p> + <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> + <script type="text/javascript"> + function showHideMergeSection() { + if ($('#id_type').val() == 'merge') { + $('#merge_section').show(); + } else { + $('#merge_section').hide(); + } + } + + $(document).ready(function() { + showHideMergeSection(); + }); + </script> + <p id="merge_section"> + <label for="id_merge_into"><?= __("Merge into") ?>:</label> + <input type="text" name="merge_into" id="id_merge_into" /> + </p> + <p> + <label for="id_comments"><?= __("Comments") ?>:</label> + <textarea name="comments" id="id_comments" rows="5" cols="50"></textarea> + </p> + <p> + <input type="submit" class="button" name="do_FileRequest" value="<?= __("File Request") ?>" /> + </p> + </fieldset> + </form> +</div> diff --git a/web/template/pkgreq_results.php b/web/template/pkgreq_results.php new file mode 100644 index 00000000..7933964c --- /dev/null +++ b/web/template/pkgreq_results.php @@ -0,0 +1,101 @@ +<div id="pkglist-results" class="box"> + <div class="pkglist-stats"> + <p><?= __('%d package requests found. Page %d of %d.', $total, $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> + + <table class="results"> + <thead> + <tr> + <th><?= __("Package") ?></th> + <th><?= __("Type") ?></th> + <th><?= __("Comments") ?></th> + <th><?= __("Filed by") ?></th> + <th><?= __("Date") ?></th> + <th><?= __("Status") ?></th> + </tr> + </thead> + <tbody> + + <?php while (list($indx, $row) = each($results)): ?> + <tr class="<?= ($indx % 2 == 0) ? 'odd' : 'even' ?>"> + <?php if ($row['BaseID']): ?> + <td><a href="<?= htmlspecialchars(get_pkgbase_uri($row["Name"]), ENT_QUOTES); ?>"><?= htmlspecialchars($row["Name"]) ?></a></td> + <?php else: ?> + <td><?= htmlspecialchars($row["Name"]) ?></td> + <?php endif; ?> + <?php if ($row['Type'] == 'merge'): ?> + <td><?= htmlspecialchars(ucfirst($row['Type']), ENT_QUOTES); ?> (<?= htmlspecialchars(ucfirst($row['MergeInto']), ENT_QUOTES); ?>)</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> + <td<?php if ($row['Status'] == 0 && time() - intval($row['RequestTS']) > $REQUEST_IDLE_TIME): ?> class="flagged"<?php endif; ?>><?= gmdate("Y-m-d H:i", intval($row['RequestTS'])) ?></td> + <?php if ($row['Status'] == 0): ?> + <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> + <?php elseif ($row['Type'] == 'orphan'): ?> + <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 endif; ?> + <?php endif; ?> + <form action="<?= get_uri('/pkgbase/'); ?>" method="post"> + <fieldset> + <input type="hidden" name="IDs[<?= $row['BaseID'] ?>]" value="1" /> + <input type="hidden" name="ID" value="<?= $row['BaseID'] ?>" /> + <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> + <input type="hidden" name="reqid" value="<?= $row['ID'] ?>" /> + <div> + <input type="submit" class="button text-button" name="do_CloseRequest" value="<?= __("Close") ?>" /> + </div> + </fieldset> + </form> + </td> + <?php else: ?> + <td><?= __("Closed") ?></td> + <?php endif; ?> + </tr> + <?php endwhile; ?> + + </tbody> + </table> + + <div class="pkglist-stats"> + <p><?= __('%d package requests found. Page %d of %d.', $total, $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> |