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

(-)a/C4/Serials.pm (+8 lines)
Lines 1910-1915 sub GetLateOrMissingIssues { Link Here
1910
    return unless ( $supplierid or $serialid );
1910
    return unless ( $supplierid or $serialid );
1911
1911
1912
    my $dbh = C4::Context->dbh;
1912
    my $dbh = C4::Context->dbh;
1913
1913
    my $sth;
1914
    my $sth;
1914
    my $byserial = '';
1915
    my $byserial = '';
1915
    if ($serialid) {
1916
    if ($serialid) {
Lines 1969-1974 sub GetLateOrMissingIssues { Link Here
1969
            $line->{claimdate}   = format_date( $line->{claimdate} );
1970
            $line->{claimdate}   = format_date( $line->{claimdate} );
1970
        }
1971
        }
1971
        $line->{"status".$line->{status}}   = 1;
1972
        $line->{"status".$line->{status}}   = 1;
1973
1974
        my $additional_field_values = Koha::AdditionalField->fetch_all_values({
1975
            record_id => $line->{subscriptionid},
1976
            tablename => 'subscription'
1977
        });
1978
        %$line = ( %$line, additional_fields => $additional_field_values->{$line->{subscriptionid}} );
1979
1972
        push @issuelist, $line;
1980
        push @issuelist, $line;
1973
    }
1981
    }
1974
    return @issuelist;
1982
    return @issuelist;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-72 / +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 8-15 Link Here
8
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
9
<script type="text/javascript">
10
<script type="text/javascript">
10
//<![CDATA[
11
//<![CDATA[
12
    var sTable;
11
	 $(document).ready(function() {
13
	 $(document).ready(function() {
12
         var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
14
         sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
13
            "sDom": 't',
15
            "sDom": 't',
14
                "aoColumnDefs": [
16
                "aoColumnDefs": [
15
                    { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
17
                    { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
Lines 18-23 Link Here
18
                ],
20
                ],
19
            "bPaginate": false
21
            "bPaginate": false
20
        }));
22
        }));
23
        sTable.fnAddFilters("filter", "200");
21
	    $('#supplierid').change(function() {
24
	    $('#supplierid').change(function() {
22
    	    $('#claims').submit();
25
    	    $('#claims').submit();
23
	    });
26
	    });
Lines 50-62 Link Here
50
        return false;
53
        return false;
51
        });
54
        });
52
55
53
        $("#titlefilter").keyup( function () {
54
            sTable.fnFilter( this.value, 3 ); // 3 is position of title column
55
        } );
56
57
        $("#branchfilter").keyup(function() {
58
            sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
59
	    });
60
	 });
56
	 });
61
57
62
	// Checks if the form can be sent (at least one checkbox must be checked)
58
	// Checks if the form can be sent (at least one checkbox must be checked)
Lines 67-102 Link Here
67
	    }
63
	    }
68
	}
64
	}
69
65
70
    // Filter by status
71
    function filterByStatus() {
72
        selectedStatus = $("#statusfilter").val();
73
        if (selectedStatus == "all") {
74
            clearFilters();
75
        } else {
76
            $("table#claimst tbody tr").hide();
77
            $("table#claimst tbody tr").each( function() {
78
                if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
79
                    $(this).show();
80
                }
81
            });
82
        }
83
    }
84
85
    // Filter by branch
86
    function filterByBranch() {
87
        selectedBranch = $("#branchfilter").val();
88
        if (selectedBranch == "all") {
89
            clearFilters();
90
        } else {
91
            $("table#claimst tbody tr").hide();
92
            $("table#claimst tbody tr").each( function() {
93
                if ( $(this).find("span.branch-" + selectedBranch).size() > 0 ) {
94
                    $(this).show();
95
                }
96
            });
97
        }
98
    }
99
100
	// Filter by date
66
	// Filter by date
101
	function filterByDate() {
67
	function filterByDate() {
102
        var beginDate = Date_from_syspref($("#from").val()).getTime();
68
        var beginDate = Date_from_syspref($("#from").val()).getTime();
Lines 144-149 Link Here
144
	// Clears filters : shows everything
110
	// Clears filters : shows everything
145
	function clearFilters() {
111
	function clearFilters() {
146
	    $("table#claimst tbody tr").show();
112
	    $("table#claimst tbody tr").show();
113
147
	}
114
	}
148
115
149
//]]>
116
//]]>
Lines 209-251 Link Here
209
	
176
	
210
	<ol>
177
	<ol>
211
	<li>
178
	<li>
212
	    <label for="statusfilter">Status : </label>
213
	    <select id="statusfilter" onchange="filterByStatus();">
214
            <option value="all" selected="selected">(All)</option>
215
            <option value="expected">Expected</option>
216
            <option value="late">Late</option>
217
            <option value="missing">Missing</option>
218
            <option value="missing_never_received">Missing (never received)</option>
219
            <option value="missing_sold_out">Missing (sold out)</option>
220
            <option value="missing_damaged">Missing (damaged)</option>
221
            <option value="missing_lost">Missing (lost)</option>
222
            <option value="claimed">Claimed</option>
223
	    </select>
224
	</li>
225
	
226
	<li>
227
	    <label for="titlefilter">Title : </label>
228
        <input id="titlefilter" type="text" />
229
    </li>
230
    <li>
231
	    <label for="branchfilter">Library: </label>
232
	    <select id="branchfilter" onchange="filterByBranch();">
233
            <option value="all" selected="selected">(All)</option>
234
            [% FOREACH branchloo IN branchloop %]
235
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
236
            [% END %]
237
        </select>
238
	</li>
239
	
240
	<li>
241
        <label for="from">From:</label>
179
        <label for="from">From:</label>
242
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
180
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
243
        <label for="to" style="float:none;">To:</label>
181
        <label for="to" style="float:none;">To:</label>
244
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
182
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
245
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
183
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
246
	    <input type="button" value="OK" onclick="filterByDate();" />
184
	    <input type="button" value="OK" onclick="filterByDate();" />
247
        </li>
185
    </li>
248
	
186
249
	<li>
187
	<li>
250
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
188
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
251
	</li>
189
	</li>
Lines 268-280 Link Here
268
                        <th class="title-string">Since</th>
206
                        <th class="title-string">Since</th>
269
                        <th>Claims count</th>
207
                        <th>Claims count</th>
270
                        <th class="title-string">Claim date</th>
208
                        <th class="title-string">Claim date</th>
209
                        [% FOR field IN additional_fields_for_subscription %]
210
                          <th>[% field.name %]</th>
211
                        [% END %]
271
                    </tr>
212
                    </tr>
272
                </thead>
213
                </thead>
214
                <tfoot>
215
                  <tr>
216
                    <td></td>
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 ISSN" /></td>
221
                    <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
222
                    <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
223
                    <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
224
                    <td><input type="text" class="filter" data-column_num="8" placeholder="Search claim count" /></td>
225
                    <td><input type="text" class="filter" data-column_num="9" 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 + 9 %]" 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
                        <td>
233
                        <td><input type="checkbox" name="serialid" value="[% missingissue.serialid %]" /></td>
276
                            <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
277
                        </td>
278
                        <td>[% missingissue.name %]</td>
234
                        <td>[% missingissue.name %]</td>
279
                        <td>
235
                        <td>
280
                            <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
236
                            <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
Lines 309-314 Link Here
309
                                <span title="0000-00-00"></span>
265
                                <span title="0000-00-00"></span>
310
                            [% END %]
266
                            [% END %]
311
                        </td>
267
                        </td>
268
                        [% FOR field IN additional_fields_for_subscription %]
269
                          [% IF field.authorised_value_category %]
270
                            <td>[% KohaAuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
271
                          [% ELSE %]
272
                            <td>[% missingissue.additional_fields.${field.name} %]</td>
273
                          [% END %]
274
                        [% END %]
312
                    </tr>
275
                    </tr>
313
                [% END %]</tbody>
276
                [% END %]</tbody>
314
            </table>
277
            </table>
(-)a/serials/claims.pl (-1 / +10 lines)
Lines 27-32 use C4::Output; Link Here
27
use C4::Context;
27
use C4::Context;
28
use C4::Letters;
28
use C4::Letters;
29
use C4::Branch;    # GetBranches GetBranchesLoop
29
use C4::Branch;    # GetBranches GetBranchesLoop
30
use C4::Koha qw( GetAuthorisedValues );
31
use Koha::AdditionalField;
30
use C4::Csv qw( GetCsvProfiles );
32
use C4::Csv qw( GetCsvProfiles );
31
33
32
my $input = CGI->new;
34
my $input = CGI->new;
Lines 56-61 for my $s (@{$supplierlist} ) { Link Here
56
    }
58
    }
57
}
59
}
58
60
61
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription', searchable => 1 } );
62
for my $field ( @$additional_fields ) {
63
    if ( $field->{authorised_value_category} ) {
64
        $field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} );
65
    }
66
}
67
59
my $branchloop = GetBranchesLoop();
68
my $branchloop = GetBranchesLoop();
60
69
61
my @serialnums=$input->param('serialid');
70
my @serialnums=$input->param('serialid');
Lines 93-98 $template->param( Link Here
93
        supplierid => $supplierid,
102
        supplierid => $supplierid,
94
        claimletter => $claimletter,
103
        claimletter => $claimletter,
95
        branchloop   => $branchloop,
104
        branchloop   => $branchloop,
105
        additional_fields_for_subscription => $additional_fields,
96
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
106
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
97
        letters => $letters,
107
        letters => $letters,
98
        (uc(C4::Context->preference("marcflavour"))) => 1
108
        (uc(C4::Context->preference("marcflavour"))) => 1
99
- 

Return to bug 10855