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

(-)a/C4/Serials.pm (+8 lines)
Lines 2011-2016 sub GetLateOrMissingIssues { Link Here
2011
    return unless ( $supplierid or $serialid );
2011
    return unless ( $supplierid or $serialid );
2012
2012
2013
    my $dbh = C4::Context->dbh;
2013
    my $dbh = C4::Context->dbh;
2014
2014
    my $sth;
2015
    my $sth;
2015
    my $byserial = '';
2016
    my $byserial = '';
2016
    if ($serialid) {
2017
    if ($serialid) {
Lines 2069-2074 sub GetLateOrMissingIssues { Link Here
2069
            $line->{claimdate}   = format_date( $line->{claimdate} );
2070
            $line->{claimdate}   = format_date( $line->{claimdate} );
2070
        }
2071
        }
2071
        $line->{"status".$line->{status}}   = 1;
2072
        $line->{"status".$line->{status}}   = 1;
2073
2074
        my $additional_field_values = Koha::AdditionalField->fetch_all_values({
2075
            record_id => $line->{subscriptionid},
2076
            tablename => 'subscription'
2077
        });
2078
        %$line = ( %$line, additional_fields => $additional_field_values->{$line->{subscriptionid}} );
2079
2072
        push @issuelist, $line;
2080
        push @issuelist, $line;
2073
    }
2081
    }
2074
    return @issuelist;
2082
    return @issuelist;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-72 / +38 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-16 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
        [% UNLESS ( preview ) %]
14
        [% UNLESS ( preview ) %]
13
         var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
15
         sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
14
            "sDom": 't',
16
            "sDom": 't',
15
                "aoColumnDefs": [
17
                "aoColumnDefs": [
16
                    [% IF ( letter ) %]
18
                    [% IF ( letter ) %]
Lines 23-28 Link Here
23
                ],
25
                ],
24
            "bPaginate": false
26
            "bPaginate": false
25
        }));
27
        }));
28
        sTable.fnAddFilters("filter", "200");
26
        [% END %]
29
        [% END %]
27
	    $('#supplierid').change(function() {
30
	    $('#supplierid').change(function() {
28
    	    $('#claims').submit();
31
    	    $('#claims').submit();
Lines 56-68 Link Here
56
        return false;
59
        return false;
57
        });
60
        });
58
61
59
        $("#titlefilter").keyup( function () {
60
            sTable.fnFilter( this.value, 3 ); // 3 is position of title column
61
        } );
62
63
        $("#branchfilter").keyup(function() {
64
            sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
65
	    });
66
	 });
62
	 });
67
63
68
	// Checks if the form can be sent (at least one checkbox must be checked)
64
	// Checks if the form can be sent (at least one checkbox must be checked)
Lines 73-108 Link Here
73
	    }
69
	    }
74
	}
70
	}
75
71
76
    // Filter by status
77
    function filterByStatus() {
78
        selectedStatus = $("#statusfilter").val();
79
        if (selectedStatus == "all") {
80
            clearFilters();
81
        } else {
82
            $("table#claimst tbody tr").hide();
83
            $("table#claimst tbody tr").each( function() {
84
                if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
85
                    $(this).show();
86
                }
87
            });
88
        }
89
    }
90
91
    // Filter by branch
92
    function filterByBranch() {
93
        selectedBranch = $("#branchfilter").val();
94
        if (selectedBranch == "all") {
95
            clearFilters();
96
        } else {
97
            $("table#claimst tbody tr").hide();
98
            $("table#claimst tbody tr").each( function() {
99
                if ( $(this).find("span.branch-" + selectedBranch).size() > 0 ) {
100
                    $(this).show();
101
                }
102
            });
103
        }
104
    }
105
106
	// Filter by date
72
	// Filter by date
107
	function filterByDate() {
73
	function filterByDate() {
108
        var beginDate = Date_from_syspref($("#from").val()).getTime();
74
        var beginDate = Date_from_syspref($("#from").val()).getTime();
Lines 150-155 Link Here
150
	// Clears filters : shows everything
116
	// Clears filters : shows everything
151
	function clearFilters() {
117
	function clearFilters() {
152
	    $("table#claimst tbody tr").show();
118
	    $("table#claimst tbody tr").show();
119
153
	}
120
	}
154
121
155
	function popup(supplierid,serialid){
122
	function popup(supplierid,serialid){
Lines 213-255 Link Here
213
	
180
	
214
	<ol>
181
	<ol>
215
	<li>
182
	<li>
216
	    <label for="statusfilter">Status : </label>
217
	    <select id="statusfilter" onchange="filterByStatus();">
218
            <option value="all" selected="selected">(All)</option>
219
            <option value="expected">Expected</option>
220
            <option value="late">Late</option>
221
            <option value="missing">Missing</option>
222
            <option value="missing_never_received">Missing (never received)</option>
223
            <option value="missing_sold_out">Missing (sold out)</option>
224
            <option value="missing_damaged">Missing (damaged)</option>
225
            <option value="missing_lost">Missing (lost)</option>
226
            <option value="claimed">Claimed</option>
227
	    </select>
228
	</li>
229
	
230
	<li>
231
	    <label for="titlefilter">Title : </label>
232
        <input id="titlefilter" type="text" />
233
    </li>
234
    <li>
235
	    <label for="branchfilter">Library: </label>
236
	    <select id="branchfilter" onchange="filterByBranch();">
237
            <option value="all" selected="selected">(All)</option>
238
            [% FOREACH branchloo IN branchloop %]
239
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
240
            [% END %]
241
        </select>
242
	</li>
243
	
244
	<li>
245
        <label for="from">From:</label>
183
        <label for="from">From:</label>
246
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
184
        <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
247
        <label for="to" style="float:none;">To:</label>
185
        <label for="to" style="float:none;">To:</label>
248
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
186
        <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
249
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
187
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
250
	    <input type="button" value="OK" onclick="filterByDate();" />
188
	    <input type="button" value="OK" onclick="filterByDate();" />
251
        </li>
189
    </li>
252
	
190
253
	<li>
191
	<li>
254
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
192
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
255
	</li>
193
	</li>
Lines 262-268 Link Here
262
        <input type="hidden" name="order" value="[% order %]" />
200
        <input type="hidden" name="order" value="[% order %]" />
263
         <table id="claimst">
201
         <table id="claimst">
264
                <thead><tr>
202
                <thead><tr>
265
                    <th><input type="checkbox" id="CheckAll"></th>
203
                    [% IF letter %]<th><input type="checkbox" id="CheckAll"></th>[% END %]
266
                    <th>Vendor</th>
204
                    <th>Vendor</th>
267
                    <th>Library</th>
205
                    <th>Library</th>
268
                    <th class="anti-the">Title</th>
206
                    <th class="anti-the">Title</th>
Lines 271-282 Link Here
271
                    <th>Status</th>
209
                    <th>Status</th>
272
                    <th class="title-string">Since</th>
210
                    <th class="title-string">Since</th>
273
                    <th class="title-string">Claim date</th>
211
                    <th class="title-string">Claim date</th>
212
                    [% FOR field IN additional_fields_for_subscription %]
213
                      <th>[% field.name %]</th>
214
                    [% END %]
274
                </tr></thead>
215
                </tr></thead>
216
                <tfoot>
217
                  <tr>
218
                    [% IF letter %]<td></td>[% 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 ISSN" /></td>
223
                    <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
224
                    <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
225
                    <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
226
                    <td><input type="text" class="filter" data-column_num="8" placeholder="Search claim date" /></td>
227
                    [% FOR field IN additional_fields_for_subscription %]
228
                      <td><input type="text" class="filter" data-column_num="[% loop.count + 8 %]" placeholder="Search [% field.name %]" /></td>
229
                    [% END %]
230
                  </tr>
231
                </tfoot>
275
                <tbody>[% FOREACH missingissue IN missingissues %]
232
                <tbody>[% FOREACH missingissue IN missingissues %]
276
                    <tr>
233
                    <tr>
277
                        <td>
234
                        [% IF letter %]
235
                          <td>
278
                            <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
236
                            <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
279
                        </td>
237
                          </td>
238
                        [% END %]
280
                        <td>
239
                        <td>
281
                        [% missingissue.name %]
240
                        [% missingissue.name %]
282
                        </td>
241
                        </td>
Lines 316-321 Link Here
316
                                <span title="0000-00-00"></span>
275
                                <span title="0000-00-00"></span>
317
                            [% END %]
276
                            [% END %]
318
                        </td>
277
                        </td>
278
                        [% FOR field IN additional_fields_for_subscription %]
279
                          [% IF field.authorised_value_category %]
280
                            <td>[% KohaAuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
281
                          [% ELSE %]
282
                            <td>[% missingissue.additional_fields.${field.name} %]</td>
283
                          [% END %]
284
                        [% END %]
319
                    </tr>
285
                    </tr>
320
                [% END %]</tbody>
286
                [% END %]</tbody>
321
            </table>
287
            </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