Commit bfd542b32c14577f605d5d4f285291d668579690
1 parent
431968b1
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
Showing
1 changed file
with
6 additions
and
5 deletions
presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteDependantDocumentBL.php
| @@ -16,7 +16,8 @@ | @@ -16,7 +16,8 @@ | ||
| 16 | require_once("../../../../config/dmsDefaults.php"); | 16 | require_once("../../../../config/dmsDefaults.php"); |
| 17 | 17 | ||
| 18 | if (checkSession()) { | 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 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 21 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 21 | require_once("$default->fileSystemRoot/lib/users/User.inc"); | 22 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 22 | require_once("$default->fileSystemRoot/lib/documentmanagement/DependantDocumentTemplate.inc"); | 23 | require_once("$default->fileSystemRoot/lib/documentmanagement/DependantDocumentTemplate.inc"); |
| @@ -31,16 +32,16 @@ if (checkSession()) { | @@ -31,16 +32,16 @@ if (checkSession()) { | ||
| 31 | if (isset($fForDelete)) { | 32 | if (isset($fForDelete)) { |
| 32 | $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID); | 33 | $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID); |
| 33 | if ($oDependantDocumentTemplate->delete()) { | 34 | if ($oDependantDocumentTemplate->delete()) { |
| 34 | - redirect($default->rootUrl . "/control.php?action=viewDependantDocument&fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID"); | 35 | + controllerRedirect("viewDependantDocument", "fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID"); |
| 35 | } else { | 36 | } else { |
| 36 | $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID); | 37 | $oDependantDocumentTemplate = DependantDocumentTemplate::get($fDependantDocumentTemplateID); |
| 37 | $oUser = User::get($oDependantDocumentTemplate->getDefaultUserId()); | 38 | $oUser = User::get($oDependantDocumentTemplate->getDefaultUserId()); |
| 38 | 39 | ||
| 39 | $oPatternCustom = & new PatternCustom(); | 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 | $main->setCentralPayload($oPatternCustom); | 42 | $main->setCentralPayload($oPatternCustom); |
| 42 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fDependantDocumentTemplateID=$fDependantDocumentTemplateID&fForDelete=1"); | 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 | $main->render(); | 45 | $main->render(); |
| 45 | } | 46 | } |
| 46 | 47 | ||
| @@ -51,7 +52,7 @@ if (checkSession()) { | @@ -51,7 +52,7 @@ if (checkSession()) { | ||
| 51 | $oUser = User::get($oDependantDocumentTemplate->getDefaultUserId()); | 52 | $oUser = User::get($oDependantDocumentTemplate->getDefaultUserId()); |
| 52 | 53 | ||
| 53 | $oPatternCustom = & new PatternCustom(); | 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 | $main->setCentralPayload($oPatternCustom); | 56 | $main->setCentralPayload($oPatternCustom); |
| 56 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fDependantDocumentTemplateID=$fDependantDocumentTemplateID&fForDelete=1"); | 57 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fFolderID=$fFolderID&fFolderCollaborationID=$fFolderCollaborationID&fDependantDocumentTemplateID=$fDependantDocumentTemplateID&fForDelete=1"); |
| 57 | $main->render(); | 58 | $main->render(); |