diff --git a/include/util.php b/include/util.php index 3462e78..92e664e 100644 --- a/include/util.php +++ b/include/util.php @@ -154,11 +154,14 @@ function get_xml_tag ($file, $mode = null) } /* bugzilla functions */ -function make_bugzilla_version_list($varname, $cvalue) +// $sVarname - name of the selection array that this function will output +// this is the name to use to retrieve the selection on the form postback +// $sSelectedValue - the currently selected entry +function make_bugzilla_version_list($sVarname, $sSelectedValue) { - $table = BUGZILLA_DB.".versions"; - $where = "WHERE product_id=".BUGZILLA_PRODUCT_ID; - $sQuery = "SELECT value FROM $table $where"; + $sTable = BUGZILLA_DB.".versions"; + $sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID; + $sQuery = "SELECT value FROM $sTable $sWhere"; $hResult = query_bugzilladb($sQuery); if(!$hResult) return; @@ -195,15 +198,29 @@ function make_bugzilla_version_list($varname, $cvalue) // build the selection array - echo "\n"; echo "\n"; + $bFoundSelectedValue = false; foreach($aVersions as $sKey => $sValue) { - if($sValue == $cvalue) + if($sValue == $sSelectedValue) + { echo "