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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2817-2823 sub CanBookBeRenewed { Link Here
2817
2817
2818
        # Fallback for automatic renewals:
2818
        # Fallback for automatic renewals:
2819
        # If norenewalbefore is undef, don't renew before due date.
2819
        # If norenewalbefore is undef, don't renew before due date.
2820
        if ( $issue->auto_renew && !$auto_renew ) {
2820
        if ( $issue->auto_renew && !$auto_renew && $patron->autorenew_checkouts ) {
2821
            my $now = dt_from_string;
2821
            my $now = dt_from_string;
2822
            if ( $now >= dt_from_string( $issue->date_due, 'sql' ) ){
2822
            if ( $now >= dt_from_string( $issue->date_due, 'sql' ) ){
2823
                $auto_renew = 1;
2823
                $auto_renew = 1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-3 / +11 lines)
Lines 568-582 Link Here
568
                                                        <div id="set-automatic-renewal" class="circ-setting">
568
                                                        <div id="set-automatic-renewal" class="circ-setting">
569
                                                            [% IF NEEDSCONFIRMATION %]
569
                                                            [% IF NEEDSCONFIRMATION %]
570
                                                                [% IF auto_renew %]
570
                                                                [% IF auto_renew %]
571
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
571
                                                                    [% IF patron.autorenewal %]
572
                                                                        <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
573
                                                                        title="Patron has opted out of auto-renewal"/>
574
                                                                    [% ELSE %]
575
                                                                        <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
576
                                                                    [% END %]
572
                                                                [% ELSE %]
577
                                                                [% ELSE %]
573
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
578
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
574
                                                                [% END %]
579
                                                                [% END %]
575
                                                            [% ELSE %]
580
                                                            [% ELSE %]
576
                                                                [% IF auto_renew %]
581
                                                                [% IF ( auto_renew && patron.autorenewal ) %]
577
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
582
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
578
                                                                [% ELSE %]
583
                                                                [% ELSIF patron.autorenewal %]
579
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
584
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
585
                                                                [% ELSE %]
586
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
587
                                                                    title="Patron has opted out of auto-renewal"/>
580
                                                                [% END %]
588
                                                                [% END %]
581
                                                            [% END %]
589
                                                            [% END %]
582
590
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+27 lines)
Lines 874-879 legend:hover { Link Here
874
                                            </li>
874
                                            </li>
875
                                        [% END # /UNLESS nosort2 %]
875
                                        [% END # /UNLESS nosort2 %]
876
876
877
                                        [% UNLESS noautorenewal %]
878
                                            <li class="radio">
879
                                                <label for="yes-autorenewal">
880
                                                    Allow auto-renewal of items:
881
                                                </label>
882
                                                    [% IF ( autorenewal ) %]
883
                                                        <label for="yes-autorenewal">
884
                                                            Yes
885
                                                            <input type="radio" id="yes-autorenewal" name="autorenewal" value="1" checked="checked" />
886
                                                        </label>
887
                                                        <label for="no-autorenewal">
888
                                                            No
889
                                                            <input type="radio" id="no-autorenewal" name="autorenewal" value="0" />
890
                                                        </label>
891
                                                    [% ELSE %]
892
                                                        <label for="yes-autorenewal">
893
                                                            Yes
894
                                                            <input type="radio" id="yes-autorenewal" name="autorenewal" value="1" />
895
                                                        </label>
896
                                                        <label for="no-autorenewal">
897
                                                            No
898
                                                            <input type="radio" id="no-autorenewal" name="autorenewal" value="0" checked="checked" />
899
                                                        </label>
900
                                                    [% END %]
901
                                            </li>
902
                                        [% END %]
903
877
                                        [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
904
                                        [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
878
                                            <li>
905
                                            <li>
879
                                                <label for="checkprevcheckout">Check for previous checkouts: </label>
906
                                                <label for="checkprevcheckout">Check for previous checkouts: </label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (+1 lines)
Lines 52-57 Link Here
52
[% CASE 'contacttitle'        %]<span>Contact: Title</span>
52
[% CASE 'contacttitle'        %]<span>Contact: Title</span>
53
[% CASE 'relationship'        %]<span>Contact: Relationship</span>
53
[% CASE 'relationship'        %]<span>Contact: Relationship</span>
54
[% CASE 'sex'                 %]<span>Gender</span>
54
[% CASE 'sex'                 %]<span>Gender</span>
55
[% CASE 'autorenewal'         %]<span>Auto-renewal</span>
55
[% CASE 'altcontactfirstname' %]<span>Alternate contact: First name</span>
56
[% CASE 'altcontactfirstname' %]<span>Alternate contact: First name</span>
56
[% CASE 'altcontactsurname'   %]<span>Alternate contact: Surname</span>
57
[% CASE 'altcontactsurname'   %]<span>Alternate contact: Surname</span>
57
[% CASE 'altcontactaddress1'  %]<span>Alternate contact: Address</span>
58
[% CASE 'altcontactaddress1'  %]<span>Alternate contact: Address</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt (+1 lines)
Lines 84-89 Link Here
84
            <li><span class="label">Library: </span>[% patron.library.branchname | html %]</li>
84
            <li><span class="label">Library: </span>[% patron.library.branchname | html %]</li>
85
            [% IF ( patron.sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', patron.sort1) | html %]</li>[% END %]
85
            [% IF ( patron.sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', patron.sort1) | html %]</li>[% END %]
86
            [% IF ( patron.sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', patron.sort2) | html %]</li>[% END %]
86
            [% IF ( patron.sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', patron.sort2) | html %]</li>[% END %]
87
            [% UNLESS ( patron.autorenewal ) %]<li>Auto renewal: Patron has opted out</li>[% END %]
87
        </ol>
88
        </ol>
88
    </div>
89
    </div>
89
    </div>
90
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+6 lines)
Lines 520-525 Link Here
520
                                                [% AuthorisedValues.GetByCode('Bsort2', patron.sort2) | html %]
520
                                                [% AuthorisedValues.GetByCode('Bsort2', patron.sort2) | html %]
521
                                            </li>
521
                                            </li>
522
                                        [% END %]
522
                                        [% END %]
523
                                        [% UNLESS ( patron.autorenewal ) %]
524
                                            <li id="patron-autorenewal">
525
                                                <span class="label">Auto renewal:</span>
526
                                                Patron has opted out
527
                                            </li>
528
                                        [% END %]
523
                                        <li id="patron-username">
529
                                        <li id="patron-username">
524
                                            <span class="label">Username: </span>
530
                                            <span class="label">Username: </span>
525
                                            [% patron.userid | html %]
531
                                            [% patron.userid | html %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+27 lines)
Lines 258-263 Link Here
258
                                        [% END %]
258
                                        [% END %]
259
                                    </li>
259
                                    </li>
260
                                [% END %]
260
                                [% END %]
261
                                [% UNLESS hidden.defined('autorenewal') %]
262
                                    <li class="lradio">
263
                                        <label for="yes-autorenewal">
264
                                            Allow auto-renewal:
265
                                        </label>
266
                                            [% IF ( borrower.autorenewal ) %]
267
                                                <label class="radio inline" for="yes-autorenewal">
268
                                                    Yes
269
                                                    <input type="radio" id="yes-autorenewal" name="borrower_autorenewal" value="1" checked="checked" />
270
                                                </label>
271
272
                                                <label class="radio inline" for="no-autorenewal">
273
                                                    No
274
                                                    <input type="radio" id="no-autorenewal" name="borrower_autorenewal" value="0" />
275
                                                </label>
276
                                            [% ELSE %]
277
                                                <label class="radio inline" for="yes-autorenewal">
278
                                                    Yes
279
                                                    <input type="radio" id="yes-autorenewal" name="borrower_autorenewal" value="1" />
280
                                                </label>
281
                                                <label class="radio inline" for="no-autorenewal">
282
                                                    No
283
                                                    <input type="radio" id="no-autorenewal" name="borrower_autorenewal" value="0" checked="checked" />
284
                                                </label>
285
                                            [% END %]
286
                                    </li>
287
                                [% END %]
261
                            </ol>
288
                            </ol>
262
                        </fieldset>
289
                        </fieldset>
263
                [% END # / defined 'branchcode' %]
290
                [% END # / defined 'branchcode' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-3 / +3 lines)
Lines 330-341 Link Here
330
                                                    [% ELSIF ISSUE.auto_account_expired %]
330
                                                    [% ELSIF ISSUE.auto_account_expired %]
331
                                                        Automatic renewal failed, your account is expired.
331
                                                        Automatic renewal failed, your account is expired.
332
                                                        <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
332
                                                        <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
333
                                                    [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
334
                                                        Automatic renewal
335
                                                        <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
336
                                                    [% ELSIF ( ISSUE.too_soon ) %]
333
                                                    [% ELSIF ( ISSUE.too_soon ) %]
337
                                                        No renewal before [% ISSUE.soonestrenewdate | html %]
334
                                                        No renewal before [% ISSUE.soonestrenewdate | html %]
338
                                                        <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
335
                                                        <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
336
                                                    [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
337
                                                        Automatic renewal
338
                                                        <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
339
                                                    [% ELSIF ( ISSUE.item_denied_renewal ) %]
339
                                                    [% ELSIF ( ISSUE.item_denied_renewal ) %]
340
                                                        Renewal not allowed
340
                                                        Renewal not allowed
341
                                                    [% END %]
341
                                                    [% END %]
(-)a/members/memberentry.pl (+1 lines)
Lines 738-743 $template->param(no_add => $no_add); Link Here
738
738
739
$template->param( sort1 => $data{'sort1'});
739
$template->param( sort1 => $data{'sort1'});
740
$template->param( sort2 => $data{'sort2'});
740
$template->param( sort2 => $data{'sort2'});
741
$template->param( autorenew => $data{'autorenew'});
741
742
742
if ($nok) {
743
if ($nok) {
743
    foreach my $error (@errors) {
744
    foreach my $error (@errors) {
(-)a/misc/cronjobs/automatic_renewals.pl (-1 / +1 lines)
Lines 80-86 GetOptions( Link Here
80
pod2usage(0) if $help;
80
pod2usage(0) if $help;
81
cronlogaction();
81
cronlogaction();
82
82
83
my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 });
83
my $auto_renews = Koha::Checkouts->search({ auto_renew => 1, 'borrower.autorenewal' => 1 },{ join => 'borrower'});
84
84
85
my %report;
85
my %report;
86
$verbose = 1 unless $verbose or $confirm;
86
$verbose = 1 unless $verbose or $confirm;
(-)a/t/db_dependent/Circulation.t (-2 / +1 lines)
Lines 274-280 Koha::CirculationRules->set_rules( Link Here
274
274
275
my ( $reused_itemnumber_1, $reused_itemnumber_2 );
275
my ( $reused_itemnumber_1, $reused_itemnumber_2 );
276
subtest "CanBookBeRenewed tests" => sub {
276
subtest "CanBookBeRenewed tests" => sub {
277
    plan tests => 77;
277
    plan tests => 83;
278
278
279
    C4::Context->set_preference('ItemsDeniedRenewal','');
279
    C4::Context->set_preference('ItemsDeniedRenewal','');
280
    # Generate test biblio
280
    # Generate test biblio
281
- 

Return to bug 24476