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');
30 <style type="text/css">
35 margin: 0px 0px 0px 0px;
36 padding: 0px 0px 0px 0px;
47 /* this is a hack to get the right pane to display
48 in recent browsers when using this interface
49 embedded in the web staff client
51 .dijitLayoutContainer {
56 <!-- The OpenSRF API writ JS -->
57 <script language='javascript' src='/IDL2js' type='text/javascript'></script>
58 <script language='javascript' src='/opac/common/js/utils.js' type='text/javascript'></script>
59 <script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
60 <script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
62 <!-- Dojo goodness -->
63 <script type="text/javascript" src="../admin.js"></script>
65 <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
66 <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
68 <script type="text/javascript" src="org_unit.js"></script>
72 <body class="tundra" id='pagebody'>
74 <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
76 <div dojoType="dijit.layout.ContentPane" sizeShare="100">
77 <script type="dojo/method">
80 pcrud.retrieveAll( 'aou', {
81 timeout : 10, order_by : { aou : 'shortname' },
82 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_ORGS); },
83 oncomplete : function (r) {
84 var _ou_list = r.recv().content();
85 var _ou_data = aou.toStoreData( _ou_list );
86 ou_list_store = new dojo.data.ItemFileWriteStore({ data : _ou_data });
88 ou_list_store.onSet = function (item, attr, o, n) {
89 if (attr == 'ischanged') return;
90 if ((n == o) || ((o == null) && (n == ''))) return;
91 this.setValue( item, 'ischanged', 1);
94 dojo.addOnUnload( function (event) {
97 query : { ischanged : 1 },
98 queryOptions : { deep : true },
99 onItem : function (item, req) {
101 if (this.isItem( item )) window.dirtyStore.push( item );
104 scope : window.ou_list_store
107 if (window.dirtyStore.length > 0) {
108 var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
111 for (var i in dirtyStore) {
112 current_ou = window.dirtyStore[i];
121 pcrud.retrieveAll( 'aout', {
122 timeout : 10, order_by : { aout : 'depth' },
123 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_TYPES_AOUT); },
124 oncomplete : function (r) {
125 window._ou_type_list = r.recv().content();
126 window._ou_type_data = aout.toStoreData( window._ou_type_list );
127 window.ou_type_store = new dojo.data.ItemFileReadStore({ data : window._ou_type_data });
131 highlighter.ou_tree = {};
132 highlighter.editor_pane = {};
133 highlighter.hoo_pane = {};
134 highlighter.addresses_pane = {};
136 highlighter.ou_tree.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'ou_tree', duration : 500 } );
137 highlighter.ou_tree.red = dojox.fx.highlight( { color : '#FF2018', node : 'ou_tree', duration : 500 } );
139 highlighter.editor_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'editor_pane', duration : 500 } );
140 highlighter.editor_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'editor_pane', duration : 500 } );
142 highlighter.hoo_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'hoo_pane', duration : 500 } );
143 highlighter.hoo_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'hoo_pane', duration : 500 } );
145 highlighter.addresses_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'addresses_pane', duration : 500 } );
146 highlighter.addresses_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'addresses_pane', duration : 500 } );
151 label="&conify.org_unit.ou_tree.label;"
152 query="{'_top':'true'}"
153 dojoType="dijit.Tree"
154 store="ou_list_store"
159 <script type="dojo/method" event="onClick" args="item,node">
161 right_pane_toggler.show();
164 window.current_fm_ou = new aou().fromStoreItem(item);
166 highlighter.editor_pane.green.play();
167 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
169 new_kid_button.disabled = false;
170 save_ou_button.disabled = false;
171 delete_ou_button.disabled = false;
173 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
175 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type' ];
176 for ( var i in main_settings_fields ) {
177 var field = main_settings_fields[i];
178 var value = this.store.getValue( current_ou, field );
181 window["editor_pane_" + field].setValue( '' ); // unset the value
182 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
183 } else window["editor_pane_" + field].setValue( value );
186 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) {
187 editor_pane_parent_ou.disabled = true;
188 editor_pane_parent_ou.setValue(null);
189 editor_pane_parent_ou.setDisplayedValue('');
190 editor_pane_parent_ou.validate(false);
192 editor_pane_parent_ou.disabled = false;
193 editor_pane_parent_ou.validate(true);
194 editor_pane_parent_ou.setValue( this.store.getValue( current_ou, 'parent_ou' ) );
197 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
204 <script type="dojo/method" event="getLabel" args="item,pI">
205 var label = this.store.getValue(item,'shortname') + ' : ' + this.store.getValue(item,'name');
206 if (this.store.getValue(item,'ischanged') == 1) label = '* ' + label;
213 <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane" sizeShare="200">
214 <script type="dojo/method">
215 window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
216 window.right_pane_toggler.hide();
219 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
221 <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
223 <table class="tundra" style="margin:10px;">
225 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
227 <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
228 <script type="dojo/connect" event="onChange">
229 if (current_ou) ou_list_store.setValue( current_ou, "name", this.getValue() );
232 <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
236 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
238 <span id="editor_pane_shortname" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_shortname" uppercase="true" regExp=".+" required="true">
239 <script type="dojo/connect" event="onChange">
240 if (current_ou) ou_list_store.setValue( current_ou, "shortname", this.getValue() );
246 <th>&conify.org_unit.editor_pane.main_email;</th>
248 <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="[a-zA-Z0-9!#$%'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?">
249 <script type="dojo/connect" event="onChange">
250 if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
256 <th>&conify.org_unit.editor_pane.main_phone;</th>
258 <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+.*)$">
259 <script type="dojo/connect" event="onChange">
260 if (current_ou) ou_list_store.setValue( current_ou, "phone", this.getValue() );
266 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
269 id="editor_pane_ou_type"
270 dojoType="dijit.form.FilteringSelect"
271 jsId="editor_pane_ou_type"
272 store="ou_type_store"
277 <script type="dojo/method" event="onChange">
278 if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
284 <th>&conify.org_unit.editor_pane.parent;</th>
287 id="editor_pane_parent_ou"
288 dojoType="dijit.form.FilteringSelect"
289 jsId="editor_pane_parent_ou"
290 store="ou_list_store"
291 searchAttr="shortname"
295 <script type="dojo/method" event="onChange">
297 if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
298 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
299 else this.required = true;
306 <th>&conify.org_unit.editor_pane.opac_visible;</th>
309 id="editor_pane_opac_visible"
310 jsId="editor_pane_opac_visible"
312 dojoType="dijit.form.CheckBox"
313 onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
319 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
321 <button jsId="save_ou_button" dojoType="dijit.form.Button" label="&conify.save_button.label;" onClick="save_org()">
322 <script type="dojo/connect" event="startup">
323 this.disabled = true;
327 <button jsId="delete_ou_button" dojoType="dijit.form.Button" label="&conify.delete_button.label;">
328 <script type="dojo/connect" event="startup">
329 this.disabled = true;
331 <script type="dojo/connect" event="onClick">
333 var old_name = ou_list_store.getValue( current_ou, 'name' );
335 if (ou_list_store.getValue( current_ou, '_trueRoot' ) == 'true') {
336 highlighter.editor_pane.red.play();
337 status_update( dojo.string.substitute( aou_strings.ERROR_DELETING_LAST_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
341 if ( current_ou.children ) {
342 var kids = current_ou.children;
343 if (!dojo.isArray(kids)) kids = [kids];
345 var existing_kids = dojo.filter(
347 function(kid){ return kid.isdeleted[0] != 1 }
349 if ( existing_kids.length > 0) {
350 highlighter.editor_pane.red.play();
351 status_update( dojo.string.substitute( aou_strings.ERROR_ORPHANS, [ou_list_store.getValue( current_ou, 'name' ), existing_kids.length] ) );
356 if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
357 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
359 var modified_ou = new aou().fromStoreItem( current_ou );
360 modified_ou.isdeleted( 1 );
363 objs.push(modified_ou);
364 if (!current_billing_address.isnew()) {
365 current_billing_address.isdeleted( 1 );
366 objs.push(current_billing_address);
369 if (!current_mailing_address.isnew()) {
370 current_mailing_address.isdeleted( 1 );
371 objs.push(current_mailing_address);
374 if (!current_holds_address.isnew()) {
375 current_holds_address.isdeleted( 1 );
376 objs.push(current_holds_address);
379 if (!current_ill_address.isnew()) {
380 current_ill_address.isdeleted( 1 );
381 objs.push(current_ill_address);
384 if (!current_ou_hoo.isnew()) {
385 current_ou_hoo.isdeleted( 1 );
386 objs.push(current_ou_hoo);
391 onerror : function (r) {
392 highlighter.editor_pane.red.play();
393 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
395 oncomplete : function (r) {
396 new_kid_button.disabled = true;
397 save_ou_button.disabled = true;
398 delete_ou_button.disabled = true;
400 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type', 'parent_ou' ];
401 for ( var i in main_settings_fields ) {
402 var field = main_settings_fields[i];
403 window["editor_pane_" + field].setValue( '' ); // unset the value
404 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
407 ou_list_store.fetch({
408 query : { id : ou_list_store.getValue( current_ou, 'id' ) },
409 queryOptions : { deep : true },
410 onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { } },
411 scope : ou_list_store
414 current_billing_address = null;
415 current_mailing_address = null;
416 current_holds_address = null;
417 current_ill_address = null;
418 current_ou_hoo = null;
421 highlighter.editor_pane.green.play();
422 status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
432 <button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.new_kid_button.label;">
433 <script type="dojo/connect" event="startup">
434 this.disabled = true;
436 <script type="dojo/connect" event="onClick">
438 var new_fm_obj = new aou().fromHash({
440 name : aou_strings.LABEL_NEW_BRANCH + virgin_ou_id,
442 shortname : ou_list_store.getValue( current_ou, 'shortname' ) + '-NEW' + virgin_ou_id--,
443 parent_ou : ou_list_store.getValue( current_ou, 'id' ),
444 ou_type : ou_list_store.getValue( current_ou, 'ou_type' )
447 pcrud.create( new_fm_obj, {
449 onerror : function (r) {
450 highlighter.editor_pane.red.play();
451 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
453 oncomplete : function (r, list) {
456 ou_list_store.newItem(
458 { parent : current_ou, attribute : 'children' }
461 highlighter.editor_pane.red.play();
462 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
467 highlighter.editor_pane.green.play();
468 highlighter.ou_tree.green.play();
469 status_update( dojo.string.substitute(aou_strings.SUCCESS_CREATING_CHILD_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
476 <div id="hoo_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.hoo_pane.title;">
477 <table class="tundra" style="margin:10px;">
478 <tr><th></th><th>&conify.org_unit.hoo_pane.open_time;</th><th>&conify.org_unit.hoo_pane.close_time;</th></tr>
479 <tr><th>&conify.org_unit.hoo_pane.monday;</th>
480 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_open" onChange="set_hoo_thisvalue('dow_0_open', this.value);"></span></td>
481 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_close" onChange="set_hoo_thisvalue('dow_0_close', this.value);"></span></td>
482 <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') );"></span></td>
484 <tr><th>&conify.org_unit.hoo_pane.tuesday;</th>
485 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_open" onChange="set_hoo_thisvalue('dow_1_open', this.value);"></span></td>
486 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_close" onChange="set_hoo_thisvalue('dow_1_close', this.value);"></span></td>
487 <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') );"></span></td>
489 <tr><th>&conify.org_unit.hoo_pane.wednesday;</th>
490 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_open" onChange="set_hoo_thisvalue('dow_2_open', this.value);"></span></td>
491 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_close" onChange="set_hoo_thisvalue('dow_2_close', this.value);"></span></td>
492 <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') );"></span></td>
494 <tr><th>&conify.org_unit.hoo_pane.thursday;</th>
495 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_open" onChange="set_hoo_thisvalue('dow_3_open', this.value);"></span></td>
496 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_close" onChange="set_hoo_thisvalue('dow_3_close', this.value);"></span></td>
497 <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') );"></span></td>
499 <tr><th>&conify.org_unit.hoo_pane.friday;</th>
500 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_open" onChange="set_hoo_thisvalue('dow_4_open', this.value);"></span></td>
501 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_close" onChange="set_hoo_thisvalue('dow_4_close', this.value);"></span></td>
502 <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') );"></span></td>
504 <tr><th>&conify.org_unit.hoo_pane.saturday;</th>
505 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_open" onChange="set_hoo_thisvalue('dow_5_open', this.value);"></span></td>
506 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_close" onChange="set_hoo_thisvalue('dow_5_close', this.value);"></span></td>
507 <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') );"></span></td>
509 <tr><th>&conify.org_unit.hoo_pane.sunday;</th>
510 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_open" onChange="set_hoo_thisvalue('dow_6_open', this.value);"></span></td>
511 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_close" onChange="set_hoo_thisvalue('dow_6_close', this.value);"></span></td>
512 <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') );"></span></td>
516 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
517 <script type="dojo/connect" event="startup">
518 this.disabled = true;
520 <script type="dojo/connect" event="onClick">
522 if (!current_ou_hoo.isnew()) {
523 current_ou_hoo.ischanged( 1 );
526 pcrud.apply( current_ou_hoo, {
528 onerror : function (r) {
529 highlighter.hoo_pane.red.play();
530 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
532 oncomplete : function (r) {
533 current_ou_hoo.isnew( 0 );
534 current_ou_hoo.ischanged( 0 );
535 highlighter.hoo_pane.green.play();
536 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
545 <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
547 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
549 <script type="dojo/method">
550 current_billing_address = null;
551 current_mailing_address = null;
552 current_holds_address = null;
553 current_ill_address = null;
556 <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
557 <table class="tundra" style="margin:10px;">
559 <th>&conify.org_unit.addresses_pane.type;</th>
561 <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"></span>
563 <th>&conify.org_unit.addresses_pane.valid;</th><td>
566 jsId="billing_addr_valid"
567 dojoType="dijit.form.CheckBox"
569 onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
574 <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"></span></td>
577 <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() )"></span></td>
580 <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"></span></td>
581 <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() )"></span></td>
582 <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"></span></td>
585 <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"></span></td>
586 <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"></span></td>
589 <th>&conify.org_unit.addresses_pane.san;</th><td colspan="2"><span jsId="billing_addr_san" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_billing_address.san( this.getValue() )" required="true"></span></td>
593 <button jsId="save_billing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
594 <script type="dojo/connect" event="startup">
595 this.disabled = true;
597 <script type="dojo/connect" event="onClick">
599 if (!current_billing_address.isnew()) {
600 current_billing_address.ischanged( 1 );
603 pcrud.apply( current_billing_address, {
605 onerror : function (r) {
606 highlighter.addresses_pane.red.play();
607 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
609 oncomplete : function (r, list) {
610 if (list[0] && (current_billing_address.isnew() == 1)) {
611 current_billing_address = list[0];
613 ou_list_store.setValue( current_ou, "billing_address", current_billing_address.id());
616 current_billing_address.isnew( 0 );
617 current_billing_address.ischanged( 0 );
618 highlighter.addresses_pane.green.play();
619 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
627 <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
628 <table class="tundra" style="margin:10px;">
630 <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() )"></span></td>
631 <th>&conify.org_unit.addresses_pane.valid;</th><td>
634 jsId="holds_addr_valid"
635 dojoType="dijit.form.CheckBox"
637 onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
642 <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"></span></td>
645 <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() )"></span></td>
648 <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"></span></td>
649 <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() )"></span></td>
650 <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"></span></td>
653 <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"></span></td>
654 <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"></span></td>
657 <th>&conify.org_unit.addresses_pane.san;</th><td colspan="2"><span jsId="holds_addr_san" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_holds_address.san( this.getValue() )" required="true"></span></td>
661 <button jsId="save_holds_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
662 <script type="dojo/connect" event="startup">
663 this.disabled = true;
665 <script type="dojo/connect" event="onClick">
667 if (!current_holds_address.isnew()) {
668 current_holds_address.ischanged( 1 );
671 pcrud.apply( current_holds_address, {
673 onerror : function (r) {
674 highlighter.addresses_pane.red.play();
675 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
677 oncomplete : function (r, list) {
678 if (list[0] && (current_holds_address.isnew() == 1)) {
679 current_holds_address = list[0];
681 ou_list_store.setValue( current_ou, "holds_address", current_holds_address.id());
684 current_holds_address.isnew( 0 );
685 current_holds_address.ischanged( 0 );
686 highlighter.addresses_pane.green.play();
687 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
695 <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
696 <table class="tundra" style="margin:10px;">
698 <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() )"></span></td>
699 <th>&conify.org_unit.addresses_pane.valid;</th><td>
702 jsId="mailing_addr_valid"
703 dojoType="dijit.form.CheckBox"
704 onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
709 <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"></span></td>
712 <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() )"></span></td>
715 <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"></span></td>
716 <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() )"></span></td>
717 <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"></span></td>
720 <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"></span></td>
721 <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"></span></td>
724 <th>&conify.org_unit.addresses_pane.san;</th><td colspan="2"><span jsId="mailing_addr_san" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_mailing_address.san( this.getValue() )" required="true"></span></td>
728 <button jsId="save_mailing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
729 <script type="dojo/connect" event="startup">
730 this.disabled = true;
732 <script type="dojo/connect" event="onClick">
734 if (!current_mailing_address.isnew()) {
735 current_mailing_address.ischanged( 1 );
738 pcrud.apply( current_mailing_address, {
740 onerror : function (r) {
741 highlighter.addresses_pane.red.play();
742 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
744 oncomplete : function (r, list) {
745 if (list[0] && (current_mailing_address.isnew() == 1)) {
746 current_mailing_address = list[0];
748 ou_list_store.setValue( current_ou, "mailing_address", current_mailing_address.id());
751 current_mailing_address.isnew( 0 );
752 current_mailing_address.ischanged( 0 );
753 highlighter.addresses_pane.green.play();
754 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
762 <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
763 <table class="tundra" style="margin:10px;">
765 <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() )"></span></td>
766 <th>&conify.org_unit.addresses_pane.valid;</th><td>
769 jsId="ill_addr_valid"
770 dojoType="dijit.form.CheckBox"
771 onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
776 <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"></span></td>
779 <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() )"></span></td>
782 <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"></span></td>
783 <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() )"></span></td>
784 <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"></span></td>
787 <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"></span></td>
788 <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"></span></td>
791 <th>&conify.org_unit.addresses_pane.san;</th><td colspan="2"><span jsId="ill_addr_san" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_ill_address.san( this.getValue() )" required="true"></span></td>
795 <button jsId="save_ill_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
796 <script type="dojo/connect" event="startup">
797 this.disabled = true;
799 <script type="dojo/connect" event="onClick">
801 if (!current_ill_address.isnew()) {
802 current_ill_address.ischanged( 1 );
805 pcrud.apply( current_ill_address, {
807 onerror : function (r) {
808 highlighter.addresses_pane.red.play();
809 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
811 oncomplete : function (r, list) {
812 if (list[0] && (current_ill_address.isnew() == 1)) {
813 current_ill_address = list[0];
815 ou_list_store.setValue( current_ou, "ill_address", current_ill_address.id());
818 current_ill_address.isnew( 0 );
819 current_ill_address.ischanged( 0 );
820 highlighter.addresses_pane.green.play();
821 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
834 <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>