From 9029a3c971314ccea4288acedcddf4b726f85446 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 15 Oct 2013 02:00:17 +0200 Subject: [PATCH] Added comments to report detail page --- htdocs/lib/Comments.php | 10 +++++----- htdocs/lib/CrashStats.php | 4 ++-- htdocs/report_detail.php | 11 +++++++++++ htdocs/statistics.php | 15 +++++++++++---- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/htdocs/lib/Comments.php b/htdocs/lib/Comments.php index 4f3f181..a9f704c 100644 --- a/htdocs/lib/Comments.php +++ b/htdocs/lib/Comments.php @@ -60,7 +60,7 @@ class Comments
-
+
@@ -152,12 +152,12 @@ class Comments
-
-
+

Comments for crash signature

+
+ -
filter->getWhere(); $q = "select count(r.id) as nr, s.id as signature_id, s.signature as signature_text, s.has_comments from reports r join signature s on r.signature_id = s.id $where group by signature_id order by nr desc"; $q .= kl_str_sql(" limit !i", 100); - if (false !== $cached = Memc::getq($q)) return $cached; + // if (false !== $cached = Memc::getq($q)) return $cached; if (!$res = DBH::$db->query($q)) { @@ -41,7 +41,7 @@ class CrashStats $ret[] = $r; } - Memc::setq($q, $ret); + // Memc::setq($q, $ret); return $ret; } diff --git a/htdocs/report_detail.php b/htdocs/report_detail.php index 7d856e2..4c256b7 100644 --- a/htdocs/report_detail.php +++ b/htdocs/report_detail.php @@ -40,6 +40,7 @@ Layout::header();
  • Settings
  • +
  • Comments
  • @@ -179,7 +180,17 @@ $(function() { + + +
    + + + + +
    render(); modal: true, autoOpen: false, width: 800, - height: 500, + height: "auto", }); $(".comment_link").each(function() { var $link = $(this); var signature_id = $link.data("signature-id"); - $link.on("click", function() { - $dialog.dialog("option", "title", "Crash signature " + signature_id); + $link.on("click", function(e) { + e.preventDefault(); + + //$dialog.dialog("option", "title", "Crash signature " + signature_id); $dialog.dialog("open"); $.ajax({ @@ -83,10 +85,15 @@ $filter->render(); if ($txt) $txt .= "

    "; if ($parts[2]) $txt .= preg_replace("/((::|<|>|,|\\(|\\)))/", "\\1", htmlentities($parts[2])); if (!$txt) $txt = " "; + $ctext = "Comments"; + if ($r->has_comments) + { + $ctext .= " ({$r->has_comments})"; + } ?> nr) ?> - Comments +