LP#1705524 Closed dates editor handles no timezones
authorBill Erickson <berickxx@gmail.com>
Thu, 3 Aug 2017 15:35:31 +0000 (11:35 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 11 Aug 2017 19:09:27 +0000 (15:09 -0400)
Fix issue in closed dates editor where it failed creating new closed
dates when an org unit had no value applied for the lib.timezone org
unit setting.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/xul/staff_client/server/admin/closed_dates.js

index c9815d0..94e94e7 100644 (file)
@@ -203,7 +203,11 @@ function cdGetTZ(org, callback) {
                 var data = r.recv().content();
                 if(e = openils.Event.parse(data))
                     return alert(e);
-                orgTZ[org] = data['lib.timezone'].value || OpenSRF.tz;
+                if (data['lib.timezone'] && data['lib.timezone'].value) {
+                    orgTZ[org] = data['lib.timezone'].value;
+                } else {
+                    orgTZ[org] = OpenSRF.tz;
+                }
                 if (callback) callback();
             }
         }