From 4743a543cc55682445fa41f7bce12d7912f6f79f Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Thu, 19 Aug 2004 13:16:37 +0000 Subject: [PATCH] Corrected multiple unit administration bug for system administrator. --- presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php | 2 +- presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php index 91310bb..baf1829 100644 --- a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php +++ b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsBL.php @@ -42,7 +42,7 @@ if (checkSession()) { $aUnitIDs = User::getUnitIDs($_SESSION["userID"]); $oPatternCustom->setHtml(getPage($aUnitIDs)); } else { - $oPatternCustom->setHtml(getPage($fUnitID)); + $oPatternCustom->setHtml(getPage(array($fUnitID))); } require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); $main->setCentralPayload($oPatternCustom); diff --git a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc index fba860a..4aa4186 100644 --- a/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/listGroupsUI.inc @@ -26,14 +26,13 @@ */ // display the listbox initially ..then just display the text -function getUnitDisplay($aUnitIDs) { +function getUnitDisplay($iUnitID) { global $default; // #3519 only allow unit filters for system administrators // unit administrators only see their units. if (Permission::userIsSystemAdministrator()) { - $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID"); - $oPatternListBox->setWhereClause("ST.unit_id IN (" . implode(",", $aUnitIDs) . ")"); + $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID"); $oPatternListBox->setPostBackOnChange(true); if ($iUnitID != 0) { $oPatternListBox->setSelectedValue($iUnitID); @@ -50,9 +49,10 @@ function getGroups($aUnitIDs) { "LEFT JOIN $default->units_table UL ON UL.id = GUL.unit_id "; // #2978 don't display system admin groups if you're not a sys admin - // filter by unit - if ($aUnitIDs) { - $sWhereClause = "WHERE GUL.unit_id IN (" . implode(",", $aUnitIDs) . ") "; + // filter by unit + $sUnitIDs = implode(",", $aUnitIDs); + if ($sUnitIDs <> "") { + $sWhereClause = "WHERE GUL.unit_id IN (" . $sUnitIDs . ") "; } // #2978 don't display sys admin groups if you're not a sysadmin if (!Permission::userIsSystemAdministrator()) { @@ -87,7 +87,7 @@ function getPage($aUnitIDs) { $sToRender .= renderHeading("Group Management"); $sToRender .= getAddLink("addGroup", "Add A Group"); - $sToRender .= getUnitDisplay($aUnitIDs); + $sToRender .= getUnitDisplay($aUnitIDs[0]); $sToRender .= getGroups($aUnitIDs); return $sToRender; } -- libgit2 0.21.4