Merge "Support to enable/disable the Bugzilla integration in the UI"
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaModule.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaModule.java
index b9030d2..60b5181 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaModule.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/bz/BugzillaModule.java
@@ -20,6 +20,7 @@
 
 import com.google.gerrit.extensions.annotations.PluginName;
 import com.google.gerrit.server.config.GerritServerConfig;
+import com.google.gerrit.server.config.PluginConfigFactory;
 import com.google.inject.AbstractModule;
 import com.google.inject.Inject;
 
@@ -32,12 +33,15 @@
 
   private final String pluginName;
   private final Config gerritConfig;
+  private final PluginConfigFactory pluginCfgFactory;
 
   @Inject
   public BugzillaModule(@PluginName final String pluginName,
-      @GerritServerConfig final Config config) {
+      @GerritServerConfig final Config config,
+      PluginConfigFactory pluginCfgFactory) {
     this.pluginName = pluginName;
     this.gerritConfig = config;
+    this.pluginCfgFactory = pluginCfgFactory;
   }
 
   @Override
@@ -46,7 +50,7 @@
       log.info("Bugzilla is configured as ITS");
       bind(ItsFacade.class).toInstance(new BugzillaItsFacade(pluginName, gerritConfig));
 
-      install(new ItsHookModule());
+      install(new ItsHookModule(pluginName, pluginCfgFactory));
     }
   }
 }
diff --git a/src/main/resources/Documentation/config.md b/src/main/resources/Documentation/config.md
index 4788a8e..c3adabb 100644
--- a/src/main/resources/Documentation/config.md
+++ b/src/main/resources/Documentation/config.md
@@ -30,6 +30,12 @@
 a project can enforce the Bugzilla integration for all child projects by
 setting `plugin.its-bugzilla.enabled` to `enforced`.
 
+On the project info screen there is a dropdown list for the
+`plugin.its-bugzilla.enabled` parameter which offers the values `true`,
+`false`, `enforced` and `INHERIT`. Project owners can change this
+parameter and save it. If the Bugzilla integration is enforced by a
+parent project the dropdown list is disabled.
+
 The Bugzilla integration can be limited to specific branches by setting
 `plugin.its-bugzilla.branch`. The branches may be configured using explicit
 branch names, ref patterns, or regular expressions. Multiple branches