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/dojo/openils_dojo.js"></script>
67 <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
69 <script type="text/javascript" src="org_unit.js"></script>
73 <body class="tundra" id='pagebody'>
75 <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
77 <div dojoType="dijit.layout.ContentPane" sizeShare="100">
78 <script type="dojo/method">
81 pcrud.retrieveAll( 'aou', {
82 timeout : 10, order_by : { aou : 'shortname' },
83 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_ORGS); },
84 oncomplete : function (r) {
85 var _ou_list = r.recv().content();
86 var _ou_data = aou.toStoreData( _ou_list );
87 ou_list_store = new dojo.data.ItemFileWriteStore({ data : _ou_data });
89 ou_list_store.onSet = function (item, attr, o, n) {
90 if (attr == 'ischanged') return;
91 if ((n == o) || ((o == null) && (n == ''))) return;
92 this.setValue( item, 'ischanged', 1);
95 dojo.addOnUnload( function (event) {
98 query : { ischanged : 1 },
99 queryOptions : { deep : true },
100 onItem : function (item, req) {
102 if (this.isItem( item )) window.dirtyStore.push( item );
105 scope : window.ou_list_store
108 if (window.dirtyStore.length > 0) {
109 var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
112 for (var i in dirtyStore) {
113 current_ou = window.dirtyStore[i];
122 pcrud.retrieveAll( 'aout', {
123 timeout : 10, order_by : { aout : 'depth' },
124 onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_TYPES_AOUT); },
125 oncomplete : function (r) {
126 window._ou_type_list = r.recv().content();
127 window._ou_type_data = aout.toStoreData( window._ou_type_list );
128 window.ou_type_store = new dojo.data.ItemFileReadStore({ data : window._ou_type_data });
132 highlighter.ou_tree = {};
133 highlighter.editor_pane = {};
134 highlighter.hoo_pane = {};
135 highlighter.addresses_pane = {};
137 highlighter.ou_tree.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'ou_tree', duration : 500 } );
138 highlighter.ou_tree.red = dojox.fx.highlight( { color : '#FF2018', node : 'ou_tree', duration : 500 } );
140 highlighter.editor_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'editor_pane', duration : 500 } );
141 highlighter.editor_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'editor_pane', duration : 500 } );
143 highlighter.hoo_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'hoo_pane', duration : 500 } );
144 highlighter.hoo_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'hoo_pane', duration : 500 } );
146 highlighter.addresses_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'addresses_pane', duration : 500 } );
147 highlighter.addresses_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'addresses_pane', duration : 500 } );
152 label="&conify.org_unit.ou_tree.label;"
153 query="{'_top':'true'}"
154 dojoType="dijit.Tree"
155 store="ou_list_store"
160 <script type="dojo/method" event="onClick" args="item,node">
162 right_pane_toggler.show();
165 window.current_fm_ou = new aou().fromStoreItem(item);
167 highlighter.editor_pane.green.play();
168 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
170 new_kid_button.disabled = false;
171 save_ou_button.disabled = false;
172 delete_ou_button.disabled = false;
174 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
176 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type' ];
177 for ( var i in main_settings_fields ) {
178 var field = main_settings_fields[i];
179 var value = this.store.getValue( current_ou, field );
182 window["editor_pane_" + field].setValue( '' ); // unset the value
183 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
184 } else window["editor_pane_" + field].setValue( value );
187 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) {
188 editor_pane_parent_ou.disabled = true;
189 editor_pane_parent_ou.setValue(null);
190 editor_pane_parent_ou.setDisplayedValue('');
191 editor_pane_parent_ou.validate(false);
193 editor_pane_parent_ou.disabled = false;
194 editor_pane_parent_ou.validate(true);
195 editor_pane_parent_ou.setValue( this.store.getValue( current_ou, 'parent_ou' ) );
198 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
205 <script type="dojo/method" event="getLabel" args="item,pI">
206 var label = this.store.getValue(item,'shortname') + ' : ' + this.store.getValue(item,'name');
207 if (this.store.getValue(item,'ischanged') == 1) label = '* ' + label;
214 <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane" sizeShare="200">
215 <script type="dojo/method">
216 window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
217 window.right_pane_toggler.hide();
220 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
222 <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
224 <table class="tundra" style="margin:10px;">
226 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
228 <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
229 <script type="dojo/connect" event="onChange">
230 if (current_ou) ou_list_store.setValue( current_ou, "name", this.getValue() );
233 <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
237 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
239 <span id="editor_pane_shortname" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_shortname" uppercase="true" regExp=".+" required="true">
240 <script type="dojo/connect" event="onChange">
241 if (current_ou) ou_list_store.setValue( current_ou, "shortname", this.getValue() );
247 <th>&conify.org_unit.editor_pane.main_email;</th>
249 <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])?">
250 <script type="dojo/connect" event="onChange">
251 if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
257 <th>&conify.org_unit.editor_pane.main_phone;</th>
259 <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+.*)$">
260 <script type="dojo/connect" event="onChange">
261 if (current_ou) ou_list_store.setValue( current_ou, "phone", this.getValue() );
267 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
270 id="editor_pane_ou_type"
271 dojoType="dijit.form.FilteringSelect"
272 jsId="editor_pane_ou_type"
273 store="ou_type_store"
278 <script type="dojo/method" event="onChange">
279 if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
285 <th>&conify.org_unit.editor_pane.parent;</th>
288 id="editor_pane_parent_ou"
289 dojoType="dijit.form.FilteringSelect"
290 jsId="editor_pane_parent_ou"
291 store="ou_list_store"
292 searchAttr="shortname"
296 <script type="dojo/method" event="onChange">
298 if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
299 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
300 else this.required = true;
307 <th>&conify.org_unit.editor_pane.opac_visible;</th>
310 id="editor_pane_opac_visible"
311 jsId="editor_pane_opac_visible"
313 dojoType="dijit.form.CheckBox"
314 onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
320 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
322 <button jsId="save_ou_button" dojoType="dijit.form.Button" label="&conify.save_button.label;" onClick="save_org()">
323 <script type="dojo/connect" event="startup">
324 this.disabled = true;
328 <button jsId="delete_ou_button" dojoType="dijit.form.Button" label="&conify.delete_button.label;">
329 <script type="dojo/connect" event="startup">
330 this.disabled = true;
332 <script type="dojo/connect" event="onClick">
334 var old_name = ou_list_store.getValue( current_ou, 'name' );
336 if (ou_list_store.getValue( current_ou, '_trueRoot' ) == 'true') {
337 highlighter.editor_pane.red.play();
338 status_update( dojo.string.substitute( aou_strings.ERROR_DELETING_LAST_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
342 if ( current_ou.children ) {
343 var kids = current_ou.children;
344 if (!dojo.isArray(kids)) kids = [kids];
346 var existing_kids = dojo.filter(
348 function(kid){ return kid.isdeleted[0] != 1 }
350 if ( existing_kids.length > 0) {
351 highlighter.editor_pane.red.play();
352 status_update( dojo.string.substitute( aou_strings.ERROR_ORPHANS, [ou_list_store.getValue( current_ou, 'name' ), existing_kids.length] ) );
357 if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
358 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
360 var modified_ou = new aou().fromStoreItem( current_ou );
361 modified_ou.isdeleted( 1 );
364 objs.push(modified_ou);
365 if (!current_billing_address.isnew()) {
366 current_billing_address.isdeleted( 1 );
367 objs.push(current_billing_address);
370 if (!current_mailing_address.isnew()) {
371 current_mailing_address.isdeleted( 1 );
372 objs.push(current_mailing_address);
375 if (!current_holds_address.isnew()) {
376 current_holds_address.isdeleted( 1 );
377 objs.push(current_holds_address);
380 if (!current_ill_address.isnew()) {
381 current_ill_address.isdeleted( 1 );
382 objs.push(current_ill_address);
385 if (!current_ou_hoo.isnew()) {
386 current_ou_hoo.isdeleted( 1 );
387 objs.push(current_ou_hoo);
392 onerror : function (r) {
393 highlighter.editor_pane.red.play();
394 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
396 oncomplete : function (r) {
397 new_kid_button.disabled = true;
398 save_ou_button.disabled = true;
399 delete_ou_button.disabled = true;
401 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type', 'parent_ou' ];
402 for ( var i in main_settings_fields ) {
403 var field = main_settings_fields[i];
404 window["editor_pane_" + field].setValue( '' ); // unset the value
405 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
408 ou_list_store.fetch({
409 query : { id : ou_list_store.getValue( current_ou, 'id' ) },
410 queryOptions : { deep : true },
411 onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { } },
412 scope : ou_list_store
415 current_billing_address = null;
416 current_mailing_address = null;
417 current_holds_address = null;
418 current_ill_address = null;
419 current_ou_hoo = null;
422 highlighter.editor_pane.green.play();
423 status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
433 <button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.new_kid_button.label;">
434 <script type="dojo/connect" event="startup">
435 this.disabled = true;
437 <script type="dojo/connect" event="onClick">
439 var new_fm_obj = new aou().fromHash({
441 name : aou_strings.LABEL_NEW_BRANCH + virgin_ou_id,
443 shortname : ou_list_store.getValue( current_ou, 'shortname' ) + '-NEW' + virgin_ou_id--,
444 parent_ou : ou_list_store.getValue( current_ou, 'id' ),
445 ou_type : ou_list_store.getValue( current_ou, 'ou_type' )
448 pcrud.create( new_fm_obj, {
450 onerror : function (r) {
451 highlighter.editor_pane.red.play();
452 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
454 oncomplete : function (r, list) {
457 ou_list_store.newItem(
459 { parent : current_ou, attribute : 'children' }
462 highlighter.editor_pane.red.play();
463 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
468 highlighter.editor_pane.green.play();
469 highlighter.ou_tree.green.play();
470 status_update( dojo.string.substitute(aou_strings.SUCCESS_CREATING_CHILD_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
477 <div id="hoo_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.hoo_pane.title;">
478 <table class="tundra" style="margin:10px;">
479 <tr><th></th><th>&conify.org_unit.hoo_pane.open_time;</th><th>&conify.org_unit.hoo_pane.close_time;</th></tr>
480 <tr><th>&conify.org_unit.hoo_pane.monday;</th>
481 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_open" onChange="set_hoo_thisvalue('dow_0_open', this.value);"></span></td>
482 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_close" onChange="set_hoo_thisvalue('dow_0_close', this.value);"></span></td>
483 <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>
485 <tr><th>&conify.org_unit.hoo_pane.tuesday;</th>
486 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_open" onChange="set_hoo_thisvalue('dow_1_open', this.value);"></span></td>
487 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_close" onChange="set_hoo_thisvalue('dow_1_close', this.value);"></span></td>
488 <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>
490 <tr><th>&conify.org_unit.hoo_pane.wednesday;</th>
491 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_open" onChange="set_hoo_thisvalue('dow_2_open', this.value);"></span></td>
492 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_close" onChange="set_hoo_thisvalue('dow_2_close', this.value);"></span></td>
493 <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>
495 <tr><th>&conify.org_unit.hoo_pane.thursday;</th>
496 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_open" onChange="set_hoo_thisvalue('dow_3_open', this.value);"></span></td>
497 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_close" onChange="set_hoo_thisvalue('dow_3_close', this.value);"></span></td>
498 <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>
500 <tr><th>&conify.org_unit.hoo_pane.friday;</th>
501 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_open" onChange="set_hoo_thisvalue('dow_4_open', this.value);"></span></td>
502 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_close" onChange="set_hoo_thisvalue('dow_4_close', this.value);"></span></td>
503 <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>
505 <tr><th>&conify.org_unit.hoo_pane.saturday;</th>
506 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_open" onChange="set_hoo_thisvalue('dow_5_open', this.value);"></span></td>
507 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_close" onChange="set_hoo_thisvalue('dow_5_close', this.value);"></span></td>
508 <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>
510 <tr><th>&conify.org_unit.hoo_pane.sunday;</th>
511 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_open" onChange="set_hoo_thisvalue('dow_6_open', this.value);"></span></td>
512 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_close" onChange="set_hoo_thisvalue('dow_6_close', this.value);"></span></td>
513 <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>
517 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
518 <script type="dojo/connect" event="startup">
519 this.disabled = true;
521 <script type="dojo/connect" event="onClick">
523 if (!current_ou_hoo.isnew()) {
524 current_ou_hoo.ischanged( 1 );
527 pcrud.apply( current_ou_hoo, {
529 onerror : function (r) {
530 highlighter.hoo_pane.red.play();
531 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
533 oncomplete : function (r) {
534 current_ou_hoo.isnew( 0 );
535 current_ou_hoo.ischanged( 0 );
536 highlighter.hoo_pane.green.play();
537 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
546 <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
548 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
550 <script type="dojo/method">
551 current_billing_address = null;
552 current_mailing_address = null;
553 current_holds_address = null;
554 current_ill_address = null;
557 <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
558 <table class="tundra" style="margin:10px;">
560 <th>&conify.org_unit.addresses_pane.type;</th>
562 <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"></span>
564 <th>&conify.org_unit.addresses_pane.valid;</th><td>
567 jsId="billing_addr_valid"
568 dojoType="dijit.form.CheckBox"
570 onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
575 <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>
578 <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>
581 <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>
582 <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>
583 <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>
586 <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>
587 <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>
590 <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>
594 <button jsId="save_billing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
595 <script type="dojo/connect" event="startup">
596 this.disabled = true;
598 <script type="dojo/connect" event="onClick">
600 if (!current_billing_address.isnew()) {
601 current_billing_address.ischanged( 1 );
604 pcrud.apply( current_billing_address, {
606 onerror : function (r) {
607 highlighter.addresses_pane.red.play();
608 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
610 oncomplete : function (r, list) {
611 if (list[0] && (current_billing_address.isnew() == 1)) {
612 current_billing_address = list[0];
614 ou_list_store.setValue( current_ou, "billing_address", current_billing_address.id());
617 current_billing_address.isnew( 0 );
618 current_billing_address.ischanged( 0 );
619 highlighter.addresses_pane.green.play();
620 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
628 <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
629 <table class="tundra" style="margin:10px;">
631 <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>
632 <th>&conify.org_unit.addresses_pane.valid;</th><td>
635 jsId="holds_addr_valid"
636 dojoType="dijit.form.CheckBox"
638 onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
643 <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>
646 <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>
649 <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>
650 <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>
651 <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>
654 <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>
655 <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>
658 <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>
662 <button jsId="save_holds_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
663 <script type="dojo/connect" event="startup">
664 this.disabled = true;
666 <script type="dojo/connect" event="onClick">
668 if (!current_holds_address.isnew()) {
669 current_holds_address.ischanged( 1 );
672 pcrud.apply( current_holds_address, {
674 onerror : function (r) {
675 highlighter.addresses_pane.red.play();
676 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
678 oncomplete : function (r, list) {
679 if (list[0] && (current_holds_address.isnew() == 1)) {
680 current_holds_address = list[0];
682 ou_list_store.setValue( current_ou, "holds_address", current_holds_address.id());
685 current_holds_address.isnew( 0 );
686 current_holds_address.ischanged( 0 );
687 highlighter.addresses_pane.green.play();
688 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
696 <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
697 <table class="tundra" style="margin:10px;">
699 <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>
700 <th>&conify.org_unit.addresses_pane.valid;</th><td>
703 jsId="mailing_addr_valid"
704 dojoType="dijit.form.CheckBox"
705 onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
710 <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>
713 <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>
716 <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>
717 <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>
718 <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>
721 <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>
722 <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>
725 <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>
729 <button jsId="save_mailing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
730 <script type="dojo/connect" event="startup">
731 this.disabled = true;
733 <script type="dojo/connect" event="onClick">
735 if (!current_mailing_address.isnew()) {
736 current_mailing_address.ischanged( 1 );
739 pcrud.apply( current_mailing_address, {
741 onerror : function (r) {
742 highlighter.addresses_pane.red.play();
743 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
745 oncomplete : function (r, list) {
746 if (list[0] && (current_mailing_address.isnew() == 1)) {
747 current_mailing_address = list[0];
749 ou_list_store.setValue( current_ou, "mailing_address", current_mailing_address.id());
752 current_mailing_address.isnew( 0 );
753 current_mailing_address.ischanged( 0 );
754 highlighter.addresses_pane.green.play();
755 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
763 <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
764 <table class="tundra" style="margin:10px;">
766 <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>
767 <th>&conify.org_unit.addresses_pane.valid;</th><td>
770 jsId="ill_addr_valid"
771 dojoType="dijit.form.CheckBox"
772 onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
777 <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>
780 <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>
783 <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>
784 <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>
785 <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>
788 <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>
789 <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>
792 <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>
796 <button jsId="save_ill_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
797 <script type="dojo/connect" event="startup">
798 this.disabled = true;
800 <script type="dojo/connect" event="onClick">
802 if (!current_ill_address.isnew()) {
803 current_ill_address.ischanged( 1 );
806 pcrud.apply( current_ill_address, {
808 onerror : function (r) {
809 highlighter.addresses_pane.red.play();
810 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
812 oncomplete : function (r, list) {
813 if (list[0] && (current_ill_address.isnew() == 1)) {
814 current_ill_address = list[0];
816 ou_list_store.setValue( current_ou, "ill_address", current_ill_address.id());
819 current_ill_address.isnew( 0 );
820 current_ill_address.ischanged( 0 );
821 highlighter.addresses_pane.green.play();
822 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
835 <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>