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

(-)a/C4/Serials.pm (+8 lines)
Lines 2041-2046 sub GetLateOrMissingIssues { Link Here
2041
    return unless ( $supplierid or $serialid );
2041
    return unless ( $supplierid or $serialid );
2042
2042
2043
    my $dbh = C4::Context->dbh;
2043
    my $dbh = C4::Context->dbh;
2044
2044
    my $sth;
2045
    my $sth;
2045
    my $byserial = '';
2046
    my $byserial = '';
2046
    if ($serialid) {
2047
    if ($serialid) {
Lines 2096-2101 sub GetLateOrMissingIssues { Link Here
2096
            $line->{claimdate}   = format_date( $line->{claimdate} );
2097
            $line->{claimdate}   = format_date( $line->{claimdate} );
2097
        }
2098
        }
2098
        $line->{"status".$line->{status}}   = 1;
2099
        $line->{"status".$line->{status}}   = 1;
2100
2101
        my $additional_field_values = Koha::AdditionalField->fetch_all_values({
2102
            record_id => $line->{subscriptionid},
2103
            tablename => 'subscription'
2104
        });
2105
        %$line = ( %$line, additional_fields => $additional_field_values->{$line->{subscriptionid}} );
2106
2099
        push @issuelist, $line;
2107
        push @issuelist, $line;
2100
    }
2108
    }
2101
    return @issuelist;
2109
    return @issuelist;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-66 / +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-248 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="claimed">Claimed</option>
220
	    </select>
221
	</li>
222
	
223
	<li>
224
	    <label for="titlefilter">Title : </label>
225
        <input id="titlefilter" type="text" />
226
    </li>
227
    <li>
228
	    <label for="branchfilter">Library: </label>
229
	    <select id="branchfilter" onchange="filterByBranch();">
230
            <option value="all" selected="selected">(All)</option>
231
            [% FOREACH branchloo IN branchloop %]
232
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
233
            [% END %]
234
        </select>
235
	</li>
236
	
237
	<li>
238
        <label for="from">From:</label>
180
        <label for="from">From:</label>
239
        <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" />
240
        <label for="to" style="float:none;">To:</label>
182
        <label for="to" style="float:none;">To:</label>
241
        <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" />
242
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
184
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
243
	    <input type="button" value="OK" onclick="filterByDate();" />
185
	    <input type="button" value="OK" onclick="filterByDate();" />
244
        </li>
186
    </li>
245
	
187
246
	<li>
188
	<li>
247
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
189
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
248
	</li>
190
	</li>
Lines 265-271 Link Here
265
                    <th>Status</th>
207
                    <th>Status</th>
266
                    <th>Since</th>
208
                    <th>Since</th>
267
                    <th>Claim date</th>
209
                    <th>Claim date</th>
210
                    [% FOR field IN additional_fields_for_subscription %]
211
                      <th>[% field.name %]</th>
212
                    [% END %]
268
                </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>
269
                <tbody>[% FOREACH missingissue IN missingissues %]
231
                <tbody>[% FOREACH missingissue IN missingissues %]
270
                    <tr>
232
                    <tr>
271
                        [% IF ( letter ) %]
233
                        [% IF ( letter ) %]
Lines 297-302 Link Here
297
                        <td>
259
                        <td>
298
                        [% missingissue.claimdate %]
260
                        [% missingissue.claimdate %]
299
                        </td>
261
                        </td>
262
                        [% FOR field IN additional_fields_for_subscription %]
263
                          [% IF field.authorised_value_category %]
264
                            <td>[% KohaAuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
265
                          [% ELSE %]
266
                            <td>[% missingissue.additional_fields.${field.name} %]</td>
267
                          [% END %]
268
                        [% END %]
300
                    </tr>
269
                    </tr>
301
                [% END %]</tbody>
270
                [% END %]</tbody>
302
            </table>
271
            </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