Handle reviews correctly.
Change-Id: I781d2c3229d3d463cb2c6f8855995a2962baf211
Signed-off-by: Wayne Beaton <wayne.beaton@eclipse-foundation.org>
diff --git a/classes/Review.class.inc b/classes/Review.class.inc
index 6b7684a..900c3c6 100644
--- a/classes/Review.class.inc
+++ b/classes/Review.class.inc
@@ -95,7 +95,11 @@
}
public function getName() {
- return $this->data['name'];
+ $name = $this->data['name'];
+ if ($project = Project::getProject($this->getProjectId())) {
+ $name = "{$project->getFormalName()} {$name}";
+ }
+ return $name;
}
public function getDate() {
diff --git a/reviews-rss.php b/reviews-rss.php
index b3b8fa3..ac298f1 100644
--- a/reviews-rss.php
+++ b/reviews-rss.php
@@ -63,8 +63,7 @@
Review::get(strtotime("-${age} days"), function($activity) {
if ($activity->isPending()) return;
- $project = Project::getProject($activity->getProjectId());
- $title = htmlentities("{$project->getFormalName()} {$activity->getName()}");
+ $title = htmlentities($activity->getName());
$link = $activity->getUrl();
$date = date('r', $activity->getDate());
$guid = sha1($link);
diff --git a/tools/reviews.php b/tools/reviews.php
index fdb3605..b9e8ca1 100644
--- a/tools/reviews.php
+++ b/tools/reviews.php
@@ -1,10 +1,9 @@
<?php
/*******************************************************************************
- * Copyright (c) 2010 Eclipse Foundation and others.
- *
+ * Copyright (c) 2010, 2021 Eclipse Foundation and others.
* This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
+ * terms of the Eclipse Public License 2.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
@@ -47,16 +46,13 @@
$reviewDate = $App->getFormattedDate(strtotime($date), 'long');
echo "<h3>$reviewDate</h3>";
- echo "<table class=\"review-table\"><tbody>";
+ echo "<ul>";
foreach($reviews as $review) {
- $project = Project::getProject($review->getProjectId());
- print "<tr>";
- print "<td><span class=\"project}\"><a href=\"{$project->getUrl()}\">{$project->getFormalName()}</a></span></td>";
- print "<td><span class=\"review-{$review->getStatus()}\"><a href=\"{$review->getUrl()}\">{$review->getName()}</a></span></td>";
- print "<td><span>{$review->getStatus()}</span></td>";
- print "</tr>";
+ print "<li>";
+ print "<span class=\"review-{$review->getStatus()}\"><a href=\"{$review->getUrl()}\">{$review->getName()}</a></span>";
+ print "</li>";
}
- echo "</tbody></table>";
+ echo "</ul>";
}
echo get_trace_html();
diff --git a/web-parts/reviews.php b/web-parts/reviews.php
index e7b9de3..7c4423e 100755
--- a/web-parts/reviews.php
+++ b/web-parts/reviews.php
@@ -1,13 +1,11 @@
<?php
/*******************************************************************************
- * Copyright (c) 2010 Eclipse Foundation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * Copyright (c) 2010, 2021 Eclipse Foundation and others.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-2.0
*
- * Contributors:
- * Wayne Beaton (Eclipse Foundation)- initial API and implementation
+ * SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
/*
@@ -64,9 +62,7 @@
print "<ul class=\"list-unstyled reset\">";
foreach ($list as $review) {
- $project = Project::getProject($review->getProjectId());
- if (!$project) continue; // Should not happen
- print "<li><span class=\"review-{$review->getStatus()}\"><a href=\"{$review->getUrl()}\">{$project->getFormalName()} {$review->getName()}</a></span></li>";
+ print "<li><span class=\"review-{$review->getStatus()}\"><a href=\"{$review->getUrl()}\">{$review->getName()}</a></span></li>";
}
print "</ul>";