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/dojo/openils_dojo.js"></script>
60 <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
62 <script type="text/javascript" src="org_unit.js"></script>
66 <body class="tundra" id='pagebody'>
68 <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
70 <div dojoType="dijit.layout.ContentPane" sizeShare="100">
71 <script type="dojo/method">
74 pcrud.retrieveAll( 'aou', {
75 timeout : 10, order_by : { aou : 'shortname' },
76 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_ORGS); },
77 oncomplete : function (r) {
78 var _ou_list = r.recv().content();
79 var _ou_data = aou.toStoreData( _ou_list );
80 ou_list_store = new dojo.data.ItemFileWriteStore({ data : _ou_data });
82 ou_list_store.onSet = function (item, attr, o, n) {
83 if (attr == 'ischanged') return;
85 this.setValue( item, 'ischanged', 1);
88 dojo.addOnUnload( function (event) {
91 query : { ischanged : 1 },
92 queryOptions : { deep : true },
93 onItem : function (item, req) {
95 if (this.isItem( item )) window.dirtyStore.push( item );
98 scope : window.ou_list_store
101 if (window.dirtyStore.length > 0) {
102 var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
105 for (var i in dirtyStore) {
106 window.current_ou = window.dirtyStore[i];
115 pcrud.retrieveAll( 'aout', {
116 timeout : 10, order_by : { aout : 'depth' },
117 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_TYPES_AOUT); },
118 oncomplete : function (r) {
119 window._ou_type_list = r.recv().content();
120 window._ou_type_data = aout.toStoreData( window._ou_type_list );
121 window.ou_type_store = new dojo.data.ItemFileReadStore({ data : window._ou_type_data });
125 highlighter.ou_tree = {};
126 highlighter.editor_pane = {};
127 highlighter.hoo_pane = {};
128 highlighter.addresses_pane = {};
130 highlighter.ou_tree.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'ou_tree', duration : 500 } );
131 highlighter.ou_tree.red = dojox.fx.highlight( { color : '#FF2018', node : 'ou_tree', duration : 500 } );
133 highlighter.editor_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'editor_pane', duration : 500 } );
134 highlighter.editor_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'editor_pane', duration : 500 } );
136 highlighter.hoo_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'hoo_pane', duration : 500 } );
137 highlighter.hoo_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'hoo_pane', duration : 500 } );
139 highlighter.addresses_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'addresses_pane', duration : 500 } );
140 highlighter.addresses_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'addresses_pane', duration : 500 } );
145 label="&conify.org_unit.ou_tree.label;"
146 query="{'_top':'true'}"
147 dojoType="dijit.Tree"
148 store="ou_list_store"
153 <script type="dojo/method" event="onClick" args="item,node">
155 right_pane_toggler.show();
158 window.current_fm_ou = new aou().fromStoreItem(item);
160 highlighter.editor_pane.green.play();
161 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
163 new_kid_button.disabled = false;
164 save_ou_button.disabled = false;
165 delete_ou_button.disabled = false;
167 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
169 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type' ];
170 for ( var i in main_settings_fields ) {
171 var field = main_settings_fields[i];
172 var value = this.store.getValue( current_ou, field );
175 window["editor_pane_" + field].setValue( '' ); // unset the value
176 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
177 } else window["editor_pane_" + field].setValue( value );
180 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) {
181 editor_pane_parent_ou.disabled = true;
182 editor_pane_parent_ou.setValue(null);
183 editor_pane_parent_ou.setDisplayedValue('');
184 editor_pane_parent_ou.validate(false);
186 editor_pane_parent_ou.disabled = false;
187 editor_pane_parent_ou.validate(true);
188 editor_pane_parent_ou.setValue( this.store.getValue( current_ou, 'parent_ou' ) );
191 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
198 <script type="dojo/method" event="getLabel" args="item,pI">
199 var label = this.store.getValue(item,'shortname') + ' : ' + this.store.getValue(item,'name');
200 if (this.store.getValue(item,'ischanged') == 1) label = '* ' + label;
207 <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane" sizeShare="200">
208 <script type="dojo/method">
209 window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
210 window.right_pane_toggler.hide();
213 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
215 <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
217 <table class="tundra" style="margin:10px;">
219 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
221 <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
222 <script type="dojo/connect" event="onChange">
223 if (current_ou) ou_list_store.setValue( current_ou, "name", this.getValue() );
226 <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
230 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
232 <span id="editor_pane_shortname" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_shortname" uppercase="true" regExp=".+" required="true">
233 <script type="dojo/connect" event="onChange">
234 if (current_ou) ou_list_store.setValue( current_ou, "shortname", this.getValue() );
240 <th>&conify.org_unit.editor_pane.main_email;</th>
242 <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="^\w+\@\w+(?:\.\w+)+$">
243 <script type="dojo/connect" event="onChange">
244 if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
250 <th>&conify.org_unit.editor_pane.main_phone;</th>
252 <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+.*)$">
253 <script type="dojo/connect" event="onChange">
254 if (current_ou) ou_list_store.setValue( current_ou, "phone", this.getValue() );
260 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
263 id="editor_pane_ou_type"
264 dojoType="dijit.form.FilteringSelect"
265 jsId="editor_pane_ou_type"
266 store="ou_type_store"
271 <script type="dojo/method" event="onChange">
272 if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
278 <th>&conify.org_unit.editor_pane.parent;</th>
281 id="editor_pane_parent_ou"
282 dojoType="dijit.form.FilteringSelect"
283 jsId="editor_pane_parent_ou"
284 store="ou_list_store"
285 searchAttr="shortname"
289 <script type="dojo/method" event="onChange">
291 if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
292 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
293 else this.required = true;
300 <th>&conify.org_unit.editor_pane.opac_visible;</th>
303 id="editor_pane_opac_visible"
304 jsId="editor_pane_opac_visible"
306 dojoType="dijit.form.CheckBox"
307 onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
313 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
315 <button jsId="save_ou_button" dojoType="dijit.form.Button" label="&conify.save_button.label;" onClick="save_org()">
316 <script type="dojo/connect" event="startup">
317 this.disabled = true;
321 <button jsId="delete_ou_button" dojoType="dijit.form.Button" label="&conify.delete_button.label;">
322 <script type="dojo/connect" event="startup">
323 this.disabled = true;
325 <script type="dojo/connect" event="onClick">
327 var old_name = ou_list_store.getValue( current_ou, 'name' );
329 if (ou_list_store.getValue( current_ou, '_trueRoot' ) == 'true') {
330 highlighter.editor_pane.red.play();
331 status_update( dojo.string.substitute( aou_strings.ERROR_DELETING_LAST_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
335 if ( current_ou.children ) {
336 var kids = current_ou.children;
337 if (!dojo.isArray(kids)) kids = [kids];
339 var existing_kids = dojo.filter(
341 function(kid){ return kid.isdeleted[0] != 1 }
343 if ( existing_kids.length > 0) {
344 highlighter.editor_pane.red.play();
345 status_update( dojo.string.substitute( aou_strings.ERROR_ORPHANS, [ou_list_store.getValue( current_ou, 'name' ), existing_kids.length] ) );
350 if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
351 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
353 var modified_ou = new aou().fromStoreItem( current_ou );
354 modified_ou.isdeleted( 1 );
356 pcrud.eliminate( modified_ou, {
358 onerror : function (r) {
359 highlighter.editor_pane.red.play();
360 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
362 oncomplete : function (r) {
363 ou_list_store.fetch({
364 query : { id : ou_list_store.getValue( current_ou, 'id' ) },
365 queryOptions : { deep : true },
366 onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { /* meh */ } },
367 scope : ou_list_store
372 new_kid_button.disabled = true;
373 save_ou_button.disabled = true;
374 delete_ou_button.disabled = true;
376 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type', 'parent_ou' ];
377 for ( var i in main_settings_fields ) {
378 var field = main_settings_fields[i];
379 window["editor_pane_" + field].setValue( '' ); // unset the value
380 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
383 highlighter.editor_pane.green.play();
384 status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
394 <button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.new_kid_button.label;">
395 <script type="dojo/connect" event="startup">
396 this.disabled = true;
398 <script type="dojo/connect" event="onClick">
400 var new_fm_obj = new aou().fromHash({
402 name : aou_strings.LABEL_NEW_BRANCH,
404 shortname : ou_list_store.getValue( current_ou, 'shortname' ) + '-NEW' + virgin_ou_id--,
405 parent_ou : ou_list_store.getValue( current_ou, 'id' ),
406 ou_type : ou_list_store.getValue( current_ou, 'ou_type' )
411 pcrud.create( new_fm_obj, {
413 onerror : function (r) {
414 highlighter.editor_pane.red.play();
415 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
417 oncomplete : function (r) {
419 if ( res && res.content() ) {
420 ou_list_store.newItem(
421 res.content().toHash(),
422 { parent : current_ou, attribute : 'children' }
425 highlighter.editor_pane.red.play();
426 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
431 highlighter.editor_pane.green.play();
432 highlighter.ou_tree.green.play();
433 status_update( dojo.string.substitute(aou_strings.SUCCESS_CREATING_CHILD_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
440 <div id="hoo_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.hoo_pane.title;">
441 <table class="tundra" style="margin:10px;">
442 <tr><th/><th>&conify.org_unit.hoo_pane.open_time;</th><th>&conify.org_unit.hoo_pane.close_time;</th></tr>
443 <tr><th>&conify.org_unit.hoo_pane.monday;</th>
444 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_open" onChange="current_ou_hoo.dow_0_open( this.getDisplayedValue() );"/></td>
445 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_close" onChange="current_ou_hoo.dow_0_close( this.getDisplayedValue() );"/></td>
446 <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>
448 <tr><th>&conify.org_unit.hoo_pane.tuesday;</th>
449 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_open" onChange="current_ou_hoo.dow_1_open( this.getDisplayedValue() );"/></td>
450 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_close" onChange="current_ou_hoo.dow_1_close( this.getDisplayedValue() );"/></td>
451 <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>
453 <tr><th>&conify.org_unit.hoo_pane.wednesday;</th>
454 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_open" onChange="current_ou_hoo.dow_2_open( this.getDisplayedValue() );"/></td>
455 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_close" onChange="current_ou_hoo.dow_2_close( this.getDisplayedValue() );"/></td>
456 <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>
458 <tr><th>&conify.org_unit.hoo_pane.thursday;</th>
459 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_open" onChange="current_ou_hoo.dow_3_open( this.getDisplayedValue() );"/></td>
460 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_close" onChange="current_ou_hoo.dow_3_close( this.getDisplayedValue() );"/></td>
461 <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>
463 <tr><th>&conify.org_unit.hoo_pane.friday;</th>
464 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_open" onChange="current_ou_hoo.dow_4_open( this.getDisplayedValue() );"/></td>
465 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_close" onChange="current_ou_hoo.dow_4_close( this.getDisplayedValue() );"/></td>
466 <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>
468 <tr><th>&conify.org_unit.hoo_pane.saturday;</th>
469 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_open" onChange="current_ou_hoo.dow_5_open( this.getDisplayedValue() );"/></td>
470 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_close" onChange="current_ou_hoo.dow_5_close( this.getDisplayedValue() );"/></td>
471 <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>
473 <tr><th>&conify.org_unit.hoo_pane.sunday;</th>
474 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_open" onChange="current_ou_hoo.dow_6_open( this.getDisplayedValue() );"/></td>
475 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_close" onChange="current_ou_hoo.dow_6_close( this.getDisplayedValue() );"/></td>
476 <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>
480 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
481 <script type="dojo/connect" event="startup">
482 this.disabled = true;
484 <script type="dojo/connect" event="onClick">
486 if (hoo_id.length == 0) {
487 pcrud.create( current_ou_hoo, {
489 onerror : function (r) {
490 highlighter.hoo_pane.red.play();
491 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
493 oncomplete : function (r) {
494 hoo_id = pcrud.search( 'aouhoo',{id:ou_list_store.getValue( current_ou, 'id' )});
495 highlighter.hoo_pane.green.play();
496 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
500 pcrud.update( current_ou_hoo, {
502 onerror : function (r) {
503 highlighter.hoo_pane.red.play();
504 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
506 oncomplete : function (r) {
507 highlighter.hoo_pane.green.play();
508 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
519 <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
521 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
523 <script type="dojo/method">
524 window.current_billing_address = null;
525 window.current_mailing_address = null;
526 window.current_holds_address = null;
527 window.current_ill_address = null;
530 <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
531 <table class="tundra" style="margin:10px;">
533 <th>&conify.org_unit.addresses_pane.type;</th>
535 <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"/>
537 <th>&conify.org_unit.addresses_pane.valid;</th><td>
540 jsId="billing_addr_valid"
541 dojoType="dijit.form.CheckBox"
543 onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
548 <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>
551 <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>
554 <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>
555 <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>
556 <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>
559 <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>
560 <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>
564 <button jsId="save_billing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
565 <script type="dojo/connect" event="startup">
566 this.disabled = true;
568 <script type="dojo/connect" event="onClick">
570 var method_name = 'open-ils.pcrud.update.aoa';
571 if (current_billing_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
574 method : method_name,
575 params : [ ses, current_billing_address ],
576 onerror : function (r) {
577 highlighter.addresses_pane.red.play();
578 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
580 oncomplete : function (r) {
582 if ( res && res.content() ) {
583 if (current_billing_address.isnew() == 1) {
584 current_billing_address = res.content();
585 ou_list_store.setValue( current_ou, 'billing_address', current_billing_address.id() );
588 current_billing_address.isnew(0);
589 highlighter.addresses_pane.green.play();
590 status_update( dojo.string.subsitute( aou_strings.SUCCESS_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
592 highlighter.addresses_pane.red.play();
593 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
602 <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
603 <table class="tundra" style="margin:10px;">
605 <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>
606 <th>&conify.org_unit.addresses_pane.valid;</th><td>
609 jsId="holds_addr_valid"
610 dojoType="dijit.form.CheckBox"
612 onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
617 <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>
620 <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>
623 <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>
624 <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>
625 <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>
628 <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>
629 <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>
633 <button jsId="save_holds_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
634 <script type="dojo/connect" event="startup">
635 this.disabled = true;
637 <script type="dojo/connect" event="onClick">
639 var method_name = 'open-ils.pcrud.update.aoa';
640 if (current_holds_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
643 method : method_name,
644 params : [ ses, current_holds_address ],
645 onerror : function (r) {
646 highlighter.addresses_pane.red.play();
647 throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
649 oncomplete : function (r) {
651 if ( res && res.content() ) {
652 if (current_holds_address.isnew() == 1) {
653 current_holds_address = res.content();
654 ou_list_store.setValue( current_ou, 'holds_address', current_holds_address.id() );
657 current_holds_address.isnew(0);
658 highlighter.addresses_pane.green.play();
659 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
661 highlighter.addresses_pane.red.play();
662 throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
671 <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
672 <table class="tundra" style="margin:10px;">
674 <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>
675 <th>&conify.org_unit.addresses_pane.valid;</th><td>
678 jsId="mailing_addr_valid"
679 dojoType="dijit.form.CheckBox"
680 onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
685 <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>
688 <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>
691 <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>
692 <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>
693 <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>
696 <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>
697 <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>
701 <button jsId="save_mailing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
702 <script type="dojo/connect" event="startup">
703 this.disabled = true;
705 <script type="dojo/connect" event="onClick">
707 var method_name = 'open-ils.pcrud.update.aoa';
708 if (current_mailing_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
711 method : method_name,
712 params : [ ses, current_mailing_address ],
713 onerror : function (r) {
714 highlighter.addresses_pane.red.play();
715 throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
717 oncomplete : function (r) {
719 if ( res && res.content() ) {
720 if (current_mailing_address.isnew() == 1) {
721 current_mailing_address = res.content();
722 ou_list_store.setValue( current_ou, 'mailing_address', current_mailing_address.id() );
725 current_mailing_address.isnew(0);
726 highlighter.addresses_pane.green.play();
727 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
729 highlighter.addresses_pane.red.play();
730 throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
739 <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
740 <table class="tundra" style="margin:10px;">
742 <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>
743 <th>&conify.org_unit.addresses_pane.valid;</th><td>
746 jsId="ill_addr_valid"
747 dojoType="dijit.form.CheckBox"
748 onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
753 <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>
756 <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>
759 <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>
760 <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>
761 <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>
764 <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>
765 <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>
769 <button jsId="save_ill_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
770 <script type="dojo/connect" event="startup">
771 this.disabled = true;
773 <script type="dojo/connect" event="onClick">
775 var method_name = 'open-ils.pcrud.update.aoa';
776 if (current_ill_address.isnew() == 1) method_name = 'open-ils.pcrud.create.aoa';
779 method : method_name,
780 params : [ ses, current_ill_address ],
781 onerror : function (r) {
782 highlighter.addresses_pane.red.play();
783 throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
785 oncomplete : function (r) {
787 if ( res && res.content() ) {
788 if (current_ill_address.isnew() == 1) {
789 current_ill_address = res.content();
790 ou_list_store.setValue( current_ou, 'ill_address', current_ill_address.id() );
793 current_ill_address.isnew(0);
794 highlighter.addresses_pane.green.play();
795 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
797 highlighter.addresses_pane.red.play();
798 throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
812 <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>