2 # Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc
3 # Mike Rylander <miker@esilibrary.com>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
16 "-//W3C//DTD XHTML 1.0 Transitional//EN"
17 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
18 <!--#include virtual="/opac/locale/${locale}/conify.dtd"-->
20 <html xmlns="http://www.w3.org/1999/xhtml">
22 <title>&conify.org_unit.title;</title>
24 <style type="text/css">
25 @import url('/js/dojo/dojo/resources/dojo.css');
26 @import url('/js/dojo/dijit/themes/tundra/tundra.css');
27 @import url('/js/dojo/dojox/widget/Toaster/Toaster.css');
35 margin: 0px 0px 0px 0px;
36 padding: 0px 0px 0px 0px;
49 <!-- The OpenSRF API writ JS -->
50 <script language='javascript' src='/opac/common/js/utils.js' type='text/javascript'></script>
51 <script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
52 <script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
53 <script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
55 <!-- Dojo goodness -->
56 <script type="text/javascript" src="../admin.js"></script>
58 <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
59 <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
61 <script type="text/javascript" src="org_unit.js"></script>
65 <body class="tundra" id='pagebody'>
67 <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
69 <div dojoType="dijit.layout.ContentPane" sizeShare="100">
70 <script type="dojo/method">
73 pcrud.retrieveAll( 'aou', {
74 timeout : 10, order_by : { aou : 'shortname' },
75 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_ORGS); },
76 oncomplete : function (r) {
77 var _ou_list = r.recv().content();
78 var _ou_data = aou.toStoreData( _ou_list );
79 ou_list_store = new dojo.data.ItemFileWriteStore({ data : _ou_data });
81 ou_list_store.onSet = function (item, attr, o, n) {
82 if (attr == 'ischanged') return;
84 this.setValue( item, 'ischanged', 1);
87 dojo.addOnUnload( function (event) {
90 query : { ischanged : 1 },
91 queryOptions : { deep : true },
92 onItem : function (item, req) {
94 if (this.isItem( item )) window.dirtyStore.push( item );
97 scope : window.ou_list_store
100 if (window.dirtyStore.length > 0) {
101 var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
104 for (var i in dirtyStore) {
105 window.current_ou = window.dirtyStore[i];
114 pcrud.retrieveAll( 'aout', {
115 timeout : 10, order_by : { aout : 'depth' },
116 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_TYPES_AOUT); },
117 oncomplete : function (r) {
118 window._ou_type_list = r.recv().content();
119 window._ou_type_data = aout.toStoreData( window._ou_type_list );
120 window.ou_type_store = new dojo.data.ItemFileReadStore({ data : window._ou_type_data });
124 highlighter.ou_tree = {};
125 highlighter.editor_pane = {};
126 highlighter.hoo_pane = {};
127 highlighter.addresses_pane = {};
129 highlighter.ou_tree.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'ou_tree', duration : 500 } );
130 highlighter.ou_tree.red = dojox.fx.highlight( { color : '#FF2018', node : 'ou_tree', duration : 500 } );
132 highlighter.editor_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'editor_pane', duration : 500 } );
133 highlighter.editor_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'editor_pane', duration : 500 } );
135 highlighter.hoo_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'hoo_pane', duration : 500 } );
136 highlighter.hoo_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'hoo_pane', duration : 500 } );
138 highlighter.addresses_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'addresses_pane', duration : 500 } );
139 highlighter.addresses_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'addresses_pane', duration : 500 } );
144 label="&conify.org_unit.ou_tree.label;"
145 query="{'_top':'true'}"
146 dojoType="dijit.Tree"
147 store="ou_list_store"
152 <script type="dojo/method" event="onClick" args="item,node">
154 right_pane_toggler.show();
157 window.current_fm_ou = new aou().fromStoreItem(item);
159 highlighter.editor_pane.green.play();
160 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
162 new_kid_button.disabled = false;
163 save_ou_button.disabled = false;
164 delete_ou_button.disabled = false;
166 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
168 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type' ];
169 for ( var i in main_settings_fields ) {
170 var field = main_settings_fields[i];
171 var value = this.store.getValue( current_ou, field );
174 window["editor_pane_" + field].setValue( '' ); // unset the value
175 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
176 } else window["editor_pane_" + field].setValue( value );
179 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) {
180 editor_pane_parent_ou.disabled = true;
181 editor_pane_parent_ou.setValue(null);
182 editor_pane_parent_ou.setDisplayedValue('');
183 editor_pane_parent_ou.validate(false);
185 editor_pane_parent_ou.disabled = false;
186 editor_pane_parent_ou.validate(true);
187 editor_pane_parent_ou.setValue( this.store.getValue( current_ou, 'parent_ou' ) );
190 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
197 <script type="dojo/method" event="getLabel" args="item,pI">
198 var label = this.store.getValue(item,'shortname') + ' : ' + this.store.getValue(item,'name');
199 if (this.store.getValue(item,'ischanged') == 1) label = '* ' + label;
206 <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane" sizeShare="200">
207 <script type="dojo/method">
208 window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
209 window.right_pane_toggler.hide();
212 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
214 <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
216 <table class="tundra" style="margin:10px;">
218 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
220 <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
221 <script type="dojo/connect" event="onChange">
222 if (current_ou) ou_list_store.setValue( current_ou, "name", this.getValue() );
225 <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
229 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
231 <span id="editor_pane_shortname" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_shortname" uppercase="true" regExp=".+" required="true">
232 <script type="dojo/connect" event="onChange">
233 if (current_ou) ou_list_store.setValue( current_ou, "shortname", this.getValue() );
239 <th>&conify.org_unit.editor_pane.main_email;</th>
241 <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="^\w+\@\w+(?:\.\w+)+$">
242 <script type="dojo/connect" event="onChange">
243 if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
249 <th>&conify.org_unit.editor_pane.main_phone;</th>
251 <span id="editor_pane_phone" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_phone" regExp="^(?:(?:\d{1}[ -\.])?\(?\d{3}\)?[ -\.]{1})?\d{3}[ -\.]{1}\d{4}(| \S+.*)$">
252 <script type="dojo/connect" event="onChange">
253 if (current_ou) ou_list_store.setValue( current_ou, "phone", this.getValue() );
259 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
262 id="editor_pane_ou_type"
263 dojoType="dijit.form.FilteringSelect"
264 jsId="editor_pane_ou_type"
265 store="ou_type_store"
270 <script type="dojo/method" event="onChange">
271 if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
277 <th>&conify.org_unit.editor_pane.parent;</th>
280 id="editor_pane_parent_ou"
281 dojoType="dijit.form.FilteringSelect"
282 jsId="editor_pane_parent_ou"
283 store="ou_list_store"
284 searchAttr="shortname"
288 <script type="dojo/method" event="onChange">
290 if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
291 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
292 else this.required = true;
299 <th>&conify.org_unit.editor_pane.opac_visible;</th>
302 id="editor_pane_opac_visible"
303 jsId="editor_pane_opac_visible"
305 dojoType="dijit.form.CheckBox"
306 onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
312 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
314 <button jsId="save_ou_button" dojoType="dijit.form.Button" label="&conify.save_button.label;" onClick="save_org()">
315 <script type="dojo/connect" event="startup">
316 this.disabled = true;
320 <button jsId="delete_ou_button" dojoType="dijit.form.Button" label="&conify.delete_button.label;">
321 <script type="dojo/connect" event="startup">
322 this.disabled = true;
324 <script type="dojo/connect" event="onClick">
326 var old_name = ou_list_store.getValue( current_ou, 'name' );
328 if (ou_list_store.getValue( current_ou, '_trueRoot' ) == 'true') {
329 highlighter.editor_pane.red.play();
330 status_update( dojo.string.substitute( aou_strings.ERROR_DELETING_LAST_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
334 if ( current_ou.children ) {
335 var kids = current_ou.children;
336 if (!dojo.isArray(kids)) kids = [kids];
338 var existing_kids = dojo.filter(
340 function(kid){ return kid.isdeleted[0] != 1 }
342 if ( existing_kids.length > 0) {
343 highlighter.editor_pane.red.play();
344 status_update( dojo.string.substitute( aou_strings.ERROR_ORPHANS, [ou_list_store.getValue( current_ou, 'name' ), existing_kids.length] ) );
349 if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
350 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
352 var modified_ou = new aou().fromStoreItem( current_ou );
353 modified_ou.isdeleted( 1 );
356 method : 'open-ils.pcrud.delete.aou',
358 params : [ ses, modified_ou ],
359 onerror : function (r) {
360 highlighter.editor_pane.red.play();
361 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
363 oncomplete : function (r) {
365 if ( res && res.content() ) {
367 ou_list_store.fetch({
368 query : { id : ou_list_store.getValue( current_ou, 'id' ) },
369 queryOptions : { deep : true },
370 onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { /* meh */ } },
371 scope : ou_list_store
376 new_kid_button.disabled = true;
377 save_ou_button.disabled = true;
378 delete_ou_button.disabled = true;
380 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type', 'parent_ou' ];
381 for ( var i in main_settings_fields ) {
382 var field = main_settings_fields[i];
383 window["editor_pane_" + field].setValue( '' ); // unset the value
384 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
387 highlighter.editor_pane.green.play();
388 status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
390 highlighter.editor_pane.red.play();
391 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
403 <button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.new_kid_button.label;">
404 <script type="dojo/connect" event="startup">
405 this.disabled = true;
407 <script type="dojo/connect" event="onClick">
409 var new_fm_obj = new aou().fromHash({
411 name : aou_strings.LABEL_NEW_BRANCH,
413 shortname : ou_list_store.getValue( current_ou, 'shortname' ) + '-NEW' + virgin_ou_id--,
414 parent_ou : ou_list_store.getValue( current_ou, 'id' ),
415 ou_type : ou_list_store.getValue( current_ou, 'ou_type' )
421 method : 'open-ils.pcrud.create.aou',
423 params : [ ses, new_fm_obj ],
424 onerror : function (r) {
425 highlighter.editor_pane.red.play();
426 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
428 oncomplete : function (r) {
430 if ( res && res.content() ) {
431 ou_list_store.newItem(
432 res.content().toHash(),
433 { parent : current_ou, attribute : 'children' }
436 highlighter.editor_pane.red.play();
437 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
442 highlighter.editor_pane.green.play();
443 highlighter.ou_tree.green.play();
444 status_update( dojo.string.substitute(aou_strings.SUCCESS_CREATING_CHILD_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
451 <div id="hoo_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.hoo_pane.title;">
452 <table class="tundra" style="margin:10px;">
453 <tr><th/><th>&conify.org_unit.hoo_pane.open_time;</th><th>&conify.org_unit.hoo_pane.close_time;</th></tr>
454 <tr><th>&conify.org_unit.hoo_pane.monday;</th>
455 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_open" onChange="current_ou_hoo.dow_0_open( this.getDisplayedValue() );"/></td>
456 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_close" onChange="current_ou_hoo.dow_0_close( this.getDisplayedValue() );"/></td>
457 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_0_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_0_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
459 <tr><th>&conify.org_unit.hoo_pane.tuesday;</th>
460 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_open" onChange="current_ou_hoo.dow_1_open( this.getDisplayedValue() );"/></td>
461 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_close" onChange="current_ou_hoo.dow_1_close( this.getDisplayedValue() );"/></td>
462 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_1_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_1_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
464 <tr><th>&conify.org_unit.hoo_pane.wednesday;</th>
465 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_open" onChange="current_ou_hoo.dow_2_open( this.getDisplayedValue() );"/></td>
466 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_close" onChange="current_ou_hoo.dow_2_close( this.getDisplayedValue() );"/></td>
467 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_2_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_2_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
469 <tr><th>&conify.org_unit.hoo_pane.thursday;</th>
470 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_open" onChange="current_ou_hoo.dow_3_open( this.getDisplayedValue() );"/></td>
471 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_close" onChange="current_ou_hoo.dow_3_close( this.getDisplayedValue() );"/></td>
472 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_3_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_3_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
474 <tr><th>&conify.org_unit.hoo_pane.friday;</th>
475 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_open" onChange="current_ou_hoo.dow_4_open( this.getDisplayedValue() );"/></td>
476 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_close" onChange="current_ou_hoo.dow_4_close( this.getDisplayedValue() );"/></td>
477 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_4_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_4_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
479 <tr><th>&conify.org_unit.hoo_pane.saturday;</th>
480 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_open" onChange="current_ou_hoo.dow_5_open( this.getDisplayedValue() );"/></td>
481 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_close" onChange="current_ou_hoo.dow_5_close( this.getDisplayedValue() );"/></td>
482 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_5_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_5_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
484 <tr><th>&conify.org_unit.hoo_pane.sunday;</th>
485 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_open" onChange="current_ou_hoo.dow_6_open( this.getDisplayedValue() );"/></td>
486 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_close" onChange="current_ou_hoo.dow_6_close( this.getDisplayedValue() );"/></td>
487 <td><span dojoType="dijit.form.Button" label="&conify.org_unit.hoo_pane.closed;" onClick="dow_6_open.setValue( new Date('Tue Mar 25 2008 00:00:00') ); dow_6_close.setValue( new Date('Tue Mar 25 2008 00:00:00') );"/></td>
491 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
492 <script type="dojo/connect" event="onClick">
494 var method_name = 'open-ils.pcrud.update.aouhoo';
495 if (current_ou_hoo.isnew() == 1) method_name = 'open-ils.pcrud.create.aouhoo';
498 method : method_name,
499 params : [ ses, current_ou_hoo ],
500 onerror : function (r) {
501 highlighter.editor_pane.red.play();
502 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
504 oncomplete : function (r) {
506 if ( res && res.content() ) {
507 current_ou_hoo.isnew(0);
508 highlighter.editor_pane.green.play();
509 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
511 highlighter.editor_pane.red.play();
512 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
522 <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
524 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
526 <script type="dojo/method">
527 window.current_billing_address = null;
528 window.current_mailing_address = null;
529 window.current_holds_address = null;
530 window.current_ill_address = null;
533 <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
534 <table class="tundra" style="margin:10px;">
536 <th>&conify.org_unit.addresses_pane.type;</th>
538 <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"/>
540 <th>&conify.org_unit.addresses_pane.valid;</th><td>
543 jsId="billing_addr_valid"
544 dojoType="dijit.form.CheckBox"
546 onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
551 <th>&conify.org_unit.addresses_pane.street1;</th><td colspan="5"><span jsId="billing_addr_street1" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_billing_address.street1( this.getValue() )" required="true"/></td>
554 <th>&conify.org_unit.addresses_pane.street2;</th><td colspan="5"><span jsId="billing_addr_street2" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.street2( this.getValue() )"/></td>
557 <th>&conify.org_unit.addresses_pane.city;</th><td><span jsId="billing_addr_city" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_billing_address.city( this.getValue() )" required="true"/></td>
558 <th>&conify.org_unit.addresses_pane.state;</th><td><span jsId="billing_addr_state" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="2" maxSize="2" uppercase="true" onChange="current_billing_address.state( this.getValue() )" required="true"/></td>
559 <th>&conify.org_unit.addresses_pane.zip;</th><td><span jsId="billing_addr_post_code" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="10" maxSize="10" regExp="^\d{5}(?:-\d{4})?$" uppercase="true" onChange="current_billing_address.post_code( this.getValue() )" required="true"/></td>
562 <th>&conify.org_unit.addresses_pane.country;</th><td colspan="2"><span jsId="billing_addr_country" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_billing_address.country( this.getValue() )" required="true"/></td>
563 <th>&conify.org_unit.addresses_pane.county;</th><td colspan="2"><span jsId="billing_addr_county" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_billing_address.county( this.getValue() )" required="true"/></td>
567 <button jsId="save_billing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
568 <script type="dojo/connect" event="startup">
569 this.disabled = true;
571 <script type="dojo/connect" event="onClick">
573 var method_name = 'open-ils.pcrud.update.aoa';
574 if (current_billing_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
577 method : method_name,
578 params : [ ses, current_billing_address ],
579 onerror : function (r) {
580 highlighter.addresses_pane.red.play();
581 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
583 oncomplete : function (r) {
585 if ( res && res.content() ) {
586 if (current_billing_address.isnew() == 1) {
587 current_billing_address = res.content();
588 ou_list_store.setValue( current_ou, 'billing_address', current_billing_address.id() );
591 current_billing_address.isnew(0);
592 highlighter.addresses_pane.green.play();
593 status_update( dojo.string.subsitute( aou_strings.SUCCESS_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
595 highlighter.addresses_pane.red.play();
596 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
605 <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
606 <table class="tundra" style="margin:10px;">
608 <th>&conify.org_unit.addresses_pane.type;</th><td colspan="3"><span jsId="holds_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_holds_address.address_type( this.getValue() )"/></td>
609 <th>&conify.org_unit.addresses_pane.valid;</th><td>
612 jsId="holds_addr_valid"
613 dojoType="dijit.form.CheckBox"
615 onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
620 <th>&conify.org_unit.addresses_pane.street1;</th><td colspan="5"><span jsId="holds_addr_street1" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_holds_address.street1( this.getValue() )" required="true"/></td>
623 <th>&conify.org_unit.addresses_pane.street2;</th><td colspan="5"><span jsId="holds_addr_street2" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_holds_address.street2( this.getValue() )"/></td>
626 <th>&conify.org_unit.addresses_pane.city;</th><td><span jsId="holds_addr_city" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_holds_address.city( this.getValue() )" required="true"/></td>
627 <th>&conify.org_unit.addresses_pane.state;</th><td><span jsId="holds_addr_state" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="2" maxSize="2" uppercase="true" onChange="current_holds_address.state( this.getValue() )" required="true"/></td>
628 <th>&conify.org_unit.addresses_pane.zip;</th><td><span jsId="holds_addr_post_code" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="10" maxSize="10" regExp="^\d{5}(?:-\d{4})?$" uppercase="true" onChange="current_holds_address.post_code( this.getValue() )" required="true"/></td>
631 <th>&conify.org_unit.addresses_pane.country;</th><td colspan="2"><span jsId="holds_addr_country" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_holds_address.country( this.getValue() )" required="true"/></td>
632 <th>&conify.org_unit.addresses_pane.county;</th><td colspan="2"><span jsId="holds_addr_county" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_holds_address.county( this.getValue() )" required="true"/></td>
636 <button jsId="save_holds_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
637 <script type="dojo/connect" event="startup">
638 this.disabled = true;
640 <script type="dojo/connect" event="onClick">
642 var method_name = 'open-ils.pcrud.update.aoa';
643 if (current_holds_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
646 method : method_name,
647 params : [ ses, current_holds_address ],
648 onerror : function (r) {
649 highlighter.addresses_pane.red.play();
650 throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
652 oncomplete : function (r) {
654 if ( res && res.content() ) {
655 if (current_holds_address.isnew() == 1) {
656 current_holds_address = res.content();
657 ou_list_store.setValue( current_ou, 'holds_address', current_holds_address.id() );
660 current_holds_address.isnew(0);
661 highlighter.addresses_pane.green.play();
662 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
664 highlighter.addresses_pane.red.play();
665 throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
674 <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
675 <table class="tundra" style="margin:10px;">
677 <th>&conify.org_unit.addresses_pane.type;</th><td colspan="3"><span jsId="mailing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_mailing_address.address_type( this.getValue() )"/></td>
678 <th>&conify.org_unit.addresses_pane.valid;</th><td>
681 jsId="mailing_addr_valid"
682 dojoType="dijit.form.CheckBox"
683 onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
688 <th>&conify.org_unit.addresses_pane.street1;</th><td colspan="5"><span jsId="mailing_addr_street1" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_mailing_address.street1( this.getValue() )" required="true"/></td>
691 <th>&conify.org_unit.addresses_pane.street2;</th><td colspan="5"><span jsId="mailing_addr_street2" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_mailing_address.street2( this.getValue() )"/></td>
694 <th>&conify.org_unit.addresses_pane.city;</th><td><span jsId="mailing_addr_city" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_mailing_address.city( this.getValue() )" required="true"/></td>
695 <th>&conify.org_unit.addresses_pane.state;</th><td><span jsId="mailing_addr_state" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="2" maxSize="2" uppercase="true" onChange="current_mailing_address.state( this.getValue() )" required="true"/></td>
696 <th>&conify.org_unit.addresses_pane.zip;</th><td><span jsId="mailing_addr_post_code" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="10" maxSize="10" regExp="^\d{5}(?:-\d{4})?$" uppercase="true" onChange="current_mailing_address.post_code( this.getValue() )" required="true"/></td>
699 <th>&conify.org_unit.addresses_pane.country;</th><td colspan="2"><span jsId="mailing_addr_country" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_mailing_address.country( this.getValue() )" required="true"/></td>
700 <th>&conify.org_unit.addresses_pane.county;</th><td colspan="2"><span jsId="mailing_addr_county" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_mailing_address.county( this.getValue() )" required="true"/></td>
704 <button jsId="save_mailing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
705 <script type="dojo/connect" event="startup">
706 this.disabled = true;
708 <script type="dojo/connect" event="onClick">
710 var method_name = 'open-ils.pcrud.update.aoa';
711 if (current_mailing_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
714 method : method_name,
715 params : [ ses, current_mailing_address ],
716 onerror : function (r) {
717 highlighter.addresses_pane.red.play();
718 throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
720 oncomplete : function (r) {
722 if ( res && res.content() ) {
723 if (current_mailing_address.isnew() == 1) {
724 current_mailing_address = res.content();
725 ou_list_store.setValue( current_ou, 'mailing_address', current_mailing_address.id() );
728 current_mailing_address.isnew(0);
729 highlighter.addresses_pane.green.play();
730 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
732 highlighter.addresses_pane.red.play();
733 throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
742 <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
743 <table class="tundra" style="margin:10px;">
745 <th>&conify.org_unit.addresses_pane.type;</th><td colspan="3"><span jsId="ill_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_ill_address.address_type( this.getValue() )"/></td>
746 <th>&conify.org_unit.addresses_pane.valid;</th><td>
749 jsId="ill_addr_valid"
750 dojoType="dijit.form.CheckBox"
751 onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
756 <th>&conify.org_unit.addresses_pane.street1;</th><td colspan="5"><span jsId="ill_addr_street1" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_ill_address.street1( this.getValue() )" required="true"/></td>
759 <th>&conify.org_unit.addresses_pane.street2;</th><td colspan="5"><span jsId="ill_addr_street2" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_ill_address.street2( this.getValue() )"/></td>
762 <th>&conify.org_unit.addresses_pane.city;</th><td><span jsId="ill_addr_city" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_ill_address.city( this.getValue() )" required="true"/></td>
763 <th>&conify.org_unit.addresses_pane.state;</th><td><span jsId="ill_addr_state" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="2" maxSize="2" uppercase="true" onChange="current_ill_address.state( this.getValue() )" required="true"/></td>
764 <th>&conify.org_unit.addresses_pane.zip;</th><td><span jsId="ill_addr_post_code" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="10" maxSize="10" regExp="^\d{5}(?:-\d{4})?$" uppercase="true" onChange="current_ill_address.post_code( this.getValue() )" required="true"/></td>
767 <th>&conify.org_unit.addresses_pane.country;</th><td colspan="2"><span jsId="ill_addr_country" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_ill_address.country( this.getValue() )" required="true"/></td>
768 <th>&conify.org_unit.addresses_pane.county;</th><td colspan="2"><span jsId="ill_addr_county" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_ill_address.county( this.getValue() )" required="true"/></td>
772 <button jsId="save_ill_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
773 <script type="dojo/connect" event="startup">
774 this.disabled = true;
776 <script type="dojo/connect" event="onClick">
778 var method_name = 'open-ils.pcrud.update.aoa';
779 if (current_ill_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
782 method : method_name,
783 params : [ ses, current_ill_address ],
784 onerror : function (r) {
785 highlighter.addresses_pane.red.play();
786 throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
788 oncomplete : function (r) {
790 if ( res && res.content() ) {
791 if (current_ill_address.isnew() == 1) {
792 current_ill_address = res.content();
793 ou_list_store.setValue( current_ou, 'ill_address', current_ill_address.id() );
796 current_ill_address.isnew(0);
797 highlighter.addresses_pane.green.play();
798 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
800 highlighter.addresses_pane.red.play();
801 throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
815 <div id="status_bar"><span style="font-weight: bold; margin: 5px; margin-right: 10px;">&conify.org_unit.status_bar;</span><span id="current_ou_name"></span></div>