Bugzilla – Attachment 96322 Details for
Bug 14963
Add the ability to suggest purchase from existing titles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14963: Add the ability to suggest purchase on existing title
Bug-14963-Add-the-ability-to-suggest-purchase-on-e.patch (text/plain), 6.79 KB, created by
Nick Clemens (kidclamp)
on 2019-12-16 12:41:00 UTC
(
hide
)
Description:
Bug 14963: Add the ability to suggest purchase on existing title
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-12-16 12:41:00 UTC
Size:
6.79 KB
patch
obsolete
>From adf8c94359f00c2ab510e0e33d489d75140f9f71 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 5 Nov 2019 19:42:43 +0100 >Subject: [PATCH] Bug 14963: Add the ability to suggest purchase on existing > title >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds the ability to create a new purchase suggestion from an >existing title. This will prevent the creation of bibliographic records >that already exist in the catalogue. Also it will ease the process >during acquisition. > >Test plan: >- Login at the OPAC and go to the detail of a bibliographic record. >- Note that there is a new link "New purchase suggestion for this title" >on the right of the screen >- Please suggest an other icon if that one is not appropriated >- Click on it and submit your new suggestion >=> You should not get the confirmation screen (introduced by bug 14973) >warning you that the title already exists. >- Login staff side and order from this suggestion. >- Receive items and confirm that a new bibliographic record is not >created. > >Sponsored-by: BULAC - http://www.bulac.fr/ > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > acqui/neworderempty.pl | 2 +- > .../bootstrap/en/includes/opac-detail-sidebar.inc | 4 ++++ > .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 13 +++++++++---- > opac/opac-suggestions.pl | 16 +++++++++++++++- > 4 files changed, 29 insertions(+), 6 deletions(-) > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index ab95f16147..f41e598861 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -255,7 +255,6 @@ if ( not $ordernumber ) { # create order > } > else { #modify order > $data = GetOrder($ordernumber); >- $biblionumber = $data->{'biblionumber'}; > $budget_id = $data->{'budget_id'}; > > $template->param( >@@ -272,6 +271,7 @@ else { #modify order > push @order_users, $order_patron if $order_patron; > } > } >+$biblionumber = $data->{biblionumber}; > > # We can have: > # - no ordernumber but a biblionumber: from a subscription, from an existing record >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >index bc4d926c62..f0dce164ce 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >@@ -33,6 +33,10 @@ > [% END %] > [% END %] > >+ [% IF Koha.Preference('suggestion') %] >+ <li><a class="btn btn-link btn-lg" href="/cgi-bin/koha/opac-suggestions.pl?op=add&biblionumber=[% biblio.biblionumber | url %]"><i class="fa fa-fw fa-money"></i> New purchase suggestion for this title</a></li> >+ [% END %] >+ > [% IF ( OpacHighlightedWords && query_desc ) %] > <li> > <a href="#" class="highlight_toggle btn btn-link btn-lg" id="highlight_toggle_off"><i class="fa fa-fw fa-pencil"></i> Unhighlight</a> >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 db6d7ce420..bc76338626 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -204,10 +204,15 @@ > </fieldset> > <fieldset class="action"> > <input type="hidden" name="suggested_by_anyone" value="[% suggested_by_anyone | html %]" /> >- <input type="hidden" name="op" value="add_validate" /> >- [% IF ( need_confirm ) %] >- <input type="submit" onclick="this.form.op.value = 'add_confirm'; this.form.submit();" class="btn" value="Confirm your suggestion" /> >- [% ELSE %] >+ [% IF need_confirm # Confirm that we want a duplicate %] >+ <input type="hidden" name="op" value="add_confirm" /> >+ <input type="submit" class="btn" value="Confirm your suggestion" /> >+ [% ELSIF biblionumber # Create from an existing title %] >+ <input type="hidden" name="op" value="add_confirm" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <input type="submit" class="btn" value="Submit your suggestion" /> >+ [% ELSE # Not created from an existing title, search for possible duplicate %] >+ <input type="hidden" name="op" value="add_validate" /> > <input type="submit" class="btn" value="Submit your suggestion" /> > [% END %] > <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a> >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 91eaebe90b..b502e92737 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -37,6 +37,7 @@ use Koha::DateUtils qw( dt_from_string ); > > my $input = new CGI; > my $op = $input->param('op'); >+my $biblionumber = $input->param('biblionumber'); > my $suggestion = $input->Vars; > my $negcaptcha = $input->param('negcap'); > my $suggested_by_anyone = $input->param('suggested_by_anyone') || 0; >@@ -116,7 +117,7 @@ if ( $op eq 'else' ) { > } > } > >-if ( $op eq "add_validate" ) { >+if ( $op eq "add_validate" && not $biblionumber ) { # If we are creating the suggestion from an existing record we do not want to search for duplicates > $op = 'add_confirm'; > my $biblio = MarcRecordFromNewSuggestion($suggestion); > if ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) { >@@ -229,6 +230,19 @@ my @mandatoryfields; > foreach (@mandatoryfields) { > $template->param( $_."_required" => 1); > } >+ if ( $biblionumber ) { >+ my $biblio = Koha::Biblios->find($biblionumber); >+ $template->param( >+ biblionumber => $biblio->biblionumber, >+ title => $biblio->title, >+ author => $biblio->author, >+ copyrightdate => $biblio->copyrightdate, >+ isbn => $biblio->biblioitem->isbn, >+ publishercode => $biblio->biblioitem->publishercode, >+ collectiontitle => $biblio->biblioitem->collectiontitle, >+ place => $biblio->biblioitem->place, >+ ); >+ } > } > > $template->param( >-- >2.11.0
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 14963
:
95170
|
95173
|
95174
|
95175
|
95195
|
95196
|
95197
|
95198
|
95200
|
95201
|
95202
|
95203
|
95204
|
95205
|
95206
|
95207
| 96322 |
96323
|
96324