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

(-)a/C4/Circulation.pm (+23 lines)
Lines 1362-1367 sub AddIssue { Link Here
1362
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1362
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1363
1363
1364
            }
1364
            }
1365
1366
            # Check if we need to use an exact due date set by the ILL module
1367
            if ( C4::Context->preference('ILLUseExactDueDate') ) {
1368
                # Check if there is an ILL connected with the biblio of the item we are issuing
1369
                my $biblionumber = $item_object->biblionumber;
1370
                my @illrequests = Koha::Illrequests->search({ biblio_id => $biblionumber });
1371
                if ( @illrequests ) {
1372
                    # There could be more than one ILL request connected with a
1373
                    # given biblio, so we need to make sure we find the right one
1374
                    foreach my $req ( @illrequests ) {
1375
                        if ( $borrower->{ 'borrowernumber' } == $req->borrowernumber ) {
1376
                            # We found the right request, now get the proper attribute
1377
                            my $ill_date_string = $req->illrequestattributes->find({ type => C4::Context->preference('ILLUseExactDueDate') })->value;
1378
                            warn $ill_date_string;
1379
                            my $ill_dt = dt_from_string( $ill_date_string );
1380
                            $ill_dt->set_hour(23);
1381
                            $ill_dt->set_minute(59);
1382
                            $datedue = $ill_dt;
1383
                        }
1384
                    }
1385
                }
1386
            }
1387
1365
            $datedue->truncate( to => 'minute' );
1388
            $datedue->truncate( to => 'minute' );
1366
1389
1367
            my $patron = Koha::Patrons->find( $borrower );
1390
            my $patron = Koha::Patrons->find( $borrower );
(-)a/installer/data/mysql/atomicupdate/bug24239-ad-hoc-due-date-for-ill.perl (+10 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
        $dbh->do( q{
4
            INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
5
            VALUES ('ILLUseExactDueDate',NULL,NULL,'Use this ILL request attribute to set a specific due date when a document on ILL loan is issued.','multiple')
6
    });
7
8
    SetVersion( $DBversion );
9
    print "Upgrade to $DBversion done (Bug 24239 - Let the ILL module set ad hoc hard due dates)\n";
10
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 239-244 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
239
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
239
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
240
('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'),
240
('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'),
241
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
241
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
242
('ILLUseExactDueDate',NULL,NULL,'Use this ILL request attribute to set a specific due date when a document on ILL loan is issued.','multiple'),
242
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
243
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
243
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
244
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
244
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
245
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +4 lines)
Lines 881-886 Circulation: Link Here
881
                  no: Disable
881
                  no: Disable
882
            - unmediated Interlibrary loan requests. If enabled and the ILL backend supports it, the newly created requests are immediately requested by backend.
882
            - unmediated Interlibrary loan requests. If enabled and the ILL backend supports it, the newly created requests are immediately requested by backend.
883
        -
883
        -
884
            - Use the ILL request attribute
885
            - pref: ILLUseExactDueDate
886
            - to set an exact due date for an ILL loan, from the ILL module. Leave empty to calculate due dates the standard way.
887
        -
884
            - pref: CirculateILL
888
            - pref: CirculateILL
885
              default: 0
889
              default: 0
886
              choices:
890
              choices:
887
- 

Return to bug 24239