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 <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-02-09 11:17:37 -03:00
parent e7aa94b782
commit cb6c280c53
2 changed files with 4 additions and 14 deletions

View File

@ -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 );

View File

@ -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);