Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d71127fda2
Fetching contributors…

Cannot retrieve contributors at this time

executable file 103 lines (88 sloc) 4.639 kb
require_once './bootstrap.php';
#require_once 'FirePHPCore/fb.php';
$config = new Zend_Config_Ini(CONFIG_PATH, ENV);
$dbCreds = new Zend_Config_Ini(CREDS_PATH, 'db');
$couch = new Couch_Client($dbCreds->dsn, $dbCreds->name);
$collectionId = $_REQUEST['id'];
$report = new Models_Reporter($couch, $collectionId);
$res = $report->fetch();
if (isset($_REQUEST['mode'])) {
$mode = $_REQUEST['mode'];
} else {
$mode = "base";
if ($mode == "list") {
//@@@TODO Make file format and name configurable
$rendered_report_text = $report->render_as_list();
$filename = "total-impact_" . $collectionId . "_" . date('Y-m-d') . ".tsv";
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Type: text/tab-delimited-values; charset=utf-8');
echo $rendered_report_text;
} else {
if ($mode == "status") {
$rendered_report_text = $report->render_status();
$rendered_about_text = $report->render_about_text();
} else {
$mode = "base";
$rendered_report_text = $report->render(False); //don't show zeros
$rendered_about_text = $report->render_about_text();
// handle missing IDs more intelligently later
if (!$res) {
header('Location: ../');
define("PAGE_SUBTITLE", $report->getBestIdentifier());
<div id="report">
<!-- START report-meta -->
<div class="wrapper">
<div id="report-meta">
<h2><span class="title"><?php echo $report->getBestIdentifier(); ?></span></h2>
<div id="report-button">
<a class="report-button" id="update-report-button" name="<?php echo $collectionId; ?>" href="#">run update</a>
<a class="report-button" href="/csv/<?php echo $collectionId; ?>">download data</a>
<div id="report-info">
<span class="badge artifacts-count"><span class="num"><?php echo $report->getArtifactsCount(); ?></span> artifacts;</span>
<span class="badge updated-at">updated <span class="date"><?php echo $report->getUpdatedAt('j M, Y'); ?></span></span>
<!--<span class="badge created-at">created <?php echo $report->getCreatedAt('j M, Y'); ?></span>-->
<!--a class="report-button" href="./?add-id=<?php echo $collectionId; ?>">refine</a-->
<div id="share">
<!-- based on code here: -->
<span id="permalink"><span class="label"> Permalink: </span><a class="copyable", href="<?php echo "http://" . $_SERVER['HTTP_HOST'] . "/collection/" . $collectionId; ?>"><?php echo "http://" . $_SERVER['HTTP_HOST'] . "/collection/" . $collectionId; ?></a><a href="#" id="copy-permalink">copy</a></span>
<script src="//" type="text/javascript"></script>
<span class="tweet-this">
<a href="" class="twitter-share-button"
data-url="<?php echo "" . $collectionId ?>"
data-text="<?php echo "Check out the total-Impact of " . $report->getBestIdentifier() . ": "; ?>"
<!-- END report-meta -->
<!-- START metrics -->
<!-- @@@ we could use large icons to visually identify different types of artifacts -->
<!-- @@@ it'd be useful to separate artifact metadata from artifact metrics, Slideshare and Dryad display both in the same element -->
<div id="metrics">
echo "$rendered_report_text";
</div><!-- END metrics -->
</div><!-- END report -->
<!-- START footer -->
<p class="something-missing">More detail on <a href="./about/#whichmetrics">available metrics</a>. Missing some artifacts or metrics? See <a href="./about/#limitations">current limitations.</a> </p>
<div id="about-metrics" class="about-metrics">
<h3>Metrics are computed based on the following data sources:</h3>
echo "$rendered_about_text";
<?php include_once('./footer.php'); ?>
<?php } ?>
Jump to Line
Something went wrong with that request. Please try again.