[open-ils-commits] r13359 - in trunk/Open-ILS/xul/staff_client: chrome/content/OpenILS server/admin server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jun 10 06:09:25 EDT 2009
Author: phasefx
Date: 2009-06-10 06:09:21 -0400 (Wed, 10 Jun 2009)
New Revision: 13359
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
trunk/Open-ILS/xul/staff_client/server/patron/info_stat_cats.xul
Log:
fix OPAC visible cosmetic bug for stat cats in staff client. Bitten again by JSON returning '0' instead of 0
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2009-06-10 09:39:29 UTC (rev 13358)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2009-06-10 10:09:21 UTC (rev 13359)
@@ -168,10 +168,11 @@
}
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;
}
Modified: trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js 2009-06-10 09:39:29 UTC (rev 13358)
+++ trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js 2009-06-10 10:09:21 UTC (rev 13359)
@@ -158,7 +158,7 @@
$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);
@@ -324,7 +324,7 @@
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 {
@@ -359,7 +359,7 @@
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; }
Modified: trunk/Open-ILS/xul/staff_client/server/patron/info_stat_cats.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/info_stat_cats.xul 2009-06-10 09:39:29 UTC (rev 13358)
+++ trunk/Open-ILS/xul/staff_client/server/patron/info_stat_cats.xul 2009-06-10 10:09:21 UTC (rev 13359)
@@ -107,7 +107,7 @@
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'));
@@ -146,7 +146,7 @@
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'));
More information about the open-ils-commits
mailing list