Commit adf7de260d00e646fd7cc08c890d507810e41e3e

Authored by Michael Joseph
1 parent 174db167

only retrieve the organisation object if there is one mapped to the unit being removed


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2397 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/removeUnitBL.php
@@ -37,6 +37,9 @@ if (checkSession()) { @@ -37,6 +37,9 @@ if (checkSession()) {
37 } else { 37 } else {
38 // retrieve organisation link (for later deletion or to get the organisation id) 38 // retrieve organisation link (for later deletion or to get the organisation id)
39 $oUnitOrg = UnitOrganisationLink::getByUnitID($fUnitID); 39 $oUnitOrg = UnitOrganisationLink::getByUnitID($fUnitID);
  40 + if ($oUnitOrg) {
  41 + $oOrganisation = Organisation::get($oUnitOrg->getOrgID());
  42 + }
40 43
41 // we've received confirmation, so delete 44 // we've received confirmation, so delete
42 if (isset($fForDeleteConfirmed)) { 45 if (isset($fForDeleteConfirmed)) {
@@ -59,7 +62,6 @@ if (checkSession()) { @@ -59,7 +62,6 @@ if (checkSession()) {
59 } 62 }
60 // ask for confirmation before deleting 63 // ask for confirmation before deleting
61 } else { 64 } else {
62 - $oOrganisation = Organisation::get($oUnitOrg->getOrgID());  
63 $oPatternCustom->setHtml(getConfirmDeletePage($oUnit, $oOrganisation)); 65 $oPatternCustom->setHtml(getConfirmDeletePage($oUnit, $oOrganisation));
64 $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDeleteConfirmed=1"); 66 $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDeleteConfirmed=1");
65 } 67 }