}
function get_bool(a) {
- // Normal javascript interpretation except 'f' == false, per postgres, and 'F' == false
- // So false includes 'f', '', 0, null, and undefined
+ // Normal javascript interpretation except 'f' == false, per postgres, and 'F' == false, and '0' == false (newer JSON is returning '0' instead of 0 in cases)
+ // So false includes 'f', '', '0', 0, null, and undefined
if (a == 'f') return false;
if (a == 'F') return false;
+ if (a == '0') return false;
if (a) return true; else return false;
}
$n(row, 'sc_edit').onclick = function(){ scEdit(tbody, type, cat); };
$n(row, 'sc_owning_lib').appendChild( text( findOrgUnit(cat.owner()).name() ));
- if( cat.opac_visible() ) unHideMe($n(row, 'sc_opac_visible'));
+ if( cat.opac_visible() != 0 && cat.opac_visible() != '0' ) unHideMe($n(row, 'sc_opac_visible'));
else unHideMe($n(row, 'sc_opac_invisible'));
tbody.appendChild(row);
name.focus();
name.select();
- if( cat.opac_visible() ) {
+ if( cat.opac_visible() != 0 && cat.opac_visible() != '0' ) {
$n( $n(row, 'sc_edit_opac_vis'),
'sc_edit_opac_visibility').checked = true;
} else {
if(!name) return false;
var isvisible = false;
- if( cat.opac_visible() ) isvisible = true;
+ if( cat.opac_visible() != 0 && cat.opac_visible() != '0' ) isvisible = true;
if( (name == cat.name()) && (visible == isvisible)
&& (newlib == cat.owner()) ) { return true; }
sp.appendChild(actsc_node);
actsc_node.hidden = false;
apply(actsc_node,'name',my_actsc[i].name());
- if (my_actsc[i].opac_visible()) {
+ if (get_bool(my_actsc[i].opac_visible())) {
apply(actsc_node, 'opac', $("patronStrings").getString('staff.patron.info_stat_cats.render_stat_cats.opac_visible'));
} else {
apply(actsc_node, 'opac', $("patronStrings").getString('staff.patron.info_stat_cats.render_stat_cats.not_opac_visible'));
actsc_node.hidden = false;
apply(actsc_node,'name',sc.name());
- if (sc.opac_visible()) {
+ if (get_bool(sc.opac_visible())) {
apply(actsc_node, 'opac', $("patronStrings").getString('staff.patron.info_stat_cats.render_stat_cats.opac_visible'));
} else {
apply(actsc_node, 'opac', $("patronStrings").getString('staff.patron.info_stat_cats.render_stat_cats.not_opac_visible'));