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

(-)a/C4/Serials.pm (+8 lines)
Lines 2046-2051 sub GetLateOrMissingIssues { Link Here
2046
    return unless ( $supplierid or $serialid );
2046
    return unless ( $supplierid or $serialid );
2047
2047
2048
    my $dbh = C4::Context->dbh;
2048
    my $dbh = C4::Context->dbh;
2049
2049
    my $sth;
2050
    my $sth;
2050
    my $byserial = '';
2051
    my $byserial = '';
2051
    if ($serialid) {
2052
    if ($serialid) {
Lines 2101-2106 sub GetLateOrMissingIssues { Link Here
2101
            $line->{claimdate}   = format_date( $line->{claimdate} );
2102
            $line->{claimdate}   = format_date( $line->{claimdate} );
2102
        }
2103
        }
2103
        $line->{"status".$line->{status}}   = 1;
2104
        $line->{"status".$line->{status}}   = 1;
2105
2106
        my $additional_field_values = Koha::AdditionalField->fetch_all_values({
2107
            record_id => $line->{subscriptionid},
2108
            tablename => 'subscription'
2109
        });
2110
        %$line = ( %$line, additional_fields => $additional_field_values->{$line->{subscriptionid}} );
2111
2104
        push @issuelist, $line;
2112
        push @issuelist, $line;
2105
    }
2113
    }
2106
    return @issuelist;
2114
    return @issuelist;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-70 / +35 lines)
Lines 1-6 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
2
3
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% USE KohaAuthorisedValues %]
4
    <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
5
    <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
5
    [% INCLUDE 'doc-head-close.inc' %]
6
    [% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'calendar.inc' %]
7
[% INCLUDE 'calendar.inc' %]
Lines 11-25 Link Here
11
<script type="text/javascript">
12
<script type="text/javascript">
12
//<![CDATA[
13
//<![CDATA[
13
    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
14
    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
15
    var sTable;
14
	 $(document).ready(function() {
16
	 $(document).ready(function() {
15
        [% UNLESS ( preview ) %]
17
        [% UNLESS ( preview ) %]
16
         var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
18
         sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
17
            "sDom": 't',
19
            "sDom": 't',
18
            "aoColumnDefs": [
20
            "aoColumnDefs": [
19
                { "aTargets": [ 0,1 ], "bSortable": false, "bSearchable": false }
21
                { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
20
            ],
22
            ],
21
            "bPaginate": false
23
            "bPaginate": false
22
        }));
24
        }));
25
        sTable.fnAddFilters("filter", "200");
23
        [% END %]
26
        [% END %]
24
	    $('#supplierid').change(function() {
27
	    $('#supplierid').change(function() {
25
    	    $('#claims').submit();
28
    	    $('#claims').submit();
Lines 53-65 Link Here
53
        return false;
56
        return false;
54
        });
57
        });
55
58
56
        $("#titlefilter").keyup( function () {
57
            sTable.fnFilter( this.value, 3 ); // 3 is position of title column
58
        } );
59
60
        $("#branchfilter").keyup(function() {
61
            sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
62
	    });
63
	 });
59
	 });
64
60
65
	// Checks if the form can be sent (at least one checkbox must be checked)
61
	// Checks if the form can be sent (at least one checkbox must be checked)
Lines 70-105 Link Here
70
	    }
66
	    }
71
	}
67
	}
72
68
73
    // Filter by status
74
    function filterByStatus() {
75
        selectedStatus = $("#statusfilter").val();
76
        if (selectedStatus == "all") {
77
            clearFilters();
78
        } else {
79
            $("table#claimst tbody tr").hide();
80
            $("table#claimst tbody tr").each( function() {
81
                if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
82
                    $(this).show();
83
                }
84
            });
85
        }
86
    }
87
88
    // Filter by branch
89
    function filterByBranch() {
90
        selectedBranch = $("#branchfilter").val();
91
        if (selectedBranch == "all") {
92
            clearFilters();
93
        } else {
94
            $("table#claimst tbody tr").hide();
95
            $("table#claimst tbody tr").each( function() {
96
                if ( $(this).find("span.branch-" + selectedBranch).size() > 0 ) {
97
                    $(this).show();
98
                }
99
            });
100
        }
101
    }
102
103
	// Filter by date
69
	// Filter by date
104
	function filterByDate() {
70
	function filterByDate() {
105
        var beginDate = Date_from_syspref($("#from").val()).getTime();
71
        var beginDate = Date_from_syspref($("#from").val()).getTime();
Lines 147-152 Link Here
147
	// Clears filters : shows everything
113
	// Clears filters : shows everything
148
	function clearFilters() {
114
	function clearFilters() {
149
	    $("table#claimst tbody tr").show();
115
	    $("table#claimst tbody tr").show();
116
150
	}
117
	}
151
118
152
	function popup(supplierid,serialid){
119
	function popup(supplierid,serialid){
Lines 210-252 Link Here
210
	
177
	
211
	<ol>
178
	<ol>
212
	<li>
179
	<li>
213
	    <label for="statusfilter">Status : </label>
214
	    <select id="statusfilter" onchange="filterByStatus();">
215
            <option value="all" selected="selected">(All)</option>
216
            <option value="expected">Expected</option>
217
            <option value="late">Late</option>
218
            <option value="missing">Missing</option>
219
            <option value="missing_never_received">Missing (never received)</option>
220
            <option value="missing_sold_out">Missing (sold out)</option>
221
            <option value="missing_damaged">Missing (damaged)</option>
222
            <option value="missing_lost">Missing (lost)</option>
223
            <option value="claimed">Claimed</option>
224
	    </select>
225
	</li>
226
	
227
	<li>
228
	    <label for="titlefilter">Title : </label>
229
        <input id="titlefilter" type="text" />
230
    </li>
231
    <li>
232
	    <label for="branchfilter">Library: </label>
233
	    <select id="branchfilter" onchange="filterByBranch();">
234
            <option value="all" selected="selected">(All)</option>
235
            [% FOREACH branchloo IN branchloop %]
236
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
237
            [% END %]
238
        </select>
239
	</li>
240
	
241
	<li>
242
        <label for="from">From:</label>
180
        <label for="from">From:</label>
243
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
181
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
244
        <label for="to" style="float:none;">To:</label>
182
        <label for="to" style="float:none;">To:</label>
245
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
183
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
246
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
184
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
247
	    <input type="button" value="OK" onclick="filterByDate();" />
185
	    <input type="button" value="OK" onclick="filterByDate();" />
248
        </li>
186
    </li>
249
	
187
250
	<li>
188
	<li>
251
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
189
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
252
	</li>
190
	</li>
Lines 269-275 Link Here
269
                    <th>Status</th>
207
                    <th>Status</th>
270
                    <th>Since</th>
208
                    <th>Since</th>
271
                    <th>Claim date</th>
209
                    <th>Claim date</th>
210
                    [% FOR field IN additional_fields_for_subscription %]
211
                      <th>[% field.name %]</th>
212
                    [% END %]
272
                </tr></thead>
213
                </tr></thead>
214
                <tfoot>
215
                  <tr>
216
                    [% IF ( letter ) %]
217
                      <td></td>
218
                    [% END %]
219
                    <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
220
                    <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
221
                    <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
222
                    <td><input type="text" class="filter" data-column_num="4" placeholder="Search issue number" /></td>
223
                    <td><input type="text" class="filter" data-column_num="5" placeholder="Search status" /></td>
224
                    <td></td>
225
                    <td><input type="text" class="filter" data-column_num="7" placeholder="Search claim date" /></td>
226
                    [% FOR field IN additional_fields_for_subscription %]
227
                      <td><input type="text" class="filter" data-column_num="[% loop.count + 7 %]" placeholder="Search [% field.name %]" /></td>
228
                    [% END %]
229
                  </tr>
230
                </tfoot>
273
                <tbody>[% FOREACH missingissue IN missingissues %]
231
                <tbody>[% FOREACH missingissue IN missingissues %]
274
                    <tr>
232
                    <tr>
275
                        [% IF ( letter ) %]
233
                        [% IF ( letter ) %]
Lines 305-310 Link Here
305
                        <td>
263
                        <td>
306
                        [% missingissue.claimdate %]
264
                        [% missingissue.claimdate %]
307
                        </td>
265
                        </td>
266
                        [% FOR field IN additional_fields_for_subscription %]
267
                          [% IF field.authorised_value_category %]
268
                            <td>[% KohaAuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
269
                          [% ELSE %]
270
                            <td>[% missingissue.additional_fields.${field.name} %]</td>
271
                          [% END %]
272
                        [% END %]
308
                    </tr>
273
                    </tr>
309
                [% END %]</tbody>
274
                [% END %]</tbody>
310
            </table>
275
            </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 98-103 $template->param( Link Here
98
        claimletter => $claimletter,
107
        claimletter => $claimletter,
99
        supplierloop => \@supplierinfo,
108
        supplierloop => \@supplierinfo,
100
        branchloop   => $branchloop,
109
        branchloop   => $branchloop,
110
        additional_fields_for_subscription => $additional_fields,
101
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
111
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
102
        (uc(C4::Context->preference("marcflavour"))) => 1
112
        (uc(C4::Context->preference("marcflavour"))) => 1
103
        );
113
        );
104
- 

Return to bug 10855