In our "Authorized values" > "Damaged", we have added a term "Normal wear" to the Koha defaults 0, 1 and 2: 0 Not damaged Not damaged 1 Damaged Some damage noted 2 Unknown Condition not stated 3 Normal wear Normal wear However, in both staff interface and OPAC, "normal wear" items are appearing as damaged I assume (maybe incorrectly) that the value of "damaged" is read by detail.pl starting line 196: if ($item->{damaged}) { $item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged; } and then passed to detail.tt start line 310: [% IF ( itemloo.damaged ) %] [% IF ( itemloo.itemdamagedloop ) %] [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %] [% IF ( itemdamagedloo.selected ) %] <span class="dmg">[% itemdamagedloo.lib %]</span> [% END %] [% END %] [% ELSE %] <span class="dmg">Damaged</span> [% END %] [% END %] I have no experience with this type of 'loo' and 'loop' coding, but it seems to me that "normal wear" is not being picked up, and therefore the ELSE default "Damaged" is being used. Could some kind person please point me to the logic of these loops? Either a brief explanation here (preferred) or a pointer to a tutorial (I have googled with no success.) Or is there something more intrinsic|relevant to the use of authorized values for "damaged"? Bugs [3637] and 5797 may be germane. Many thanks, Paul --- Maritime heritage and history, preservation and conservation, research and education through the written word and the arts. <http://UltraMarine.ca>, <http://AandC.org> and <http://MarDoc.ca>
Paul schreef op wo 08-02-2012 om 14:37 [-0500]:
0 Not damaged Not damaged 3 Normal wear Normal wear
However, in both staff interface and OPAC, "normal wear" items are appearing as damaged
I assume (maybe incorrectly) that the value of "damaged" is read by detail.pl starting line 196:
if ($item->{damaged}) {
So the nutshell version of what's going on: The Perl line above says essentially "if the damaged value != 0, then..." So by having "normal wear" at 3, it thinks its damaged. My suggestion to change this would perhaps to be to change that line so that it's if ($item->{damaged} > 0) { and then you could set 'normal wear' to -1 and it wouldn't show as damaged. -- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
Happy New Year to all, Finally made 3.8.5 public at <http://opac.navalmarinearchive.com> but have not really "published the news" yet. One glitch that I would really like to re-address is the "damaged" values. Problem: example at <http://opac.navalmarinearchive.com/cgi-bin/koha/opac-search.pl?q=Whaling+and+old+Salem> -- red label "Reference only: Damaged (1)" when the book is "Normal wear", but "Normal wear" is properly shown in the item's "MARC detail." In 3.6.x (with Robin Sheat's kind assistance, see below) we successfully used additional auth values of "damaged" 2 Unknown Condition not stated 1 Damaged Some damage noted 0 Not damaged Not damaged -1 Used book Used book -2 Normal wear Normal wear but in 3.8 the "fix" is no longer functional. In 3.6 it was a fairly trivial change to detail.pl 'if ($item->{damaged})' using >0 -- but a grep in 3.8.4/5 shows that this phrase has disappeared (and I've spent some time looking for "damaged" across Perl, xslt, inc, tt, etc. with no luck.) Could some kind soul please suggest where I start looking for a solution? Thanks in advance and best regards, Paul At 11:08 AM 2/9/2012 +1300, Robin Sheat wrote:
Paul schreef op wo 08-02-2012 om 14:37 [-0500]:
I assume (maybe incorrectly) that the value of "damaged" is read by detail.pl starting line 196:
if ($item->{damaged}) {
So the nutshell version of what's going on:
The Perl line above says essentially "if the damaged value != 0, then..."
So by having "normal wear" at 3, it thinks its damaged. My suggestion to change this would perhaps to be to change that line so that it's
if ($item->{damaged} > 0) {
and then you could set 'normal wear' to -1 and it wouldn't show as damaged.
-- Robin Sheat Catalyst IT Ltd. â +64 4 803 2204 GPG: 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
--- Maritime heritage and history, preservation and conservation, research and education through the written word and the arts. <http://NavalMarineArchive.com> and <http://UltraMarine.ca>
participants (2)
-
Paul -
Robin Sheat