Browse files

Added tab-separated scan notes output

  • Loading branch information...
1 parent 8c1646f commit 65121e3924678ac5a7c3d962521699cc85a2165d Michal Migurski committed May 5, 2011
Showing with 32 additions and 5 deletions.
  1. +17 −5 site/templates/scan-large-notes.htmlf.tpl
  2. +15 −0 site/www/scan-notes.php
View
22 site/templates/scan-large-notes.htmlf.tpl
@@ -1,8 +1,20 @@
-{if $scan.has_geotiff == 'yes'}
- <p>
- GeoTIFF: <a href="{$scan.base_url|escape}/walking-paper-{$scan.id|escape}.tif">walking-paper-{$scan.id|escape}.tif</a>.
- </p>
-{/if}
+<ul>
+ <li>
+ Original uploaded file: <a href="{$scan.base_url}/{$scan.uploaded_file|escape}">{$scan.uploaded_file|escape}</a>.
+ </li>
+
+ {if $scan.has_geotiff == 'yes'}
+ <li>
+ GeoTIFF: <a href="{$scan.base_url|escape}/walking-paper-{$scan.id|escape}.tif">walking-paper-{$scan.id|escape}.tif</a>.
+ </li>
+ {/if}
+
+ {if $notes|@count}
+ <li>
+ Notes on this page as <a href="{$base_dir}/scan-notes.php?id={$scan.id|escape}">tab-separated values</a>.
+ </li>
+ {/if}
+</ul>
{if $scan.has_geojpeg == 'yes'}
<p class="wide" id="notes-image">
View
15 site/www/scan-notes.php
@@ -30,7 +30,22 @@
}
}
+ $scan_notes = get_scan_notes($dbh, array('page' => 1, 'perpage' => 242), $scan ? $scan['id'] : null);
+
if($user['id'])
setcookie('visitor', write_userdata($user['id'], $language), time() + 86400 * 31);
+
+ header('Content-Type: text/tab-separated-values; charset=utf-8');
+ echo "scan_id number note north west south east\n";
+
+ foreach($scan_notes as $note)
+ printf("%s %d %s %.8f %.8f %.8f %.8f\n",
+ $note['scan_id'],
+ $note['number'],
+ '"'.str_replace('"', '""', $note['note']).'"',
+ $note['north'],
+ $note['west'],
+ $note['south'],
+ $note['east']);
?>

0 comments on commit 65121e3

Please sign in to comment.