Bug 7164 - add Koha history timeline tab to 'About' page
authorMason James <mtj@kohaaloha.com>
Sat, 5 Nov 2011 10:28:48 +0000 (23:28 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 14 Dec 2011 13:44:45 +0000 (14:44 +0100)
Includes follow up by Chris Cormack fixing formatting in docs/history.txt

[MINOR EDIT] Added html filter to output for validity's sake

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index 596637d..249f245 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -33,6 +33,8 @@ use C4::Auth;
 use C4::Context;
 use C4::Installer;
 
+#use Smart::Comments '####';
+
 my $query = new CGI;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
@@ -106,7 +108,46 @@ foreach (@components) {
         $row = [];
     }
 }
+## ## $table
 
 $template->param( table => $table );
 
+
+## ------------------------------------------
+## Koha time line code
+
+#get file location
+my $dir = C4::Context->config('intranetdir');
+open( FILE, "$dir" . "/docs/history.txt" );
+my $i = 0;
+
+my @rows2 = ();
+my $row2  = [];
+
+my @lines = <FILE>;
+close(FILE);
+
+shift @lines; #remove header row
+
+foreach (@lines) {
+    my ( $date, $desc, $tag ) = split(/\t/);
+    push(
+        @rows2,
+        {
+            date => $date,
+            desc => $desc,
+        }
+    );
+}
+
+my $table2 = [];
+#foreach my $row2 (@rows2) {
+foreach  (@rows2) {
+    push (@$row2, $_);
+    push( @$table2, { row2 => $row2 } );
+    $row2 = [];
+}
+
+$template->param( table2 => $table2 );
+
 output_html_with_http_headers $query, $cookie, $template->output;
index bdf06d0..582892e 100644 (file)
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; About Koha</div>
 
 <div id="doc3" class="yui-t7">
-   
+
    <div id="bd">
     <div id="yui-main">
     <div class="yui-g">
             <h1>About Koha</h1>
-    
+
     <div id="abouttabs" class="toptabs numbered">
         <ul>
         <li><a href="about.pl#about">Server Information</a></li>
         <li><a href="about.pl#team">Koha Team</a></li>
         <li><a href="about.pl#licenses">Licenses</a></li>
         <li><a href="about.pl#translations">Translations</a></li>
+        <li><a href="about.pl#history">Koha Timeline</a></li>
         </ul>
-        
+
         <div id="about">
-            
+
         <table>
             <caption>Server information</caption>
             <tr><th scope="row">Koha version: </th><td>[% kohaVersion |html %]</td></tr>
@@ -95,8 +96,8 @@
                 <li>The <strong><a href="http://library.neu.edu.tr">Near East University</a></strong>, Cyprus</li>
                 <li><strong>OPUS International Consultants</strong>, Wellington, New Zealand (Corporate Serials sponsorship)</li>
                 <li><strong><a href="http://www.famfamfam.com/">famfamfam.com</a></strong> Birmingham (UK) based developer Mark James for the famfamfam Silk iconset.</li>
-            </ul>   
-                
+            </ul>
+
             <h2>Koha Release Team</h2>
             <ul>
                <li><strong>Colin Campbell</strong> (Koha 3.4 QA Manager)</li>
                 <li><strong>Katipo Communications</strong>, New Zealand</li>
                 <li><strong>KohaAloha</strong>, New Zealand</li>
                 <li><strong>LibLime</strong>, USA</li>
-                <li><strong>Libriotech</strong>, Norway</li> 
+                <li><strong>Libriotech</strong>, Norway</li>
                <li><strong>Nelsonville Public Library</strong>, Ohio, USA</li>
                <li><strong>PTFS</strong>, Maryland, USA</li>
                <li><strong>PTFS Europe Ltd</strong>, United Kingdom</li>
                <li><strong>Tamil</strong>, France</li>
                <li><strong>Xercode</strong>, Spain</li>
             </ul>
-                       
+
             <h2>Additional Thanks To...</h2>
             <ul>
            <li>Jo Ransom</li>
                 <li>Nicolas Morin (French Translation in 2.0)</li>
             </ul>
         </div>
+
         <div id="licenses">
             <h2>Koha</h2>
             <p>
             <h2>YUI</h2>
             <p>
             <a href="http://developer.yahoo.com/auth/license.txt">BSD License</a>
-            </p> 
+            </p>
             <h2>Famfamfam iconset</h2>
               <ul>
                 <li><a href="http://www.famfamfam.com/lab/icons/silk/">FamFamFam Site</a></li>
                   by the Bridge Consortium of Carleton College and St. Olaf College.</li>
               </ul>
         </div>
+
         <div id="translations">
             <h2>Translation</h2>
             <ul>
 <li><strong>&#1575;&#1585;&#1583;&#1608;(Urdu)</strong> Ata ur Rehman</li>
 <li><strong>&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072; (Ukrainian)</strong> Victor Titarchuk and Serhij Dubyk</li>
             </ul>
-    
+
+        </div>
+
+        <div id="history">
+        <h2>Koha history timeline</h2>
+        <table style="cursor:pointer">
+        <thead>
+        <tr>
+            <td  style="font-weight:bold;" >Date</td>
+            <td  style="font-weight:bold;" >Description</td>
+        </tr>
+        </thead>
+        [% FOREACH tabl IN table2 %]
+            <tr class="[% loop.parity %]">
+                [% FOREACH ro IN tabl.row2 %]
+                     <td>[% ro.date %]</td>
+                     <td>[% ro.desc|html %]</td>
+                [% END %]
+            </tr>
+        [% END %]
+        </table>
         </div>
+
     </div>
+
 </div></div></div>
 [% INCLUDE 'intranet-bottom.inc' %]