Browse Source

Bug 29137: Add new syspref to disable AV creation within the cataloguing module

"I don't like this patch at all!"
"We will see a cataloger revolt if we do not find a way to make this
optional for catalogers."

I imagined a hord of catalogers running behind me and I got scared.

This patch will allow to turn the new feature added by bug 25728 off.

Test plan:
Confirm that the new CreateAVFromCataloguing will permit to turn the
feature off.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
21.05.x
Jonathan Druart 3 years ago
committed by Kyle Hall
parent
commit
4aaf9847c9
  1. 15
      installer/data/mysql/atomicupdate/bug_29137.pl
  2. 1
      installer/data/mysql/mandatory/sysprefs.sql
  3. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
  4. 6
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
  5. 6
      koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
  6. 6
      koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
  7. 2
      koha-tmpl/intranet-tmpl/prog/js/cataloging.js

15
installer/data/mysql/atomicupdate/bug_29137.pl

@ -0,0 +1,15 @@
use Modern::Perl;
return {
bug_number => "29137",
description => "Add system preference CreateAVFromCataloguing",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do( q{
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
VALUES ('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo')
});
},
}

1
installer/data/mysql/mandatory/sysprefs.sql

@ -142,6 +142,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('CollapseFieldsPatronAddForm','',NULL,'Collapse these fields by default when adding a new patron. These fields can still be expanded.','Multiple'),
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'),
('CurrencyFormat','US','US|FR|CH','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'),

8
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref

@ -35,6 +35,14 @@ Cataloging:
controlnumber: "control number"
biblionumber: "bibliographic record number"
- "in the file name."
-
- pref: CreateAVFromCataloguing
default: 1
choices:
1: "Allow"
0: "Don't allow"
- authorized values to be created within the cataloguing module. Librarien will need the manage_auth_values subpermission.
Spine labels:
-
- When using the quick spine label printer,

6
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt

@ -6,7 +6,11 @@
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.js("lib/hc-sticky.js") | $raw %]
<script>
var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]";
[% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
var auth_values_creation = 1;
[% ELSE %]
var auth_values_creation = 0;
[% END %]
</script>
[% INCLUDE 'select2.inc' %]
[% Asset.js("js/cataloging.js") | $raw %]

6
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt

@ -7,7 +7,11 @@
[% Asset.js("lib/hc-sticky.js") | $raw %]
[% INCLUDE 'select2.inc' %]
<script>
var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]";
[% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
var auth_values_creation = 1;
[% ELSE %]
var auth_values_creation = 0;
[% END %]
$.fn.select2.defaults.set("width", "100%" );
</script>
[% Asset.js("js/cataloging.js") | $raw %]

6
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt

@ -9,7 +9,11 @@
[% Asset.css("css/addbiblio.css") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script>
var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]";
[% IF Koha.Preference('CreateAVFromCataloguing') && CAN_user_parameters_manage_auth_values %]
var auth_values_creation = 1;
[% ELSE %]
var auth_values_creation = 0;
[% END %]
</script>
[% INCLUDE 'select2.inc' %]
[% Asset.js("js/cataloging.js") | $raw %]

2
koha-tmpl/intranet-tmpl/prog/js/cataloging.js

@ -89,7 +89,7 @@ var Select2Utils = {
initSelect2: function(selects) {
if ($.fn.select2) {
if ( window.CAN_user_parameters_manage_auth_values === undefined || ! CAN_user_parameters_manage_auth_values ) {
if ( window.auth_values_creation === undefined || ! auth_values_creation ) {
$(selects).select2().on("select2:clear", function () {
$(this).on("select2:opening.cancelOpen", function (evt) {
evt.preventDefault();

Loading…
Cancel
Save