]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 390955: Add some useful standard searches to the index page
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 6 Jan 2014 23:02:09 +0000 (00:02 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 6 Jan 2014 23:02:09 +0000 (00:02 +0100)
r=dkl a=sgreen

images/rss.png [new file with mode: 0644]
index.cgi
skins/standard/global.css
skins/standard/index.css
template/en/default/index.html.tmpl

diff --git a/images/rss.png b/images/rss.png
new file mode 100644 (file)
index 0000000..1679ab0
Binary files /dev/null and b/images/rss.png differ
index 096d48d41d36d482da67054e3b1f588a478a643f..e52d01b030d710758b090c54f5e7bc2c5a433425 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -45,6 +45,19 @@ if ($user->in_group('admin')) {
     $vars->{'release'} = Bugzilla::Update::get_notifications();
 }
 
+if ($user->id) {
+    my $dbh = Bugzilla->dbh;
+    $vars->{assignee_count} =
+      $dbh->selectrow_array('SELECT COUNT(*) FROM bugs WHERE assigned_to = ?
+                             AND resolution = ""', undef, $user->id);
+    $vars->{reporter_count} =
+      $dbh->selectrow_array('SELECT COUNT(*) FROM bugs WHERE reporter = ?
+                             AND resolution = ""', undef, $user->id);
+    $vars->{requestee_count} =
+      $dbh->selectrow_array('SELECT COUNT(DISTINCT bug_id) FROM flags
+                             WHERE requestee_id = ?', undef, $user->id);
+}
+
 # Generate and return the UI (HTML page) from the appropriate template.
 $template->process("index.html.tmpl", $vars)
   || ThrowTemplateError($template->error());
index d10fac026e27849437b8d03315f6af9da2346e29..cf4fe57bf670de3239f4c629e9d08bb50db67e1e 100644 (file)
@@ -259,6 +259,12 @@ div#docslinks {
     margin: 0;
 }
 
+.rss {
+    background: transparent url(../../images/rss.png) no-repeat;
+    padding-left: 16px;
+    line-height: 1.5em;
+}
+
 /**************************/
 /* Bug links and statuses */
 /**************************/
index 5956920255ea4b9dbdea9ec193ffe07bdcb52fcc..bfe0b2ab877a6ba2d56725b5bcc71aedd3197388 100644 (file)
     .bz_common_actions a:hover {
         text-decoration: none;
     }
-    #enter_bug { background: url(index/file-a-bug.png)     no-repeat; }
-    #query     { background: url(index/search.png)  no-repeat; }
-    #account   { 
-      background: url(index/new-account.png) no-repeat; 
-      margin-right: 0;
-    }
-    
+    #enter_bug { background: url(index/file-a-bug.png)  no-repeat; }
+    #query     { background: url(index/search.png)      no-repeat; }
+    #account   { background: url(index/new-account.png) no-repeat; }
+    #help      { background: url(index/help.png)        no-repeat; }
+
     #quicksearchForm
     {
         clear: both;
         margin: 0 0 0.8em 0;
         padding: 0;
     }
-    
+
+    #common_queries ul {
+        list-style: none;
+        padding-left: 1.5em;
+    }
+
+    #common_queries li a {
+        text-decoration: none;
+    }
+
     ul.additional_links 
     {
         list-style: none;
index b47b912c080ce1c97f037068125cb96fdd3c3d7b..61d083d1b7af8c03b2b76e34678322d81d5a3168 100644 (file)
@@ -22,9 +22,6 @@
 <!--
 function onLoadActions() {
   quicksearchHelpText('quicksearch_main', 'show');
-  if( window.external.AddSearchProvider ){
-    YAHOO.util.Dom.removeClass('quicksearch_plugin', 'bz_default_hidden');
-  }
   document.getElementById('quicksearch_top').focus();
 }
 var quicksearch_message = "Enter [% terms.abug %] # or some search terms";
@@ -101,73 +98,105 @@ YAHOO.util.Event.onDOMReady(onLoadActions);
 [% END %]
 
 <div id="page-index">
-  <table>
-    <tr>
-      <td>
-        <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1>
-        <div class="intro">[% Hook.process('intro') %]</div>
-
-        <div class="bz_common_actions">
-          <ul>
-            <li>
-              <a id="enter_bug" href="enter_bug.cgi"><span>File
-              [%= terms.aBug %]</span></a>
-            </li>
-            <li>
-              <a id="query" href="query.cgi"><span>Search</span></a>
-            </li>
-            <li>
-              <a id="account"
-                 [% IF user.id %]
-                   href="userprefs.cgi"><span>User Preferences</span></a>
-                 [% ELSIF Param('createemailregexp')
-                          && user.authorizer.user_can_create_account 
-                 %]
-                   href="createaccount.cgi"><span>Open a New Account</span></a>
-                 [% ELSE %]
-                   href="?GoAheadAndLogIn=1"><span>Log In</span></a>
-                 [% END %]
-            </li>
-          </ul>
-        </div>
-
-        <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi"
-              onsubmit="return checkQuicksearch(this);">
-          <div>
-            <input id="quicksearch_main" type="text" name="quicksearch"
-              title="Quick Search" 
-              onfocus="quicksearchHelpText(this.id, 'hide');"
-              onblur="quicksearchHelpText(this.id, 'show');"
-            >
-            <input id="find" type="submit" value="Quick Search">
-            <ul class="additional_links" id="quicksearch_links">
-              <li>
-                <a href="page.cgi?id=quicksearch.html">Quick Search help</a>
-              </li>
-              <li class="bz_default_hidden" id="quicksearch_plugin">
-                |
-                <a href="javascript:window.external.AddSearchProvider('[% urlbase FILTER html %]search_plugin.cgi')">
-                 Install the Quick Search plugin
-                </a>
-              </li>
-            </ul>
-            <ul class="additional_links">
-              <li>
-                <a href="[% docs_urlbase FILTER html %]using.html">
-                  [%- terms.Bugzilla %] User's Guide</a>
-              </li>
-              <li>
-                |
-                <a href="page.cgi?id=release-notes.html">Release Notes</a>
-              </li>
-              [% Hook.process('additional_links') %]
-            </ul>
-          </div>
-        </form>
-        <div class="outro">[% Hook.process('outro') %]</div>
-      </td>
-    </tr>
-  </table>
+  <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1>
+  <div class="intro">[% Hook.process('intro') %]</div>
+
+  <div class="bz_common_actions">
+    <ul>
+      <li>
+        <a id="enter_bug" href="enter_bug.cgi"><span>File [% terms.aBug %]</span></a>
+      </li>
+      <li>
+        <a id="query" href="query.cgi"><span>Search</span></a>
+      </li>
+      <li>
+        <a id="account"
+          [% IF user.id %]
+            href="userprefs.cgi"><span>User Preferences</span></a>
+          [% ELSIF Param('createemailregexp') && user.authorizer.user_can_create_account %]
+            href="createaccount.cgi"><span>Open a New Account</span></a>
+          [% ELSE %]
+            href="?GoAheadAndLogIn=1"><span>Log In</span></a>
+          [% END %]
+      </li>
+      [% IF Param("docs_urlbase") %]
+        <li>
+          <a id="help" href="[% docs_urlbase FILTER html %]using.html"><span>Documentation</span></a>
+        </li>
+      [% END %]
+    </ul>
+  </div>
+
+  <div>
+    <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi"
+          onsubmit="return checkQuicksearch(this);">
+      <input id="quicksearch_main" type="text" name="quicksearch" title="Quick Search"
+             onfocus="quicksearchHelpText(this.id, 'hide');"
+             onblur="quicksearchHelpText(this.id, 'show');">
+      <input id="find" type="submit" value="Quick Search">
+      <a href="page.cgi?id=quicksearch.html" title="Quick Search help">[?]</a>
+    </form>
+
+    <ul class="additional_links">
+      [% Hook.process('additional_links') %]
+    </ul>
+  </div>
+
+  <div id="common_queries">
+    <h4>Common Queries:</h4>
+    <ul>
+      [% IF user.id %]
+        <li>
+          [% title = BLOCK %]Open [% terms.bugs %] assigned to me[% END %]
+          <a href="buglist.cgi?f1=assigned_to&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---">
+            [% title FILTER html %]</a> ([% assignee_count FILTER html %])
+          <a href="buglist.cgi?f1=assigned_to&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+             class="rss">&nbsp;</a>
+        </li>
+        <li>
+          [% title = BLOCK %]Open [% terms.bugs %] reported by me[% END %]
+          <a href="buglist.cgi?f1=reporter&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---">
+            [% title FILTER html %]</a> ([% reporter_count FILTER html %])
+          <a href="buglist.cgi?f1=reporter&amp;o1=equals&amp;v1=%25user%25&amp;resolution=---&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+             class="rss">&nbsp;</a>
+        </li>
+        [% IF Bugzilla.has_flags %]
+          <li>
+            [% title = BLOCK %]Requests addressed to me[% END %]
+            <a href="request.cgi?action=queue&amp;requestee=[% user.login FILTER uri %]&amp;group=type&amp;do_union=0">
+              [% title FILTER html %]</a> ([% requestee_count FILTER html %])
+            <a href="buglist.cgi?f1=requestees.login_name&amp;o1=equals&amp;v1=%25user%25&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+               class="rss">&nbsp;</a>
+          </li>
+        [% END %]
+      [% END %]
+
+      <li>
+        [% terms.Bugs %] reported in the
+        <a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=24h">last 24 hours</a>
+        [% title = BLOCK %][% terms.Bugs %] reported in the last 24 hours[% END %]
+        <a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=24h&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+           class="rss">&nbsp;</a>
+        | <a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=7d">last 7 days</a>
+        [% title = BLOCK %][% terms.Bugs %] reported in the last 7 days[% END %]
+        <a href="buglist.cgi?chfield=[Bug%20creation]&amp;chfieldfrom=7d&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+           class="rss">&nbsp;</a>
+      </li>
+      <li>
+        [% terms.Bugs %] changed in the
+        <a href="buglist.cgi?chfieldfrom=24h">last 24 hours</a>
+        [% title = BLOCK %][% terms.Bugs %] changed in the last 24 hours[% END %]
+        <a href="buglist.cgi?chfieldfrom=24h&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+           class="rss">&nbsp;</a>
+        | <a href="buglist.cgi?chfieldfrom=7d">last 7 days</a>
+        [% title = BLOCK %][% terms.Bugs %] changed in the last 7 days[% END %]
+        <a href="buglist.cgi?chfieldfrom=7d&amp;ctype=atom&amp;title=[% title FILTER uri %]"
+           class="rss">&nbsp;</a>
+      </li>
+    </ul>
+  </div>
+
+  <div class="outro">[% Hook.process('outro') %]</div>
 </div>
 
 [% PROCESS global/footer.html.tmpl %]