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">
72 var ou_list_data = { label : 'shortname', identifier : 'id' };
73 window.dirtyStore = [];
76 method : 'open-ils.permacrud.search.aou.atomic',
78 params : [ ses, { id : { "!=" : null } }, { order_by : { aou : 'shortname' } } ],
79 onerror : function (r) { throw aou_strings.ERROR_FETCHING_ORGS; },
80 oncomplete : function (r) {
81 window._ou_list = r.recv().content();
82 window._ou_data = aou.toStoreData( window._ou_list );
83 window.ou_list_store = new dojo.data.ItemFileWriteStore({ data : window._ou_data });
85 window.ou_list_store.onSet = function (item, attr, o, n) {
86 if (attr == 'ischanged') return;
88 this.setValue( item, 'ischanged', 1);
91 dojo.addOnUnload( function (event) {
94 query : { ischanged : 1 },
95 queryOptions : { deep : true },
96 onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } },
100 if (dirtyStore.length > 0) {
101 var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
104 for (var i in window.dirtyStore) {
105 window.current_ou = window.dirtyStore[i];
116 method : 'open-ils.permacrud.search.aout.atomic',
118 params : [ ses, { id : { "!=" : null } }, { order_by : { aout : 'depth' } } ],
119 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_TYPES_AOUT) },
120 oncomplete : function (r) {
121 window._ou_type_list = r.recv().content();
122 window._ou_type_data = aout.toStoreData( window._ou_type_list );
123 window.ou_type_store = new dojo.data.ItemFileReadStore({ data : window._ou_type_data });
127 highlighter.ou_tree = {};
128 highlighter.editor_pane = {};
129 highlighter.hoo_pane = {};
130 highlighter.addresses_pane = {};
132 highlighter.ou_tree.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'ou_tree', duration : 500 } );
133 highlighter.ou_tree.red = dojox.fx.highlight( { color : '#FF2018', node : 'ou_tree', duration : 500 } );
135 highlighter.editor_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'editor_pane', duration : 500 } );
136 highlighter.editor_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'editor_pane', duration : 500 } );
138 highlighter.hoo_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'hoo_pane', duration : 500 } );
139 highlighter.hoo_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'hoo_pane', duration : 500 } );
141 highlighter.addresses_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'addresses_pane', duration : 500 } );
142 highlighter.addresses_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'addresses_pane', duration : 500 } );
147 label="&conify.org_unit.ou_tree.label;"
148 query="{'_top':'true'}"
149 dojoType="dijit.Tree"
150 store="ou_list_store"
155 <script type="dojo/method" event="onClick" args="item,node">
157 right_pane_toggler.show();
160 window.current_fm_ou = new aou().fromStoreItem(item);
162 highlighter.editor_pane.green.play();
163 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
165 new_kid_button.disabled = false;
166 save_ou_button.disabled = false;
167 delete_ou_button.disabled = false;
169 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
171 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type' ];
172 for ( var i in main_settings_fields ) {
173 var field = main_settings_fields[i];
174 var value = this.store.getValue( current_ou, field );
177 window["editor_pane_" + field].setValue( '' ); // unset the value
178 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
179 } else window["editor_pane_" + field].setValue( value );
182 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) {
183 editor_pane_parent_ou.disabled = true;
184 editor_pane_parent_ou.setValue(null);
185 editor_pane_parent_ou.setDisplayedValue('');
186 editor_pane_parent_ou.validate(false);
188 editor_pane_parent_ou.disabled = false;
189 editor_pane_parent_ou.validate(true);
190 editor_pane_parent_ou.setValue( this.store.getValue( current_ou, 'parent_ou' ) );
193 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
200 <script type="dojo/method" event="getLabel" args="item,pI">
201 var label = this.store.getValue(item,'shortname') + ' : ' + this.store.getValue(item,'name');
202 if (this.store.getValue(item,'ischanged') == 1) label = '* ' + label;
209 <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane" sizeShare="200">
210 <script type="dojo/method">
211 window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
212 window.right_pane_toggler.hide();
215 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
217 <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
219 <table class="tundra" style="margin:10px;">
221 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
223 <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
224 <script type="dojo/connect" event="onChange">
225 if (current_ou) ou_list_store.setValue( current_ou, "name", this.getValue() );
228 <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
232 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
234 <span id="editor_pane_shortname" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_shortname" uppercase="true" regExp=".+" required="true">
235 <script type="dojo/connect" event="onChange">
236 if (current_ou) ou_list_store.setValue( current_ou, "shortname", this.getValue() );
242 <th>&conify.org_unit.editor_pane.main_email;</th>
244 <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="^\w+\@\w+(?:\.\w+)+$">
245 <script type="dojo/connect" event="onChange">
246 if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
252 <th>&conify.org_unit.editor_pane.main_phone;</th>
254 <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+.*)$">
255 <script type="dojo/connect" event="onChange">
256 if (current_ou) ou_list_store.setValue( current_ou, "phone", this.getValue() );
262 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
265 id="editor_pane_ou_type"
266 dojoType="dijit.form.FilteringSelect"
267 jsId="editor_pane_ou_type"
268 store="ou_type_store"
273 <script type="dojo/method" event="onChange">
274 if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
280 <th>&conify.org_unit.editor_pane.parent;</th>
283 id="editor_pane_parent_ou"
284 dojoType="dijit.form.FilteringSelect"
285 jsId="editor_pane_parent_ou"
286 store="ou_list_store"
287 searchAttr="shortname"
291 <script type="dojo/method" event="onChange">
293 if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
294 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
295 else this.required = true;
302 <th>&conify.org_unit.editor_pane.opac_visible;</th>
305 id="editor_pane_opac_visible"
306 jsId="editor_pane_opac_visible"
308 dojoType="dijit.form.CheckBox"
309 onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
315 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
317 <button jsId="save_ou_button" dojoType="dijit.form.Button" label="&conify.save_button.label;" onClick="save_org()">
318 <script type="dojo/connect" event="startup">
319 this.disabled = true;
323 <button jsId="delete_ou_button" dojoType="dijit.form.Button" label="&conify.delete_button.label;">
324 <script type="dojo/connect" event="startup">
325 this.disabled = true;
327 <script type="dojo/connect" event="onClick">
329 var old_name = ou_list_store.getValue( current_ou, 'name' );
331 if (ou_list_store.getValue( current_ou, '_trueRoot' ) == 'true') {
332 highlighter.editor_pane.red.play();
333 status_update( dojo.string.substitute( aou_strings.ERROR_DELETING_LAST_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
337 if ( current_ou.children ) {
338 var kids = current_ou.children;
339 if (!dojo.isArray(kids)) kids = [kids];
341 var existing_kids = dojo.filter(
343 function(kid){ return kid.isdeleted[0] != 1 }
345 if ( existing_kids.length > 0) {
346 highlighter.editor_pane.red.play();
347 status_update( dojo.string.substitute( aou_strings.ERROR_ORPHANS, [ou_list_store.getValue( current_ou, 'name' ), existing_kids.length] ) );
352 if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
353 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
355 var modified_ou = new aou().fromStoreItem( current_ou );
356 modified_ou.isdeleted( 1 );
359 method : 'open-ils.permacrud.delete.aou',
361 params : [ ses, modified_ou ],
362 onerror : function (r) {
363 highlighter.editor_pane.red.play();
364 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
366 oncomplete : function (r) {
368 if ( res && res.content() ) {
370 ou_list_store.fetch({
371 query : { id : ou_list_store.getValue( current_ou, 'id' ) },
372 queryOptions : { deep : true },
373 onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { /* meh */ } },
374 scope : ou_list_store
379 new_kid_button.disabled = true;
380 save_ou_button.disabled = true;
381 delete_ou_button.disabled = true;
383 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type', 'parent_ou' ];
384 for ( var i in main_settings_fields ) {
385 var field = main_settings_fields[i];
386 window["editor_pane_" + field].setValue( '' ); // unset the value
387 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
390 highlighter.editor_pane.green.play();
391 status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
393 highlighter.editor_pane.red.play();
394 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
406 <button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.new_kid_button.label;">
407 <script type="dojo/connect" event="startup">
408 this.disabled = true;
410 <script type="dojo/connect" event="onClick">
412 var new_fm_obj = new aou().fromHash({
414 name : aou_strings.LABEL_NEW_BRANCH,
416 shortname : ou_list_store.getValue( current_ou, 'shortname' ) + '-NEW' + virgin_ou_id--,
417 parent_ou : ou_list_store.getValue( current_ou, 'id' ),
418 ou_type : ou_list_store.getValue( current_ou, 'ou_type' )
424 method : 'open-ils.permacrud.create.aou',
426 params : [ ses, new_fm_obj ],
427 onerror : function (r) {
428 highlighter.editor_pane.red.play();
429 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
431 oncomplete : function (r) {
433 if ( res && res.content() ) {
434 ou_list_store.newItem(
435 res.content().toHash(),
436 { parent : current_ou, attribute : 'children' }
439 highlighter.editor_pane.red.play();
440 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
445 highlighter.editor_pane.green.play();
446 highlighter.ou_tree.green.play();
447 status_update( dojo.string.substitute(aou_strings.SUCCESS_CREATING_CHILD_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
454 <div id="hoo_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.hoo_pane.title;">
455 <table class="tundra" style="margin:10px;">
456 <tr><th/><th>&conify.org_unit.hoo_pane.open_time;</th><th>&conify.org_unit.hoo_pane.close_time;</th></tr>
457 <tr><th>&conify.org_unit.hoo_pane.monday;</th>
458 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_open" onChange="current_ou_hoo.dow_0_open( this.getDisplayedValue() );"/></td>
459 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_close" onChange="current_ou_hoo.dow_0_close( this.getDisplayedValue() );"/></td>
460 <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>
462 <tr><th>&conify.org_unit.hoo_pane.tuesday;</th>
463 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_open" onChange="current_ou_hoo.dow_1_open( this.getDisplayedValue() );"/></td>
464 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_close" onChange="current_ou_hoo.dow_1_close( this.getDisplayedValue() );"/></td>
465 <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>
467 <tr><th>&conify.org_unit.hoo_pane.wednesday;</th>
468 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_open" onChange="current_ou_hoo.dow_2_open( this.getDisplayedValue() );"/></td>
469 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_close" onChange="current_ou_hoo.dow_2_close( this.getDisplayedValue() );"/></td>
470 <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>
472 <tr><th>&conify.org_unit.hoo_pane.thursday;</th>
473 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_open" onChange="current_ou_hoo.dow_3_open( this.getDisplayedValue() );"/></td>
474 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_close" onChange="current_ou_hoo.dow_3_close( this.getDisplayedValue() );"/></td>
475 <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>
477 <tr><th>&conify.org_unit.hoo_pane.friday;</th>
478 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_open" onChange="current_ou_hoo.dow_4_open( this.getDisplayedValue() );"/></td>
479 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_close" onChange="current_ou_hoo.dow_4_close( this.getDisplayedValue() );"/></td>
480 <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>
482 <tr><th>&conify.org_unit.hoo_pane.saturday;</th>
483 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_open" onChange="current_ou_hoo.dow_5_open( this.getDisplayedValue() );"/></td>
484 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_close" onChange="current_ou_hoo.dow_5_close( this.getDisplayedValue() );"/></td>
485 <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>
487 <tr><th>&conify.org_unit.hoo_pane.sunday;</th>
488 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_open" onChange="current_ou_hoo.dow_6_open( this.getDisplayedValue() );"/></td>
489 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_close" onChange="current_ou_hoo.dow_6_close( this.getDisplayedValue() );"/></td>
490 <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>
494 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
495 <script type="dojo/connect" event="onClick">
497 var method_name = 'open-ils.permacrud.update.aouhoo';
498 if (current_ou_hoo.isnew() == 1) method_name = 'open-ils.permacrud.create.aouhoo';
501 method : method_name,
502 params : [ ses, current_ou_hoo ],
503 onerror : function (r) {
504 highlighter.editor_pane.red.play();
505 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
507 oncomplete : function (r) {
509 if ( res && res.content() ) {
510 current_ou_hoo.isnew(0);
511 highlighter.editor_pane.green.play();
512 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
514 highlighter.editor_pane.red.play();
515 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
525 <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
527 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
529 <script type="dojo/method">
530 window.current_billing_address = null;
531 window.current_mailing_address = null;
532 window.current_holds_address = null;
533 window.current_ill_address = null;
536 <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
537 <table class="tundra" style="margin:10px;">
539 <th>&conify.org_unit.addresses_pane.type;</th>
541 <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"/>
543 <th>&conify.org_unit.addresses_pane.valid;</th><td>
546 jsId="billing_addr_valid"
547 dojoType="dijit.form.CheckBox"
549 onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
554 <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>
557 <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>
560 <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>
561 <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>
562 <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>
565 <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>
566 <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>
570 <button jsId="save_billing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
571 <script type="dojo/connect" event="startup">
572 this.disabled = true;
574 <script type="dojo/connect" event="onClick">
576 var method_name = 'open-ils.permacrud.update.aoa';
577 if (current_billing_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
580 method : method_name,
581 params : [ ses, current_billing_address ],
582 onerror : function (r) {
583 highlighter.addresses_pane.red.play();
584 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
586 oncomplete : function (r) {
588 if ( res && res.content() ) {
589 if (current_billing_address.isnew() == 1) {
590 current_billing_address = res.content();
591 ou_list_store.setValue( current_ou, 'billing_address', current_billing_address.id() );
594 current_billing_address.isnew(0);
595 highlighter.addresses_pane.green.play();
596 status_update( dojo.string.subsitute( aou_strings.SUCCESS_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
598 highlighter.addresses_pane.red.play();
599 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
608 <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
609 <table class="tundra" style="margin:10px;">
611 <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>
612 <th>&conify.org_unit.addresses_pane.valid;</th><td>
615 jsId="holds_addr_valid"
616 dojoType="dijit.form.CheckBox"
618 onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
623 <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>
626 <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>
629 <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>
630 <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>
631 <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>
634 <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>
635 <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>
639 <button jsId="save_holds_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
640 <script type="dojo/connect" event="startup">
641 this.disabled = true;
643 <script type="dojo/connect" event="onClick">
645 var method_name = 'open-ils.permacrud.update.aoa';
646 if (current_holds_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
649 method : method_name,
650 params : [ ses, current_holds_address ],
651 onerror : function (r) {
652 highlighter.addresses_pane.red.play();
653 throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
655 oncomplete : function (r) {
657 if ( res && res.content() ) {
658 if (current_holds_address.isnew() == 1) {
659 current_holds_address = res.content();
660 ou_list_store.setValue( current_ou, 'holds_address', current_holds_address.id() );
663 current_holds_address.isnew(0);
664 highlighter.addresses_pane.green.play();
665 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
667 highlighter.addresses_pane.red.play();
668 throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
677 <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
678 <table class="tundra" style="margin:10px;">
680 <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>
681 <th>&conify.org_unit.addresses_pane.valid;</th><td>
684 jsId="mailing_addr_valid"
685 dojoType="dijit.form.CheckBox"
686 onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
691 <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>
694 <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>
697 <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>
698 <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>
699 <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>
702 <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>
703 <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>
707 <button jsId="save_mailing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
708 <script type="dojo/connect" event="startup">
709 this.disabled = true;
711 <script type="dojo/connect" event="onClick">
713 var method_name = 'open-ils.permacrud.update.aoa';
714 if (current_mailing_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
717 method : method_name,
718 params : [ ses, current_mailing_address ],
719 onerror : function (r) {
720 highlighter.addresses_pane.red.play();
721 throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
723 oncomplete : function (r) {
725 if ( res && res.content() ) {
726 if (current_mailing_address.isnew() == 1) {
727 current_mailing_address = res.content();
728 ou_list_store.setValue( current_ou, 'mailing_address', current_mailing_address.id() );
731 current_mailing_address.isnew(0);
732 highlighter.addresses_pane.green.play();
733 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
735 highlighter.addresses_pane.red.play();
736 throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
745 <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
746 <table class="tundra" style="margin:10px;">
748 <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>
749 <th>&conify.org_unit.addresses_pane.valid;</th><td>
752 jsId="ill_addr_valid"
753 dojoType="dijit.form.CheckBox"
754 onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
759 <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>
762 <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>
765 <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>
766 <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>
767 <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>
770 <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>
771 <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>
775 <button jsId="save_ill_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
776 <script type="dojo/connect" event="startup">
777 this.disabled = true;
779 <script type="dojo/connect" event="onClick">
781 var method_name = 'open-ils.permacrud.update.aoa';
782 if (current_ill_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
785 method : method_name,
786 params : [ ses, current_ill_address ],
787 onerror : function (r) {
788 highlighter.addresses_pane.red.play();
789 throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
791 oncomplete : function (r) {
793 if ( res && res.content() ) {
794 if (current_ill_address.isnew() == 1) {
795 current_ill_address = res.content();
796 ou_list_store.setValue( current_ou, 'ill_address', current_ill_address.id() );
799 current_ill_address.isnew(0);
800 highlighter.addresses_pane.green.play();
801 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
803 highlighter.addresses_pane.red.play();
804 throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
818 <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>