Commit 45da37c6e4c76127b025263ee5b3727b43eb3ce9

Authored by michael
1 parent bd05f736

changed to use controllerRedirect and attempted to fix lack of templateDocument name integration


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2222 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteDependantDocumentBL.php
... ... @@ -16,7 +16,8 @@
16 16 require_once("../../../../config/dmsDefaults.php");
17 17  
18 18 if (checkSession()) {
19   - if (isset($fFolderID) && isset($fFolderCollaborationID)) {
  19 + if (isset($fFolderID) && isset($fFolderCollaborationID)) {
  20 + require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
20 21 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
21 22 require_once("$default->fileSystemRoot/lib/users/User.inc");
22 23 require_once("$default->fileSystemRoot/lib/documentmanagement/DependantDocumentTemplate.inc");
... ... @@ -31,16 +32,16 @@ if (checkSession()) {
31 32 if (isset($fForDelete)) {
32 33 $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID);
33 34 if ($oDependantDocumentTemplate->delete()) {
34   - redirect($default->rootUrl . "/control.php?action=viewDependantDocument&fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID");
  35 + controllerRedirect("viewDependantDocument", "fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID");
35 36 } else {
36 37 $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID);
37 38 $oUser = User::get($oDependantDocumentTemplate->getDefaultUserId());
38 39  
39 40 $oPatternCustom = & new PatternCustom();
40   - $oPatternCustom->setHtml(getPage($fFolderID, $fFolderCollaborationID, $oDependantDocumentTemplate->getDocumentTitle(), $oUser->getName(), 'sTemplateDocument'));
  41 + $oPatternCustom->setHtml(getPage($fFolderID, $fFolderCollaborationID, $oDependantDocumentTemplate->getDocumentTitle(), $oUser->getName(), Document::getName($oDependantDocumentTemplate->getTemplateDocumentID())));
41 42 $main->setCentralPayload($oPatternCustom);
42 43 $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fDependantDocumentTemplateID=$fDependantDocumentTemplateID&fForDelete=1");
43   - $main->setErrorMessage("An error occured while attempting to delete the depedant document");
  44 + $main->setErrorMessage("An error occured while attempting to delete the dependant document");
44 45 $main->render();
45 46 }
46 47  
... ... @@ -51,7 +52,7 @@ if (checkSession()) {
51 52 $oUser = User::get($oDependantDocumentTemplate->getDefaultUserId());
52 53  
53 54 $oPatternCustom = & new PatternCustom();
54   - $oPatternCustom->setHtml(getPage($fFolderID, $fFolderCollaborationID, $oDependantDocumentTemplate->getDocumentTitle(), $oUser->getName(), 'sTemplateDocument'));
  55 + $oPatternCustom->setHtml(getPage($fFolderID, $fFolderCollaborationID, $oDependantDocumentTemplate->getDocumentTitle(), $oUser->getName(), Document::getName($oDependantDocumentTemplate->getTemplateDocumentID())));
55 56 $main->setCentralPayload($oPatternCustom);
56 57 $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fDependantDocumentTemplateID=$fDependantDocumentTemplateID&fForDelete=1");
57 58 $main->render();
... ...