View | Details | Raw Unified | Return to bug 19532
Collapse All | Expand All

(-)a/Koha/Recalls.pm (-1 / +1 lines)
Lines 183-189 sub move_recall { Link Here
183
183
184
    if ( $message eq 'no action provided' and $item and $item->biblionumber and $borrowernumber ) {
184
    if ( $message eq 'no action provided' and $item and $item->biblionumber and $borrowernumber ) {
185
        # move_recall was not called to revert or cancel, but was called to fulfill
185
        # move_recall was not called to revert or cancel, but was called to fulfill
186
        my $recall = Koha::Recalls->find({ borrowernumber => $borrowernumber, biblionumber => $item->biblionumber, itemnumber => [ $item->itemnumber, undef ], old => undef });
186
        my $recall = Koha::Recalls->search({ borrowernumber => $borrowernumber, biblionumber => $item->biblionumber, itemnumber => [ $item->itemnumber, undef ], old => undef }, { order_by => { -asc => 'recalldate' } })->next;
187
        if ( $recall ) {
187
        if ( $recall ) {
188
            $recall->set_finished;
188
            $recall->set_finished;
189
            $message = 'fulfilled';
189
            $message = 'fulfilled';
(-)a/koha-tmpl/intranet-tmpl/prog/js/recalls.js (-1 / +1 lines)
Lines 77-83 $(document).ready(function() { Link Here
77
                    if(data.success == 0) {
77
                    if(data.success == 0) {
78
                        message = __("The recall waiting status may have already been reverted. Please refresh the page.");
78
                        message = __("The recall waiting status may have already been reverted. Please refresh the page.");
79
                    } else {
79
                    } else {
80
                        message = __("Status updated");
80
                        message = __("Waiting status reverted");
81
                    }
81
                    }
82
                    $self.parent().parent().parent().parent().html(message);
82
                    $self.parent().parent().parent().parent().html(message);
83
                });
83
                });
(-)a/opac/opac-recall.pl (-1 / +1 lines)
Lines 23-29 use C4::Auth; Link Here
23
use C4::Output;
23
use C4::Output;
24
use C4::Context;
24
use C4::Context;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
    {
28
    {
29
        template_name   => "opac-recall.tt",
29
        template_name   => "opac-recall.tt",
(-)a/opac/opac-recalls.pl (-1 / +1 lines)
Lines 23-29 use C4::Auth; # get_template_and_user Link Here
23
use C4::Output;
23
use C4::Output;
24
use Koha::Recalls;
24
use Koha::Recalls;
25
25
26
my $input = new CGI;
26
my $input = CGI->new;
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
   {
28
   {
29
      template_name   => "opac-recalls.tt",
29
      template_name   => "opac-recalls.tt",
(-)a/recalls/recall_pickup_slip.pl (-1 / +1 lines)
Lines 23-29 use C4::Context; Link Here
23
use C4::Output;
23
use C4::Output;
24
use C4::Auth;
24
use C4::Auth;
25
25
26
my $input = new CGI;
26
my $input = CGI->new;
27
27
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
28
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29
    {
29
    {
(-)a/recalls/recalls_old_queue.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
23
use Koha::BiblioFrameworks;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
27
    {
28
      template_name   => "recalls/recalls_old_queue.tt",
28
      template_name   => "recalls/recalls_old_queue.tt",
(-)a/recalls/recalls_overdue.pl (-1 / +1 lines)
Lines 23-29 use C4::Output; Link Here
23
use Koha::BiblioFrameworks;
23
use Koha::BiblioFrameworks;
24
use Koha::DateUtils;
24
use Koha::DateUtils;
25
25
26
my $query = new CGI;
26
my $query = CGI->new;
27
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
28
    {
28
    {
29
       template_name   => "recalls/recalls_overdue.tt",
29
       template_name   => "recalls/recalls_overdue.tt",
(-)a/recalls/recalls_queue.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
23
use Koha::BiblioFrameworks;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
27
    {
28
      template_name   => "recalls/recalls_queue.tt",
28
      template_name   => "recalls/recalls_queue.tt",
(-)a/recalls/recalls_to_pull.pl (-1 / +1 lines)
Lines 22-28 use C4::Auth; Link Here
22
use C4::Output;
22
use C4::Output;
23
use Koha::BiblioFrameworks;
23
use Koha::BiblioFrameworks;
24
24
25
my $query = new CGI;
25
my $query = CGI->new;
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
26
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27
    {
27
    {
28
      template_name   => "recalls/recalls_to_pull.tt",
28
      template_name   => "recalls/recalls_to_pull.tt",
(-)a/recalls/recalls_waiting.pl (-1 / +1 lines)
Lines 25-31 use Koha::BiblioFrameworks; Link Here
25
use Koha::DateUtils;
25
use Koha::DateUtils;
26
use Koha::Patrons;
26
use Koha::Patrons;
27
27
28
my $query = new CGI;
28
my $query = CGI->new;
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
30
    {
30
    {
31
        template_name   => "recalls/recalls_waiting.tt",
31
        template_name   => "recalls/recalls_waiting.tt",
(-)a/svc/recall (-1 / +1 lines)
Lines 27-33 use C4::Output qw(output_with_http_headers); Link Here
27
use C4::Circulation qw(AddReturn);
27
use C4::Circulation qw(AddReturn);
28
use Koha::Recalls;
28
use Koha::Recalls;
29
29
30
my $input = new CGI;
30
my $input = CGI->new;
31
my $json = encode_json({ success => 0 });
31
my $json = encode_json({ success => 0 });
32
32
33
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { recall => 'manage_recalls' } );
33
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { recall => 'manage_recalls' } );
(-)a/t/db_dependent/Koha/Recalls.t (-3 / +2 lines)
Lines 43-49 my $item1 = $builder->build_sample_item(); Link Here
43
my $biblio1 = $item1->biblio;
43
my $biblio1 = $item1->biblio;
44
my $branch1 = $item1->holdingbranch;
44
my $branch1 = $item1->holdingbranch;
45
my $itemtype1 = $item1->effective_itemtype;
45
my $itemtype1 = $item1->effective_itemtype;
46
my $item2 = $builder->build_sample_item();
46
my $item2 = $builder->build_sample_item({ biblionumber => $biblio1->biblionumber });
47
my $biblio2 = $item1->biblio;
47
my $biblio2 = $item1->biblio;
48
my $branch2 = $item1->holdingbranch;
48
my $branch2 = $item1->holdingbranch;
49
my $itemtype2 = $item1->effective_itemtype;
49
my $itemtype2 = $item1->effective_itemtype;
Lines 168-174 ok( $recall->cancelled, "Recall cancelled with move_recall" ); Link Here
168
    expirationdate => undef,
168
    expirationdate => undef,
169
    interface => 'COMMANDLINE',
169
    interface => 'COMMANDLINE',
170
});
170
});
171
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id, itemnumber => $item2->itemnumber, borrowernumber => $patron1->borrowernumber });
171
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id, item => $item2, borrowernumber => $patron1->borrowernumber });
172
$recall = Koha::Recalls->find( $recall->recall_id );
172
$recall = Koha::Recalls->find( $recall->recall_id );
173
ok( $recall->finished, "Recall fulfilled with move_recall" );
173
ok( $recall->finished, "Recall fulfilled with move_recall" );
174
174
175
- 

Return to bug 19532