View | Details | Raw Unified | Return to bug 10915
Collapse All | Expand All

(-)a/about.pl (-27 / +31 lines)
Lines 157-195 if ( defined C4::Context->config('docdir') ) { Link Here
157
    $docdir = C4::Context->config('intranetdir') . '/docs';
157
    $docdir = C4::Context->config('intranetdir') . '/docs';
158
}
158
}
159
159
160
open( my $file, "<", "$docdir" . "/history.txt" );
160
if ( open( my $file, "<", "$docdir" . "/history.txt" ) ) {
161
my $i = 0;
162
161
163
my @rows2 = ();
162
    my $i = 0;
164
my $row2  = [];
165
163
166
my @lines = <$file>;
164
    my @rows2 = ();
167
close($file);
165
    my $row2  = [];
168
166
169
shift @lines; #remove header row
167
    my @lines = <$file>;
168
    close($file);
170
169
171
foreach (@lines) {
170
    shift @lines; #remove header row
172
    my ( $date, $desc, $tag ) = split(/\t/);
171
173
    if(!$desc && $date=~ /(?<=\d{4})\s+/) {
172
    foreach (@lines) {
174
        ($date, $desc)= ($`, $');
173
        my ( $date, $desc, $tag ) = split(/\t/);
175
    }
174
        if(!$desc && $date=~ /(?<=\d{4})\s+/) {
176
    push(
175
            ($date, $desc)= ($`, $');
177
        @rows2,
178
        {
179
            date => $date,
180
            desc => $desc,
181
        }
176
        }
182
    );
177
        push(
183
}
178
            @rows2,
179
            {
180
                date => $date,
181
                desc => $desc,
182
            }
183
        );
184
    }
184
185
185
my $table2 = [];
186
    my $table2 = [];
186
#foreach my $row2 (@rows2) {
187
    #foreach my $row2 (@rows2) {
187
foreach  (@rows2) {
188
    foreach  (@rows2) {
188
    push (@$row2, $_);
189
        push (@$row2, $_);
189
    push( @$table2, { row2 => $row2 } );
190
        push( @$table2, { row2 => $row2 } );
190
    $row2 = [];
191
        $row2 = [];
191
}
192
    }
192
193
193
$template->param( table2 => $table2 );
194
    $template->param( table2 => $table2 );
195
} else {
196
    $template->param( timeline_read_error => 1 );
197
}
194
198
195
output_html_with_http_headers $query, $cookie, $template->output;
199
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-1 / +6 lines)
Lines 530-535 Link Here
530
530
531
        <div id="history">
531
        <div id="history">
532
        <h2>Koha history timeline</h2>
532
        <h2>Koha history timeline</h2>
533
    [% IF ! timeline_read_error %]
533
        <table style="cursor:pointer">
534
        <table style="cursor:pointer">
534
        <thead>
535
        <thead>
535
        <tr>
536
        <tr>
Lines 546-551 Link Here
546
            </tr>
547
            </tr>
547
        [% END %]
548
        [% END %]
548
        </table>
549
        </table>
550
    [% ELSE %]
551
        <div class="dialog alert">
552
            Could not read the history.txt file. Please make sure &lt;docdir&gt; is correctly defined in koha-conf.xml.
553
        </div>
554
    [% END %]
549
        </div>
555
        </div>
550
556
551
    </div>
557
    </div>
552
- 

Return to bug 10915