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

(-)a/C4/Circulation.pm (+23 lines)
Lines 1472-1477 sub AddIssue { Link Here
1472
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1472
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1473
1473
1474
            }
1474
            }
1475
1476
            # Check if we need to use an exact due date set by the ILL module
1477
            if ( C4::Context->preference('ILLUseExactDueDate') ) {
1478
                # Check if there is an ILL connected with the biblio of the item we are issuing
1479
                my $biblionumber = $item_object->biblionumber;
1480
                my @illrequests = Koha::Illrequests->search({ biblio_id => $biblionumber });
1481
                if ( @illrequests ) {
1482
                    # There could be more than one ILL request connected with a
1483
                    # given biblio, so we need to make sure we find the right one
1484
                    foreach my $req ( @illrequests ) {
1485
                        if ( $borrower->{ 'borrowernumber' } == $req->borrowernumber ) {
1486
                            # We found the right request, now get the proper attribute
1487
                            my $ill_date_string = $req->illrequestattributes->find({ type => C4::Context->preference('ILLUseExactDueDate') })->value;
1488
                            warn $ill_date_string;
1489
                            my $ill_dt = dt_from_string( $ill_date_string );
1490
                            $ill_dt->set_hour(23);
1491
                            $ill_dt->set_minute(59);
1492
                            $datedue = $ill_dt;
1493
                        }
1494
                    }
1495
                }
1496
            }
1497
1475
            $datedue->truncate( to => 'minute' );
1498
            $datedue->truncate( to => 'minute' );
1476
1499
1477
            my $patron = Koha::Patrons->find( $borrower );
1500
            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/mandatory/sysprefs.sql (+1 lines)
Lines 260-265 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
260
('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'),
260
('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'),
261
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
261
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
262
('ILLSendStaffNotices', NULL, NULL, 'Send these ILL notices to staff', 'multiple'),
262
('ILLSendStaffNotices', NULL, NULL, 'Send these ILL notices to staff', 'multiple'),
263
('ILLUseExactDueDate',NULL,NULL,'Use this ILL request attribute to set a specific due date when a document on ILL loan is issued.','multiple'),
263
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
264
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
264
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
265
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
265
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
266
('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 940-945 Circulation: Link Here
940
                  1: Enable
940
                  1: Enable
941
                  0: Disable
941
                  0: Disable
942
            - unmediated interlibrary loan requests. If enabled and the ILL backend supports it, the newly created requests are immediately requested by backend.
942
            - unmediated interlibrary loan requests. If enabled and the ILL backend supports it, the newly created requests are immediately requested by backend.
943
        -
944
            - Use the ILL request attribute
945
            - pref: ILLUseExactDueDate
946
            - to set an exact due date for an ILL loan, from the ILL module. Leave empty to calculate due dates the standard way.
943
        -
947
        -
944
            - pref: CirculateILL
948
            - pref: CirculateILL
945
              default: 0
949
              default: 0
946
- 

Return to bug 24239