From 2351a79dcf59154b4974725df64883e457440e49 Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 24 Mar 2008 04:51:07 +0000 Subject: [PATCH] working on Hours of Operation git-svn-id: svn://svn.open-ils.org/ILS/branches/dojo-admin@9120 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/conify/global/actor/org_unit.html | 93 +++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/conify/global/actor/org_unit.html b/Open-ILS/web/conify/global/actor/org_unit.html index 27ca5bedad..c2f5adcf54 100644 --- a/Open-ILS/web/conify/global/actor/org_unit.html +++ b/Open-ILS/web/conify/global/actor/org_unit.html @@ -44,6 +44,7 @@ dojo.require('dojo.parser'); dojo.require('dojo.data.ItemFileWriteStore'); dojo.require('dijit.form.TextBox'); + dojo.require('dijit.form.TimeTextBox'); dojo.require('dijit.form.ValidationTextBox'); dojo.require('dijit.form.CheckBox'); dojo.require('dijit.form.FilteringSelect'); @@ -64,12 +65,40 @@ var ses = cookieManager.read('ses') || cgi.param('ses'); var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); - var current_ou; + var current_ou, current_ou_hoo; var virgin_ou_id = -1; var ou_type_store = new dojo.data.ItemFileWriteStore({ data : aout.toStoreData( globalOrgTypes ) }); var highlighter = {}; + + function hoo_load () { + // empty result not coming through ... + current_ou_hoo = new aouhoo().fromHash({id:ou_list_store.getValue( current_ou, 'id' )}); + current_ou_hoo.isnew(1); + + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aouhoo', + params : [ ses, ou_list_store.getValue( current_ou, 'id' ) ], + 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'); + var res = r.recv(); + if (res) { + if (res.content()) current_ou_hoo = res.content(); + } else { + 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++) { + window['dow_' + i + '_open'].setValue( current_ou_hoo['dow_' + i + '_open']() ); + window['dow_' + i + '_close'].setValue( current_ou_hoo['dow_' + i + '_close']() ); + } + } + }).send(); + } @@ -137,6 +166,8 @@ editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false ); + hoo_load(); + + + -- 2.11.0