]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 286338: Remove admin options from footer in favor of a single link to Admin Optio...
authorlpsolit%gmail.com <>
Thu, 5 Apr 2007 23:18:06 +0000 (23:18 +0000)
committerlpsolit%gmail.com <>
Thu, 5 Apr 2007 23:18:06 +0000 (23:18 +0000)
admin.cgi [new file with mode: 0644]
skins/standard/admin.css
skins/standard/global.css
template/en/default/admin/admin.html.tmpl [new file with mode: 0644]
template/en/default/filterexceptions.pl
template/en/default/global/common-links.html.tmpl
template/en/default/global/useful-links.html.tmpl
template/en/default/global/user-error.html.tmpl

diff --git a/admin.cgi b/admin.cgi
new file mode 100644 (file)
index 0000000..3edff13
--- /dev/null
+++ b/admin.cgi
@@ -0,0 +1,49 @@
+#!/usr/bin/perl -wT
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Frédéric Buclin.
+# Portions created by Frédéric Buclin are Copyright (C) 2007
+# Frédéric Buclin. All Rights Reserved.
+#
+# Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
+
+use strict;
+
+use lib qw(.);
+
+use Bugzilla;
+use Bugzilla::Constants;
+use Bugzilla::Error;
+
+my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $user = Bugzilla->login(LOGIN_REQUIRED);
+
+print $cgi->header();
+
+$user->in_group('admin')
+  || $user->in_group('tweakparams')
+  || $user->in_group('editusers')
+  || $user->can_bless
+  || (Bugzilla->params->{'useclassification'} && $user->in_group('editclassifications'))
+  || $user->in_group('editcomponents')
+  || scalar(@{$user->get_products_by_permission('editcomponents')})
+  || $user->in_group('creategroups')
+  || $user->in_group('editkeywords')
+  || $user->in_group('bz_canusewhines')
+  || ThrowUserError('auth_failure', {action => 'access', object => 'administrative_pages'});
+
+$template->process('admin/admin.html.tmpl')
+  || ThrowTemplateError($template->error());
index e94e889da02f896cff913c1a3a2b54caa79ac3d0..9fcb46c94e45540ee2bf2c01218d2ce16e3ba822 100644 (file)
@@ -43,3 +43,25 @@ p.areyoureallyreallysure {
 tr.param_disabled {
     background-color: lightgrey;
 }
+
+td.admin_links {
+    width: 50%;
+    padding: 1em;
+    vertical-align: top;
+}
+
+td.admin_links dt {
+    margin-top: 1em;
+}
+
+td.admin_links dt.forbidden, td.admin_links dd.forbidden {
+    font-size: smaller;
+    font-style: italic;
+    color: #aaa;
+}
+
+td.admin_links dt.forbidden a, td.admin_links dd.forbidden a {
+    text-decoration: none;
+    color: inherit;
+    cursor: default;
+}
index 0b0a51300fef3d8d2f13da3808de923576562504..1687a4aa0c8b85a1fac884427fdebe671c53cfea 100644 (file)
     }
 
     #footer #links-actions,
-    #footer #links-edit,
     #footer #links-saved,
     #footer #links-special {
         display: table-row;
diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl
new file mode 100644 (file)
index 0000000..15316ed
--- /dev/null
@@ -0,0 +1,126 @@
+[%# 1.0@bugzilla.org %]
+[%# The contents of this file are subject to the Mozilla Public
+  # License Version 1.1 (the "License"); you may not use this file
+  # except in compliance with the License. You may obtain a copy of
+  # the License at http://www.mozilla.org/MPL/
+  #
+  # Software distributed under the License is distributed on an "AS
+  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+  # implied. See the License for the specific language governing
+  # rights and limitations under the License.
+  #
+  # The Original Code is the Bugzilla Bug Tracking System.
+  #
+  # Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
+  #%]
+
+[% PROCESS global/variables.none.tmpl %]
+
+[% title = BLOCK %]
+  Administrate your installation ([% terms.Bugzilla %]
+  [%+ constants.BUGZILLA_VERSION FILTER html %])
+[% END %]
+
+[% PROCESS global/header.html.tmpl title = title
+                                   style_urls = ['skins/standard/admin.css']
+%]
+
+<div>
+  This page is only accessible to empowered users. You can access administrive pages
+  from here (based on your privileges), letting you configure different aspects of
+  this installation. Note: some sections may not be accessible to you and are marked
+  using a lighter color.
+</div>
+
+<table>
+  <tr>
+    <td class="admin_links">
+      <dl>
+        [% class = user.groups.tweakparams ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editparams.cgi">Parameters</a></dt>
+        <dd class="[% class %]">Set core parameters of the installation. That's the
+        place where you specify the URL to access this installation, determine how
+        users authenticate, choose which [% terms.bug %] fields to display, select
+        the mail transfer agent to send email notifications, choose which group of
+        users can use charts and share queries, and much more.</dd>
+
+        <dt class="[% class %]"><a href="editsettings.cgi">User Preferences</a></dt>
+        <dd class="[% class %]">Set the default user preferences. These are the values
+        which will be used by default for all users. Users will be able to edit their
+        own preferences from the <a href="userprefs.cgi?tab=settings">Preferences</a>.</dd>
+
+        [% class = user.groups.editcomponents ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="sanitycheck.cgi">Sanity Check</a></dt>
+        <dd class="[% class %]">Run sanity checks to locate problems in your database.
+        This may take several tens of minutes depending on the size of your installation.
+        You can also automate this check by running <tt>sanitycheck.pl</tt> from a cron job.
+        A notification will be sent per email to the specified user if errors are detected.</dd>
+
+        [% class = (user.groups.editusers || user.can_bless) ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editusers.cgi">Users</a></dt>
+        <dd class="[% class %]">Create new user accounts or edit existing ones. You can
+        also add and remove users from groups (also known as "user privileges").</dd>
+
+        [% class = (Param('useclassification') && user.groups.editclassifications) ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editclassifications.cgi">Classifications</a></dt>
+        <dd class="[% class %]">If your installation has to manage many products at once,
+        it's a good idea to group these products into distinct categories. This lets users
+        find information more easily when doing searches or when filing new [% terms.bugs %].</dd>
+
+        [% class = (user.groups.editcomponents
+                    || user.get_products_by_permission("editcomponents").size) ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editproducts.cgi">Products</a></dt>
+        <dd class="[% class %]">Edit all aspects of products, including group restrictions
+        which let you define who can access [% terms.bugs %] being in these products. You
+        can also edit some specific attributes of products such as
+        <a href="editcomponents.cgi">components</a>, <a href="editversions.cgi">versions</a>
+        and <a href="editmilestones.cgi">milestones</a> directly.</dd>
+      </dl>
+    </td>
+
+    <td class="admin_links">
+      <dl>
+        [% class = user.groups.editcomponents ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editflagtypes.cgi">Flags</a></dt>
+        <dd class="[% class %]">A flag is a custom 4-states attribute of [% terms.bugs %]
+        and/or attachments. These states are: granted, denied, requested and undefined.
+        You can set as many flags as desired per [% terms.bug %], and define which users
+        are allowed to edit them.</dd>
+
+        [% class = user.groups.admin ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editfields.cgi">Custom Fields</a></dt>
+        <dd class="[% class %]">[% terms.Bugzilla %] lets you define fields which are
+        not implemented by default, based on your local and specific requirements.
+        These fields can then be used as any other field, meaning that you can set
+        them in [% terms.bugs %] and run any search involving them.<br>
+        Before creating new fields, keep in mind that too many fields may make the user
+        interface more complex and harder to use. Be sure you have investigated other ways
+        to satisfy your needs before doing this.</dd>
+
+        <dt class="[% class %]"><a href="editvalues.cgi">Field Values</a></dt>
+        <dd class="[% class %]">Define legal values for fields whose values must belong
+        to some given list. This is also the place where you define legal values for some
+        types of custom fields.</dd>
+
+        [% class = user.groups.creategroups ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editgroups.cgi">Groups</a></dt>
+        <dd class="[% class %]">Define groups which will be used in the installation.
+        They can either be used to define new user privileges or to restrict the access
+        to some [% terms.bugs %].</dd>
+
+        [% class = user.groups.editkeywords ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editkeywords.cgi">Keywords</a></dt>
+        <dd class="[% class %]">Set keywords to be used with [% terms.bugs %]. Keywords
+        are an easy way to "tag" [% terms.bugs %] to let you find them more easily later.</dd>
+
+        [% class = user.groups.bz_canusewhines ? "" : "forbidden" %]
+        <dt class="[% class %]"><a href="editwhines.cgi">Whining</a></dt>
+        <dd class="[% class %]">Set queries which will be run at some specified date
+        and time, and get the result of these queries directly per email. This is a
+        good way to create reminders and to keep track of the activity in your installation.</dd>
+      </dl>
+    </td>
+  </tr>
+</table>
+
+[% PROCESS global/footer.html.tmpl %]
index 231ad98f511ea62a6a6e071445754a7a16e67f44..72ab1550ab36cca0dd430cf631e2b805dd2a63c0 100644 (file)
   'section_num'
 ],
 
+'admin/admin.html.tmpl' => [
+  'class'
+],
+
 'admin/table.html.tmpl' => [
   'link_uri'
 ],
index dca5d7262ea6646afab87e618aed2f10e5367249..937f7a9553bbf5629d9662d18197dfa3948825ca 100644 (file)
 
   [% IF user.login %]
     <li><span class="separator">| </span><a href="userprefs.cgi">Preferences</a></li>
+    [% IF user.groups.tweakparams || user.groups.editusers || user.can_bless
+          || (Param('useclassification') && user.groups.editclassifications)
+          || user.groups.editcomponents || user.groups.admin || user.groups.creategroups
+          || user.groups.editkeywords || user.groups.bz_canusewhines
+          || user.get_products_by_permission("editcomponents").size %]
+      <li><span class="separator">| </span><a href="admin.cgi">Administration</a></li>
+    [% END %]
     <li>
       <span class="separator">| </span>
       [% IF user.authorizer.can_logout %]
index 5dff3d578667b57a857eb980ed453b857fe88e23..998b5a67a0c926634c160c87a5629adb191bd7fe 100644 (file)
       [% PROCESS "global/common-links.html.tmpl" btn_id = "find_bottom" %]
   </li>
 
-  [%# We have no other choices than enumerating all required privileges to have
-    # at least one link in this section. %]
-  [% IF user.login
-     && (user.groups.tweakparams || user.groups.editusers || user.can_bless
-         || (Param('useclassification') && user.groups.editclassifications)
-         || user.groups.editcomponents || user.groups.admin || user.groups.creategroups
-         || user.groups.editkeywords || user.groups.bz_canusewhines) %]
-
-    [% print_pipe = 0 %]
-    <li id="links-edit">
-      <div class="label">Edit: </div>
-      <ul class="links">
-        [% IF user.groups.tweakparams %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editparams.cgi">Parameters</a></li>
-          [% print_pipe = 1 %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editsettings.cgi">User Preferences</a></li>
-        [% END %]
-        [% IF user.groups.editcomponents %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="sanitycheck.cgi">Sanity Check</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF user.groups.editusers || user.can_bless %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editusers.cgi">Users</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF Param('useclassification') && user.groups.editclassifications %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editclassifications.cgi">Classifications</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF user.groups.editcomponents || user.get_products_by_permission("editcomponents").size %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editproducts.cgi">Products</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF user.groups.editcomponents %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editflagtypes.cgi">Flags</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF user.groups.admin %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editfields.cgi">Custom Fields</a></li>
-          [% print_pipe = 1 %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editvalues.cgi">Field Values</a></li>
-        [% END %]
-        [% IF user.groups.creategroups %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editgroups.cgi">Groups</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF user.groups.editkeywords %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editkeywords.cgi">Keywords</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-        [% IF user.groups.bz_canusewhines %]
-          <li>[% '<span class="separator">| </span>' IF print_pipe %]<a href="editwhines.cgi">Whining</a></li>
-          [% print_pipe = 1 %]
-        [% END %]
-      </ul>
-    </li>
-  [% END %]
-    
-    [%# Saved searches %]
+  [%# Saved searches %]
     
   [% IF user.showmybugslink OR user.queries.size 
         OR user.queries_subscribed.size 
index 7452ab8d1a6b256113fd360cdcb264920e893d6b..171eb9c20475378194e4c8696cb121d553837e08 100644 (file)
       use
     [% END %]
 
-    [% IF object == "attachment" %]
+    [% IF object == "administrative_pages" %]
+      administrative pages
+    [% ELSIF object == "attachment" %]
       this attachment
     [% ELSIF object == "bugs" %]
       [%+ terms.bugs %]