Bugzilla – Attachment 39131 Details for
Bug 7683
statistic wizard: cataloging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 7683: Remove use of items.statisticvalue and DHTMLcalendar()
SIGNED-OFF-Bug-7683-Remove-use-of-itemsstatisticva.patch (text/plain), 8.15 KB, created by
Bernardo Gonzalez Kriegel
on 2015-05-13 13:51:04 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 7683: Remove use of items.statisticvalue and DHTMLcalendar()
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-05-13 13:51:04 UTC
Size:
8.15 KB
patch
obsolete
>From 2153ab5bd5360db2c2fedade29c9f9dec86364d8 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 23 Sep 2013 13:34:15 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 7683: Remove use of items.statisticvalue > and DHTMLcalendar() > >Also fix indexes of @filters array > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > .../prog/en/modules/reports/catalogue_stats.tt | 25 --------- > reports/catalogue_stats.pl | 54 +++++++++----------- > 2 files changed, 23 insertions(+), 56 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >index e3ea708..bfc919b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >@@ -275,31 +275,6 @@ > <td colspan="4"><input type="hidden" name="Filter" /></td> > </tr> > [% END %] >- [% IF (statisticvalue) %] >- <tr> >- <td>[% statisticvalue_label %]</td> >- <td><input type="radio" name="Line" value="items.statisticvalue" /></td> >- <td><input type="radio" name="Column" value="items.statisticvalue" /></td> >- <td> >- [% IF (statisticvalue_avlist) %] >- <select name="Filter" id="statisticvalue"> >- <option value=""> </option> >- [% FOREACH av IN statisticvalue_avlist %] >- <option value="[% av.authorised_value %]"> >- [% av.lib %] >- </option> >- [% END %] >- </select> >- [% ELSE %] >- <input type="text" name="Filter" id="statisticvalue" /> >- [% END %] >- </td> >- </tr> >- [% ELSE %] >- <tr style="display:none"> >- <td colspan="4"><input type="hidden" name="Filter" /></td> >- </tr> >- [% END %] > <tr> > <td colspan="3">Filter barcode</td> > <td> >diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl >index a06717f..c90887a 100755 >--- a/reports/catalogue_stats.pl >+++ b/reports/catalogue_stats.pl >@@ -164,7 +164,7 @@ if ($do_it) { > push @locations, { code => $_, description => "$_ - " . $locations->{$_} }; > } > >- foreach my $kohafield (qw(items.notforloan items.materials items.statisticvalue)) { >+ foreach my $kohafield (qw(items.notforloan items.materials)) { > my $subfield_structure = GetMarcSubfieldStructureFromKohaField($kohafield); > if($subfield_structure) { > my $avlist; >@@ -195,7 +195,6 @@ if ($do_it) { > CGIextChoice => \@mime, > CGIsepChoice => GetDelimiterChoices, > item_itype => $item_itype, >- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), > ); > > } >@@ -238,7 +237,7 @@ sub calculate { > my @loopfilter; > for ( my $i = 0 ; $i <= @$filters ; $i++ ) { > my %cell; >- if ( defined @$filters[$i] and @$filters[$i] ne '' and $i != 16 ) { >+ if ( defined @$filters[$i] and @$filters[$i] ne '' and $i != 15 ) { > if ( ( ( $i == 1 ) or ( $i == 3 ) or ( $i == 5 ) or ( $i == 9 ) ) and ( @$filters[ $i - 1 ] ) ) { > $cell{err} = 1 if ( @$filters[$i] < @$filters[ $i - 1 ] ); > } >@@ -259,13 +258,12 @@ sub calculate { > : ( $i == 12 ) ? "Collection Code" > : ( $i == 13 ) ? "Status" > : ( $i == 14 ) ? "Materials" >- : ( $i == 15 ) ? "Statistic value" >- : ( $i == 17 and $filters->[16] == 0 ) ? "Barcode (not like)" >- : ( $i == 17 and $filters->[16] == 1 ) ? "Barcode (like)" >- : ( $i == 18 ) ? "Acquired date from" >- : ( $i == 19 ) ? "Acquired date to" >- : ( $i == 20 ) ? "Removed date from" >- : ( $i == 21 ) ? "Removed date to" >+ : ( $i == 16 and $filters->[15] == 0 ) ? "Barcode (not like)" >+ : ( $i == 16 and $filters->[15] == 1 ) ? "Barcode (like)" >+ : ( $i == 17 ) ? "Acquired date from" >+ : ( $i == 18 ) ? "Acquired date to" >+ : ( $i == 19 ) ? "Removed date from" >+ : ( $i == 20 ) ? "Removed date to" > : ''; > > push @loopfilter, \%cell; >@@ -298,11 +296,10 @@ sub calculate { > $linefilter[0] = @$filters[12] if ( $line =~ /items\.ccode/ ); > $linefilter[0] = @$filters[13] if ( $line =~ /items\.notforloan/ ); > $linefilter[0] = @$filters[14] if ( $line =~ /items\.materials/ ); >- $linefilter[0] = @$filters[15] if ( $line =~ /items\.statisticvalue/ ); >- $linefilter[0] = @$filters[18] if ( $line =~ /items\.dateaccessioned/ ); >- $linefilter[1] = @$filters[19] if ( $line =~ /items\.dateaccessioned/ ); >- $linefilter[0] = @$filters[20] if ( $line =~ /deleteditems\.timestamp/ ); >- $linefilter[1] = @$filters[21] if ( $line =~ /deleteditems\.timestamp/ ); >+ $linefilter[0] = @$filters[17] if ( $line =~ /items\.dateaccessioned/ ); >+ $linefilter[1] = @$filters[18] if ( $line =~ /items\.dateaccessioned/ ); >+ $linefilter[0] = @$filters[19] if ( $line =~ /deleteditems\.timestamp/ ); >+ $linefilter[1] = @$filters[20] if ( $line =~ /deleteditems\.timestamp/ ); > > my @colfilter; > $colfilter[0] = @$filters[0] if ( $column =~ /dewey/ ); >@@ -324,11 +321,10 @@ sub calculate { > $colfilter[0] = @$filters[12] if ( $column =~ /items\.ccode/ ); > $colfilter[0] = @$filters[13] if ( $column =~ /items\.notforloan/ ); > $colfilter[0] = @$filters[14] if ( $column =~ /items\.materials/ ); >- $colfilter[0] = @$filters[15] if ( $column =~ /items\.statisticvalue/ ); >- $colfilter[0] = @$filters[18] if ( $column =~ /items.dateaccessioned/ ); >- $colfilter[1] = @$filters[19] if ( $column =~ /items\.dateaccessioned/ ); >- $colfilter[0] = @$filters[20] if ( $column =~ /deleteditems\.timestamp/ ); >- $colfilter[1] = @$filters[21] if ( $column =~ /deleteditems\.timestamp/ ); >+ $colfilter[0] = @$filters[17] if ( $column =~ /items.dateaccessioned/ ); >+ $colfilter[1] = @$filters[18] if ( $column =~ /items\.dateaccessioned/ ); >+ $colfilter[0] = @$filters[19] if ( $column =~ /deleteditems\.timestamp/ ); >+ $colfilter[1] = @$filters[20] if ( $column =~ /deleteditems\.timestamp/ ); > > # 1st, loop rows. > my $origline = $line; >@@ -556,25 +552,21 @@ sub calculate { > @$filters[14] =~ s/\*/%/g; > $strcalc .= " AND $itemstable.materials LIKE '" . @$filters[14] . "'"; > } >- if ( defined @$filters[15] and @$filters[15] ne '' ) { >- @$filters[15] =~ s/\*/%/g; >- $strcalc .= " AND $itemstable.statisticvalue LIKE '" . @$filters[15] . "'"; >+ if ( @$filters[17] ) { >+ @$filters[17] =~ s/\*/%/g; >+ $strcalc .= " AND $itemstable.dateaccessioned >= '@$filters[17]' "; > } > if ( @$filters[18] ) { > @$filters[18] =~ s/\*/%/g; >- $strcalc .= " AND $itemstable.dateaccessioned >= '@$filters[18]' "; >+ $strcalc .= " AND $itemstable.dateaccessioned <= '@$filters[18]' "; > } >- if ( @$filters[19] ) { >+ if ( $cellvalue eq 'deleteditems' and @$filters[19] ) { > @$filters[19] =~ s/\*/%/g; >- $strcalc .= " AND $itemstable.dateaccessioned <= '@$filters[19]' "; >+ $strcalc .= " AND DATE(deleteditems.timestamp) >= '@$filters[19]' "; > } > if ( $cellvalue eq 'deleteditems' and @$filters[20] ) { > @$filters[20] =~ s/\*/%/g; >- $strcalc .= " AND DATE(deleteditems.timestamp) >= '@$filters[20]' "; >- } >- if ( $cellvalue eq 'deleteditems' and @$filters[21] ) { >- @$filters[21] =~ s/\*/%/g; >- $strcalc .= " AND DATE(deleteditems.timestamp) <= '@$filters[21]' "; >+ $strcalc .= " AND DATE(deleteditems.timestamp) <= '@$filters[20]' "; > } > $strcalc .= " group by $linefield, $colfield order by $linefield,$colfield"; > $debug and warn "SQL: $strcalc"; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7683
:
12762
|
12785
|
12940
|
14399
|
14466
|
16327
|
16328
|
16329
|
16367
|
16775
|
20241
|
20242
|
20243
|
20244
|
20245
|
21357
|
21358
|
23683
|
23684
|
23685
|
23686
|
23687
|
23688
|
23689
|
23690
|
23691
|
25072
|
25073
|
25091
|
25092
|
25093
|
25094
|
25095
|
25096
|
25097
|
25098
|
25099
|
25100
|
26678
|
26679
|
26680
|
26681
|
26682
|
28466
|
28467
|
28468
|
28469
|
28470
|
36489
|
36490
|
36491
|
36492
|
36493
|
39129
|
39130
|
39131
|
39132
|
39133
|
41821
|
41829
|
44651
|
44652
|
44653
|
44654
|
44655
|
45238
|
45239
|
45240
|
45241
|
45242