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 120-125 Link Here
120
                                    <th class="ar-copynumber">Copy number</th>
120
                                    <th class="ar-copynumber">Copy number</th>
121
                                    <th class="ar-enumchron">Enumeration</th>
121
                                    <th class="ar-enumchron">Enumeration</th>
122
                                    <th class="ar-barcode">Barcode</th>
122
                                    <th class="ar-barcode">Barcode</th>
123
                                    <th class="ar-format">Format</th>
123
                                    <th class="ar-patron">Patron</th>
124
                                    <th class="ar-patron">Patron</th>
124
                                    <th class="ar-date">Date</th>
125
                                    <th class="ar-date">Date</th>
125
                                    <th class="ar-actions">Actions</th>
126
                                    <th class="ar-actions">Actions</th>
Lines 184-189 Link Here
184
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
185
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
185
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
186
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
186
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
187
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
188
                                        <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
187
                                        <td class="ar-patron">
189
                                        <td class="ar-patron">
188
                                            <p>
190
                                            <p>
189
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
191
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
Lines 221-226 Link Here
221
                                    <th class="ar-copynumber">Copy number</th>
223
                                    <th class="ar-copynumber">Copy number</th>
222
                                    <th class="ar-enumchron">Enumeration</th>
224
                                    <th class="ar-enumchron">Enumeration</th>
223
                                    <th class="ar-barcode">Barcode</th>
225
                                    <th class="ar-barcode">Barcode</th>
226
                                    <th class="ar-format">Format</th>
224
                                    <th class="ar-patron">Patron</th>
227
                                    <th class="ar-patron">Patron</th>
225
                                    <th class="ar-date">Date</th>
228
                                    <th class="ar-date">Date</th>
226
                                    <th class="ar-actions">Actions</th>
229
                                    <th class="ar-actions">Actions</th>
Lines 283-288 Link Here
283
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
286
                                        <td class="ar-copynumber">[% ar.item.copynumber | html %]</td>
284
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
287
                                        <td class="ar-enumchron">[% ar.item.enumchron | html %]</td>
285
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
288
                                        <td class="ar-barcode">[% ar.item.barcode | html %]</td>
289
                                        <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
286
                                        <td class="ar-patron">
290
                                        <td class="ar-patron">
287
                                            <p>
291
                                            <p>
288
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]">
292
                                                <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 119-124 Link Here
119
                                </li>
119
                                </li>
120
120
121
                                <li>
121
                                <li>
122
                                    <label for="format">Format:</label>
123
                                    <select name="format" id="format">
124
                                        <option value="PHOTOCOPY">Photocopy</option>
125
                                        <option value="SCAN">Digital scan</option>
126
                                    </select>
127
                                </li>
128
129
                                <li>
122
                                    <label for="branchcode">Pickup library:</label>
130
                                    <label for="branchcode">Pickup library:</label>
123
                                    <select name="branchcode" id="branchcode" required="required">
131
                                    <select name="branchcode" id="branchcode" required="required">
124
                                        [% FOREACH b IN Branches.all %]
132
                                        [% FOREACH b IN Branches.all %]
Lines 209-214 Link Here
209
217
210
[% BLOCK jsinclude %]
218
[% BLOCK jsinclude %]
211
<script>
219
<script>
220
$(document).ready( function() {
212
    allow_submit = false;
221
    allow_submit = false;
213
    $('#place-article-request').on('submit', function( event ){
222
    $('#place-article-request').on('submit', function( event ){
214
        if ( ! allow_submit ) {
223
        if ( ! allow_submit ) {
Lines 237-245 Link Here
237
                return 0;
246
                return 0;
238
            }
247
            }
239
248
249
            // Check if all fields are blank
250
            if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' ) {
251
                alert( _("Please fill in at least one field.") );
252
                return 0;
253
            }
254
240
            allow_submit = true;
255
            allow_submit = true;
241
            $('#place-article-request').submit();
256
            $('#place-article-request').submit();
242
        }
257
        }
243
    });
258
    });
259
260
    // Initialize format(s)
261
    var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]";
262
    if( !supported_formats.match(/PHOTOCOPY/) )
263
        $('#format option[value="PHOTOCOPY"]').remove();
264
    if( !supported_formats.match(/SCAN/) )
265
        $('#format option[value="SCAN"]').remove();
266
267
    if( $('#format option').length > 1 ) {
268
        // Select first listed format
269
        var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, '');
270
        $('#format option[value="'+first_format+'"]').attr('selected', true);
271
    }
272
});
244
</script>
273
</script>
245
[% END %]
274
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+3 lines)
Lines 685-690 Link Here
685
                                                <th class="article-request-pages">Pages</th>
685
                                                <th class="article-request-pages">Pages</th>
686
                                                <th class="article-request-chapters">Chapters</th>
686
                                                <th class="article-request-chapters">Chapters</th>
687
                                                <th class="article-request-patron-notes">Notes</th>
687
                                                <th class="article-request-patron-notes">Notes</th>
688
                                                <th class="article-request-format">Format</th>
688
                                                <th class="article-request-status">Status</th>
689
                                                <th class="article-request-status">Status</th>
689
                                                <th class="article-request-branchcode">Pickup library</th>
690
                                                <th class="article-request-branchcode">Pickup library</th>
690
                                                <th class="nosort article-request-cancel">&nbsp;</th>
691
                                                <th class="nosort article-request-cancel">&nbsp;</th>
Lines 738-743 Link Here
738
                                                    [% ar.patron_notes | html %]
739
                                                    [% ar.patron_notes | html %]
739
                                                </td>
740
                                                </td>
740
741
742
                                                <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
743
741
                                                <td class="article-request-status">
744
                                                <td class="article-request-status">
742
                                                    [% IF ar.status == 'PENDING' %]
745
                                                    [% IF ar.status == 'PENDING' %]
743
                                                        Pending
746
                                                        Pending
(-)a/opac/opac-request-article.pl (-1 / +2 lines)
Lines 53-58 if ( $action eq 'create' ) { Link Here
53
    my $pages        = $cgi->param('pages')        || undef;
53
    my $pages        = $cgi->param('pages')        || undef;
54
    my $chapters     = $cgi->param('chapters')     || undef;
54
    my $chapters     = $cgi->param('chapters')     || undef;
55
    my $patron_notes = $cgi->param('patron_notes') || undef;
55
    my $patron_notes = $cgi->param('patron_notes') || undef;
56
    my $format       = $cgi->param('format')       || undef;
56
57
57
    my $ar = Koha::ArticleRequest->new(
58
    my $ar = Koha::ArticleRequest->new(
58
        {
59
        {
Lines 68-73 if ( $action eq 'create' ) { Link Here
68
            pages          => $pages,
69
            pages          => $pages,
69
            chapters       => $chapters,
70
            chapters       => $chapters,
70
            patron_notes   => $patron_notes,
71
            patron_notes   => $patron_notes,
72
            format         => $format,
71
        }
73
        }
72
    )->store();
74
    )->store();
73
75
74
- 

Return to bug 20472