From f2e17d3af3abcbf5fdcaf32cbe4ad076cbf599e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sun, 14 Oct 2007 16:12:21 +0200 Subject: [PATCH] objectManager: Add support for hiding the reject button, use it for buglinks --- include/bugs.php | 5 +++++ include/objectManager.php | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/bugs.php b/include/bugs.php index 7e87f0d..6e28be0 100644 --- a/include/bugs.php +++ b/include/bugs.php @@ -482,6 +482,11 @@ class Bug echo $oTable->GetString(); } + function objectHideReject() + { + return TRUE; + } + // NOTE: we don't have any editing support for this entry at this time // so output the entry and a field to identify the bug id function outputEditor() diff --git a/include/objectManager.php b/include/objectManager.php index fec70ff..75de915 100644 --- a/include/objectManager.php +++ b/include/objectManager.php @@ -271,6 +271,14 @@ class ObjectManager $this->handleMultiPageControls($aClean, FALSE); } + private function getOptionalSetting($sFunction, $bDefault) + { + if(!method_exists($this->sClass, $sFunction)) + return $bDefault; + + return $this->getObject()->$sFunction(); + } + /* display the entry for editing */ public function display_entry_for_editing($aClean, $sErrors) { @@ -363,7 +371,7 @@ class ObjectManager 'class="button" />',"\n"; } - if(!$this->bIsRejected) + if(!$this->bIsRejected && !$this->getOptionalSetting("objectHideReject", FALSE)) { echo '',"\n";