@@ -, +, @@ - C4/Koha.pm : include the non-NULL but empty category in the selection - admin/authorised_values.pl : Added the DOCTYPECAT as default. Seemed the cleanest solution. - installer/data/mysql/kohastructure.sql : cleaned the unwelcomed whitespaces. - koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt : fixed typo and added instruction message - koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt : minimized the diff by redoing the code. a) In Intranet/Koha Admin/Authorized values, select DOCTYPECAT in the category dropdown b) Click button "New authorized value for DOCTYPECAT" c) Enter Authorized value: HARDWARE Description : Hardware Description (OPAC): Hardware a) In Intranet/Koha Admin/Item types, choose (at least) two item types and for each: - Click action/Edit on the right column - Third row (below Description) is the Search category list box, select Hardware - click Save changes at the bottom a) In Intranet/Koha Admin/Item types (again), choose a different item type: - Click action/Edit - Click the checkbox "Hide in OPAC" below the list of icons. a) Go to OPAC/Adv search. b) Validate that all items modified above (hidden or grouped) do not appear in Item type list c) Validate that new item type Hardware does appear instead. d) Select item Hardware, start Search. e) Validate returned items are the of the two types that were grouped into the Hardware category in step 4. --- C4/Koha.pm | 5 ++--- admin/authorised_values.pl | 2 +- installer/data/mysql/kohastructure.sql | 23 ++++++++++---------- .../prog/en/modules/admin/itemtypes.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 20 ++++++----------- 5 files changed, 24 insertions(+), 30 deletions(-) --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -274,12 +274,11 @@ sub GetItemTypes { sub GetItemTypesCategorized { my $dbh = C4::Context->dbh; my $query = qq| - SELECT itemtype, description, imageurl, hideinopac, 0 as 'iscat' FROM itemtypes WHERE ISNULL(searchcategory) + SELECT itemtype, description, imageurl, hideinopac, 0 as 'iscat' FROM itemtypes WHERE ISNULL(searchcategory) or length(searchcategory) = 0 UNION SELECT DISTINCT searchcategory AS `itemtype`, authorised_values.lib_opac AS description, authorised_values.imageurl AS imageurl, hideinopac, 1 as 'iscat' FROM itemtypes - LEFT JOIN authorised_values ON searchcategory = authorised_value - WHERE searchcategory > '' + LEFT JOIN authorised_values ON searchcategory = authorised_value WHERE searchcategory > '' |; my $sth = $dbh->prepare($query); $sth->execute; --- a/admin/authorised_values.pl +++ a/admin/authorised_values.pl @@ -247,7 +247,7 @@ sub default_form { } # push koha system categories - foreach (qw(Asort1 Asort2 Bsort1 Bsort2 SUGGEST DAMAGED LOST REPORT_GROUP REPORT_SUBGROUP DEPARTMENT TERM SUGGEST_STATUS)) { + foreach (qw(Asort1 Asort2 Bsort1 Bsort2 SUGGEST DAMAGED LOST REPORT_GROUP REPORT_SUBGROUP DEPARTMENT TERM SUGGEST_STATUS DOCTYPECAT)) { push @category_list, $_ unless $categories{$_}; } --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2,7 +2,7 @@ -- -- Host: localhost Database: koha30test -- ------------------------------------------------------ --- Server version 4.1.22 +-- Server version 4.1.22 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -2111,10 +2111,10 @@ CREATE TABLE `suggestions` ( -- purchase suggestions branchcode VARCHAR(10) default NULL, -- foreign key linking the suggested branch to the branches table collectiontitle text default NULL, -- collection name for the suggested item itemtype VARCHAR(30) default NULL, -- suggested item type - quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased - currency VARCHAR(3) default NULL, -- suggested currency for the suggested price - price DECIMAL(28,6) default NULL, -- suggested price - total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency) + quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased + currency VARCHAR(3) default NULL, -- suggested currency for the suggested price + price DECIMAL(28,6) default NULL, -- suggested price + total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency) PRIMARY KEY (`suggestionid`), KEY `suggestedby` (`suggestedby`), KEY `managedby` (`managedby`) @@ -2412,12 +2412,12 @@ CREATE TABLE `permissions` ( DROP TABLE IF EXISTS `serialitems`; CREATE TABLE `serialitems` ( - `itemnumber` int(11) NOT NULL, - `serialid` int(11) NOT NULL, - UNIQUE KEY `serialitemsidx` (`itemnumber`), - KEY `serialitems_sfk_1` (`serialid`), - CONSTRAINT `serialitems_sfk_1` FOREIGN KEY (`serialid`) REFERENCES `serial` (`serialid`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `serialitems_sfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE + `itemnumber` int(11) NOT NULL, + `serialid` int(11) NOT NULL, + UNIQUE KEY `serialitemsidx` (`itemnumber`), + KEY `serialitems_sfk_1` (`serialid`), + CONSTRAINT `serialitems_sfk_1` FOREIGN KEY (`serialid`) REFERENCES `serial` (`serialid`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `serialitems_sfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- @@ -3286,3 +3286,4 @@ ALTER TABLE `patron_list_patrons` /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -177,6 +177,7 @@ Item types administration [% END %] [% END %] + (Options are defined as the authorized values for the DOCTYPECAT category) [% ELSE %] Search category @@ -252,10 +253,9 @@ Item types administration [% ELSE %] [% END %] - (if checked, items of this type will be hidden as filters in OPAC's Advanded Search) + (if checked, items of this type will be hidden as filters in OPAC's advanced search)
  • - [% IF ( notforloan ) %] [% ELSE %] --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt @@ -186,20 +186,14 @@
    Limit to any of the following: - [% count = 0 %] - [% FOREACH itemtype IN advsearchloo.code_loop %] - [% IF ((!itemtype.searchcategory) AND (itemtype.cat == 0)) OR (itemtype.cat == 1) %] - [% count = (count + 1) %] - + + [% FOREACH itemtypeloo IN advsearchloo.code_loop %] + [% IF ((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1) %] + [% END %] - [% IF ( loop.last ) %] - [% ELSE %][% UNLESS ( count % 5 ) %][% END %] - [% END %] - [% END %] + [% IF ( loop.last ) %][% ELSE %][% UNLESS ( loop.count % 5 ) %][% END %][% END %] + [% END %]
    - - -
    --