Commit 5eab9721953dc5ad3ac7978f0313c99c11604daf
1 parent
5dfa77d6
fixed error displaying
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1163 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
5 additions
and
8 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/checkOutDocumentBL.php
| @@ -60,7 +60,7 @@ if (checkSession()) { | @@ -60,7 +60,7 @@ if (checkSession()) { | ||
| 60 | 60 | ||
| 61 | } else { | 61 | } else { |
| 62 | // document update failed | 62 | // document update failed |
| 63 | - $oPatternCustom->setHtml("<p class=\"errorText\">An error occurred while storing this document in the database</p>\n"); | 63 | + $oPatternCustom->setHtml(renderErrorPage("An error occurred while storing this document in the database")); |
| 64 | } | 64 | } |
| 65 | } else { | 65 | } else { |
| 66 | // prompt the user for a checkout comment | 66 | // prompt the user for a checkout comment |
| @@ -69,27 +69,24 @@ if (checkSession()) { | @@ -69,27 +69,24 @@ if (checkSession()) { | ||
| 69 | } else { | 69 | } else { |
| 70 | // this document is already checked out | 70 | // this document is already checked out |
| 71 | // TODO: for extra credit, tell the user who has this document checked out | 71 | // TODO: for extra credit, tell the user who has this document checked out |
| 72 | - $oPatternCustom->setHtml("<p class=\"errorText\">This document is already checked out</p>\n"); | 72 | + $oPatternCustom->setHtml(renderErrorPage("This document is already checked out")); |
| 73 | } | 73 | } |
| 74 | } else { | 74 | } else { |
| 75 | // no permission to checkout the document | 75 | // no permission to checkout the document |
| 76 | - $oPatternCustom->setHtml("<p class=\"errorText\">Could not check out this document</p>\n"); | 76 | + $oPatternCustom->setHtml(renderErrorPage("You don't have permission to check out this document")); |
| 77 | } | 77 | } |
| 78 | } else { | 78 | } else { |
| 79 | // couldn't instantiate the document | 79 | // couldn't instantiate the document |
| 80 | - $oPatternCustom->setHtml("<p class=\"errorText\">Could not check out this document</p>\n"); | 80 | + $oPatternCustom->setHtml(renderErrorPage("Could not check out this document")); |
| 81 | } | 81 | } |
| 82 | } else { | 82 | } else { |
| 83 | // no document id was set when coming to this page, | 83 | // no document id was set when coming to this page, |
| 84 | - $oPatternCustom->setHtml("<p class=\"errorText\">No document is currently selected for check out</p>\n"); | 84 | + $oPatternCustom->setHtml(renderErrorPage("No document is currently selected for check out")); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 87 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 88 | $main->setCentralPayload($oPatternCustom); | 88 | $main->setCentralPayload($oPatternCustom); |
| 89 | $main->setFormAction($_SERVER["PHP_SELF"]); | 89 | $main->setFormAction($_SERVER["PHP_SELF"]); |
| 90 | - if (isset($sErrorMessage)) { | ||
| 91 | - $main->setErrorMessage($sErrorMessage); | ||
| 92 | - } | ||
| 93 | $main->render(); | 90 | $main->render(); |
| 94 | } | 91 | } |
| 95 | ?> | 92 | ?> |