Bug 39726: Remove op connectDuplicate from acqui/newordersuggestions.pl
ConnectDuplicate does not appear to be used anywhere. No test plan to provide here. git grep connectDuplicate should return nothing Since there is no cud-, it would at least have been broken for a year Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
de837ace63
commit
b2505f31c3
|
|
@ -23,7 +23,6 @@ use base 'Exporter';
|
|||
|
||||
BEGIN {
|
||||
our @EXPORT = qw(
|
||||
ConnectSuggestionAndBiblio
|
||||
DelSuggestion
|
||||
GetSuggestion
|
||||
ModStatus
|
||||
|
|
@ -140,26 +139,6 @@ sub ModSuggestion {
|
|||
return 1; # No useful if the exception is raised earlier
|
||||
}
|
||||
|
||||
=head2 ConnectSuggestionAndBiblio
|
||||
|
||||
&ConnectSuggestionAndBiblio($ordernumber,$biblionumber)
|
||||
|
||||
connect a suggestion to an existing biblio
|
||||
|
||||
=cut
|
||||
|
||||
sub ConnectSuggestionAndBiblio {
|
||||
my ( $suggestionid, $biblionumber ) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $query = q{
|
||||
UPDATE suggestions
|
||||
SET biblionumber=?
|
||||
WHERE suggestionid=?
|
||||
};
|
||||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute( $biblionumber, $suggestionid );
|
||||
}
|
||||
|
||||
=head2 DelSuggestion
|
||||
|
||||
&DelSuggestion($borrowernumber,$ordernumber)
|
||||
|
|
|
|||
|
|
@ -77,12 +77,7 @@ the id of the suggestion to select.
|
|||
|
||||
=item op
|
||||
|
||||
can be equal to
|
||||
* connectDuplicate :
|
||||
then call to the function : ConnectSuggestionAndBiblio.
|
||||
i.e set the biblionumber of this suggestion.
|
||||
* else :
|
||||
is the default value.
|
||||
The operation to perform
|
||||
|
||||
=back
|
||||
|
||||
|
|
@ -93,7 +88,7 @@ use Modern::Perl;
|
|||
use CGI qw ( -utf8 );
|
||||
use C4::Auth qw( get_template_and_user );
|
||||
use C4::Output qw( output_html_with_http_headers );
|
||||
use C4::Suggestions qw( ConnectSuggestionAndBiblio ModSuggestion );
|
||||
use C4::Suggestions qw( ModSuggestion );
|
||||
use C4::Budgets;
|
||||
|
||||
use Koha::Acquisition::Booksellers;
|
||||
|
|
@ -124,10 +119,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
|
|||
}
|
||||
);
|
||||
|
||||
if ( $op eq 'connectDuplicate' ) {
|
||||
ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber );
|
||||
}
|
||||
|
||||
if ( $op eq 'cud-link_order' and $link_order ) {
|
||||
my $order = Koha::Acquisition::Orders->find($link_order);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use Modern::Perl;
|
|||
|
||||
use DateTime::Duration;
|
||||
use Test::NoWarnings;
|
||||
use Test::More tests => 53;
|
||||
use Test::More tests => 50;
|
||||
use Test::Warn;
|
||||
|
||||
use t::lib::Mocks;
|
||||
|
|
@ -38,7 +38,7 @@ use Koha::Suggestions;
|
|||
BEGIN {
|
||||
use_ok(
|
||||
'C4::Suggestions',
|
||||
qw( ModSuggestion ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )
|
||||
qw( ModSuggestion DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -310,16 +310,6 @@ $messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber2
|
|||
|
||||
is( scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error' );
|
||||
|
||||
is( ConnectSuggestionAndBiblio(), '0E0', 'ConnectSuggestionAndBiblio without arguments returns 0E0' );
|
||||
my $biblio_2 = $builder->build_object( { class => 'Koha::Biblios' } );
|
||||
my $connect_suggestion_and_biblio = ConnectSuggestionAndBiblio( $my_suggestionid, $biblio_2->biblionumber );
|
||||
is( $connect_suggestion_and_biblio, '1', 'ConnectSuggestionAndBiblio returns 1' );
|
||||
$suggestion = Koha::Suggestions->find($my_suggestionid);
|
||||
is(
|
||||
$suggestion->biblionumber, $biblio_2->biblionumber,
|
||||
'ConnectSuggestionAndBiblio updates the biblio number correctly'
|
||||
);
|
||||
|
||||
my $del_suggestion = {
|
||||
title => 'my deleted title',
|
||||
STATUS => 'CHECKED',
|
||||
|
|
|
|||
Loading…
Reference in New Issue