Bugzilla – Attachment 134531 Details for
Bug 29311
Do not allow editing of bibliographic information when entering suggestion from existing bibs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29311: Do not allow editing of bibliographic information when entering suggestion from existing bibs
Bug-29311-Do-not-allow-editing-of-bibliographic-in.patch (text/plain), 8.50 KB, created by
Séverine Queune
on 2022-05-03 12:06:20 UTC
(
hide
)
Description:
Bug 29311: Do not allow editing of bibliographic information when entering suggestion from existing bibs
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2022-05-03 12:06:20 UTC
Size:
8.50 KB
patch
obsolete
>From ed761bc816bc78ccd557dea4c13e1499ebf3f632 Mon Sep 17 00:00:00 2001 >From: jeremy breuillard <jeremy.breuillard@biblibre.com> >Date: Mon, 21 Mar 2022 15:29:57 +0100 >Subject: [PATCH] Bug 29311: Do not allow editing of bibliographic information > when entering suggestion from existing bibs >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch changes the behavior of the suggestion form in OPAC. The suggestion form for an existing record has its total of inputs limited, otherwise the inputs are all available. > >Test plan: >1)OPAC: Login to your OPAC account >2)Choose a record and get onto its details page >3)Click 'suggest for purchase' >4)Notice: all the fields can be modified >5)Apply patch >6)Repeat 2) and 3) or refresh >7)You see that the fields about bibliographic informations are disabled now > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > .../bootstrap/en/modules/opac-suggestions.tt | 45 ++++++++++++++++--- > opac/opac-suggestions.pl | 14 +++++- > 2 files changed, 52 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index 0eb939e176..7668aa47e2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -113,7 +113,10 @@ > [% END %] > [% UNLESS ( isbn_hidden )%] > <li> >- [% IF ( isbn_required ) %] >+ [% IF ( biblionumber ) %] >+ <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label> >+ [% isbn | html %] >+ [% ELSIF ( isbn_required ) %] > <label for="isbn" class="required">Standard number (ISBN, ISSN or other):</label> > <input type="text" id="isbn" name="isbn" maxlength="80" value="[% isbn | html %]" required="required" /> > <div class="required_label required">Required</div> >@@ -125,7 +128,10 @@ > [% END %] > [% UNLESS ( publishercode_hidden ) %] > <li> >- [% IF ( publishercode_required ) %] >+ [% IF ( biblionumber ) %] >+ <label for="publishercode" class="required">Publisher:</label> >+ [% publishercode | html %] >+ [% ELSIF ( publishercode_required ) %] > <label for="publishercode" class="required">Publisher:</label> > <input type="text" id="publishercode" name="publishercode" class="span6" maxlength="80" value="[% publishercode | html %]" required="required" /> > <div class="required_label required">Required</div> >@@ -137,7 +143,10 @@ > [% END %] > [% UNLESS ( collectiontitle_hidden ) %] > <li> >- [% IF ( collectiontitle_required ) %] >+ [% IF ( biblionumber ) %] >+ <label for="collectiontitle" class="required">Collection title:</label> >+ [% collectiontitle | html %] >+ [% ELSIF ( collectiontitle_required ) %] > <label for="collectiontitle" class="required">Collection title:</label> > <input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" value="[% collectiontitle | html %]" required="required" /> > <div class="required_label required">Required</div> >@@ -149,7 +158,10 @@ > [% END %] > [% UNLESS ( place_hidden ) %] > <li> >- [% IF ( place_required ) %] >+ [% IF ( biblionumber ) %] >+ <label for="place" class="required">Publication place:</label> >+ [% place | html %] >+ [% ELSIF ( place_required ) %] > <label for="place" class="required">Publication place:</label> > <input type="text" id="place" name="place" required="required" maxlength="80" value="[% place | html %]" /> > <div class="required_label required">Required</div> >@@ -480,7 +492,6 @@ > [% END %] > [% END %] > [% END # / IF suggestions_loop %] >- > [% END # IF op_else %] > </div> <!-- / #usersuggestions --> > </div> <!-- / .col-lg-10 --> >@@ -492,6 +503,30 @@ > [% BLOCK jsinclude %] > [% INCLUDE 'datatables.inc' %] > <script> >+ // Disable fields if there is a biblionumber >+ [% IF ( biblionumber ) %] >+ window.addEventListener("DOMContentLoaded", (event) => { >+ function disabled() { >+ const title = document.getElementById('title'); >+ const author = document.getElementById('author'); >+ const copyrightdate = document.getElementById('copyrightdate'); >+ const isbn = document.getElementById('isbn'); >+ const publishercode = document.getElementById('publishercode'); >+ const collectiontitle = document.getElementById('collectiontitle'); >+ const place = document.getElementById('place'); >+ >+ title.disabled = true; >+ author.disabled = true; >+ copyrightdate.disabled = true; >+ isbn.disabled = true; >+ publishercode.disabled = true; >+ collectiontitle.disabled = true; >+ place.disabled = true; >+ } >+ disabled(); >+ }); >+ [% END %] >+ > [% IF ( loggedinusername ) %] > function enableCheckboxActions(){ > // Enable/disable controls if checkboxes are checked >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index fcc95801aa..381f3f2dc5 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -192,6 +192,17 @@ if ( $op eq "add_confirm" ) { > $suggestion->{suggesteddate} = dt_from_string; > $suggestion->{branchcode} = $input->param('branchcode') || C4::Context->userenv->{"branch"}; > $suggestion->{STATUS} = 'ASKED'; >+ if ( $biblionumber ) { >+ my $biblio = Koha::Biblios->find($biblionumber); >+ $suggestion->{biblionumber} = $biblio->biblionumber; >+ $suggestion->{title} = $biblio->title; >+ $suggestion->{author} = $biblio->author; >+ $suggestion->{copyrightdate} = $biblio->copyrightdate; >+ $suggestion->{isbn} = $biblio->biblioitem->isbn; >+ $suggestion->{publishercode} = $biblio->biblioitem->publishercode; >+ $suggestion->{collectiontitle} = $biblio->biblioitem->collectiontitle; >+ $suggestion->{place} = $biblio->biblioitem->place; >+ } > > &NewSuggestion($suggestion); > $patrons_pending_suggestions_count++; >@@ -292,5 +303,4 @@ $template->param( > patrons_total_suggestions_count => $patrons_total_suggestions_count, > ); > >-output_html_with_http_headers $input, $cookie, $template->output, undef, { force_no_caching => 1 }; >- >+output_html_with_http_headers $input, $cookie, $template->output, undef, { force_no_caching => 1 }; >\ No newline at end of file >-- >2.30.2
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 29311
:
133120
|
134531
|
146849
|
148776
|
148922
|
148923
|
148924
|
149391
|
149392