From 7c731050337afdcc509cdfb39fa31ed537b495ab Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Sun, 24 Mar 2019 22:56:06 -0300 Subject: [PATCH] Bug 22284: Add new checkbox in Library Groups This patch adds a new checkbox option 'Is local hold group' when you create a new root group. To test: 1) In intranet go to Library Groups in admin module 2) Add new root group 3) Check that there is no 'Is local hold group' checkbox 4) Apply this patch 5) Add new root group SUCCESS => a new 'Is local hold group' checkbox appears 6) Select 'Is local hold group' and save 7) Click edit button for root group SUCCESS => 'Is local hold group' is checked 8) Sign off Sponsored-by: VOKAL Signed-off-by: Josef Moravec Signed-off-by: Liz Rea Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- admin/library_groups.pl | 4 +++ .../prog/en/modules/admin/library_groups.tt | 25 ++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/admin/library_groups.pl b/admin/library_groups.pl index 4c5ce25b4e..f8b2574cda 100755 --- a/admin/library_groups.pl +++ b/admin/library_groups.pl @@ -50,6 +50,7 @@ if ( $action eq 'add' ) { my $ft_hide_patron_info = $cgi->param('ft_hide_patron_info') || 0; my $ft_search_groups_opac = $cgi->param('ft_search_groups_opac') || 0; my $ft_search_groups_staff = $cgi->param('ft_search_groups_staff') || 0; + my $ft_local_hold_group = $cgi->param('ft_local_hold_group') || 0; if ( !$branchcode && Koha::Library::Groups->search( { title => $title } )->count() ) { $template->param( error_duplicate_title => $title ); @@ -63,6 +64,7 @@ if ( $action eq 'add' ) { ft_hide_patron_info => $ft_hide_patron_info, ft_search_groups_opac => $ft_search_groups_opac, ft_search_groups_staff => $ft_search_groups_staff, + ft_local_hold_group => $ft_local_hold_group, branchcode => $branchcode, } )->store(); @@ -77,6 +79,7 @@ elsif ( $action eq 'edit' ) { my $ft_hide_patron_info = $cgi->param('ft_hide_patron_info') || 0; my $ft_search_groups_opac = $cgi->param('ft_search_groups_opac') || 0; my $ft_search_groups_staff = $cgi->param('ft_search_groups_staff') || 0; + my $ft_local_hold_group = $cgi->param('ft_local_hold_group') || 0; if ($id) { my $group = Koha::Library::Groups->find($id); @@ -88,6 +91,7 @@ elsif ( $action eq 'edit' ) { ft_hide_patron_info => $ft_hide_patron_info, ft_search_groups_opac => $ft_search_groups_opac, ft_search_groups_staff => $ft_search_groups_staff, + ft_local_hold_group => $ft_local_hold_group, } )->store(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt index d8981cf1fe..c4d1a83813 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt @@ -121,6 +121,12 @@ Use for staff search groups

+

+ +

@@ -178,6 +184,12 @@ Use for staff search groups

+

+ +

@@ -257,7 +269,8 @@ var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info'); var ft_search_groups_opac = $(this).data('groupFt_search_groups_opac'); var ft_search_groups_staff = $(this).data('groupFt_search_groups_staff'); - edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ); + var ft_local_hold_group = $(this).data('groupFt_local_hold_group'); + edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group ); }); $('.delete-group').on('click', function(e) { @@ -292,6 +305,7 @@ $('#add-group-modal-ft_hide_patron_info').prop('checked', false); $('#add-group-modal-ft_search_groups_opac').prop('checked', false); $('#add-group-modal-ft_search_groups_staff').prop('checked', false); + $('#add-group-modal-ft_local_hold_group').prop('checked', false); if ( parent_id ) { $('#root-group-features-add').hide(); } else { @@ -301,7 +315,7 @@ } - function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ) { + function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group ) { $('#edit-group-modal-id').val( id ); $('#edit-group-modal-title').val( title ); $('#edit-group-modal-description').val( description ); @@ -310,11 +324,13 @@ $('#edit-group-modal-ft_hide_patron_info').prop('checked', false); $('#edit-group-modal-ft_search_groups_opac').prop('checked', false); $('#edit-group-modal-ft_search_groups_staff').prop('checked', false); + $('#edit-group-modal-ft_local_hold_group').prop('checked', false); $('#root-group-features-edit').hide(); } else { $('#edit-group-modal-ft_hide_patron_info').prop('checked', ft_hide_patron_info ? true : false ); $('#edit-group-modal-ft_search_groups_opac').prop('checked', ft_search_groups_opac ? true : false ); $('#edit-group-modal-ft_search_groups_staff').prop('checked', ft_search_groups_staff ? true : false ); + $('#edit-group-modal-ft_local_hold_group').prop('checked', ft_local_hold_group ? true : false ); $('#root-group-features-edit').show(); } @@ -367,6 +383,9 @@ [% IF group.ft_search_groups_staff %]
  • Use for staff search groups
  • [% END %] + [% IF group.ft_local_hold_group %] +
  • Is local hold group
  • + [% END %] [% END %] @@ -384,7 +403,7 @@
  • - + Edit
  • -- 2.39.5