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

(-)a/C4/Serials.pm (+8 lines)
Lines 1878-1883 name,title,planneddate,serialseq,serial.subscriptionid from tables : subscriptio Link Here
1878
sub GetLateOrMissingIssues {
1878
sub GetLateOrMissingIssues {
1879
    my ( $supplierid, $serialid, $order ) = @_;
1879
    my ( $supplierid, $serialid, $order ) = @_;
1880
    my $dbh = C4::Context->dbh;
1880
    my $dbh = C4::Context->dbh;
1881
1881
    my $sth;
1882
    my $sth;
1882
    my $byserial = '';
1883
    my $byserial = '';
1883
    if ($serialid) {
1884
    if ($serialid) {
Lines 1933-1938 sub GetLateOrMissingIssues { Link Here
1933
            $line->{claimdate}   = format_date( $line->{claimdate} );
1934
            $line->{claimdate}   = format_date( $line->{claimdate} );
1934
        }
1935
        }
1935
        $line->{"status".$line->{status}}   = 1;
1936
        $line->{"status".$line->{status}}   = 1;
1937
1938
        my $additional_field_values = Koha::AdditionalField->fetch_all_values({
1939
            record_id => $line->{subscriptionid},
1940
            tablename => 'subscription'
1941
        });
1942
        %$line = ( %$line, additional_fields => $additional_field_values->{$line->{subscriptionid}} );
1943
1936
        push @issuelist, $line;
1944
        push @issuelist, $line;
1937
    }
1945
    }
1938
    return @issuelist;
1946
    return @issuelist;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-63 / +37 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,-1 ], "bSortable": false, "bSearchable": false }
19
                { "aTargets": [ 0,-1 ], "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-94 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:contains(" + selectedStatus + ")").show();
79
	    }
80
	}
81
82
	// Filter by branch
83
	function filterByBranch() {
84
	    selectedBranch = $("#branchfilter").val();
85
	    if (selectedBranch == "all") {
86
		clearFilters();
87
	    } else {
88
		$("table#claimst tbody tr").hide();
89
		$("table#claimst tbody tr:contains(" + selectedBranch + ")").show();
90
	    }
91
	}
92
	// Filter by date
67
	// Filter by date
93
	function filterByDate() {
68
	function filterByDate() {
94
        var beginDate = Date_from_syspref($("#from").val()).getTime();
69
        var beginDate = Date_from_syspref($("#from").val()).getTime();
Lines 136-141 Link Here
136
	// Clears filters : shows everything
111
	// Clears filters : shows everything
137
	function clearFilters() {
112
	function clearFilters() {
138
	    $("table#claimst tbody tr").show();
113
	    $("table#claimst tbody tr").show();
114
139
	}
115
	}
140
116
141
	function popup(supplierid,serialid){
117
	function popup(supplierid,serialid){
Lines 199-242 Link Here
199
	
175
	
200
	<ol>
176
	<ol>
201
	<li>
177
	<li>
202
	    <label for="statusfilter">Status : </label>
203
	    <select id="statusfilter" onchange="filterByStatus();">
204
		<option value="all" selected="selected">(All)</option>
205
		<option>Expected</option>
206
		<option>Arrived</option>
207
		<option>Late</option>
208
		<option>Missing</option>
209
		<option>Claimed</option>
210
        <option>Stopped</option>
211
	    </select>
212
	</li>
213
	
214
	<li>
215
	    <label for="titlefilter">Title : </label>
216
        <input id="titlefilter" type="text" />
217
    </li>
218
    <li>
219
	    <label for="branchfilter">Library: </label>
220
	    <select id="branchfilter" onchange="filterByBranch();">
221
            [% FOREACH branchloo IN branchloop %]
222
                [% IF ( branchloo.selected ) %]
223
                <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
224
                [% ELSE %]
225
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
226
                [% END %]
227
            [% END %]
228
        </select>
229
	</li>
230
	
231
	<li>
232
        <label for="from">From:</label>
178
        <label for="from">From:</label>
233
        <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" />
234
        <label for="to" style="float:none;">To:</label>
180
        <label for="to" style="float:none;">To:</label>
235
        <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" />
236
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
182
        <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
237
	    <input type="button" value="OK" onclick="filterByDate();" />
183
	    <input type="button" value="OK" onclick="filterByDate();" />
238
        </li>
184
    </li>
239
	
185
240
	<li>
186
	<li>
241
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
187
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
242
	</li>
188
	</li>
Lines 259-266 Link Here
259
                    <th>Status</th>
205
                    <th>Status</th>
260
                    <th>Since</th>
206
                    <th>Since</th>
261
                    <th>Claim date</th>
207
                    <th>Claim date</th>
262
                <th>Begin claim</th>
208
                    [% FOR field IN additional_fields_for_subscription %]
209
                      <th>[% field.name %]</th>
210
                    [% END %]
211
                <th></th>
263
                </tr></thead>
212
                </tr></thead>
213
                <tfoot>
214
                  <tr>
215
                    [% IF ( letter ) %]
216
                      <td></td>
217
                    [% END %]
218
                    <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
219
                    <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
220
                    <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
221
                    <td><input type="text" class="filter" data-column_num="4" placeholder="Search issue number" /></td>
222
                    <td><input type="text" class="filter" data-column_num="5" placeholder="Search status" /></td>
223
                    <td></td>
224
                    <td><input type="text" class="filter" data-column_num="7" placeholder="Search claim date" /></td>
225
                    [% FOR field IN additional_fields_for_subscription %]
226
                      <td><input type="text" class="filter" data-column_num="[% loop.count + 7 %]" placeholder="Search [% field.name %]" /></td>
227
                    [% END %]
228
                    <td></td>
229
                  </tr>
230
                </tfoot>
264
                <tbody>[% FOREACH missingissue IN missingissues %]
231
                <tbody>[% FOREACH missingissue IN missingissues %]
265
                    <tr>
232
                    <tr>
266
                        [% IF ( letter ) %]
233
                        [% IF ( letter ) %]
Lines 294-299 Link Here
294
                        <td>
261
                        <td>
295
                        [% missingissue.claimdate %]
262
                        [% missingissue.claimdate %]
296
                        </td>
263
                        </td>
264
                        [% FOR field IN additional_fields_for_subscription %]
265
                          [% IF field.authorised_value_category %]
266
                            <td>[% KohaAuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
267
                          [% ELSE %]
268
                            <td>[% missingissue.additional_fields.${field.name} %]</td>
269
                          [% END %]
270
                        [% END %]
297
                        <td>
271
                        <td>
298
                            <a href="/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=[% missingissue.supplieri %]&amp;serialid=[% missingissue.serialid %]&amp;op=claims">Export item data</a>
272
                            <a href="/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=[% missingissue.supplieri %]&amp;serialid=[% missingissue.serialid %]&amp;op=claims">Export item data</a>
299
                        </td>
273
                        </td>
(-)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
33
32
my $input = CGI->new;
34
my $input = CGI->new;
33
35
Lines 57-62 for my $s (@{$supplierlist} ) { Link Here
57
    }
59
    }
58
}
60
}
59
61
62
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription', searchable => 1 } );
63
for my $field ( @$additional_fields ) {
64
    if ( $field->{authorised_value_category} ) {
65
        $field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} );
66
    }
67
}
68
60
my $letters = GetLetters('claimissues');
69
my $letters = GetLetters('claimissues');
61
my @letters;
70
my @letters;
62
foreach (keys %{$letters}){
71
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
        (uc(C4::Context->preference("marcflavour"))) => 1
111
        (uc(C4::Context->preference("marcflavour"))) => 1
102
        );
112
        );
103
output_html_with_http_headers $input, $cookie, $template->output;
113
output_html_with_http_headers $input, $cookie, $template->output;
104
- 

Return to bug 10855