From 55e530f918ac5189cba9f81f32c08c66d05b6425 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 15 Aug 2012 13:18:29 +1200 Subject: [PATCH] BUGFIX: removing unnecessary extra function to embargo (to show document about to be published when in draft mode) --- code/DMSDocument.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/code/DMSDocument.php b/code/DMSDocument.php index e289ef8..91eeddb 100644 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -256,10 +256,16 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { /** * Returns if this is Document is embargoed or expired. + * Also, returns if the document should be displayed on the front-end. Respecting the current reading mode + * of the site and the embargo status. + * I.e. if a document is embargoed until published, then it should still show up in draft mode. * @return bool True or False depending on whether this document is embargoed */ function isHidden() { - return $this->isEmbargoed() || $this->isExpired(); + $hidden = $this->isEmbargoed() || $this->isExpired(); + $readingMode = Versioned::get_reading_mode(); + if ($readingMode == "Stage.Stage" && $this->EmbargoedUntilPublished == true) $hidden = false; + return $hidden; } /** @@ -670,18 +676,6 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { $file->delete(); } - - /** - * Returns if the document should be displayed on the front-end. Respecting the current reading mode - * of the site and the embargo status. - * I.e. if a document is embargoed until published, then it should still show up in draft mode. - */ - function getDisplayDocument() { - $display = !$this->isHidden(); - $readingMode = Versioned::get_reading_mode(); - if ($readingMode == "Stage.Stage" && $this->EmbargoedUntilPublished == true) $display = true; - return $display; - } } class DMSDocument_Controller extends Controller {