Commit fe75e399804bb0ef9bcda64d2bcdacb29aa65793
1 parent
f1b63a57
removed debug logging and added operational/status logging
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2450 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentBL.php
| @@ -31,7 +31,6 @@ if (checkSession()) { | @@ -31,7 +31,6 @@ if (checkSession()) { | ||
| 31 | require_once("addDocumentUI.inc"); | 31 | require_once("addDocumentUI.inc"); |
| 32 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/store.inc"); | 32 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/store.inc"); |
| 33 | 33 | ||
| 34 | - $default->log->info("before:" . arrayToString($_REQUEST)); | ||
| 35 | if (isset($fFolderID)) { | 34 | if (isset($fFolderID)) { |
| 36 | if (Permission::userHasFolderWritePermission($fFolderID)) { | 35 | if (Permission::userHasFolderWritePermission($fFolderID)) { |
| 37 | //user has permission to add document to this folder | 36 | //user has permission to add document to this folder |
| @@ -51,11 +50,18 @@ if (checkSession()) { | @@ -51,11 +50,18 @@ if (checkSession()) { | ||
| 51 | if (PhysicalDocumentManager::uploadPhysicalDocument($oDocument, $fFolderID, "None", $_FILES['fFile']['tmp_name'])) { | 50 | if (PhysicalDocumentManager::uploadPhysicalDocument($oDocument, $fFolderID, "None", $_FILES['fFile']['tmp_name'])) { |
| 52 | //create the web document link | 51 | //create the web document link |
| 53 | $oWebDocument = & new WebDocument($oDocument->getID(), -1, 1, NOT_PUBLISHED, getCurrentDateTime()); | 52 | $oWebDocument = & new WebDocument($oDocument->getID(), -1, 1, NOT_PUBLISHED, getCurrentDateTime()); |
| 54 | - $oWebDocument->create(); | 53 | + if ($oWebDocument->create()) { |
| 54 | + $default->log->error("addDocumentBL.php created web document for document ID=" . $oDocument->getID()); | ||
| 55 | + } else { | ||
| 56 | + $default->log->error("addDocumentBL.php couldn't create web document for document ID=" . $oDocument->getID()); | ||
| 57 | + } | ||
| 55 | //create the document transaction record | 58 | //create the document transaction record |
| 56 | $oDocumentTransaction = & new DocumentTransaction($oDocument->getID(), "Document created", CREATE); | 59 | $oDocumentTransaction = & new DocumentTransaction($oDocument->getID(), "Document created", CREATE); |
| 57 | - $oDocumentTransaction->create(); | ||
| 58 | - $default->log->info("addDocumentBL.php successfully added document " . $oDocument->getFileName() . " to folder " . Folder::getFolderPath($fFolderID) . " id=$fFolderID"); | 60 | + if ($oDocumentTransaction->create()) { |
| 61 | + $default->log->error("addDocumentBL.php created create document transaction for document ID=" . $oDocument->getID()); | ||
| 62 | + } else { | ||
| 63 | + $default->log->error("addDocumentBL.php couldn't create create document transaction for document ID=" . $oDocument->getID()); | ||
| 64 | + } | ||
| 59 | 65 | ||
| 60 | //the document was created/uploaded due to a collaboration step in another | 66 | //the document was created/uploaded due to a collaboration step in another |
| 61 | //document and must be linked to that document | 67 | //document and must be linked to that document |
| @@ -101,6 +107,7 @@ if (checkSession()) { | @@ -101,6 +107,7 @@ if (checkSession()) { | ||
| 101 | "folderName" => Folder::getFolderName($fFolderID))); | 107 | "folderName" => Folder::getFolderName($fFolderID))); |
| 102 | $default->log->info("addDocumentBL.php fired $count subscription alerts for new document " . $oDocument->getName()); | 108 | $default->log->info("addDocumentBL.php fired $count subscription alerts for new document " . $oDocument->getName()); |
| 103 | 109 | ||
| 110 | + $default->log->info("addDocumentBL.php successfully added document " . $oDocument->getFileName() . " to folder " . Folder::getFolderPath($fFolderID) . " id=$fFolderID"); | ||
| 104 | //redirect to the document details page | 111 | //redirect to the document details page |
| 105 | controllerRedirect("viewDocument", "fDocumentID=" . $oDocument->getID()); | 112 | controllerRedirect("viewDocument", "fDocumentID=" . $oDocument->getID()); |
| 106 | } else { | 113 | } else { |