summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/index.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/index.php b/packages/index.php
index bb0aa94..d712423 100644
--- a/packages/index.php
+++ b/packages/index.php
@@ -16,6 +16,7 @@ require_once BASE . "/lib/format.php";
"title" => "CPU architecture",
"label" => "Arch",
"table" => "architectures",
+ "column" => "`architectures`.`name`",
"extra_condition" => "",
"values" => array()
),
@@ -24,14 +25,15 @@ require_once BASE . "/lib/format.php";
"title" => "respository",
"label" => "Repository",
"table" => "repositories",
- "extra_condition" => " WHERE `repositories`.`is_on_master_mirror`",
+ "column" => "CONCAT(`architectures`.`name`,\"/\",`repositories`.`name`)",
+ "extra_condition" => mysql_join_repositories_architectures() . " WHERE `repositories`.`is_on_master_mirror`",
"values" => array()
)
);
foreach ( $multi_select_search_criteria as $criterium => $content ) {
$result = mysql_run_query(
- "SELECT `name` FROM `" . $content["table"] . "`" . $content["extra_condition"] . " ORDER BY `name`"
+ "SELECT " . $content["column"] . " AS `name` FROM `" . $content["table"] . "`" . $content["extra_condition"] . " ORDER BY `name`"
);
while ($row = $result -> fetch_assoc())
$multi_select_search_criteria[$criterium]["values"][] = $row["name"];
@@ -45,9 +47,9 @@ require_once BASE . "/lib/format.php";
$filter = " WHERE 1";
foreach ($multi_select_search_criteria as $criterium)
if (isset($_GET[$criterium["name"]])) {
- $filter .= " AND `" . $criterium["table"] . "`.`name` IN (";
+ $filter .= " AND " . $criterium["column"] . " IN (";
foreach ($criterium["values"] as $value)
- if (strpos("&" . $_SERVER["QUERY_STRING"] . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
+ if (strpos("&" . urldecode($_SERVER["QUERY_STRING"]) . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
$filter .= "\"" . $value . "\",";
$filter .= "\"\")";
}
@@ -113,6 +115,7 @@ require_once BASE . "/lib/format.php";
mysql_join_binary_packages_binary_packages_in_repositories() .
mysql_join_binary_packages_in_repositories_repositories() .
" AND `repositories`.`is_on_master_mirror`" .
+ mysql_join_repositories_architectures("","r_a") .
mysql_join_binary_packages_build_assignments() .
mysql_join_build_assignments_package_sources() .
$filter . $exact_filter .
@@ -124,7 +127,7 @@ require_once BASE . "/lib/format.php";
"SELECT " .
"`binary_packages`.`pkgname`," .
"`package_sources`.`pkgbase`," .
- "`repositories`.`name` AS `repo`," .
+ "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`) AS `repo`," .
"`architectures`.`name` AS `arch`," .
"CONCAT(IF(`binary_packages`.`epoch`=\"0\",\"\",CONCAT(`binary_packages`.`epoch`,\":\"))," .
"`binary_packages`.`pkgver`,\"-\"," .
@@ -152,7 +155,7 @@ require_once BASE . "/lib/format.php";
"repo" => array(
"title" => "repository",
"label" => "Repo",
- "mysql" => "`repositories`.`name`"
+ "mysql" => "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`)"
),
"pkgname" => array(
"title" => "package name",
@@ -191,6 +194,7 @@ require_once BASE . "/lib/format.php";
mysql_join_binary_packages_binary_packages_in_repositories() .
mysql_join_binary_packages_in_repositories_repositories() .
" AND `repositories`.`is_on_master_mirror`" .
+ mysql_join_repositories_architectures("","r_a") .
mysql_join_binary_packages_build_assignments() .
mysql_join_build_assignments_package_sources() .
$filter . $fuzzy_filter .
@@ -220,7 +224,7 @@ require_once BASE . "/lib/format.php";
"SELECT " .
"`binary_packages`.`pkgname`," .
"`package_sources`.`pkgbase`," .
- "`repositories`.`name` AS `repo`," .
+ "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`) AS `repo`," .
"`architectures`.`name` AS `arch`," .
"CONCAT(IF(`binary_packages`.`epoch`=\"0\",\"\",CONCAT(`binary_packages`.`epoch`,\":\"))," .
"`binary_packages`.`pkgver`,\"-\"," .
@@ -251,7 +255,7 @@ require_once BASE . "/lib/format.php";
print " " . $row["repo"] . "\n";
print " </td>\n";
print " <td>\n";
- print " <a href=\"/" . $row["repo"] . "/" . $row["arch"] . "/" . $row["pkgname"] ."/\" ";
+ print " <a href=\"/" . $row["repo"] . "/" . $row["pkgname"] ."/\" ";
print "title=\"View package details for " . $row["pkgname"] . "\">" . $row["pkgname"] . "</a>\n";
print " </td>\n";
print " <td>\n";
@@ -391,7 +395,7 @@ require_once BASE . "/lib/format.php";
print " <select multiple=\"multiple\" id=\"id_" . $criterium["name"] . "\" name=\"" . $criterium["name"] . "\">\n";
foreach ($criterium["values"] as $value) {
print " <option value=\"" . $value . "\"";
- if (strpos( "&" . $_SERVER["QUERY_STRING"] . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
+ if (strpos( "&" . urldecode($_SERVER["QUERY_STRING"]) . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
print " selected=\"selected\"";
print ">" . $value . "</option>\n";
}