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

(-)a/C4/Circulation.pm (+24 lines)
Lines 46-51 use Koha::Biblioitems; Link Here
46
use Koha::DateUtils;
46
use Koha::DateUtils;
47
use Koha::Calendar;
47
use Koha::Calendar;
48
use Koha::Checkouts;
48
use Koha::Checkouts;
49
use Koha::Illrequests;
49
use Koha::IssuingRules;
50
use Koha::IssuingRules;
50
use Koha::Items;
51
use Koha::Items;
51
use Koha::Patrons;
52
use Koha::Patrons;
Lines 1352-1357 sub AddIssue { Link Here
1352
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1353
                $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower );
1353
1354
1354
            }
1355
            }
1356
1357
            # Check if we need to use an exact due date set by the ILL module
1358
            if ( C4::Context->preference('ILLUseExactDueDate') ) {
1359
                # Check if there is an ILL connected with the biblio of the item we are issuing
1360
                my $biblionumber = $item_object->biblionumber;
1361
                my @illrequests = Koha::Illrequests->search({ biblio_id => $biblionumber });
1362
                if ( @illrequests ) {
1363
                    # There could be more than one ILL request connected with a
1364
                    # given biblio, so we need to make sure we find the right one
1365
                    foreach my $req ( @illrequests ) {
1366
                        if ( $borrower->{ 'borrowernumber' } == $req->borrowernumber ) {
1367
                            # We found the right request, now get the proper attribute
1368
                            my $ill_date_string = $req->illrequestattributes->find({ type => C4::Context->preference('ILLUseExactDueDate') })->value;
1369
                            warn $ill_date_string;
1370
                            my $ill_dt = dt_from_string( $ill_date_string );
1371
                            $ill_dt->set_hour(23);
1372
                            $ill_dt->set_minute(59);
1373
                            $datedue = $ill_dt;
1374
                        }
1375
                    }
1376
                }
1377
            }
1378
1355
            $datedue->truncate( to => 'minute' );
1379
            $datedue->truncate( to => 'minute' );
1356
1380
1357
            my $patron = Koha::Patrons->find( $borrower );
1381
            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 233-238 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
233
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
233
('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'),
234
('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'),
234
('ILLModuleUnmediated','0','','If enabled, try to immediately progress newly placed ILL requests.','YesNo'),
235
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
235
('ILLOpacbackends',NULL,NULL,'ILL backends to enabled for OPAC initiated requests','multiple'),
236
('ILLUseExactDueDate',NULL,NULL,'Use this ILL request attribute to set a specific due date when a document on ILL loan is issued.','multiple'),
236
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
237
('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'),
237
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
238
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'),
238
('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),
239
('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 832-837 Circulation: Link Here
832
                  yes: Enable
832
                  yes: Enable
833
                  no: Disable
833
                  no: Disable
834
            - unmediated Interlibrary loan requests. If enabled and the ILL backend supports it, the newly created requests are immediately requested by backend.
834
            - unmediated Interlibrary loan requests. If enabled and the ILL backend supports it, the newly created requests are immediately requested by backend.
835
        -
836
            - Use the ILL request attribute
837
            - pref: ILLUseExactDueDate
838
            - to set an exact due date for an ILL loan, from the ILL module. Leave empty to calculate due dates the standard way.
835
    Fines Policy:
839
    Fines Policy:
836
        -
840
        -
837
            - Calculate fines based on days overdue
841
            - Calculate fines based on days overdue
838
- 

Return to bug 24239