summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Flag.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-03-18 03:38:27 +0100
committerlpsolit%gmail.com <>2008-03-18 03:38:27 +0100
commit84c503892397b64020047cffe4fc32bae6bd8a85 (patch)
tree96dfc6aacd2ff6ec81414145dc01d521a9866981 /Bugzilla/Flag.pm
parent141674b72a53c2ab32341095d10eee964b7f5af8 (diff)
downloadbugzilla-84c503892397b64020047cffe4fc32bae6bd8a85.tar.gz
bugzilla-84c503892397b64020047cffe4fc32bae6bd8a85.tar.xz
Bug 180259: "Requests" (logged out) and "My Requests" (logged in) links appear in footer even if the site doesn't use requests - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=LpSolit
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r--Bugzilla/Flag.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 00e40e33f..f8c43b508 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -191,6 +191,26 @@ sub attachment {
=over
+=item C<has_flags>
+
+Returns 1 if at least one flag exists in the DB, else 0. This subroutine
+is mainly used to decide to display the "(My )Requests" link in the footer.
+
+=back
+
+=cut
+
+sub has_flags {
+ my $dbh = Bugzilla->dbh;
+
+ my $has_flags = $dbh->selectrow_array('SELECT 1 FROM flags ' . $dbh->sql_limit(1));
+ return $has_flags || 0;
+}
+
+=pod
+
+=over
+
=item C<match($criteria)>
Queries the database for flags matching the given criteria