From e6620aa936558dde12c90c09c66d6ee2d68934f9 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 8 Jan 2025 15:11:55 +0000 Subject: [PATCH] Bug 23010: Add system preference PreventWithdrawingItemsStatus --- ..._23010_add_PreventWithdrawingItemsStatus.pl | 18 ++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../modules/admin/preferences/circulation.pref | 7 +++++++ .../prog/js/cataloging_additem.js | 2 +- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_23010_add_PreventWithdrawingItemsStatus.pl diff --git a/installer/data/mysql/atomicupdate/bug_23010_add_PreventWithdrawingItemsStatus.pl b/installer/data/mysql/atomicupdate/bug_23010_add_PreventWithdrawingItemsStatus.pl new file mode 100755 index 00000000000..e9954661203 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23010_add_PreventWithdrawingItemsStatus.pl @@ -0,0 +1,18 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "23010", + description => "Add new PreventWithDrawingItemsStatus system preference", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) + VALUES ('PreventWithDrawingItemsStatus',NULL,'','Prevent the withdrawing of items based on statuses','Choice') + }); + + say $out "Added new system preference 'PreventWithDrawingItemsStatus'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index ede2d4d2755..61382705638 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -630,6 +630,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('PreservationNotForLoanDefaultTrainIn', '', '', 'Not for loan to apply to items removed from the preservation waiting list', 'TextArea'), ('PreservationNotForLoanWaitingListIn', '', '', 'Not for loan to apply to items added to the preservation waiting list', 'TextArea'), ('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'), +('PreventWithdrawingItemsStatus', '1', '', 'Prevent the withdrawing of items based on certain statuses' , 'multiple'), ('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'), ('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'), ('PrivacyPolicyConsent','','Enforced|Permissive|Disabled','Data privacy policy consent in the OPAC', 'Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 65cf0b5030f..6c7e93c1c8c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -677,6 +677,13 @@ Circulation: 1: Block 0: "Don't block" - returning of items that have been withdrawn. + - + - "Prevent the ability to withdraw items with the following statuses:" + - pref: PreventWithdrawingItemsStatus + multiple: + intransit: In-transit + checkedout: Checked out + - - - pref: BlockReturnOfLostItems choices: diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js index d4f28bbf841..cbaaea082df 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js @@ -4,7 +4,7 @@ var browser = KOHA.browser(searchid, parseInt(biblionumber, 10)); browser.show(); $(document).ready(function(){ - + $('#cataloguing_additem_newitem #f[action^="/cgi-bin/koha/cataloguing/additem.pl"]') // Remove the onclick event defined in browser.js, // otherwise the deletion confirmation will not work correctly $('a[href*="biblionumber="]').off('click'); -- 2.39.5