Also added ESCAPE="HTML" to column/row headers because users may define
collections that include ampersands, like:
    B&T Rental--Fiction
The Tidy error associated would be:
    line 574 column 29 - Error: general entity "T" not defined and no default 
entity
---
 .../prog/en/modules/reports/issues_stats.tmpl      |    4 ++--
 reports/issues_stats.pl                            |    4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl 
b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
index 4f2d616..5eb0101 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl
@@ -39,13 +39,13 @@
             <tr>
                 <th><!-- TMPL_VAR name="line" --> / <!-- TMPL_VAR 
name="column" --></th>
                 <!-- TMPL_LOOP NAME="loopcol" -->
-                    <th><!-- TMPL_VAR NAME="coltitle_display" --></th>
+                    <th><!-- TMPL_VAR ESCAPE="HTML" NAME="coltitle_display" 
--></th>
                 <!-- /TMPL_LOOP -->
                 <th>TOTAL</th>
                 </tr>
                 <!-- TMPL_LOOP NAME="looprow" -->
                     <tr<!-- TMPL_UNLESS NAME="__odd__" --> 
class="highlight"<!-- /TMPL_UNLESS -->>
-                        <td><!-- TMPL_VAR NAME="rowtitle_display" 
DEFAULT="UNKNOWN VALUE"--></td>
+                        <td><!-- TMPL_VAR ESCAPE="HTML" 
NAME="rowtitle_display" DEFAULT="UNKNOWN VALUE" --></td>
                     <!-- TMPL_LOOP NAME="loopcell" -->
                                                <td><!-- TMPL_VAR NAME="value" 
DEFAULT="&nbsp;" --></td>
                     <!-- /TMPL_LOOP -->
diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl
index 949e0b9..201c676 100755
--- a/reports/issues_stats.pl
+++ b/reports/issues_stats.pl
@@ -442,7 +442,9 @@ sub calculate {
         FROM statistics
         LEFT JOIN borrowers ON 
statistics.borrowernumber=borrowers.borrowernumber
        ";
-       $strcalc .= "LEFT JOIN items ON statistics.itemnumber=items.itemnumber 
" if (($colsource eq 
'items')||@$filters[5]||@$filters[6]||@$filters[7]||@$filters[8]);
+       $strcalc .= "LEFT JOIN items ON statistics.itemnumber=items.itemnumber "
+        if ($linefield =~ /^items\./ or $colfield =~ /^items\./ or ($colsource 
eq 'items')
+            ||@$filters[5]||@$filters[6]||@$filters[7]||@$filters[8]);
         
        $strcalc .= "WHERE 1=1 ";
        @$filters = map {defined($_) and s/\*/%/g; $_} @$filters;
-- 
1.5.5.GIT

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to