[OPEN-ILS-DEV] PATCH: copy_details.js

Brandon W. Uhlman brandon.uhlman at bclibrary.ca
Wed Mar 26 21:40:48 EDT 2008


This patch fixes a problem where the opac_visible flag on a copy stat  
cat (asset.stat_cat) is not respected in the OPAC. The opac_visible  
flag was not being checked in the cpdShowStats() function when the  
table with the stat cat details was being constructed. I've submitted  
this to BugZilla as bug #616.

This patch iterates through all the copy stat cats for a given copy,  
and sets a 'visibleStatCat' boolean flag and breaks if we find one  
that's OPAC visible.

If the flag is unset, and we are not in the staff client (isXUL() is  
false), we return just as we do if the stat cat list is empty or null.  
If one of these conditions is true, we iterate a second time through  
the list of stat cat entries, and append them to the display table if  
they are flagged as OPAC visible or we're in the staff client.

This patch may not be elegant, and judging by how long it took me to  
write this patch, my command of boolean logic is more tenuous than I  
imagined it. Someone else should eyeball this and test it before even  
*thinking* about committing it.

Cheers,

Brandon

Brandon W. Uhlman, Systems Consultant
Public Library Services Branch
Ministry of Education, Government of British Columbia

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Developer's Certificate of Origin 1.1 By making a contribution to
this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated
in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person
who certified (a), (b) or (c) and I have not modified it; and

(d) In the case of each of (a), (b), or (c), I understand and agree
that this project and the contribution are public and that a record
of the contribution (including all personal information I submit
with it, including my sign-off) is maintained indefinitely and may
be redistributed consistent with this project or the open source
license indicated in the file.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: opac_visible.patch
Type: text/x-c
Size: 1305 bytes
Desc: not available
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20080326/ffd2d7fd/opac_visible.bin


More information about the Open-ils-dev mailing list