From: miker Date: Mon, 24 Mar 2008 20:33:59 +0000 (+0000) Subject: successfully editing org units and hours of operation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cea7306b1fa69dc6225b0dcbac414002b8e5f01f;p=Evergreen.git successfully editing org units and hours of operation git-svn-id: svn://svn.open-ils.org/ILS/branches/dojo-admin@9128 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/conify/global/actor/org_unit.html b/Open-ILS/web/conify/global/actor/org_unit.html index c2f5adcf54..68575814eb 100644 --- a/Open-ILS/web/conify/global/actor/org_unit.html +++ b/Open-ILS/web/conify/global/actor/org_unit.html @@ -43,6 +43,7 @@ dojo.require('conify.fieldmapper.addFromStoreItem', true); dojo.require('dojo.parser'); dojo.require('dojo.data.ItemFileWriteStore'); + dojo.require('dojo.date.stamp'); dojo.require('dijit.form.TextBox'); dojo.require('dijit.form.TimeTextBox'); dojo.require('dijit.form.ValidationTextBox'); @@ -83,21 +84,35 @@ timeout : 1, onerror : function (r) { throw 'Problem fetching hours of operation for ' + ou_list_store.getValue( current_ou, 'name' );}, oncomplete : function (r) { - alert('back from hoo call'); + current_ou_hoo = null; + var res = r.recv(); if (res) { if (res.content()) current_ou_hoo = res.content(); - } else { + } + + if (!current_ou_hoo) { current_ou_hoo = new aouhoo().fromHash({id:ou_list_store.getValue( current_ou, 'id' )}); current_ou_hoo.isnew(1); + for (var i = 0; i < 7; i++) { + current_ou_hoo['dow_' + i + '_open']('09:00:00'); + current_ou_hoo['dow_' + i + '_close']('17:00:00'); + } } for (var i = 0; i < 7; i++) { - window['dow_' + i + '_open'].setValue( current_ou_hoo['dow_' + i + '_open']() ); - window['dow_' + i + '_close'].setValue( current_ou_hoo['dow_' + i + '_close']() ); + window['dow_' + i + '_open'].setValue( + dojo.date.stamp.fromISOString( 'T' + current_ou_hoo['dow_' + i + '_open']() ) + ); + window['dow_' + i + '_close'].setValue( + dojo.date.stamp.fromISOString( 'T' + current_ou_hoo['dow_' + i + '_close']() ) + ); } + + highlighter.hoo_pane.green.play(); } }).send(); + } @@ -182,8 +197,11 @@
@@ -435,32 +453,32 @@
- - + + - - + + - - + + - - + + - - + + - - + + - - + +
Open timeClose time
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday