Bugzilla – Attachment 122375 Details for
Bug 20472
Add digital scan as optional format to Article Requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20472: Add format field to the interface
Bug-20472-Add-format-field-to-the-interface.patch (text/plain), 14.19 KB, created by
Martin Renvoize (ashimema)
on 2021-06-24 10:08:03 UTC
(
hide
)
Description:
Bug 20472: Add format field to the interface
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-06-24 10:08:03 UTC
Size:
14.19 KB
patch
obsolete
>From 56136e65bb266184c4e7144bd2bff8a7e181f6e5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 3 Apr 2018 16:19:13 +0200 >Subject: [PATCH] Bug 20472: Add format field to the interface > >We need to add the format to the forms entering new requests: > opac/opac-request-article > circ/request-article >If the pref contains multiple formats like SCAN|PHOTOCOPY, the first listed >format will be preselected on the request form. If there is only one option, >we should not disable the select however. (Possibly hide it.) > >If we have no mandatory fields, we should not allow the submit of a complete >empty form (check on OPAC). > >And we need to show the format of pending requests on forms: > opac/opac-user > circ/request-article (biblio detail tab) > circ/article-requests (staff form to handle requests) > members/moremember (Article requests tab at the bottom) > circ/circulation (Checkout/Article requests tab) >Note: The last two forms use the same include file. > >Test plan: >[1] Add an article request via opac or staff. Choose Scan. >[2] Verify that you see the Scan format on opac-user and the > above-mentioned staff forms. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > circ/request-article.pl | 2 ++ > .../en/includes/patron-article-requests.inc | 3 ++ > .../prog/en/modules/circ/article-requests.tt | 4 +++ > .../prog/en/modules/circ/request-article.tt | 23 +++++++++++++++ > .../en/modules/opac-request-article.tt | 29 +++++++++++++++++++ > .../bootstrap/en/modules/opac-user.tt | 3 ++ > opac/opac-request-article.pl | 2 ++ > 7 files changed, 66 insertions(+) > >diff --git a/circ/request-article.pl b/circ/request-article.pl >index 48b1d02e56..fdbd74a525 100755 >--- a/circ/request-article.pl >+++ b/circ/request-article.pl >@@ -66,6 +66,7 @@ if ( $action eq 'create' ) { > my $pages = $cgi->param('pages') || undef; > my $chapters = $cgi->param('chapters') || undef; > my $patron_notes = $cgi->param('patron_notes') || undef; >+ my $format = $cgi->param('format') || undef; > > my $ar = Koha::ArticleRequest->new( > { >@@ -81,6 +82,7 @@ if ( $action eq 'create' ) { > pages => $pages, > chapters => $chapters, > patron_notes => $patron_notes, >+ format => $format, > } > )->store(); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc >index 25279adfc8..b2a25a0580 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-article-requests.inc >@@ -13,6 +13,7 @@ > <th class="article-request-pages">Pages</th> > <th class="article-request-chapters">Chapters</th> > <th class="article-request-notes">Notes</th> >+ <th class="article-request-format">Format</th> > <th class="article-request-status">Status</th> > <th class="article-request-branchcode">Pickup library</th> > </tr> >@@ -66,6 +67,8 @@ > [% ar.patron_notes | html %] > </td> > >+ <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td> >+ > <td class="article-request-status"> > [% IF ar.status == 'PENDING' %] > Pending >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >index 286db72985..8cf05a2d5f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >@@ -127,6 +127,7 @@ > <th class="ar-copynumber">Copy number</th> > <th class="ar-enumchron">Enumeration</th> > <th class="ar-barcode">Barcode</th> >+ <th class="ar-format">Format</th> > <th class="ar-patron">Patron</th> > <th class="ar-date">Date</th> > <th class="ar-actions noExport">Actions</th> >@@ -191,6 +192,7 @@ > <td class="ar-copynumber">[% ar.item.copynumber | html %]</td> > <td class="ar-enumchron">[% ar.item.enumchron | html %]</td> > <td class="ar-barcode">[% ar.item.barcode | html %]</td> >+ <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td> > <td class="ar-patron"> > <p> > <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]"> >@@ -228,6 +230,7 @@ > <th class="ar-copynumber">Copy number</th> > <th class="ar-enumchron">Enumeration</th> > <th class="ar-barcode">Barcode</th> >+ <th class="ar-format">Format</th> > <th class="ar-patron">Patron</th> > <th class="ar-date">Date</th> > <th class="ar-actions noExport">Actions</th> >@@ -290,6 +293,7 @@ > <td class="ar-copynumber">[% ar.item.copynumber | html %]</td> > <td class="ar-enumchron">[% ar.item.enumchron | html %]</td> > <td class="ar-barcode">[% ar.item.barcode | html %]</td> >+ <td class="ar-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td> > <td class="ar-patron"> > <p> > <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber | uri %]"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >index e59703482e..8d452ea0a2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >@@ -143,6 +143,14 @@ > <input type="text" name="patron_notes" id="patron_notes" size="50"/> > </li> > >+ <li> >+ <label for="format">Format:</label> >+ <select name="format" id="format"> >+ <option value="PHOTOCOPY">Photocopy</option> >+ <option value="SCAN">Digital scan</option> >+ </select> >+ </li> >+ > <li> > <label for="branchcode">Pickup library:</label> > <select name="branchcode" id="branchcode"> >@@ -244,6 +252,7 @@ > <th>Pages</th> > <th>Chapters</th> > <th>Patron notes</th> >+ <th>Format</th> > <th>Item</th> > <th>Status</th> > <th>Pickup library</th> >@@ -262,6 +271,7 @@ > <td>[% ar.pages | html %]</td> > <td>[% ar.chapters | html %]</td> > <td>[% ar.patron_notes | html %]</td> >+ <td>[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td> > <td> > [% IF ar.item %] > <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber | uri %]&biblionumber=[% ar.biblionumber | uri %]">[% ar.item.barcode | html %]</a> >@@ -408,6 +418,19 @@ > }); > } > }); >+ >+ // Initialize format(s) >+ var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]"; >+ if( !supported_formats.match(/PHOTOCOPY/) ) >+ $('#format option[value="PHOTOCOPY"]').remove(); >+ if( !supported_formats.match(/SCAN/) ) >+ $('#format option[value="SCAN"]').remove(); >+ >+ if( $('#format option').length > 1 ) { >+ // Select first listed format >+ var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, ''); >+ $('#format option[value="'+first_format+'"]').attr('selected', true); >+ } > }); > </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >index 69dd4f0b58..6f9f4df2ef 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >@@ -120,6 +120,14 @@ > <input type="text" name="patron_notes" id="patron_notes" size="50"/> > </li> > >+ <li> >+ <label for="format">Format:</label> >+ <select name="format" id="format"> >+ <option value="PHOTOCOPY">Photocopy</option> >+ <option value="SCAN">Digital scan</option> >+ </select> >+ </li> >+ > <li> > <label for="branchcode">Pickup library:</label> > <select name="branchcode" id="branchcode" required="required"> >@@ -211,6 +219,7 @@ > > [% BLOCK jsinclude %] > <script> >+$(document).ready( function() { > allow_submit = false; > $('#place-article-request').on('submit', function( event ){ > if ( ! allow_submit ) { >@@ -239,9 +248,29 @@ > return 0; > } > >+ // Check if all fields are blank >+ if( m.length == 0 && $('#title').val()=='' && $('#author').val()=='' && $('#volume').val()=='' && $('#issue').val()=='' && $('#date').val()=='' && $('#pages').val()=='' && $('#chapters').val()=='' && $('#patron_notes').val()=='' ) { >+ alert( _("Please fill in at least one field.") ); >+ return 0; >+ } >+ > allow_submit = true; > $('#place-article-request').submit(); > } > }); >+ >+ // Initialize format(s) >+ var supported_formats = "[% Koha.Preference('ArticleRequestsSupportedFormats') %]"; >+ if( !supported_formats.match(/PHOTOCOPY/) ) >+ $('#format option[value="PHOTOCOPY"]').remove(); >+ if( !supported_formats.match(/SCAN/) ) >+ $('#format option[value="SCAN"]').remove(); >+ >+ if( $('#format option').length > 1 ) { >+ // Select first listed format >+ var first_format = supported_formats.split('|')[0].replace(/^\s*|\s*$/g, ''); >+ $('#format option[value="'+first_format+'"]').attr('selected', true); >+ } >+}); > </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 7410c07354..7c92ba2f9e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -728,6 +728,7 @@ > <th class="article-request-pages">Pages</th> > <th class="article-request-chapters">Chapters</th> > <th class="article-request-patron-notes">Notes</th> >+ <th class="article-request-format">Format</th> > <th class="article-request-status">Status</th> > <th class="article-request-branchcode">Pickup library</th> > <th class="nosort article-request-cancel"> </th> >@@ -781,6 +782,8 @@ > [% ar.patron_notes | html %] > </td> > >+ <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td> >+ > <td class="article-request-status"> > [% IF ar.status == 'PENDING' %] > Pending >diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl >index 6dc9189ef8..f52c81f14d 100755 >--- a/opac/opac-request-article.pl >+++ b/opac/opac-request-article.pl >@@ -52,6 +52,7 @@ if ( $action eq 'create' ) { > my $pages = $cgi->param('pages') || undef; > my $chapters = $cgi->param('chapters') || undef; > my $patron_notes = $cgi->param('patron_notes') || undef; >+ my $format = $cgi->param('format') || undef; > > my $ar = Koha::ArticleRequest->new( > { >@@ -67,6 +68,7 @@ if ( $action eq 'create' ) { > pages => $pages, > chapters => $chapters, > patron_notes => $patron_notes, >+ format => $format, > } > )->store(); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20472
:
107506
|
107507
|
107508
|
107509
|
107510
|
107511
|
107512
|
111473
|
111474
|
111475
|
111476
|
111477
|
111478
|
111479
|
122366
|
122367
|
122368
|
122369
|
122370
|
122371
|
122372
|
122373
|
122374
|
122375
|
122376
|
122377
|
122378
|
122379
|
122382
|
122383
|
122699
|
122700
|
122701
|
122702
|
122703
|
122704
|
122705
|
122706
|
122775
|
122781