From ad8b318c1eaddbc2043b9a7cbaa6332177db491c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 18 Feb 2019 20:47:42 +0100 Subject: move array of columns from packages/index.php to lib/style.php --- lib/style.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++--- packages/index.php | 55 ++++++------------------------------------------------ 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/lib/style.php b/lib/style.php index 051a0a5..ff2d364 100644 --- a/lib/style.php +++ b/lib/style.php @@ -1,6 +1,6 @@ array( + "title" => "architecture", + "label" => "Arch", + "mysql" => "`architectures`.`name`" + ), + "repo" => array( + "title" => "repository", + "label" => "Repo", + "mysql" => "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`)" + ), + "pkgname" => array( + "title" => "package name", + "label" => "Name", + "mysql" => "`binary_packages`.`pkgname`" + ), + "pkgver" => array( + "title" => "package version", + "label" => "Version", + "mysql" => mysql_query_package_version("binary_packages") + ), + "bugs" => array( + "title" => "bug status", + "label" => "Bugs", + "mysql" => "NOT `binary_packages`.`has_issues`" + ), + "build_date" => array( + "title" => "build date", + "label" => "Build Date", + "mysql" => "IFNULL(`build_assignments`.`return_date`,\"00-00-0000 00:00:00\")" + ), + "move_date" => array( + "title" => "last update", + "label" => "Last Updated", + "mysql" => "IFNULL(`binary_packages_in_repositories`.`last_moved`,\"00-00-0000 00:00:00\")" + ), + "del" => array( + "title" => "to be deleted", + "label" => "Delete", + "mysql" => "`binary_packages_in_repositories`.`is_to_be_deleted`" + ) +); + function query_package_listing($filter_and_order, $float_columns, $count_only) { if ($count_only) $columns = "COUNT(DISTINCT `binary_packages`.`id`)"; @@ -124,13 +167,14 @@ function query_package_listing($filter_and_order, $float_columns, $count_only) { } } -function print_package_listing($list, $sorts, $print_order_links) { +function print_package_listing($list, $print_order_links) { + global $pkglist_sorts; print " \n"; print " \n"; print " \n"; - foreach ($sorts as $get => $sort) { + foreach ($pkglist_sorts as $get => $sort) { print "
\n"; if ($print_order_links) { print " array( - "title" => "architecture", - "label" => "Arch", - "mysql" => "`architectures`.`name`" - ), - "repo" => array( - "title" => "repository", - "label" => "Repo", - "mysql" => "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`)" - ), - "pkgname" => array( - "title" => "package name", - "label" => "Name", - "mysql" => "`binary_packages`.`pkgname`" - ), - "pkgver" => array( - "title" => "package version", - "label" => "Version", - "mysql" => mysql_query_package_version("binary_packages") - ), - "bugs" => array( - "title" => "bug status", - "label" => "Bugs", - "mysql" => "NOT `binary_packages`.`has_issues`" - ), - "build_date" => array( - "title" => "build date", - "label" => "Build Date", - "mysql" => "IFNULL(`build_assignments`.`return_date`,\"00-00-0000 00:00:00\")" - ), - "move_date" => array( - "title" => "last update", - "label" => "Last Updated", - "mysql" => "IFNULL(`binary_packages_in_repositories`.`last_moved`,\"00-00-0000 00:00:00\")" - ), - "del" => array( - "title" => "to be deleted", - "label" => "Delete", - "mysql" => "`binary_packages_in_repositories`.`is_to_be_deleted`" - ) - ); - $q_f = $extra_joins . $filter . $fuzzy_filter . " ORDER BY "; if (array_key_exists("sort", $_GET)) { - if (isset($sorts[$_GET["sort"]]["mysql"])) - $q_f .= $sorts[$_GET["sort"]]["mysql"] . ","; - elseif (isset($sorts[substr($_GET["sort"],1)]["mysql"])) - $q_f .= $sorts[substr($_GET["sort"],1)]["mysql"] . " DESC,"; + if (isset($pkglist_sorts[$_GET["sort"]]["mysql"])) + $q_f .= $pkglist_sorts[$_GET["sort"]]["mysql"] . ","; + elseif (isset($pkglist_sorts[substr($_GET["sort"],1)]["mysql"])) + $q_f .= $pkglist_sorts[substr($_GET["sort"],1)]["mysql"] . " DESC,"; } $q_f .= "`binary_packages`.`pkgname`,`repositories`.`stability`,`repositories`.`name`,`architectures`.`name`"; @@ -355,7 +312,7 @@ if (count($exact_matches) > 0) {

exact match found.

0) { header_and_footer(); - print_package_listing($fuzzy_matches, $sorts, true); + print_package_listing($fuzzy_matches, true); header_and_footer(); -- cgit v1.2.3-70-g09d2