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

(-)a/installer/data/mysql/atomicupdate/bug_32776_-_add_ConvertSelectedHoldsToRecalls_syspref.pl (+14 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "32776",
5
    description => "Convert selected reserves to recalls",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ConvertedSelectedHoldsToRecalls', 'oldest', 'oldest|recallable', 'Choose whether the convert_reserves_to_recalls.pl cronjob should convert only the oldest reserve on the record to a recall, or one reserve for each item available to be recalled', 'Choice') });
11
12
        say $out "Added system preference 'ConvertedSelectedHoldsToRecalls'";
13
    },
14
};
(-)a/installer/data/mysql/atomicupdate/bug_32776_-_add_ConvertSelectedReservesToRecalls_syspref.pl (-14 lines)
Lines 1-14 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "32776",
5
    description => "Convert selected reserves to recalls",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ConvertSelectedReservesToRecalls', 'oldest', 'oldest|recallable', 'Choose whether the convert_reserves_to_recalls.pl cronjob should convert only the oldest reserve on the record to a recall, or one reserve for each item available to be recalled', 'Choice') });
11
12
        say $out "Added system preference 'ConvertSelectedReservesToRecalls'";
13
    },
14
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 158-164 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
158
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
158
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
159
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
159
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
160
('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'),
160
('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'),
161
('ConvertSelectedReservesToRecalls', 'oldest', 'oldest|recallable', 'Choose whether the convert_reserves_to_recalls.pl cronjob should convert only the oldest reserve on the record to a recall, or one reserve for each item available to be recalled', 'Choice'),
161
('ConvertedSelectedHoldsToRecalls', 'oldest', 'oldest|recallable', 'Choose whether the convert_holds_to_recalls.pl cronjob should convert only the oldest hold on the record to a recall, or one hold for each item available to be recalled', 'Choice'),
162
('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'),
162
('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'),
163
('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'),
163
('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'),
164
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
164
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-5 / +5 lines)
Lines 1351-1363 Circulation: Link Here
1351
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1351
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1352
        -
1352
        -
1353
            - Automatically convert
1353
            - Automatically convert
1354
            - pref: ConvertSelectedReservesToRecalls
1354
            - pref: ConvertedSelectedHoldsToRecalls
1355
              default: oldest
1355
              default: oldest
1356
              choices:
1356
              choices:
1357
                  oldest: the oldest reserve placed on the record
1357
                  oldest: the oldest hold placed on the record
1358
                  recallable: one reserve for each item available to be recalled
1358
                  recallable: one hold for each item available to be recalled
1359
            - to a recall, once a specific number of reserves have been requested on the record.
1359
            - to a recall, once a specific number of holds have been requested on the record.
1360
            - <span class="hint">This system preference is used by the convert_reserves_to_recalls.pl cronjob.</span>
1360
            - <span class="hint">This system preference is used by the convert_holds_to_recalls.pl cronjob.</span>
1361
1361
1362
    SIP2:
1362
    SIP2:
1363
        -
1363
        -
(-)a/misc/cronjobs/recalls/convert_holds_to_recalls.pl (-6 / +5 lines)
Lines 46-56 This script converts holds to recalls when a record has a set minimum number of Link Here
46
46
47
If a record is found to have the specified minimum number of holds, the script will find the oldest hold and convert it to a recall, as long as it would be a legal recall.
47
If a record is found to have the specified minimum number of holds, the script will find the oldest hold and convert it to a recall, as long as it would be a legal recall.
48
48
49
This script uses the ConvertSelectedReservesToRecalls system preference.
49
This script uses the ConvertedSelectedHoldsToRecalls system preference.
50
50
51
When ConvertSelectedReservesToRecalls is set to 'oldest', this script will only convert the single oldest hold. Once converted, the script will move on to the next record, it will not continue to convert holds on this record.
51
When ConvertedSelectedHoldsToRecalls is set to 'oldest', this script will only convert the single oldest hold. Once converted, the script will move on to the next record, it will not continue to convert holds on this record.
52
52
53
When ConvertSelectedReservesToRecalls is set to 'recallable', this script will convert reserves one-by-one, oldest first, until all recallable items have been recalled.
53
When ConvertedSelectedHoldsToRecalls is set to 'recallable', this script will convert reserves one-by-one, oldest first, until all recallable items have been recalled.
54
54
55
  Options:
55
  Options:
56
    -v          verbose
56
    -v          verbose
Lines 99-105 foreach my $bib ( @bib_holds ) { Link Here
99
        # Get all holds on this biblio
99
        # Get all holds on this biblio
100
        my @holds = Koha::Holds->search({ biblionumber => $bib->{biblionumber} }, { order_by => { -asc => 'reservedate' } })->as_list;
100
        my @holds = Koha::Holds->search({ biblionumber => $bib->{biblionumber} }, { order_by => { -asc => 'reservedate' } })->as_list;
101
101
102
        if ( C4::Context->preference('ConvertSelectedReservesToRecalls') eq 'oldest' ) {
102
        if ( C4::Context->preference('ConvertedSelectedHoldsToRecalls') eq 'oldest' ) {
103
103
104
            my $hold_to_convert = $holds[0];
104
            my $hold_to_convert = $holds[0];
105
            my $itemnumber_to_allocate = can_convert( $hold_to_convert );
105
            my $itemnumber_to_allocate = can_convert( $hold_to_convert );
Lines 109-115 foreach my $bib ( @bib_holds ) { Link Here
109
                report( $hold_to_convert, ++$count );
109
                report( $hold_to_convert, ++$count );
110
            }
110
            }
111
111
112
        } elsif ( C4::Context->preference('ConvertSelectedReservesToRecalls') eq 'recallable' ) {
112
        } elsif ( C4::Context->preference('ConvertedSelectedHoldsToRecalls') eq 'recallable' ) {
113
113
114
            my $this_record_holds_converted = 0;
114
            my $this_record_holds_converted = 0;
115
115
116
- 

Return to bug 32776