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

(-)a/circ/returns.pl (-13 / +45 lines)
Lines 415-421 if ( $messages->{'ResFound'}) { Link Here
415
    my $reserve    = $messages->{'ResFound'};
415
    my $reserve    = $messages->{'ResFound'};
416
    my $patron = Koha::Patrons->find( $reserve->{borrowernumber} );
416
    my $patron = Koha::Patrons->find( $reserve->{borrowernumber} );
417
    my $holdmsgpreferences =  C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name   => 'Hold_Filled' } );
417
    my $holdmsgpreferences =  C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name   => 'Hold_Filled' } );
418
    if ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) {
418
419
    if ( $reserve->{'ResFound'} eq "Reserved" && C4::Context->preference('HoldsAutoFill') ) {
420
        my $item = Koha::Items->find( $itemnumber );
421
        my $biblio = $item->biblio;
422
423
        my $diffBranchSend = ($userenv_branch ne $reserve->{branchcode}) ? $reserve->{branchcode} : undef;
424
        ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} );
425
        my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber});
426
427
        my $patron = Koha::Patrons->find( $nextreservinfo );
428
        my $name   = $patron ? $patron->surname . ", " . $patron->title . " " . $patron->firstname : '';
429
430
        $template->param(
431
            hold_auto_filled => 1,
432
            print_slip       => C4::Context->preference('HoldsAutoFillPrintSlip'),
433
            patron           => $patron,
434
            borrowernumber   => $patron->id,
435
            biblionumber     => $biblio->id,
436
        );
437
438
        if ( $messages->{'transfert'} ) {
439
            $template->param(
440
                itemtitle      => $biblio->title,
441
                itemnumber     => $item->itemnumber,
442
                itembiblionumber => $biblio->biblionumber,
443
                iteminfo       => $biblio->author,
444
                name           => $name,
445
                diffbranch     => 1,
446
            );
447
        }
448
    }
449
    elsif ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) {
419
        if ( $reserve->{'ResFound'} eq "Waiting" ) {
450
        if ( $reserve->{'ResFound'} eq "Waiting" ) {
420
            $template->param(
451
            $template->param(
421
                waiting      => ($userenv_branch eq $reserve->{'branchcode'} ? 1 : 0 ),
452
                waiting      => ($userenv_branch eq $reserve->{'branchcode'} ? 1 : 0 ),
Lines 429-447 if ( $messages->{'ResFound'}) { Link Here
429
            );
460
            );
430
        }
461
        }
431
462
432
        # same params for Waiting or Reserved
433
        $template->param(
434
            # FIXME The full patron object should be passed to the template
435
            found          => 1,
436
            patron         => $patron,
437
            barcode        => $barcode,
438
            destbranch     => $reserve->{'branchcode'},
439
            itemnumber     => $reserve->{'itemnumber'},
440
            reservenotes   => $reserve->{'reservenotes'},
441
            reserve_id     => $reserve->{reserve_id},
442
            bormessagepref => $holdmsgpreferences->{'transports'},
443
        );
444
    } # else { ; }  # error?
463
    } # else { ; }  # error?
464
465
    # same params for Waiting or Reserved
466
    $template->param(
467
        # FIXME The full patron object should be passed to the template
468
        found          => 1,
469
        patron         => $patron,
470
        barcode        => $barcode,
471
        destbranch     => $reserve->{'branchcode'},
472
        itemnumber     => $reserve->{'itemnumber'},
473
        reservenotes   => $reserve->{'reservenotes'},
474
        reserve_id     => $reserve->{reserve_id},
475
        bormessagepref => $holdmsgpreferences->{'transports'},
476
    );
445
}
477
}
446
478
447
# Error Messages
479
# Error Messages
(-)a/installer/data/mysql/atomicupdate/bug_19383.sql (+3 lines)
Line 0 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
3
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 191-196 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
191
('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'),
191
('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'),
192
('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch\'s items to emphasize. If PatronBranch, emphasize the logged in user\'s library\'s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha\'s Apache configuration file.','Choice'),
192
('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch\'s items to emphasize. If PatronBranch, emphasize the logged in user\'s library\'s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha\'s Apache configuration file.','Choice'),
193
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
193
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
194
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
195
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
194
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
196
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
195
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
197
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
196
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
198
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 478-483 Circulation: Link Here
478
            - his/her auto renewals.
478
            - his/her auto renewals.
479
    Checkin Policy:
479
    Checkin Policy:
480
        -
480
        -
481
            - pref: HoldsAutoFill
482
              choices:
483
                  yes: Do
484
                  no: "Don't"
485
            - automatically fill holds instead of asking the librarian.
486
        -
487
            - pref: HoldsAutoFillPrintSlip
488
              choices:
489
                  yes: Do
490
                  no: "Don't"
491
            - automatically display the hold slip dialog for auto-filled holds.
492
        -
481
            - pref: BlockReturnOfWithdrawnItems
493
            - pref: BlockReturnOfWithdrawnItems
482
              choices:
494
              choices:
483
                  yes: Block
495
                  yes: Block
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +56 lines)
Lines 52-57 Link Here
52
[% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
52
[% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
53
<div class="yui-g">
53
<div class="yui-g">
54
54
55
    [% IF hold_auto_filled %]
56
        <div class="dialog alert hold-auto-filled">
57
            [% IF ( reservenotes ) %]
58
                <h4>Notes: [% reservenotes %]</h4>
59
            [% END %]
60
            <h3>Hold filled for:</h3>
61
                <li>
62
                    [% INCLUDE 'patron-title.inc' patron=patron %]
63
                    <span class="patron-category"> - [% patron.category.description %]</span>
64
                </li>
65
66
                [% INCLUDE display_holdpatron_address %]
67
68
                [% IF ( patron.phone ) %]
69
                    <li>[% patron.phone  %]</li>
70
                [% END %]
71
72
                [% IF ( patron.email ) %]
73
                    <li>
74
                        [% IF ( transfertodo ) %]
75
                            [% patron.email %]
76
                        [% ELSE %]
77
                            <a id="boremail" href="mailto:[% patron.email %]">[% patron.email %]</a>
78
                        [% END %]
79
                    </li>
80
                [% END %]
81
82
                [% UNLESS ( transfertodo) %]
83
                    [% INCLUDE display_bormessagepref %]
84
                [% END %]
85
86
                [% IF ( patron.debarred ) %]
87
                    <li class="error">Patron is RESTRICTED</li>
88
                [% END %]
89
90
                [% IF ( patron.gonenoaddress ) %]
91
                    <li class="error">Patron's address is in doubt</li>
92
                [% END %]
93
94
            [% IF ( transfertodo ) %]
95
                <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
96
            [% ELSE %]
97
                <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
98
            [% END %]
99
100
            <a href="#" class="btn btn-default print print-slip">
101
                <i class="fa fa-print"></i> Print
102
            </a>
103
        </div>
104
    [% END %]
105
55
[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
106
[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
56
    <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
107
    <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
57
[% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
108
[% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
Lines 709-714 Link Here
709
760
710
            $(".modal").on('hidden.bs.modal', function (e) { $("#barcode").focus(); });
761
            $(".modal").on('hidden.bs.modal', function (e) { $("#barcode").focus(); });
711
762
763
            $(".print-slip").on('click', function(e) {
764
                e.preventDefault();
765
                Dopop('hold-transfer-slip.pl?borrowernumber=[% patron.borrowernumber %]&amp;biblionumber=[% biblionumber %]');
766
            });
767
712
            [% IF print_slip %]
768
            [% IF print_slip %]
713
                Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% itemnumber | html %]');
769
                Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% itemnumber | html %]');
714
            [% END %]
770
            [% END %]
715
- 

Return to bug 19383