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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports/display_values_status.inc (+12 lines)
Line 0 Link Here
1
[% USE AuthorisedValues %]
2
3
[% display_values.status.ACCEPTED = BLOCK %]Accepted[% END %]
4
[% display_values.status.ASKED = BLOCK %]Pending[% END %]
5
[% display_values.status.AVAILABLE = BLOCK %]Available[% END %]
6
[% display_values.status.CHECKED = BLOCK %]Checked[% END %]
7
[% display_values.status.ORDERED = BLOCK %]Ordered[% END %]
8
[% display_values.status.REJECTED = BLOCK %]Rejected[% END %]
9
[% FOREACH av IN AuthorisedValues.Get('SUGGEST_STATUS') %]
10
  [% value = av.authorised_value %]
11
  [% display_values.status.$value = av.lib %]
12
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports/fields.inc (-5 / +5 lines)
Lines 9-25 Link Here
9
    [% CASE 'ordereddate' %]Order date
9
    [% CASE 'ordereddate' %]Order date
10
    [% CASE 'ordereddate_from' %]Order date (from)
10
    [% CASE 'ordereddate_from' %]Order date (from)
11
    [% CASE 'ordereddate_to' %]Order date (to)
11
    [% CASE 'ordereddate_to' %]Order date (to)
12
    [% CASE 'publicationyear' %]Publication year
12
    [% CASE 'copyrightdate' %]Copyright date
13
    [% CASE 'publicationyear_from' %]Publication year (from)
13
    [% CASE 'copyrightdate_from' %]Copyright date (from)
14
    [% CASE 'publicationyear_to' %]Publication year (to)
14
    [% CASE 'copyrightdate_to' %]Copyright date (to)
15
    [% CASE 'status' %]Status
15
    [% CASE 'status' %]Status
16
    [% CASE 'budgetid' %]Fund
16
    [% CASE 'budgetid' %]Fund
17
    [% CASE 'budgetid_children' %]Include child funds
17
    [% CASE 'budgetid_children' %]Include child funds
18
    [% CASE 'categorycode' %]Borrower category
18
    [% CASE 'categorycode' %]Borrower category
19
    [% CASE 'sort1' %]Borrower sort field 1
19
    [% CASE 'sort1' %]Borrower sort field 1
20
    [% CASE 'sort2' %]Borrower sort field 2
20
    [% CASE 'sort2' %]Borrower sort field 2
21
    [% CASE 'branchcode' %]Branch
21
    [% CASE 'branchcode' %]Library
22
    [% CASE 'reason' %]Reject reason
22
    [% CASE 'reason' %]Reason
23
    [% CASE 'itemtype' %]Item type
23
    [% CASE 'itemtype' %]Item type
24
  [% END %]
24
  [% END %]
25
[% END %]
25
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats.tt (-10 / +17 lines)
Lines 1-4 Link Here
1
[% PROCESS 'reports/fields.inc' %]
1
[% PROCESS 'reports/fields.inc' %]
2
[% PROCESS 'reports/display_values_status.inc' %]
3
4
[% USE AuthorisedValues %]
2
5
3
[% BLOCK tr %]
6
[% BLOCK tr %]
4
  <tr>
7
  <tr>
Lines 37-48 Link Here
37
40
38
[% BLOCK select_tr %]
41
[% BLOCK select_tr %]
39
  [% select_filter = BLOCK %]
42
  [% select_filter = BLOCK %]
40
    <select name="filter_[% name %]">
43
    [% IF display_values.$name.keys.size > 0 %]
41
      <option value=""></option>
44
      <select name="filter_[% name %]">
42
      [% FOREACH value IN display_values.$name.keys.sort %]
45
        <option value=""></option>
43
        <option value="[% value %]">[% display_values.$name.$value %]</option>
46
        [% FOREACH value IN display_values.$name.keys.sort %]
44
      [% END %]
47
          <option value="[% value %]">[% display_values.$name.$value %]</option>
45
    </select>
48
        [% END %]
49
      </select>
50
    [% ELSE %]
51
      <input type="text" name="filter_[% name %]">
52
    [% END %]
46
  [% END %]
53
  [% END %]
47
54
48
  [% INCLUDE tr filter=select_filter %]
55
  [% INCLUDE tr filter=select_filter %]
Lines 126-138 Link Here
126
                  [% INCLUDE date_tr name='rejecteddate' %]
133
                  [% INCLUDE date_tr name='rejecteddate' %]
127
                  [% INCLUDE date_tr name='ordereddate' %]
134
                  [% INCLUDE date_tr name='ordereddate' %]
128
135
129
                  [% publicationyear_filter = BLOCK %]
136
                  [% copyrightdate_filter = BLOCK %]
130
                    From
137
                    From
131
                    <input type="text" size="4" name="filter_publicationyear_from"/>
138
                    <input type="text" size="4" name="filter_copyrightdate_from"/>
132
                    To
139
                    To
133
                    <input type="text" size="4" name="filter_publicationyear_to"/>
140
                    <input type="text" size="4" name="filter_copyrightdate_to"/>
134
                  [% END %]
141
                  [% END %]
135
                  [% INCLUDE tr name='publicationyear' filter=publicationyear_filter %]
142
                  [% INCLUDE tr name='copyrightdate' filter=copyrightdate_filter %]
136
143
137
                  [% INCLUDE select_tr name='status' %]
144
                  [% INCLUDE select_tr name='status' %]
138
                  [% INCLUDE select_tr name='categorycode' %]
145
                  [% INCLUDE select_tr name='categorycode' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/suggestions_stats_results.tt (+1 lines)
Lines 1-4 Link Here
1
[% PROCESS 'reports/fields.inc' %]
1
[% PROCESS 'reports/fields.inc' %]
2
[% PROCESS 'reports/display_values_status.inc' %]
2
3
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
  <title>Koha &rsaquo; Reports &rsaquo; Acquisitions statistics results</title>
5
  <title>Koha &rsaquo; Reports &rsaquo; Acquisitions statistics results</title>
(-)a/reports/suggestions_stats.pl (-16 / +7 lines)
Lines 87-101 if ($line and $column) { Link Here
87
87
88
my $display_values = {};
88
my $display_values = {};
89
89
90
$display_values->{status} = {
91
    ACCEPTED => gettext('Accepted'),
92
    ASKED => gettext('Pending'),
93
    AVAILABLE => gettext('Available'),
94
    CHECKED => gettext('Checked'),
95
    ORDERED => gettext('Ordered'),
96
    REJECTED => gettext('Rejected'),
97
};
98
99
my $budgets = C4::Budgets::GetBudgets;
90
my $budgets = C4::Budgets::GetBudgets;
100
foreach my $budget (@$budgets) {
91
foreach my $budget (@$budgets) {
101
    my $budget_id = $budget->{budget_id};
92
    my $budget_id = $budget->{budget_id};
Lines 167-173 sub calculate { Link Here
167
    my ($line, $column, $groupby, $filters) = @_;
158
    my ($line, $column, $groupby, $filters) = @_;
168
159
169
    my @valid_fields = (qw(
160
    my @valid_fields = (qw(
170
        suggesteddate rejecteddate ordereddate publicationyear status budgetid
161
        suggesteddate rejecteddate ordereddate copyrightdate status budgetid
171
        categorycode sort1 sort2 branchcode reason itemtype
162
        categorycode sort1 sort2 branchcode reason itemtype
172
    ));
163
    ));
173
    return unless (grep /^$line$/, @valid_fields);
164
    return unless (grep /^$line$/, @valid_fields);
Lines 208-220 sub calculate { Link Here
208
        }
199
        }
209
    }
200
    }
210
201
211
    if ($filters->{publicationyear_from}) {
202
    if ($filters->{copyrightdate_from}) {
212
        push @conditions, 'publicationyear >= ?';
203
        push @conditions, 'copyrightdate >= ?';
213
        push @bind_values, $filters->{publicationyear_from};
204
        push @bind_values, $filters->{copyrightdate_from};
214
    }
205
    }
215
    if ($filters->{publicationyear_to}) {
206
    if ($filters->{copyrightdate_to}) {
216
        push @conditions, 'publicationyear <= ?';
207
        push @conditions, 'copyrightdate <= ?';
217
        push @bind_values, $filters->{publicationyear_to};
208
        push @bind_values, $filters->{copyrightdate_to};
218
    }
209
    }
219
210
220
    if ($filters->{budgetid}) {
211
    if ($filters->{budgetid}) {
(-)a/t/db_dependent/Budgets.t (-5 / +4 lines)
Lines 633-645 is( C4::Budgets::GetBudget($budget_id21)->{budget_owner_id}, Link Here
633
    undef, "SetOwnerToFundHierarchy should have set John Doe $john_doe for budget 21 ($budget_id21)" );
633
    undef, "SetOwnerToFundHierarchy should have set John Doe $john_doe for budget 21 ($budget_id21)" );
634
634
635
my @descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id1);
635
my @descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id1);
636
is_deeply(\@descendants_ids, [$budget_id12, $budget_id11, $budget_id111]);
636
is_deeply(\@descendants_ids, [$budget_id12, $budget_id11, $budget_id111], "descendants of budget 1 are 12, 11, 111");
637
@descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id11);
637
@descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id11);
638
is_deeply(\@descendants_ids, [$budget_id111]);
638
is_deeply(\@descendants_ids, [$budget_id111], "descendant of buget 11 is 111");
639
@descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id111);
639
@descendants_ids = C4::Budgets::GetBudgetDescendantsIds($budget_id111);
640
is_deeply(\@descendants_ids, []);
640
is_deeply(\@descendants_ids, [], "budget 111 has no descendants");
641
@descendants_ids = C4::Budgets::GetBudgetDescendantsIds(undef);
641
@descendants_ids = C4::Budgets::GetBudgetDescendantsIds(undef);
642
is_deeply(\@descendants_ids, []);
642
is_deeply(\@descendants_ids, [], "GetBudgetDescendantsIds returns an empty list when parameter is undef");
643
643
644
# Test GetBudgetAuthCats
644
# Test GetBudgetAuthCats
645
645
646
- 

Return to bug 13392