Bugzilla – Attachment 164837 Details for
Bug 35717
Link suggestions to orders by adding ordernumber to suggestions table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35717: Remove GetSuggestionInfoFromBiblionumber
Bug-35717-Remove-GetSuggestionInfoFromBiblionumber.patch (text/plain), 5.39 KB, created by
Nick Clemens (kidclamp)
on 2024-04-12 12:09:01 UTC
(
hide
)
Description:
Bug 35717: Remove GetSuggestionInfoFromBiblionumber
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-12 12:09:01 UTC
Size:
5.39 KB
patch
obsolete
>From aaa74edf87764e9510b43c1a46d7177f2f0cb9c5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 May 2023 15:19:38 +0200 >Subject: [PATCH] Bug 35717: Remove GetSuggestionInfoFromBiblionumber > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Suggestions.pm | 28 ---------------------------- > acqui/orderreceive.pl | 6 ------ > t/db_dependent/Suggestions.t | 19 ++----------------- > 3 files changed, 2 insertions(+), 51 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 14c6b203c1b..29c092426cc 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -36,7 +36,6 @@ our @EXPORT = qw( > GetSuggestion > GetSuggestionByStatus > GetSuggestionFromBiblionumber >- GetSuggestionInfoFromBiblionumber > GetSuggestionInfo > ModStatus > ModSuggestion >@@ -119,33 +118,6 @@ sub GetSuggestionFromBiblionumber { > return $suggestionid; > } > >-=head2 GetSuggestionInfoFromBiblionumber >- >-Get a suggestion and borrower's informations from it's biblionumber. >- >-return : >-all informations (suggestion and borrower) of the suggestion which is related to the biblionumber given. >- >-=cut >- >-sub GetSuggestionInfoFromBiblionumber { >- my ($biblionumber) = @_; >- my $query = q{ >- SELECT suggestions.*, >- U1.surname AS surnamesuggestedby, >- U1.firstname AS firstnamesuggestedby, >- U1.borrowernumber AS borrnumsuggestedby >- FROM suggestions >- LEFT JOIN borrowers AS U1 ON suggestedby=U1.borrowernumber >- WHERE biblionumber=? >- LIMIT 1 >- }; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare($query); >- $sth->execute($biblionumber); >- return $sth->fetchrow_hashref; >-} >- > =head2 GetSuggestionInfo > > Get a suggestion and borrower's informations from it's suggestionid >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index 153e1157c19..f327519b2cd 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -133,12 +133,6 @@ if ($order) { > $template->param( orders => $orders, ); > } > >- my $suggestion = GetSuggestionInfoFromBiblionumber( $order->biblionumber ); >- >- if ($suggestion) { >- $template->param( suggestion => $suggestion ); >- } >- > $template->param( > order => $order, > creator => $creator, >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 88aae138c17..1987d9896a0 100755 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use DateTime::Duration; >-use Test::More tests => 92; >+use Test::More tests => 80; > use Test::Warn; > > use t::lib::Mocks; >@@ -35,7 +35,7 @@ use Koha::Patrons; > use Koha::Suggestions; > > BEGIN { >- use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionInfoFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); >+ use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); > } > > my $schema = Koha::Database->new->schema; >@@ -299,21 +299,6 @@ is( GetSuggestionFromBiblionumber(2), undef, 'GetSuggestionFromBiblionumber with > is( GetSuggestionFromBiblionumber($biblio_1->biblionumber), $my_suggestionid, 'GetSuggestionFromBiblionumber functions correctly' ); > > >-is( GetSuggestionInfoFromBiblionumber(), undef, 'GetSuggestionInfoFromBiblionumber without the biblio number returns undef' ); >-is( GetSuggestionInfoFromBiblionumber(2), undef, 'GetSuggestionInfoFromBiblionumber with an invalid biblio number returns undef' ); >-$suggestion = GetSuggestionInfoFromBiblionumber($biblio_1->biblionumber); >-is( $suggestion->{suggestionid}, $my_suggestionid, 'GetSuggestionInfoFromBiblionumber returns the suggestion id correctly' ); >-is( $suggestion->{title}, $mod_suggestion1->{title}, 'GetSuggestionInfoFromBiblionumber returns the title correctly' ); >-is( $suggestion->{author}, $mod_suggestion1->{author}, 'GetSuggestionInfoFromBiblionumber returns the author correctly' ); >-is( $suggestion->{publishercode}, $mod_suggestion1->{publishercode}, 'GetSuggestionInfoFromBiblionumber returns the publisher code correctly' ); >-is( $suggestion->{suggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfoFromBiblionumber returns the borrower number correctly' ); >-is( $suggestion->{biblionumber}, $my_suggestion->{biblionumber}, 'GetSuggestionInfoFromBiblionumber returns the biblio number correctly' ); >-is( $suggestion->{STATUS}, $mod_suggestion3->{STATUS}, 'GetSuggestionInfoFromBiblionumber returns the status correctly' ); >-is( $suggestion->{surnamesuggestedby}, $member->{surname}, 'GetSuggestionInfoFromBiblionumber returns the surname correctly' ); >-is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInfoFromBiblionumber returns the firstname correctly' ); >-is( $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfoFromBiblionumeber returns the borrower number correctly' ); >- >- > my $suggestions = GetSuggestionByStatus(); > is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); > $suggestions = GetSuggestionByStatus('CHECKED'); >-- >2.39.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 35717
:
160576
|
160577
|
160578
|
160579
|
160580
|
160581
|
160582
|
160583
|
164834
|
164835
|
164836
|
164837
|
164838
|
164839
|
164840
|
172871
|
172872
|
172873
|
172874
|
172875
|
172876
|
172877
|
172878
|
172899
|
172900
|
172901