From cb6c280c53c18ee8d25b71c8011dc9188ed3ccca Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Feb 2018 11:17:37 -0300 Subject: [PATCH] Bug 20157: Group search groups together We do not actually need 2 groups, the previous feature worked for both OPAC and STAFF interface. The only difference was the "show_in_pulldown" feature. Here we are going to REMOVE this feature for ergonomic reasons. We will already have 3 features and it will surcharge the interface to add another one. Moreover the feature will have to be applied at the OPAC (and so will add lot of JS checks to keep data consistent: only useful if ft_search_groups_opac is set). Moreover it is quite easy to remove entry from the dropdown list in JavaScript. If people was really using this feature, we will re-add it, just let us know. Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug_20157.perl | 3 +-- installer/data/mysql/updatedatabase.pl | 15 +++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_20157.perl b/installer/data/mysql/atomicupdate/bug_20157.perl index de87756934..351548663e 100644 --- a/installer/data/mysql/atomicupdate/bug_20157.perl +++ b/installer/data/mysql/atomicupdate/bug_20157.perl @@ -4,8 +4,7 @@ if( CheckVersion( $DBversion ) ) { if( !column_exists( 'library_groups', 'ft_search_groups_opac' ) ) { $dbh->do( "ALTER TABLE library_groups ADD COLUMN ft_search_groups_opac tinyint(1) NOT NULL DEFAULT 0 AFTER ft_hide_patron_info" ); $dbh->do( "ALTER TABLE library_groups ADD COLUMN ft_search_groups_staff tinyint(1) NOT NULL DEFAULT 0 AFTER ft_search_groups_opac" ); - $dbh->do( "UPDATE library_groups SET ft_search_groups_staff = 1 WHERE title = '__SEARCH_GROUPS__'" ); - $dbh->do( "UPDATE library_groups SET ft_search_groups_opac = 1 WHERE title = '__SEARCH_GROUPS_OPAC__'" ); + $dbh->do( "UPDATE library_groups SET ft_search_groups_staff = 1 AND ft_search_groups_opac = 1 WHERE title = '__SEARCH_GROUPS__'" ); } SetVersion( $DBversion ); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 484d4ff593..61fc8455d0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15250,14 +15250,9 @@ if ( CheckVersion($DBversion) ) { if ( TableExists( 'branchcategories' ) and TableExists('branchrelations' )) { $dbh->do(q{ - INSERT INTO library_groups ( title, description, created_on ) VALUES ( '__SEARCH_GROUPS__', 'Library search groups - Staff only', NOW() ) + INSERT INTO library_groups ( title, description, created_on ) VALUES ( '__SEARCH_GROUPS__', 'Library search groups', NOW() ) }); - my $search_groups_staff_root_id = $dbh->last_insert_id(undef, undef, 'library_groups', undef); - - $dbh->do(q{ - INSERT INTO library_groups ( title, description, created_on ) VALUE ( '__SEARCH_GROUPS_OPAC__', 'Library search groups - Staff only', NOW() ) - }); - my $search_groups_opac_root_id = $dbh->last_insert_id(undef, undef, 'library_groups', undef); + my $search_groups_root_id = $dbh->last_insert_id(undef, undef, 'library_groups', undef); my $sth = $dbh->prepare("SELECT * FROM branchcategories"); @@ -15272,11 +15267,7 @@ if ( CheckVersion($DBversion) ) { my $description = $lc->{categorycode}; $description .= " - " . $lc->{codedescription} if $lc->{codedescription}; - $sth2->execute( - $lc->{show_in_pulldown} ? $search_groups_opac_root_id : $search_groups_staff_root_id, - $lc->{categoryname}, - $description, - ); + $sth2->execute($search_groups_root_id, $lc->{categoryname}, $description); my $subgroup_id = $dbh->last_insert_id(undef, undef, 'library_groups', undef); -- 2.39.5