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

(-)a/circ/request-article.pl (+2 lines)
Lines 67-72 if ( $action eq 'create' ) { Link Here
67
    my $pages        = $cgi->param('pages')        || undef;
67
    my $pages        = $cgi->param('pages')        || undef;
68
    my $chapters     = $cgi->param('chapters')     || undef;
68
    my $chapters     = $cgi->param('chapters')     || undef;
69
    my $patron_notes = $cgi->param('patron_notes') || undef;
69
    my $patron_notes = $cgi->param('patron_notes') || undef;
70
    my $format       = $cgi->param('format')       || undef;
70
71
71
    my $ar = Koha::ArticleRequest->new(
72
    my $ar = Koha::ArticleRequest->new(
72
        {
73
        {
Lines 82-87 if ( $action eq 'create' ) { Link Here
82
            pages          => $pages,
83
            pages          => $pages,
83
            chapters       => $chapters,
84
            chapters       => $chapters,
84
            patron_notes   => $patron_notes,
85
            patron_notes   => $patron_notes,
86
            format         => $format,
85
        }
87
        }
86
    )->store();
88
    )->store();
87
89
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc (+3 lines)
Lines 13-18 Link Here
13
                <th class="article-request-pages">Pages</th>
13
                <th class="article-request-pages">Pages</th>
14
                <th class="article-request-chapters">Chapters</th>
14
                <th class="article-request-chapters">Chapters</th>
15
                <th class="article-request-notes">Notes</th>
15
                <th class="article-request-notes">Notes</th>
16
                <th class="article-request-format">Format</th>
16
                <th class="article-request-status">Status</th>
17
                <th class="article-request-status">Status</th>
17
                <th class="article-request-branchcode">Pickup library</th>
18
                <th class="article-request-branchcode">Pickup library</th>
18
            </tr>
19
            </tr>
Lines 66-71 Link Here
66
                        [% ar.patron_notes | html %]
67
                        [% ar.patron_notes | html %]
67
                    </td>
68
                    </td>
68
69
70
                    <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
71
69
                    <td class="article-request-status">
72
                    <td class="article-request-status">
70
                        [% IF ar.status == 'PENDING' %]
73
                        [% IF ar.status == 'PENDING' %]
71
                            Pending
74
                            Pending
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (+4 lines)
Lines 118-123 Link Here
118
                                    <th class="ar-copynumber">Copy number</th>
118
                                    <th class="ar-copynumber">Copy number</th>
119
                                    <th class="ar-enumchron">Enumeration</th>
119
                                    <th class="ar-enumchron">Enumeration</th>
120
                                    <th class="ar-barcode">Barcode</th>
120
                                    <th class="ar-barcode">Barcode</th>
121
                                    <th class="ar-format">Format</th>
121
                                    <th class="ar-patron">Patron</th>
122
                                    <th class="ar-patron">Patron</th>
122
                                    <th class="ar-date">Date</th>
123
                                    <th class="ar-date">Date</th>
123
                                    <th class="ar-actions">Actions</th>
124
                                    <th class="ar-actions">Actions</th>
Lines 188-193 Link Here
188
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
189
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
189
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
190
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
190
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
191
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
192
                                        <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
191
                                        <td class="ar-patron">
193
                                        <td class="ar-patron">
192
                                            <p>
194
                                            <p>
193
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
195
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
Lines 225-230 Link Here
225
                                    <th class="ar-copynumber">Copy number</th>
227
                                    <th class="ar-copynumber">Copy number</th>
226
                                    <th class="ar-enumchron">Enumeration</th>
228
                                    <th class="ar-enumchron">Enumeration</th>
227
                                    <th class="ar-barcode">Barcode</th>
229
                                    <th class="ar-barcode">Barcode</th>
230
                                    <th class="ar-format">Format</th>
228
                                    <th class="ar-patron">Patron</th>
231
                                    <th class="ar-patron">Patron</th>
229
                                    <th class="ar-date">Date</th>
232
                                    <th class="ar-date">Date</th>
230
                                    <th class="ar-actions">Actions</th>
233
                                    <th class="ar-actions">Actions</th>
Lines 295-300 Link Here
295
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
298
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
296
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
299
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
297
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
300
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
301
                                        <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
298
                                        <td class="ar-patron">
302
                                        <td class="ar-patron">
299
                                            <p>
303
                                            <p>
300
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
304
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt (+23 lines)
Lines 133-138 Link Here
133
                                        </li>
133
                                        </li>
134
134
135
                                        <li>
135
                                        <li>
136
                                            <label for="format">Format:</label>
137
                                            <select name="format" id="format">
138
                                                <option value="PHOTOCOPY">Photocopy</option>
139
                                                <option value="SCAN">Digital scan</option>
140
                                            </select>
141
                                        </li>
142
143
                                        <li>
136
                                            <label for="branchcode">Pickup library:</label>
144
                                            <label for="branchcode">Pickup library:</label>
137
                                            <select name="branchcode" id="branchcode">
145
                                            <select name="branchcode" id="branchcode">
138
                                                [% FOREACH b IN Branches.all %]
146
                                                [% FOREACH b IN Branches.all %]
Lines 233-238 Link Here
233
                                    <th>Pages</th>
241
                                    <th>Pages</th>
234
                                    <th>Chapters</th>
242
                                    <th>Chapters</th>
235
                                    <th>Patron notes</th>
243
                                    <th>Patron notes</th>
244
                                    <th>Format</th>
236
                                    <th>Item</th>
245
                                    <th>Item</th>
237
                                    <th>Status</th>
246
                                    <th>Status</th>
238
                                    <th>Pickup library</th>
247
                                    <th>Pickup library</th>
Lines 251-256 Link Here
251
                                        <td>[% ar.pages | html %]</td>
260
                                        <td>[% ar.pages | html %]</td>
252
                                        <td>[% ar.chapters | html %]</td>
261
                                        <td>[% ar.chapters | html %]</td>
253
                                        <td>[% ar.patron_notes | html %]</td>
262
                                        <td>[% ar.patron_notes | html %]</td>
263
                                        <td>[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
254
                                        <td>
264
                                        <td>
255
                                            [% IF ar.item %]
265
                                            [% IF ar.item %]
256
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
266
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
Lines 384-389 Link Here
384
                    });
394
                    });
385
                }
395
                }
386
            });
396
            });
397
398
            // Initialize format(s)
399
            var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]";
400
            if( !supported_formats.match(/PHOTOCOPY/) )
401
                $('#format option[value="PHOTOCOPY"]').remove();
402
            if( !supported_formats.match(/SCAN/) )
403
                $('#format option[value="SCAN"]').remove();
404
405
            if( $('#format option').length > 1 ) {
406
            // Select first listed format
407
                var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
408
                $('#format option[value="'+first_format+'"]').attr('selected', true);
409
            }
387
        });
410
        });
388
    </script>
411
    </script>
389
[% END %]
412
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt (+29 lines)
Lines 109-114 Link Here
109
                        </li>
109
                        </li>
110
110
111
                        <li>
111
                        <li>
112
                            <label for="format">Format:</label>
113
                            <select name="format" id="format">
114
                                <option value="PHOTOCOPY">Photocopy</option>
115
                                <option value="SCAN">Digital scan</option>
116
                            </select>
117
                        </li>
118
119
                        <li>
112
                            <label for="branchcode">Pickup library:</label>
120
                            <label for="branchcode">Pickup library:</label>
113
                            <select name="branchcode" id="branchcode" required="required">
121
                            <select name="branchcode" id="branchcode" required="required">
114
                                [% FOREACH b IN Branches.all %]
122
                                [% FOREACH b IN Branches.all %]
Lines 198-203 Link Here
198
206
199
[% BLOCK jsinclude %]
207
[% BLOCK jsinclude %]
200
<script>
208
<script>
209
$(document).ready( function() {
201
    allow_submit = false;
210
    allow_submit = false;
202
    $('#place-article-request').on('submit', function( event ){
211
    $('#place-article-request').on('submit', function( event ){
203
        if ( ! allow_submit ) {
212
        if ( ! allow_submit ) {
Lines 226-234 Link Here
226
                return 0;
235
                return 0;
227
            }
236
            }
228
237
238
            // Check if all fields are blank
239
            if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' ) {
240
                alert( _("Please fill in at least one field.") );
241
                return 0;
242
            }
243
229
            allow_submit = true;
244
            allow_submit = true;
230
            $('#place-article-request').submit();
245
            $('#place-article-request').submit();
231
        }
246
        }
232
    });
247
    });
248
249
    // Initialize format(s)
250
    var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]";
251
    if( !supported_formats.match(/PHOTOCOPY/) )
252
        $('#format option[value="PHOTOCOPY"]').remove();
253
    if( !supported_formats.match(/SCAN/) )
254
        $('#format option[value="SCAN"]').remove();
255
256
    if( $('#format option').length > 1 ) {
257
        // Select first listed format
258
        var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
259
        $('#format option[value="'+first_format+'"]').attr('selected', true);
260
    }
261
});
233
</script>
262
</script>
234
[% END %]
263
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+3 lines)
Lines 671-676 Link Here
671
                                                <th class="article-request-pages">Pages</th>
671
                                                <th class="article-request-pages">Pages</th>
672
                                                <th class="article-request-chapters">Chapters</th>
672
                                                <th class="article-request-chapters">Chapters</th>
673
                                                <th class="article-request-patron-notes">Notes</th>
673
                                                <th class="article-request-patron-notes">Notes</th>
674
                                                <th class="article-request-format">Format</th>
674
                                                <th class="article-request-status">Status</th>
675
                                                <th class="article-request-status">Status</th>
675
                                                <th class="article-request-branchcode">Pickup library</th>
676
                                                <th class="article-request-branchcode">Pickup library</th>
676
                                                <th class="nosort article-request-cancel">&nbsp;</th>
677
                                                <th class="nosort article-request-cancel">&nbsp;</th>
Lines 724-729 Link Here
724
                                                    [% ar.patron_notes | html %]
725
                                                    [% ar.patron_notes | html %]
725
                                                </td>
726
                                                </td>
726
727
728
                                                <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
729
727
                                                <td class="article-request-status">
730
                                                <td class="article-request-status">
728
                                                    [% IF ar.status == 'PENDING' %]
731
                                                    [% IF ar.status == 'PENDING' %]
729
                                                        Pending
732
                                                        Pending
(-)a/opac/opac-request-article.pl (-1 / +2 lines)
Lines 54-59 if ( $action eq 'create' ) { Link Here
54
    my $pages        = $cgi->param('pages')        || undef;
54
    my $pages        = $cgi->param('pages')        || undef;
55
    my $chapters     = $cgi->param('chapters')     || undef;
55
    my $chapters     = $cgi->param('chapters')     || undef;
56
    my $patron_notes = $cgi->param('patron_notes') || undef;
56
    my $patron_notes = $cgi->param('patron_notes') || undef;
57
    my $format       = $cgi->param('format')       || undef;
57
58
58
    my $ar = Koha::ArticleRequest->new(
59
    my $ar = Koha::ArticleRequest->new(
59
        {
60
        {
Lines 69-74 if ( $action eq 'create' ) { Link Here
69
            pages          => $pages,
70
            pages          => $pages,
70
            chapters       => $chapters,
71
            chapters       => $chapters,
71
            patron_notes   => $patron_notes,
72
            patron_notes   => $patron_notes,
73
            format         => $format,
72
        }
74
        }
73
    )->store();
75
    )->store();
74
76
75
- 

Return to bug 20472