Commit 65a07bc39b59cf47e84584d3000bb143c134c7b4
1 parent
0b63e661
added comments and error logging
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1765 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
9 additions
and
1 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php
| @@ -48,6 +48,7 @@ if (checkSession()) { | @@ -48,6 +48,7 @@ if (checkSession()) { | ||
| 48 | if ($oDocument->delete()) { | 48 | if ($oDocument->delete()) { |
| 49 | if (unlink($sDocumentPath)) { | 49 | if (unlink($sDocumentPath)) { |
| 50 | // successfully deleted the document from the file system | 50 | // successfully deleted the document from the file system |
| 51 | + $default->log->info("deleteDocumentBL.php successfully deleted document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID()); | ||
| 51 | 52 | ||
| 52 | // delete all collaboration roles | 53 | // delete all collaboration roles |
| 53 | for ($i=0; $i<count($aFolderUserRoles); $i++) { | 54 | for ($i=0; $i<count($aFolderUserRoles); $i++) { |
| @@ -84,6 +85,7 @@ if (checkSession()) { | @@ -84,6 +85,7 @@ if (checkSession()) { | ||
| 84 | redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); | 85 | redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); |
| 85 | } else { | 86 | } else { |
| 86 | //could not delete the document from the file system | 87 | //could not delete the document from the file system |
| 88 | + $default->log->error("deleteDocumentBL.php Filesystem error deleting document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID()); | ||
| 87 | //reverse the document deletion | 89 | //reverse the document deletion |
| 88 | $oDocument->create(); | 90 | $oDocument->create(); |
| 89 | //get rid of the document transaction | 91 | //get rid of the document transaction |
| @@ -96,6 +98,8 @@ if (checkSession()) { | @@ -96,6 +98,8 @@ if (checkSession()) { | ||
| 96 | } | 98 | } |
| 97 | } else { | 99 | } else { |
| 98 | //could not delete the document in the db | 100 | //could not delete the document in the db |
| 101 | + $default->log->error("deleteDocumentBL.php DB error deleting document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID()); | ||
| 102 | + | ||
| 99 | $oDocumentTransaction->delete(); | 103 | $oDocumentTransaction->delete(); |
| 100 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 104 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 101 | $oPatternCustom = & new PatternCustom(); | 105 | $oPatternCustom = & new PatternCustom(); |
presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderBL.php
| @@ -40,6 +40,7 @@ if (checkSession()) { | @@ -40,6 +40,7 @@ if (checkSession()) { | ||
| 40 | if ($oFolder->delete()) { | 40 | if ($oFolder->delete()) { |
| 41 | if (PhysicalFolderManagement::deleteFolder($sFolderPath)) { | 41 | if (PhysicalFolderManagement::deleteFolder($sFolderPath)) { |
| 42 | // successfully deleted the folder from the file system | 42 | // successfully deleted the folder from the file system |
| 43 | + $default->log->info("deleteFolderBL.php successfully deleted folder " . $oFolder->getName() . " from parent folder " . Folder::getFolderPath($oFolder->getParentID()) . " id=" . $oFolder->getParentID()); | ||
| 43 | 44 | ||
| 44 | // delete folder collaboration entries | 45 | // delete folder collaboration entries |
| 45 | $aFolderCollaboration = FolderCollaboration::getList("WHERE folder_id=$fFolderID"); | 46 | $aFolderCollaboration = FolderCollaboration::getList("WHERE folder_id=$fFolderID"); |
| @@ -77,7 +78,9 @@ if (checkSession()) { | @@ -77,7 +78,9 @@ if (checkSession()) { | ||
| 77 | // redirect to the browse folder page with the parent folder id | 78 | // redirect to the browse folder page with the parent folder id |
| 78 | redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oFolder->getParentID()); | 79 | redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oFolder->getParentID()); |
| 79 | } else { | 80 | } else { |
| 80 | - // could not delete the folder from the file system, so reverse the folder deletion | 81 | + // could not delete the folder from the file system |
| 82 | + $default->log->error("deleteFolderBL.php Filesystem error deleting folder " . $oFolder->getName() . " from parent folder " . Folder::getFolderPath($oFolder->getParentID()) . " id=" . $oFolder->getParentID()); | ||
| 83 | + // so reverse the folder deletion | ||
| 81 | $oFolder->create(); | 84 | $oFolder->create(); |
| 82 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 85 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 83 | $oPatternCustom->setHtml(""); | 86 | $oPatternCustom->setHtml(""); |
| @@ -87,6 +90,7 @@ if (checkSession()) { | @@ -87,6 +90,7 @@ if (checkSession()) { | ||
| 87 | } | 90 | } |
| 88 | } else { | 91 | } else { |
| 89 | // could not delete the folder in the db | 92 | // could not delete the folder in the db |
| 93 | + $default->log->error("deleteFolderBL.php DB error deleting folder " . $oFolder->getName() . " from parent folder " . Folder::getFolderPath($oFolder->getParentID()) . " id=" . $oFolder->getParentID()); | ||
| 90 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 94 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 91 | $oPatternCustom->setHtml(""); | 95 | $oPatternCustom->setHtml(""); |
| 92 | $main->setCentralPayload($oPatternCustom); | 96 | $main->setCentralPayload($oPatternCustom); |