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

(-)a/circ/request-article.pl (+2 lines)
Lines 66-71 if ( $action eq 'create' ) { Link Here
66
    my $pages        = $cgi->param('pages')        || undef;
66
    my $pages        = $cgi->param('pages')        || undef;
67
    my $chapters     = $cgi->param('chapters')     || undef;
67
    my $chapters     = $cgi->param('chapters')     || undef;
68
    my $patron_notes = $cgi->param('patron_notes') || undef;
68
    my $patron_notes = $cgi->param('patron_notes') || undef;
69
    my $format       = $cgi->param('format')       || undef;
69
70
70
    my $ar = Koha::ArticleRequest->new(
71
    my $ar = Koha::ArticleRequest->new(
71
        {
72
        {
Lines 81-86 if ( $action eq 'create' ) { Link Here
81
            pages          => $pages,
82
            pages          => $pages,
82
            chapters       => $chapters,
83
            chapters       => $chapters,
83
            patron_notes   => $patron_notes,
84
            patron_notes   => $patron_notes,
85
            format         => $format,
84
        }
86
        }
85
    )->store();
87
    )->store();
86
88
(-)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 127-132 Link Here
127
                                    <th class="ar-copynumber">Copy number</th>
127
                                    <th class="ar-copynumber">Copy number</th>
128
                                    <th class="ar-enumchron">Enumeration</th>
128
                                    <th class="ar-enumchron">Enumeration</th>
129
                                    <th class="ar-barcode">Barcode</th>
129
                                    <th class="ar-barcode">Barcode</th>
130
                                    <th class="ar-format">Format</th>
130
                                    <th class="ar-patron">Patron</th>
131
                                    <th class="ar-patron">Patron</th>
131
                                    <th class="ar-date">Date</th>
132
                                    <th class="ar-date">Date</th>
132
                                    <th class="ar-actions noExport">Actions</th>
133
                                    <th class="ar-actions noExport">Actions</th>
Lines 191-196 Link Here
191
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
192
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
192
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
193
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
193
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
194
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
195
                                        <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
194
                                        <td class="ar-patron">
196
                                        <td class="ar-patron">
195
                                            <p>
197
                                            <p>
196
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
198
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
Lines 228-233 Link Here
228
                                    <th class="ar-copynumber">Copy number</th>
230
                                    <th class="ar-copynumber">Copy number</th>
229
                                    <th class="ar-enumchron">Enumeration</th>
231
                                    <th class="ar-enumchron">Enumeration</th>
230
                                    <th class="ar-barcode">Barcode</th>
232
                                    <th class="ar-barcode">Barcode</th>
233
                                    <th class="ar-format">Format</th>
231
                                    <th class="ar-patron">Patron</th>
234
                                    <th class="ar-patron">Patron</th>
232
                                    <th class="ar-date">Date</th>
235
                                    <th class="ar-date">Date</th>
233
                                    <th class="ar-actions noExport">Actions</th>
236
                                    <th class="ar-actions noExport">Actions</th>
Lines 290-295 Link Here
290
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
293
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
291
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
294
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
292
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
295
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
296
                                        <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
293
                                        <td class="ar-patron">
297
                                        <td class="ar-patron">
294
                                            <p>
298
                                            <p>
295
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
299
                                                <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 143-148 Link Here
143
                                            <input type="text" name="patron_notes" id="patron_notes" size="50"/>
143
                                            <input type="text" name="patron_notes" id="patron_notes" size="50"/>
144
                                        </li>
144
                                        </li>
145
145
146
                                        <li>
147
                                            <label for="format">Format:</label>
148
                                            <select name="format" id="format">
149
                                                <option value="PHOTOCOPY">Photocopy</option>
150
                                                <option value="SCAN">Digital scan</option>
151
                                            </select>
152
                                        </li>
153
146
                                        <li>
154
                                        <li>
147
                                            <label for="branchcode">Pickup library:</label>
155
                                            <label for="branchcode">Pickup library:</label>
148
                                            <select name="branchcode" id="branchcode">
156
                                            <select name="branchcode" id="branchcode">
Lines 244-249 Link Here
244
                                    <th>Pages</th>
252
                                    <th>Pages</th>
245
                                    <th>Chapters</th>
253
                                    <th>Chapters</th>
246
                                    <th>Patron notes</th>
254
                                    <th>Patron notes</th>
255
                                    <th>Format</th>
247
                                    <th>Item</th>
256
                                    <th>Item</th>
248
                                    <th>Status</th>
257
                                    <th>Status</th>
249
                                    <th>Pickup library</th>
258
                                    <th>Pickup library</th>
Lines 262-267 Link Here
262
                                        <td>[% ar.pages | html %]</td>
271
                                        <td>[% ar.pages | html %]</td>
263
                                        <td>[% ar.chapters | html %]</td>
272
                                        <td>[% ar.chapters | html %]</td>
264
                                        <td>[% ar.patron_notes | html %]</td>
273
                                        <td>[% ar.patron_notes | html %]</td>
274
                                        <td>[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
265
                                        <td>
275
                                        <td>
266
                                            [% IF ar.item %]
276
                                            [% IF ar.item %]
267
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
277
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a>
Lines 408-413 Link Here
408
                    });
418
                    });
409
                }
419
                }
410
            });
420
            });
421
422
            // Initialize format(s)
423
            var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]";
424
            if( !supported_formats.match(/PHOTOCOPY/) )
425
                $('#format option[value="PHOTOCOPY"]').remove();
426
            if( !supported_formats.match(/SCAN/) )
427
                $('#format option[value="SCAN"]').remove();
428
429
            if( $('#format option').length > 1 ) {
430
            // Select first listed format
431
                var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
432
                $('#format option[value="'+first_format+'"]').attr('selected', true);
433
            }
411
        });
434
        });
412
    </script>
435
    </script>
413
[% END %]
436
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt (+29 lines)
Lines 120-125 Link Here
120
                                    <input type="text" name="patron_notes" id="patron_notes" size="50"/>
120
                                    <input type="text" name="patron_notes" id="patron_notes" size="50"/>
121
                                </li>
121
                                </li>
122
122
123
                                <li>
124
                                    <label for="format">Format:</label>
125
                                    <select name="format" id="format">
126
                                        <option value="PHOTOCOPY">Photocopy</option>
127
                                        <option value="SCAN">Digital scan</option>
128
                                    </select>
129
                                </li>
130
123
                                <li>
131
                                <li>
124
                                    <label for="branchcode">Pickup library:</label>
132
                                    <label for="branchcode">Pickup library:</label>
125
                                    <select name="branchcode" id="branchcode" required="required">
133
                                    <select name="branchcode" id="branchcode" required="required">
Lines 211-216 Link Here
211
219
212
[% BLOCK jsinclude %]
220
[% BLOCK jsinclude %]
213
<script>
221
<script>
222
$(document).ready( function() {
214
    allow_submit = false;
223
    allow_submit = false;
215
    $('#place-article-request').on('submit', function( event ){
224
    $('#place-article-request').on('submit', function( event ){
216
        if ( ! allow_submit ) {
225
        if ( ! allow_submit ) {
Lines 239-247 Link Here
239
                return 0;
248
                return 0;
240
            }
249
            }
241
250
251
            // Check if all fields are blank
252
            if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' ) {
253
                alert( _("Please fill in at least one field.") );
254
                return 0;
255
            }
256
242
            allow_submit = true;
257
            allow_submit = true;
243
            $('#place-article-request').submit();
258
            $('#place-article-request').submit();
244
        }
259
        }
245
    });
260
    });
261
262
    // Initialize format(s)
263
    var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]";
264
    if( !supported_formats.match(/PHOTOCOPY/) )
265
        $('#format option[value="PHOTOCOPY"]').remove();
266
    if( !supported_formats.match(/SCAN/) )
267
        $('#format option[value="SCAN"]').remove();
268
269
    if( $('#format option').length > 1 ) {
270
        // Select first listed format
271
        var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
272
        $('#format option[value="'+first_format+'"]').attr('selected', true);
273
    }
274
});
246
</script>
275
</script>
247
[% END %]
276
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+3 lines)
Lines 728-733 Link Here
728
                                                <th class="article-request-pages">Pages</th>
728
                                                <th class="article-request-pages">Pages</th>
729
                                                <th class="article-request-chapters">Chapters</th>
729
                                                <th class="article-request-chapters">Chapters</th>
730
                                                <th class="article-request-patron-notes">Notes</th>
730
                                                <th class="article-request-patron-notes">Notes</th>
731
                                                <th class="article-request-format">Format</th>
731
                                                <th class="article-request-status">Status</th>
732
                                                <th class="article-request-status">Status</th>
732
                                                <th class="article-request-branchcode">Pickup library</th>
733
                                                <th class="article-request-branchcode">Pickup library</th>
733
                                                <th class="nosort article-request-cancel">&nbsp;</th>
734
                                                <th class="nosort article-request-cancel">&nbsp;</th>
Lines 781-786 Link Here
781
                                                    [% ar.patron_notes | html %]
782
                                                    [% ar.patron_notes | html %]
782
                                                </td>
783
                                                </td>
783
784
785
                                                <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
786
784
                                                <td class="article-request-status">
787
                                                <td class="article-request-status">
785
                                                    [% IF ar.status == 'PENDING' %]
788
                                                    [% IF ar.status == 'PENDING' %]
786
                                                        Pending
789
                                                        Pending
(-)a/opac/opac-request-article.pl (-1 / +2 lines)
Lines 52-57 if ( $action eq 'create' ) { Link Here
52
    my $pages        = $cgi->param('pages')        || undef;
52
    my $pages        = $cgi->param('pages')        || undef;
53
    my $chapters     = $cgi->param('chapters')     || undef;
53
    my $chapters     = $cgi->param('chapters')     || undef;
54
    my $patron_notes = $cgi->param('patron_notes') || undef;
54
    my $patron_notes = $cgi->param('patron_notes') || undef;
55
    my $format       = $cgi->param('format')       || undef;
55
56
56
    my $ar = Koha::ArticleRequest->new(
57
    my $ar = Koha::ArticleRequest->new(
57
        {
58
        {
Lines 67-72 if ( $action eq 'create' ) { Link Here
67
            pages          => $pages,
68
            pages          => $pages,
68
            chapters       => $chapters,
69
            chapters       => $chapters,
69
            patron_notes   => $patron_notes,
70
            patron_notes   => $patron_notes,
71
            format         => $format,
70
        }
72
        }
71
    )->store();
73
    )->store();
72
74
73
- 

Return to bug 20472