[aur-dev] [PATCH 1/2] Allow to search for both maintainer and co-maintainer
As a follow-up to commit 6cb8c04 (Implement co-maintainer search, 2017-01-26), add an option to search for both maintainers and co-maintainers at the same time. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/lib/pkgfuncs.inc.php | 8 ++++++++ web/template/pkg_search_form.php | 1 + 2 files changed, 9 insertions(+) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 063cc93..030ec9a 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -717,6 +717,14 @@ function pkg_search_page($params, $show_headers=true, $SID="") { $q_where .= "WHERE PackageComaintainers.PackageBaseID = PackageBases.ID "; $q_where .= "AND Users.Username = " . $dbh->quote($params['K']) . ")"; } + elseif (isset($params["SeB"]) && $params["SeB"] == "M") { + /* Search by maintainer and co-maintainer. */ + $q_where .= "AND (Users.Username = " . $dbh->quote($params['K']) . " "; + $q_where .= "OR EXISTS (SELECT * FROM PackageComaintainers "; + $q_where .= "INNER JOIN Users ON Users.ID = PackageComaintainers.UsersID "; + $q_where .= "WHERE PackageComaintainers.PackageBaseID = PackageBases.ID "; + $q_where .= "AND Users.Username = " . $dbh->quote($params['K']) . "))"; + } elseif (isset($params["SeB"]) && $params["SeB"] == "s") { /* Search by submitter. */ $q_where .= "AND SubmitterUID = " . intval(uid_from_username($params['K'])) . " "; diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php index 688cfcc..3d0cde6 100644 --- a/web/template/pkg_search_form.php +++ b/web/template/pkg_search_form.php @@ -10,6 +10,7 @@ $searchby = array( 'k' => __('Keywords'), 'm' => __('Maintainer'), 'c' => __('Co-maintainer'), + 'M' => __('Maintainer, Co-maintainer'), 's' => __('Submitter') ); -- 2.11.1
Implement a table that shows all packages which are flagged out-of-date and either maintained or co-maintained by the currently logged in user. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/html/home.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/html/home.php b/web/html/home.php index 08ae59f..62409af 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -21,6 +21,18 @@ if (isset($_COOKIE["AURSID"])) { <div id="intro" class="box"> <?php if (isset($_COOKIE["AURSID"])): ?> <h2><?= __("Dashboard"); ?></h2> + <h3><?= __("My Flagged Packages"); ?></h3> + <?php + $params = array( + 'PP' => 50, + 'SeB' => 'M', + 'K' => username_from_sid($_COOKIE["AURSID"]), + 'outdated' => 'on', + 'SB' => 'l', + 'SO' => 'a' + ); + pkg_search_page($params, false, $_COOKIE["AURSID"]); + ?> <h3><?= __("My Packages"); ?> <span class="more">(<a href="<?= get_uri('/packages/') ?>?SeB=m&K=<?= username_from_sid($_COOKIE["AURSID"]); ?>"><?= __('more') ?></a>)</span></h3> <?php $params = array( -- 2.11.1
participants (1)
-
Lukas Fleischer