From: miker Date: Tue, 25 Mar 2008 04:57:36 +0000 (+0000) Subject: full basic org unit config interface X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d87dd9c359ada55dd90000a8d9205c55a7f760ae;p=Evergreen.git full basic org unit config interface git-svn-id: svn://svn.open-ils.org/ILS/branches/dojo-admin@9134 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 68575814eb..cffb6da380 100644 --- a/Open-ILS/web/conify/global/actor/org_unit.html +++ b/Open-ILS/web/conify/global/actor/org_unit.html @@ -17,6 +17,14 @@ padding: 0px 0px 0px 0px; overflow: hidden; } + + th + { + text-align: right; + font-weight: bold; + padding-left: 20px; + padding-right: 5px; + } @@ -73,6 +81,34 @@ var highlighter = {}; + function save_org () { + var modified_ou = new aou().fromStoreItem( current_ou ); + modified_ou.ischanged( 1 ); + + new_kid_button.disabled = false; + save_ou_button.disabled = false; + delete_ou_button.disabled = false; + + pCRUD.request({ + method : 'open-ils.permacrud.update.aou', + timeout : 10, + params : [ ses, modified_ou ], + onerror : function (r) { + highlighter.editor_pane.red.play(); + throw 'Problem saving data for ' + ou_list_store.getValue( current_ou, 'name' ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + highlighter.editor_pane.green.play(); + } else { + highlighter.editor_pane.red.play(); + throw 'Problem saving data for ' + ou_list_store.getValue( current_ou, 'name' ); + } + }, + }).send(); + } + function hoo_load () { // empty result not coming through ... current_ou_hoo = new aouhoo().fromHash({id:ou_list_store.getValue( current_ou, 'id' )}); @@ -81,7 +117,6 @@ 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) { current_ou_hoo = null; @@ -114,6 +149,141 @@ }).send(); } + + function addr_load () { + // empty result not coming through ... + + save_ill_address.disabled = false; + save_holds_address.disabled = false; + save_mailing_address.disabled = false; + save_billing_address.disabled = false; + + if (ou_list_store.getValue( current_ou, 'billing_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'billing_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_billing_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_billing_address = res.content(); + } + + if (!current_billing_address) { + current_billing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_billing_address.isnew(1); + } + + set_addr_inputs('billing'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_billing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_billing_address.isnew(1); + set_addr_inputs('billing'); + } + + if (ou_list_store.getValue( current_ou, 'mailing_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'mailing_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_mailing_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_mailing_address = res.content(); + } + + if (!current_mailing_address) { + current_mailing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_mailing_address.isnew(1); + } + + set_addr_inputs('mailing'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_mailing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_mailing_address.isnew(1); + set_addr_inputs('mailing'); + } + + if (ou_list_store.getValue( current_ou, 'holds_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'holds_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_holds_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_holds_address = res.content(); + } + + if (!current_holds_address) { + current_holds_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_holds_address.isnew(1); + } + + set_addr_inputs('holds'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_holds_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_holds_address.isnew(1); + set_addr_inputs('holds'); + } + + if (ou_list_store.getValue( current_ou, 'ill_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'ill_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_ill_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_ill_address = res.content(); + } + + if (!current_ill_address) { + current_ill_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_ill_address.isnew(1); + } + + set_addr_inputs('ill'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_ill_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_ill_address.isnew(1); + set_addr_inputs('ill'); + } + + } + + function set_addr_inputs (type) { + window[type + '_addr_valid'].setChecked( window['current_' + type + '_address'].valid() == 't' ? true : false ); + window[type + '_addr_type'].setValue( window['current_' + type + '_address'].address_type() || '' ); + window[type + '_addr_street1'].setValue( window['current_' + type + '_address'].street1() || '' ); + window[type + '_addr_street2'].setValue( window['current_' + type + '_address'].street2() || '' ); + window[type + '_addr_city'].setValue( window['current_' + type + '_address'].city() || '' ); + window[type + '_addr_county'].setValue( window['current_' + type + '_address'].county() || '' ); + window[type + '_addr_country'].setValue( window['current_' + type + '_address'].country() || '' ); + window[type + '_addr_state'].setValue( window['current_' + type + '_address'].state() || '' ); + window[type + '_addr_post_code'].setValue( window['current_' + type + '_address'].post_code() || '' ); + } + @@ -149,13 +319,15 @@ @@ -192,329 +365,613 @@ -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Org Unit Name - - - -
Org Unit Policy Code - - - -
Main Email Address - - - -
Main Phone Number - - - -
Org Unit Type -
- -
-
Parent Org Unit -
- -
-
OPAC Visible - - - -
- -
- - + + + +
+ + + +
- - + +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Open timeClose time
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
- - -
- - -