Commit 03171c88af68ec834ec059286bbc2af9f66970c9
1 parent
8ad3fe5c
error checking for blank updating
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1131 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
5 additions
and
2 deletions
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/editUnitBL.php
| @@ -30,7 +30,10 @@ if (checkSession()) { | @@ -30,7 +30,10 @@ if (checkSession()) { | ||
| 30 | $oUnit = Unit::get($fUnitID); | 30 | $oUnit = Unit::get($fUnitID); |
| 31 | $oUnit->setName($fUnitName); | 31 | $oUnit->setName($fUnitName); |
| 32 | 32 | ||
| 33 | - if ($oUnit->update()) { | 33 | + if($fUnitName== "") |
| 34 | + { | ||
| 35 | + $oPatternCustom->setHtml(getEditPageFail()); | ||
| 36 | + }elseif ($oUnit->update()) { | ||
| 34 | // if successfull print out success message | 37 | // if successfull print out success message |
| 35 | $oPatternCustom->setHtml(getEditPageSuccess()); | 38 | $oPatternCustom->setHtml(getEditPageSuccess()); |
| 36 | 39 |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/editUnitUI.inc
| @@ -65,7 +65,7 @@ function getEditPageFail() { | @@ -65,7 +65,7 @@ function getEditPageFail() { | ||
| 65 | global $default; | 65 | global $default; |
| 66 | 66 | ||
| 67 | $sToRender .= "<br></br>\n"; | 67 | $sToRender .= "<br></br>\n"; |
| 68 | - $sToRender .= "<b>Success!</b>\n"; | 68 | + $sToRender .= "<b>FAILED!</b>\n"; |
| 69 | $sToRender .= "<table>\n"; | 69 | $sToRender .= "<table>\n"; |
| 70 | $sToRender .= "<br></br>\n"; | 70 | $sToRender .= "<br></br>\n"; |
| 71 | $sToRender .= "<tr></tr>\n"; | 71 | $sToRender .= "<tr></tr>\n"; |