Commit e0b473f8a4ef3760edff4b3e5d9f65611dca59b9
1 parent
720d19cc
updated to use document status checking methods
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1955 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
23 additions
and
24 deletions
lib/browse/CategoryBrowser.inc
| ... | ... | @@ -91,7 +91,7 @@ class CategoryBrowser extends Browser { |
| 91 | 91 | // check permissions |
| 92 | 92 | if (Permission::userHasDocumentReadPermission($sql->f("document_id"))) { |
| 93 | 93 | $oDocument = & Document::get($sql->f("document_id")); |
| 94 | - if ($oDocument->getStatusID() == lookupStatusID("Live")) { | |
| 94 | + if ($oDocument->isLive()) { | |
| 95 | 95 | $results["documents"][] = $oDocument; |
| 96 | 96 | } |
| 97 | 97 | } else { | ... | ... |
lib/browse/DocumentTypeBrowser.inc
| ... | ... | @@ -81,7 +81,7 @@ class DocumentTypeBrowser extends Browser { |
| 81 | 81 | // check permission |
| 82 | 82 | if (Permission::userHasDocumentReadPermission($sql->f("id"))) { |
| 83 | 83 | $oDocument = & Document::get($sql->f("id")); |
| 84 | - if ($oDocument->getStatusID() == lookupStatusID("Live")) { | |
| 84 | + if ($oDocument->isLive()) { | |
| 85 | 85 | $results["documents"][] = $oDocument; |
| 86 | 86 | } |
| 87 | 87 | } else { | ... | ... |
lib/browse/FolderBrowser.inc
| ... | ... | @@ -121,7 +121,7 @@ class FolderBrowser extends Browser { |
| 121 | 121 | // add documents to array |
| 122 | 122 | // set file attributes |
| 123 | 123 | $oDocument = & Document::get($sql->f("id")); |
| 124 | - if ($oDocument->getStatusID() == lookupStatusID("Live")) { | |
| 124 | + if ($oDocument->isLive()) { | |
| 125 | 125 | $results["documents"][] = $oDocument; |
| 126 | 126 | } |
| 127 | 127 | } else { | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | -* documentViewUI.php | |
| 4 | -* Contains the business logic required to build the document view page. | |
| 5 | -* Will use documentViewUI.php for HTML | |
| 6 | -* | |
| 7 | -* Expected form varaibles: | |
| 8 | -* o $fDocumentID - Primary key of document to view | |
| 9 | -* | |
| 10 | -* Optional form variables: | |
| 11 | -* o fCollaborationEdit - the user attempted to edit a collaboration step that is currently active | |
| 12 | -* o fForDownload - the user is attempting to download the document | |
| 13 | -* o fBeginCollaboration - the user selected the 'Begin Collaboration' button | |
| 14 | -* o fFireSubscription - the document has been modified, and a subscription alert must be fired | |
| 15 | -* | |
| 16 | -* | |
| 17 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 18 | -* @date 21 January 2003 | |
| 19 | -* @package presentation.lookAndFeel.knowledgeTree.documentManager | |
| 20 | -*/ | |
| 21 | - | |
| 3 | + * $Id$ | |
| 4 | + * Contains the business logic required to build the document view page. | |
| 5 | + * Will use documentViewUI.php for HTML | |
| 6 | + * | |
| 7 | + * Expected form varaibles: | |
| 8 | + * o $fDocumentID - Primary key of document to view | |
| 9 | + * | |
| 10 | + * Optional form variables: | |
| 11 | + * o fCollaborationEdit - the user attempted to edit a collaboration step that is currently active | |
| 12 | + * o fForDownload - the user is attempting to download the document | |
| 13 | + * o fBeginCollaboration - the user selected the 'Begin Collaboration' button | |
| 14 | + * o fFireSubscription - the document has been modified, and a subscription alert must be fired | |
| 15 | + * | |
| 16 | + * | |
| 17 | + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 18 | + * @date 21 January 2003 | |
| 19 | + * @package presentation.lookAndFeel.knowledgeTree.documentManager | |
| 20 | + */ | |
| 22 | 21 | |
| 23 | 22 | require_once("../../../../config/dmsDefaults.php"); |
| 24 | 23 | |
| ... | ... | @@ -225,13 +224,13 @@ if (checkSession()) { |
| 225 | 224 | } |
| 226 | 225 | |
| 227 | 226 | $oPatternCustom = & new PatternCustom(); |
| 228 | - if ($oDocument->getStatusID() == lookupStatusID("Live")) { | |
| 227 | + if ($oDocument->isLive()) { | |
| 229 | 228 | if (Permission::userHasDocumentWritePermission($fDocumentID)) { |
| 230 | 229 | $oPatternCustom->setHtml(getEditPage($oDocument)); |
| 231 | 230 | } else if (Permission::userHasDocumentReadPermission($fDocumentID)) { |
| 232 | 231 | $oPatternCustom->setHtml(getViewPage($oDocument)); |
| 233 | 232 | } |
| 234 | - } else if ($oDocument->getStatusID() == lookupStatusID("Archived")) { | |
| 233 | + } else if ($oDocument->isArchived()) { | |
| 235 | 234 | // cancel |
| 236 | 235 | $oPatternCustom->setHtml("<a href=\"" . generateControllerLink("browse", "fFolderID=" . $oDocument->getFolderID()) . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\" /></a>\n"); |
| 237 | 236 | $main->setErrorMessage("This document has been archived."); | ... | ... |