Bugzilla – Attachment 148922 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: Forbid editing biblio info when creating suggestion for biblio
Bug-29311-Forbid-editing-biblio-info-when-creating.patch (text/plain), 10.71 KB, created by
Nick Clemens
on 2023-03-29 14:04:41 UTC
(
hide
)
Description:
Bug 29311: Forbid editing biblio info when creating suggestion for biblio
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2023-03-29 14:04:41 UTC
Size:
10.71 KB
patch
obsolete
>From f4dd12b14da2b08105250f2556dd2794da166805 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: Forbid editing biblio info when creating > suggestion for biblio >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When creating a suggestion for an existing biblio, biblio info like >title or author should not be editable. > >Test plan: >1. Enable system preference 'suggestion' >2. Log in at OPAC >3. Go to a biblio record detail page >4. Click 'suggest for purchase' >5. Notice that all fields can be modified (title, author, ...) >6. Apply patch >7. Repeat steps 2 and 3 or refresh the page >8. Verify that the biblio fields cannot be modified now. The only fields > that should be editable are: quantity, item type, library, reason for > suggestion, and notes > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../bootstrap/en/modules/opac-suggestions.tt | 38 +++++++++++++++---- > opac/opac-suggestions.pl | 11 ++++++ > 2 files changed, 41 insertions(+), 8 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 76bcf0b4e0..11ad867662 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -84,7 +84,10 @@ > </li> > [% END %] > <li> >- [% IF ( title_required ) %] >+ [% IF biblionumber %] >+ <label>Title:</label> >+ <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">[% title | html %]</a> >+ [% ELSIF ( title_required ) %] > <label for="title" class="required">Title:</label> > <input type="text" id="title" name="title" class="span6" maxlength="255" value="[% title | html %]" required="required" /> > <div class="required_label required">Required</div> >@@ -95,7 +98,10 @@ > </li> > [% UNLESS ( author_hidden ) %] > <li> >- [% IF ( author_required ) %] >+ [% IF biblionumber %] >+ <label>Author:</label> >+ <span>[% author | html %]</span> >+ [% ELSIF ( author_required ) %] > <label for="author" class="required">Author:</label> > <input type="text" id="author" name="author" class="span6" maxlength="80" value="[% author | html %]" required="required" /> > <div class="required_label required">Required</div> >@@ -108,21 +114,28 @@ > [% UNLESS ( copyrightdate_hidden )%] > <li> > <div title="Copyright or publication year, for example: 2022"> >- [% IF ( copyrightdate_required ) %] >+ [% IF biblionumber %] >+ <label>Publication year:</label> >+ <span>[% copyrightdate | html %]</span> >+ [% ELSIF ( copyrightdate_required ) %] > <label for="copyrightdate" class="required">Publication year:</label> > <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="10" maxlength="4" value="[% copyrightdate | html %]" required="required" /> > <div class="required_label required">Required</div> >+ <span class="hint">Copyright or publication year, for example: 2022</span> > [% ELSE %] > <label for="copyrightdate">Publication year:</label> > <input type="text" id="copyrightdate" name="copyrightdate" pattern="[12]\d{3}" size="10" maxlength="4" value="[% copyrightdate | html %]" /> >+ <span class="hint">Copyright or publication year, for example: 2022</span> > [% END %] >- <span class="hint">Copyright or publication year, for example: 2022</span> > </div> > </li> > [% END %] > [% UNLESS ( isbn_hidden or Koha.Preference('OPACSuggestionAutoFill') ) %] > <li> >- [% IF ( isbn_required ) %] >+ [% IF biblionumber %] >+ <label>Standard number (ISBN, ISSN or other):</label> >+ <span>[% isbn | html %]</span> >+ [% 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> >@@ -134,7 +147,10 @@ > [% END %] > [% UNLESS ( publishercode_hidden ) %] > <li> >- [% IF ( publishercode_required ) %] >+ [% IF biblionumber %] >+ <label>Publisher:</label> >+ <span>[% publishercode | html %]</span> >+ [% 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> >@@ -146,7 +162,10 @@ > [% END %] > [% UNLESS ( collectiontitle_hidden ) %] > <li> >- [% IF ( collectiontitle_required ) %] >+ [% IF biblionumber %] >+ <label for="collectiontitle" class="required">Collection title:</label> >+ <span>[% collectiontitle | html %]</span> >+ [% 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> >@@ -158,7 +177,10 @@ > [% END %] > [% UNLESS ( place_hidden ) %] > <li> >- [% IF ( place_required ) %] >+ [% IF biblionumber %] >+ <label for="place" class="required">Publication place:</label> >+ <span>[% place | html %]</span> >+ [% 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> >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index dceae6c766..cdedea0aa6 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -199,6 +199,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++; >-- >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