http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10937
--- Comment #33 from M. Tompsett <[email protected]> --- Comment on attachment 28626 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28626 Bug 10937 - Option to hide and group itemtypes from advanced search Review of attachment 28626: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10937&attachment=28626) ----------------------------------------------------------------- ::: C4/Koha.pm @@ +278,5 @@ > > +=head2 GetItemTypesCategorized > + > +Returns item types but grouped by category if available. > +The categories must be part of Authorized Values (DOCTYPECAT) The perldoc on these new functions is lacking. @@ +320,5 @@ > +=head2 GetItemTypesByCategory > + > + $category = category filter > + > +Returns the itemtypes that are grouped into the category. The perldoc is valid, but horrible. ::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ +127,5 @@ > + [% END %] > + </select> > + (Options are defined as the authorized values for the DOCTYPECAT > category) > + </li> > + [% ELSE %] Can you explain why there is an IF/ELSE case? ::: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ +141,5 @@ > <legend>Limit to any of the > following:</legend> > <div class="row-fluid"> > [% FOREACH itemtypeloo IN > advsearchloo.code_loop %] > + [% IF > ((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR > (itemtypeloo.cat == 1) %] > + <div class="span3"><input > type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') %]-[% > itemtypeloo.number %]" name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% > ELSE %]limit[% END %]" value="[% IF ( itemtypeloo.cat == 1 ) %][% > itemtypeloo.code %][% ELSE %]mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code > %][% END %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% > itemtypeloo.number %]">[% UNLESS ( noItemTypeImages ) %][% IF ( > itemtypeloo.imageurl ) %]<img border="0" src="[% itemtypeloo.imageurl %]" > alt="[% itemtypeloo.description %]" />[% END %] [% END %] This be some ugly code. Improve readability, please. ::: koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt @@ +187,5 @@ > <table> > <tr> > [% FOREACH itemtypeloo IN advsearchloo.code_loop %] > + [% IF ((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) > OR (itemtypeloo.cat == 1) %] > + <td><input type="checkbox" id="[% itemtypeloo.ccl FILTER > remove(',') %]-[% itemtypeloo.number %]" name="[% IF ( itemtypeloo.cat == 1 ) > %]searchcat[% ELSE %]limit[% END %]" value="[% IF ( itemtypeloo.cat == 1 ) > %][% itemtypeloo.code %][% ELSE %]mc-[% itemtypeloo.ccl %]:[% > itemtypeloo.code %][% END %]"/><label for="[% itemtypeloo.ccl FILTER > remove(',') %]-[% itemtypeloo.number %]">[% UNLESS ( noItemTypeImages ) %][% > IF ( itemtypeloo.imageurl ) %]<img border="0" src="[% itemtypeloo.imageurl > %]" alt="[% itemtypeloo.description %]" />[% END %] [% END %] You should looking into Tool Template variables. This code is ugly to read. http://www.template-toolkit.org/docs/manual/Variables.html -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
