From 05633751411b14f7d18f20f06bae6adcc5dee53c Mon Sep 17 00:00:00 2001 From: rob Date: Fri, 16 May 2003 09:20:46 +0000 Subject: [PATCH] Started adding functionality for editing --- presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php | 22 ++++++++++++++++++++++ presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc | 6 +++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php b/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php index ea5c3eb..af8aae9 100644 --- a/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php +++ b/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php @@ -71,6 +71,28 @@ if (checkSession()) { $main->setHasRequiredFields(true); $main->render(); } + } else if (isset($fForEdit)) { + $oFolderCollaboration = FolderCollaboration::get($fFolderCollaborationID); + if ($oFolderCollaboration->hasDocumentInProcess()) { + include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); + + $oPatternCustom = & new PatternCustom(); + $oPatternCustom->setHtml(getViewPage($fFolderCollaborationID, $fFolderID)); + $main->setCentralPayload($oPatternCustom); + $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fForAdd=1"); + $main->setErrorMessage("You cannot add a new depedant document as there is currently a document in this folder undergoing collaboration"); + $main->render(); + + } else { + include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); + + $oPatternCustom = & new PatternCustom(); + $oPatternCustom->setHtml(getAddPage($fFolderCollaborationID, $fFolderID, (isset($fUnitID) ? $fUnitID : -1), (isset($fDocumentTitle) ? $fDocumentTitle : ""), (isset($fTemplateDocument) ? $fTemplateDocument : ""), (isset($fDocumentID) ? $fDocumentID : "") )); + $main->setCentralPayload($oPatternCustom); + $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fForStore=1"); + $main->setHasRequiredFields(true); + $main->render(); + } } else { include_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); diff --git a/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc b/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc index 52ca016..0e459b6 100644 --- a/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsUI.inc @@ -33,9 +33,9 @@ function getDocumentLinkFolderCollaborationData($iFolderCollaborationID) { $aColumns = array("document_title", "username", "template_document_name","edit"); $aColumnHeaders = array("Document title", "Default creator", "Template document", "Edit"); $aColumnTypes = array(1,1,3,3); - $aDBColumnArray = array("id","group_folder_approval_link_id", "template_document_id"); - $aQueryStringVariableNames = array("fDependantDocumentTemplateID","fFolderCollaborationID","fDocumentID"); - $aLinkURLs = array(2=>"$default->rootUrl/control.php?action=viewDocument", 3=>"$default->rootUrl/control.php?action=linkDocFolderCollaboration"); + $aDBColumnArray = array("id","group_folder_approval_link_id","template_document_id"); + $aQueryStringVariableNames = array("fDependantDocumentTemplateID", "fFolderCollaborationID", "fDocumentID"); + $aLinkURLs = array(2=>"$default->rootUrl/control.php?action=viewDocument", 3=>"$default->rootUrl/control.php?action=viewDependantDocument&fForEdit=1"); $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "90%", $aLinkURLs, $aDBColumnArray,$aQueryStringVariableNames); $oPatternTableSqlQuery->setTableHeading("Dependant Documents"); -- libgit2 0.21.4