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

(-)a/C4/Serials.pm (+8 lines)
Lines 2015-2020 sub GetLateOrMissingIssues { Link Here
2015
    return unless ( $supplierid or $serialid );
2015
    return unless ( $supplierid or $serialid );
2016
2016
2017
    my $dbh = C4::Context->dbh;
2017
    my $dbh = C4::Context->dbh;
2018
2018
    my $sth;
2019
    my $sth;
2019
    my $byserial = '';
2020
    my $byserial = '';
2020
    if ($serialid) {
2021
    if ($serialid) {
Lines 2070-2075 sub GetLateOrMissingIssues { Link Here
2070
            $line->{claimdate}   = format_date( $line->{claimdate} );
2071
            $line->{claimdate}   = format_date( $line->{claimdate} );
2071
        }
2072
        }
2072
        $line->{"status".$line->{status}}   = 1;
2073
        $line->{"status".$line->{status}}   = 1;
2074
2075
        my $additional_field_values = Koha::AdditionalField->fetch_all_values({
2076
            record_id => $line->{subscriptionid},
2077
            tablename => 'subscription'
2078
        });
2079
        %$line = ( %$line, additional_fields => $additional_field_values->{$line->{subscriptionid}} );
2080
2073
        push @issuelist, $line;
2081
        push @issuelist, $line;
2074
    }
2082
    }
2075
    return @issuelist;
2083
    return @issuelist;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-64 / +35 lines)
Lines 1-4 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% USE KohaAuthorisedValues %]
2
    <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
3
    <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
3
    [% INCLUDE 'doc-head-close.inc' %]
4
    [% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'calendar.inc' %]
5
[% INCLUDE 'calendar.inc' %]
Lines 9-23 Link Here
9
<script type="text/javascript">
10
<script type="text/javascript">
10
//<![CDATA[
11
//<![CDATA[
11
    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
12
    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
13
    var sTable;
12
	 $(document).ready(function() {
14
	 $(document).ready(function() {
13
        [% UNLESS ( preview ) %]
15
        [% UNLESS ( preview ) %]
14
         var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
16
         sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
15
            "sDom": 't',
17
            "sDom": 't',
16
            "aoColumnDefs": [
18
            "aoColumnDefs": [
17
                { "aTargets": [ 0,1 ], "bSortable": false, "bSearchable": false }
19
                { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
18
            ],
20
            ],
19
            "bPaginate": false
21
            "bPaginate": false
20
        }));
22
        }));
23
        sTable.fnAddFilters("filter", "200");
21
        [% END %]
24
        [% END %]
22
	    $('#supplierid').change(function() {
25
	    $('#supplierid').change(function() {
23
    	    $('#claims').submit();
26
    	    $('#claims').submit();
Lines 51-63 Link Here
51
        return false;
54
        return false;
52
        });
55
        });
53
56
54
        $("#titlefilter").keyup( function () {
55
            sTable.fnFilter( this.value, 3 ); // 3 is position of title column
56
        } );
57
58
        $("#branchfilter").keyup(function() {
59
            sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
60
	    });
61
	 });
57
	 });
62
58
63
	// Checks if the form can be sent (at least one checkbox must be checked)
59
	// Checks if the form can be sent (at least one checkbox must be checked)
Lines 68-98 Link Here
68
	    }
64
	    }
69
	}
65
	}
70
66
71
    // Filter by status
72
    function filterByStatus() {
73
        selectedStatus = $("#statusfilter").val();
74
        if (selectedStatus == "all") {
75
            clearFilters();
76
        } else {
77
            $("table#claimst tbody tr").hide();
78
            $("table#claimst tbody tr").each( function() {
79
                if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
80
                    $(this).show();
81
                }
82
            });
83
        }
84
    }
85
86
	// Filter by branch
87
	function filterByBranch() {
88
	    selectedBranch = $("#branchfilter").val();
89
	    if (selectedBranch == "all") {
90
		clearFilters();
91
	    } else {
92
		$("table#claimst tbody tr").hide();
93
		$("table#claimst tbody tr:contains(" + selectedBranch + ")").show();
94
	    }
95
	}
96
	// Filter by date
67
	// Filter by date
97
	function filterByDate() {
68
	function filterByDate() {
98
        var beginDate = Date_from_syspref($("#from").val()).getTime();
69
        var beginDate = Date_from_syspref($("#from").val()).getTime();
Lines 140-145 Link Here
140
	// Clears filters : shows everything
111
	// Clears filters : shows everything
141
	function clearFilters() {
112
	function clearFilters() {
142
	    $("table#claimst tbody tr").show();
113
	    $("table#claimst tbody tr").show();
114
143
	}
115
	}
144
116
145
	function popup(supplierid,serialid){
117
	function popup(supplierid,serialid){
Lines 203-244 Link Here
203
	
175
	
204
	<ol>
176
	<ol>
205
	<li>
177
	<li>
206
	    <label for="statusfilter">Status : </label>
207
	    <select id="statusfilter" onchange="filterByStatus();">
208
            <option value="all" selected="selected">(All)</option>
209
            <option value="expected">Expected</option>
210
            <option value="late">Late</option>
211
            <option value="missing">Missing</option>
212
            <option value="claimed">Claimed</option>
213
	    </select>
214
	</li>
215
	
216
	<li>
217
	    <label for="titlefilter">Title : </label>
218
        <input id="titlefilter" type="text" />
219
    </li>
220
    <li>
221
	    <label for="branchfilter">Library: </label>
222
	    <select id="branchfilter" onchange="filterByBranch();">
223
            [% FOREACH branchloo IN branchloop %]
224
                [% IF ( branchloo.selected ) %]
225
                <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
226
                [% ELSE %]
227
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
228
                [% END %]
229
            [% END %]
230
        </select>
231
	</li>
232
	
233
	<li>
234
        <label for="from">From:</label>
178
        <label for="from">From:</label>
235
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
179
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
236
        <label for="to" style="float:none;">To:</label>
180
        <label for="to" style="float:none;">To:</label>
237
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
181
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
238
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
182
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
239
	    <input type="button" value="OK" onclick="filterByDate();" />
183
	    <input type="button" value="OK" onclick="filterByDate();" />
240
        </li>
184
    </li>
241
	
185
242
	<li>
186
	<li>
243
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
187
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
244
	</li>
188
	</li>
Lines 261-267 Link Here
261
                    <th>Status</th>
205
                    <th>Status</th>
262
                    <th>Since</th>
206
                    <th>Since</th>
263
                    <th>Claim date</th>
207
                    <th>Claim date</th>
208
                    [% FOR field IN additional_fields_for_subscription %]
209
                      <th>[% field.name %]</th>
210
                    [% END %]
264
                </tr></thead>
211
                </tr></thead>
212
                <tfoot>
213
                  <tr>
214
                    [% IF ( letter ) %]
215
                      <td></td>
216
                    [% END %]
217
                    <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
218
                    <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
219
                    <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
220
                    <td><input type="text" class="filter" data-column_num="4" placeholder="Search issue number" /></td>
221
                    <td><input type="text" class="filter" data-column_num="5" placeholder="Search status" /></td>
222
                    <td></td>
223
                    <td><input type="text" class="filter" data-column_num="7" placeholder="Search claim date" /></td>
224
                    [% FOR field IN additional_fields_for_subscription %]
225
                      <td><input type="text" class="filter" data-column_num="[% loop.count + 7 %]" placeholder="Search [% field.name %]" /></td>
226
                    [% END %]
227
                  </tr>
228
                </tfoot>
265
                <tbody>[% FOREACH missingissue IN missingissues %]
229
                <tbody>[% FOREACH missingissue IN missingissues %]
266
                    <tr>
230
                    <tr>
267
                        [% IF ( letter ) %]
231
                        [% IF ( letter ) %]
Lines 293-298 Link Here
293
                        <td>
257
                        <td>
294
                        [% missingissue.claimdate %]
258
                        [% missingissue.claimdate %]
295
                        </td>
259
                        </td>
260
                        [% FOR field IN additional_fields_for_subscription %]
261
                          [% IF field.authorised_value_category %]
262
                            <td>[% KohaAuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
263
                          [% ELSE %]
264
                            <td>[% missingissue.additional_fields.${field.name} %]</td>
265
                          [% END %]
266
                        [% END %]
296
                    </tr>
267
                    </tr>
297
                [% END %]</tbody>
268
                [% END %]</tbody>
298
            </table>
269
            </table>
(-)a/serials/claims.pl (-1 / +10 lines)
Lines 28-33 use C4::Bookseller qw( GetBookSeller ); Link Here
28
use C4::Context;
28
use C4::Context;
29
use C4::Letters;
29
use C4::Letters;
30
use C4::Branch;    # GetBranches GetBranchesLoop
30
use C4::Branch;    # GetBranches GetBranchesLoop
31
use C4::Koha qw( GetAuthorisedValues );
32
use Koha::AdditionalField;
31
use C4::Csv qw( GetCsvProfiles );
33
use C4::Csv qw( GetCsvProfiles );
32
34
33
my $input = CGI->new;
35
my $input = CGI->new;
Lines 58-63 for my $s (@{$supplierlist} ) { Link Here
58
    }
60
    }
59
}
61
}
60
62
63
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription', searchable => 1 } );
64
for my $field ( @$additional_fields ) {
65
    if ( $field->{authorised_value_category} ) {
66
        $field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} );
67
    }
68
}
69
61
my $letters = GetLetters('claimissues');
70
my $letters = GetLetters('claimissues');
62
my @letters;
71
my @letters;
63
foreach (keys %{$letters}){
72
foreach (keys %{$letters}){
Lines 99-104 $template->param( Link Here
99
        claimletter => $claimletter,
108
        claimletter => $claimletter,
100
        supplierloop => \@supplierinfo,
109
        supplierloop => \@supplierinfo,
101
        branchloop   => $branchloop,
110
        branchloop   => $branchloop,
111
        additional_fields_for_subscription => $additional_fields,
102
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
112
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
103
        (uc(C4::Context->preference("marcflavour"))) => 1
113
        (uc(C4::Context->preference("marcflavour"))) => 1
104
        );
114
        );
105
- 

Return to bug 10855