[Koha-bugs] [Bug 10937] Option to hide and group itemtypes from advanced search
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Jun 3 01:03:09 CEST 2014
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10937
--- Comment #33 from M. Tompsett <mtompset at hotmail.com> ---
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.
More information about the Koha-bugs
mailing list