the mad's touch: make bug reports linked from the changelog :D
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 22 Jun 2006 22:45:25 +0000 (22:45 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 22 Jun 2006 22:45:25 +0000 (22:45 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@335 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
htdocs/changeLog.php
templates/changeLog.tpl

index 7e2c4d6..7e23025 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ New :
 
     * Documentation :
         - Display ChangeLog in site.                                        -Car
+        - Bounty: link bug reports from Changelog.                          -MC
 
     * Geoloc :
         - Dynamic maps using geodesix plugin.                               -Car
index dbc6f83..87f35ff 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
  
- require_once 'xorg.inc.php';
- new_skinned_page('changeLog.tpl', AUTH_PUBLIC);
- $page->assign('ChangeLog', file_get_contents($globals->spoolroot.'/ChangeLog'));
- $page->run();
- ?>
\ No newline at end of file
+require_once 'xorg.inc.php';
+
+new_skinned_page('changeLog.tpl', AUTH_PUBLIC);
+
+function bugize($list)
+{
+    $list = split(',', $list);
+    $ans  = array();
+    
+    foreach ($list as $bug) {
+        $clean = str_replace('#', '', $bug);
+        $ans[] = "<a href='http://trackers.polytechnique.org/task/$clean'>$bug</a>";
+    }
+
+    return join(',', $ans);
+}
+
+$clog = htmlentities(file_get_contents($globals->spoolroot.'/ChangeLog'));
+$clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
+$page->assign('ChangeLog', $clog);
+$page->run();
+?>
index cf83a42..21b777d 100644 (file)
@@ -22,5 +22,5 @@
 <h1>ChangeLog</h1>\r
 <p>Voici la liste des modifications faites sur <a href="http://opensource.polytechnique.org/platal/">plat/al</a>, le support libre de ce site.</p>\r
 <pre>\r
-{$ChangeLog}\r
-</pre>
\ No newline at end of file
+{$ChangeLog|smarty:nodefaults}\r
+</pre>\r