From b01445782f61090409e7ef3cf6fa4b6fd38e5ac1 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 19 Jun 2017 10:05:37 +0000 Subject: [PATCH] Bug 18818: Display in quick add list now depends on a field in database This patch allows to manage the patron categories contained in 'Quick add new patron'. Test plan: 1) Apply patch 2) Update database structure : installer/data/mysql/updatedatabase.pl 3) Update DBIx shema : misc/devel/update_dbix_class_files.pl 4) Check in 'Administation > Patron categories' there is a field named "Display in Quick add patron" (and check everything is set to "Display") 5) Try to edit and check that the field exists and edits well the field 6) Go to 'Patrons > quick add patron' and check that the list contains only wished categories --- admin/categories.pl | 2 ++ .../bug_18818_quick_add_patron_category_list.sql | 1 + .../intranet-tmpl/prog/en/includes/patron-toolbar.inc | 6 +++++- .../intranet-tmpl/prog/en/modules/admin/categories.tt | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_18818_quick_add_patron_category_list.sql diff --git a/admin/categories.pl b/admin/categories.pl index 358ef7d..33556a3 100755 --- a/admin/categories.pl +++ b/admin/categories.pl @@ -92,6 +92,7 @@ elsif ( $op eq 'add_validate' ) { my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions'); my $checkPrevCheckout = $input->param('checkprevcheckout'); my $default_privacy = $input->param('default_privacy'); + my $quick_add_display = $input->param('quick_add_display'); my @branches = grep { $_ ne q{} } $input->multi_param('branches'); my $is_a_modif = $input->param("is_a_modif"); @@ -121,6 +122,7 @@ elsif ( $op eq 'add_validate' ) { $category->category_type($category_type); $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions); $category->checkprevcheckout($checkPrevCheckout); + $category->quick_add_display($quick_add_display); $category->default_privacy($default_privacy); eval { $category->store; diff --git a/installer/data/mysql/atomicupdate/bug_18818_quick_add_patron_category_list.sql b/installer/data/mysql/atomicupdate/bug_18818_quick_add_patron_category_list.sql new file mode 100644 index 0000000..35a82a4 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18818_quick_add_patron_category_list.sql @@ -0,0 +1 @@ +ALTER TABLE categories ADD quick_add_display integer DEFAULT 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc index c57910b..270a763 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc @@ -14,7 +14,11 @@
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt index f7103ab..77c1a86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt @@ -210,6 +210,13 @@ [% END %]
  • + + +
  • +