Bugzilla – Attachment 78624 Details for
Bug 13392
New statistics wizard for suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13392: QA fixes
Bug-13392-QA-fixes.patch (text/plain), 8.93 KB, created by
Julian Maurice
on 2018-09-13 14:58:54 UTC
(
hide
)
Description:
Bug 13392: QA fixes
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-09-13 14:58:54 UTC
Size:
8.93 KB
patch
obsolete
>From 2a62342f81ba6173c6eb95419ae63b557508bc16 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 11 Feb 2015 15:26:02 +0100 >Subject: [PATCH] Bug 13392: QA fixes > >1/ Add tests descriptions >2/ Do not use Koha::I18N for suggestion statuses, and add statuses from >SUGGEST_STATUS authorised values >3/ Use copyrightdate instead of publicationyear which seems to be unused >4/ Display free text filters if there is no values in corresponding >authorised values list >5/ Rename 'Branch' to 'Library' and 'Reject reason' to 'Reason' > >Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../reports/display_values_status.inc | 12 +++++++++ > .../prog/en/includes/reports/fields.inc | 10 +++---- > .../en/modules/reports/suggestions_stats.tt | 27 ++++++++++++------- > .../reports/suggestions_stats_results.tt | 1 + > reports/suggestions_stats.pl | 23 +++++----------- > t/db_dependent/Budgets.t | 8 +++--- > 6 files changed, 46 insertions(+), 35 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/reports/display_values_status.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports/display_values_status.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports/display_values_status.inc >new file mode 100644 >index 0000000000..956231c0e2 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports/display_values_status.inc >@@ -0,0 +1,12 @@ >+[% USE AuthorisedValues %] >+ >+[% display_values.status.ACCEPTED = BLOCK %]Accepted[% END %] >+[% display_values.status.ASKED = BLOCK %]Pending[% END %] >+[% display_values.status.AVAILABLE = BLOCK %]Available[% END %] >+[% display_values.status.CHECKED = BLOCK %]Checked[% END %] >+[% display_values.status.ORDERED = BLOCK %]Ordered[% END %] >+[% display_values.status.REJECTED = BLOCK %]Rejected[% END %] >+[% FOREACH av IN AuthorisedValues.Get('SUGGEST_STATUS') %] >+ [% value = av.authorised_value %] >+ [% display_values.status.$value = av.lib %] >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports/fields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports/fields.inc >index 5500c146bb..dc7df421e0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports/fields.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports/fields.inc >@@ -9,17 +9,17 @@ > [% CASE 'ordereddate' %]Order date > [% CASE 'ordereddate_from' %]Order date (from) > [% CASE 'ordereddate_to' %]Order date (to) >- [% CASE 'publicationyear' %]Publication year >- [% CASE 'publicationyear_from' %]Publication year (from) >- [% CASE 'publicationyear_to' %]Publication year (to) >+ [% CASE 'copyrightdate' %]Copyright date >+ [% CASE 'copyrightdate_from' %]Copyright date (from) >+ [% CASE 'copyrightdate_to' %]Copyright date (to) > [% CASE 'status' %]Status > [% CASE 'budgetid' %]Fund > [% CASE 'budgetid_children' %]Include child funds > [% CASE 'categorycode' %]Borrower category > [% CASE 'sort1' %]Borrower sort field 1 > [% CASE 'sort2' %]Borrower sort field 2 >- [% CASE 'branchcode' %]Branch >- [% CASE 'reason' %]Reject reason >+ [% CASE 'branchcode' %]Library >+ [% CASE 'reason' %]Reason > [% CASE 'itemtype' %]Item type > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats.tt >index e1a2914565..ee538467bb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats.tt >@@ -1,4 +1,7 @@ > [% PROCESS 'reports/fields.inc' %] >+[% PROCESS 'reports/display_values_status.inc' %] >+ >+[% USE AuthorisedValues %] > > [% BLOCK tr %] > <tr> >@@ -37,12 +40,16 @@ > > [% BLOCK select_tr %] > [% select_filter = BLOCK %] >- <select name="filter_[% name %]"> >- <option value=""></option> >- [% FOREACH value IN display_values.$name.keys.sort %] >- <option value="[% value %]">[% display_values.$name.$value %]</option> >- [% END %] >- </select> >+ [% IF display_values.$name.keys.size > 0 %] >+ <select name="filter_[% name %]"> >+ <option value=""></option> >+ [% FOREACH value IN display_values.$name.keys.sort %] >+ <option value="[% value %]">[% display_values.$name.$value %]</option> >+ [% END %] >+ </select> >+ [% ELSE %] >+ <input type="text" name="filter_[% name %]"> >+ [% END %] > [% END %] > > [% INCLUDE tr filter=select_filter %] >@@ -126,13 +133,13 @@ > [% INCLUDE date_tr name='rejecteddate' %] > [% INCLUDE date_tr name='ordereddate' %] > >- [% publicationyear_filter = BLOCK %] >+ [% copyrightdate_filter = BLOCK %] > From >- <input type="text" size="4" name="filter_publicationyear_from"/> >+ <input type="text" size="4" name="filter_copyrightdate_from"/> > To >- <input type="text" size="4" name="filter_publicationyear_to"/> >+ <input type="text" size="4" name="filter_copyrightdate_to"/> > [% END %] >- [% INCLUDE tr name='publicationyear' filter=publicationyear_filter %] >+ [% INCLUDE tr name='copyrightdate' filter=copyrightdate_filter %] > > [% INCLUDE select_tr name='status' %] > [% INCLUDE select_tr name='categorycode' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats_results.tt >index c507eb17f3..2e00d47c14 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats_results.tt >@@ -1,4 +1,5 @@ > [% PROCESS 'reports/fields.inc' %] >+[% PROCESS 'reports/display_values_status.inc' %] > > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Reports › Acquisitions statistics results</title> >diff --git a/reports/suggestions_stats.pl b/reports/suggestions_stats.pl >index e88aba7cd5..6c0cef8fc5 100755 >--- a/reports/suggestions_stats.pl >+++ b/reports/suggestions_stats.pl >@@ -87,15 +87,6 @@ if ($line and $column) { > > my $display_values = {}; > >-$display_values->{status} = { >- ACCEPTED => gettext('Accepted'), >- ASKED => gettext('Pending'), >- AVAILABLE => gettext('Available'), >- CHECKED => gettext('Checked'), >- ORDERED => gettext('Ordered'), >- REJECTED => gettext('Rejected'), >-}; >- > my $budgets = C4::Budgets::GetBudgets; > foreach my $budget (@$budgets) { > my $budget_id = $budget->{budget_id}; >@@ -167,7 +158,7 @@ sub calculate { > my ($line, $column, $groupby, $filters) = @_; > > my @valid_fields = (qw( >- suggesteddate rejecteddate ordereddate publicationyear status budgetid >+ suggesteddate rejecteddate ordereddate copyrightdate status budgetid > categorycode sort1 sort2 branchcode reason itemtype > )); > return unless (grep /^$line$/, @valid_fields); >@@ -208,13 +199,13 @@ sub calculate { > } > } > >- if ($filters->{publicationyear_from}) { >- push @conditions, 'publicationyear >= ?'; >- push @bind_values, $filters->{publicationyear_from}; >+ if ($filters->{copyrightdate_from}) { >+ push @conditions, 'copyrightdate >= ?'; >+ push @bind_values, $filters->{copyrightdate_from}; > } >- if ($filters->{publicationyear_to}) { >- push @conditions, 'publicationyear <= ?'; >- push @bind_values, $filters->{publicationyear_to}; >+ if ($filters->{copyrightdate_to}) { >+ push @conditions, 'copyrightdate <= ?'; >+ push @bind_values, $filters->{copyrightdate_to}; > } > > if ($filters->{budgetid}) { >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index 6fa0a9a6fa..f40524f22d 100755 >--- a/t/db_dependent/Budgets.t >+++ b/t/db_dependent/Budgets.t >@@ -747,13 +747,13 @@ is( C4::Budgets::GetBudget($budget_id21)->{budget_owner_id}, > undef, "SetOwnerToFundHierarchy should have set John Doe $john_doe for budget 21 ($budget_id21)" ); > > my @descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id1); >-is_deeply(\@descendants_ids, [$budget_id12, $budget_id11, $budget_id111]); >+is_deeply(\@descendants_ids, [$budget_id12, $budget_id11, $budget_id111], "descendants of budget 1 are 12, 11, 111"); > @descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id11); >-is_deeply(\@descendants_ids, [$budget_id111]); >+is_deeply(\@descendants_ids, [$budget_id111], "descendant of buget 11 is 111"); > @descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id111); >-is_deeply(\@descendants_ids, []); >+is_deeply(\@descendants_ids, [], "budget 111 has no descendants"); > @descendants_ids = C4::Budgets::GetBudgetDescendantsIds(undef); >-is_deeply(\@descendants_ids, []); >+is_deeply(\@descendants_ids, [], "GetBudgetDescendantsIds returns an empty list when parameter is undef"); > > # Test GetBudgetAuthCats > >-- >2.17.1
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 13392
:
34124
|
34125
|
34135
|
34136
|
34328
|
34329
|
35835
|
35836
|
35837
|
36188
|
36189
|
36190
|
36343
|
36344
|
36345
|
40305
|
40306
|
40307
|
40308
|
48291
|
48292
|
48293
|
48294
|
49088
|
51995
|
51996
|
51997
|
51998
|
51999
|
56110
|
56889
|
60956
|
60957
|
60958
|
60959
|
60960
|
60961
|
60962
|
64459
|
64460
|
64461
|
64462
|
64463
|
64464
|
64465
|
78622
|
78623
| 78624 |
78625
|
78626
|
78627
|
78628
|
78629