]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/conify/global/actor/org_unit.html
Make quotes in JavaScript inside attribute values work in XMLENT
[Evergreen.git] / Open-ILS / web / conify / global / actor / org_unit.html
1 <!--
2 # Copyright (C) 2008  Georgia Public Library Service / Equinox Software, Inc
3 # Mike Rylander <miker@esilibrary.com>
4
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.
9
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.
14 -->
15 <!DOCTYPE html PUBLIC 
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"-->
19 ]>
20 <html xmlns="http://www.w3.org/1999/xhtml">
21         <head>
22                 <title>&conify.org_unit.title;</title>
23
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');
28                 </style>
29
30                 <style>
31                         html, body
32                         {
33                                 height: 100%;
34                                 width: 100%;
35                                 margin: 0px 0px 0px 0px;
36                                 padding: 0px 0px 0px 0px;
37                                 overflow: hidden;
38                         }
39
40                         th
41                         {
42                                 text-align: right;
43                                 font-weight: bold;
44                                 padding-left: 20px;
45                                 padding-right: 5px;
46                         }
47                 </style>
48
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>
54
55                 <!-- Dojo goodness -->
56                 <script type="text/javascript" src="../admin.js"></script>
57
58                 <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
59                 <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
60
61                 <script type="text/javascript" src="org_unit.js"></script>
62
63         </head>
64
65         <body class="tundra" id='pagebody'>
66
67                 <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
68
69                         <div dojoType="dijit.layout.ContentPane" sizeShare="100">
70                                 <script type="dojo/method">
71 <![CDATA[
72                                         var ou_list_data = { label : 'shortname', identifier : 'id' };
73                                         window.dirtyStore = [];
74                 
75                                         pCRUD.request({
76                                                 method : 'open-ils.permacrud.search.aou.atomic',
77                                                 timeout : 15,
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 });
84
85                                                         window.ou_list_store.onSet = function (item, attr, o, n) {
86                                                                 if (attr == 'ischanged') return;
87                                                                 if (n == o) return;
88                                                                 this.setValue( item, 'ischanged', 1);
89                                                         };
90
91                                                         dojo.addOnUnload( function (event) {
92
93                                                                 ou_list_store.fetch({
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 */ } },
97                                                                         scope : ou_list_store
98                                                                 });
99
100                                                                 if (dirtyStore.length > 0) {
101                                                                         var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
102
103                                                                         if (confirmation) {
104                                                                                 for (var i in window.dirtyStore) {
105                                                                                         window.current_ou = window.dirtyStore[i];
106                                                                                         save_org(true);
107                                                                                 }
108                                                                         }
109                                                                 }
110
111                                                         });
112                                                 }
113                                         }).send();
114
115                     pCRUD.request({
116                         method : 'open-ils.permacrud.search.aout.atomic',
117                         timeout : 10,
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 });
124                         }
125                     }).send();
126
127                                         highlighter.ou_tree = {};
128                                         highlighter.editor_pane = {};
129                                         highlighter.hoo_pane = {};
130                                         highlighter.addresses_pane = {};
131
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 } );
134
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 } );
137
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 } );
140
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 } );
143 ]]>
144                                 </script>
145                                 <div
146                                   id="ou_tree"
147                                   label="&conify.org_unit.ou_tree.label;"
148                                   query="{'_top':'true'}"
149                                   dojoType="dijit.Tree"
150                                   store="ou_list_store"
151                                   minSize="200"
152                                   jsId="ou_tree"
153                                 >
154
155                                         <script type="dojo/method" event="onClick" args="item,node">
156 <![CDATA[
157                                                 right_pane_toggler.show();
158
159                                                 current_ou = item;
160                                                 window.current_fm_ou = new aou().fromStoreItem(item);
161
162                                                 highlighter.editor_pane.green.play();
163                                                 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
164
165                                                 new_kid_button.disabled = false;
166                                                 save_ou_button.disabled = false;
167                                                 delete_ou_button.disabled = false;
168
169                                                 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
170
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 );
175
176                                                         if (!value) {
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 );
180                                                 }
181
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);
187                                                 } else {
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' ) );
191                                                 }
192
193                                                 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
194
195                                                 hoo_load();
196                                                 addr_load();
197 ]]>
198                                         </script>
199
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;
203                                                 return label;
204                                         </script>
205
206                                 </div>
207                         </div>
208
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();
213                                 </script>
214
215                                 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
216         
217                                         <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
218
219                                                 <table class="tundra" style="margin:10px;">
220                                                         <tr>
221                                                                 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
222                                                                 <td>
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() );
226                                                                                 </script>
227                                                                         </span>
228                                                                         <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
229                                                                 </td>
230                                                         </tr>
231                                                         <tr>
232                                                                 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
233                                                                 <td>
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() );
237                                                                                 </script>
238                                                                         </span>
239                                                                 </td>
240                                                         </tr>
241                                                         <tr>
242                                                                 <th>&conify.org_unit.editor_pane.main_email;</th>
243                                                                 <td>
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() );
247                                                                                 </script>
248                                                                         </span>
249                                                                 </td>
250                                                         </tr>
251                                                         <tr>
252                                                                 <th>&conify.org_unit.editor_pane.main_phone;</th>
253                                                                 <td>
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() );
257                                                                                 </script>
258                                                                         </span>
259                                                                 </td>
260                                                         </tr>
261                                                         <tr>
262                                                                 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
263                                                                 <td>
264                                                                         <div
265                                                                           id="editor_pane_ou_type"
266                                                                           dojoType="dijit.form.FilteringSelect"
267                                                                           jsId="editor_pane_ou_type"
268                                                                           store="ou_type_store"
269                                                                           searchAttr="name"
270                                                                           ignoreCase="true"
271                                                                           required="true"
272                                                                         >
273                                                                                 <script type="dojo/method" event="onChange">
274                                                                                         if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
275                                                                                 </script>
276                                                                         </div>
277                                                                 </td>
278                                                         </tr>
279                                                         <tr>
280                                                                 <th>&conify.org_unit.editor_pane.parent;</th>
281                                                                 <td>
282                                                                         <div
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"
288                                                                           ignoreCase="true"
289                                                                           required="true"
290                                                                         >
291                                                                                 <script type="dojo/method" event="onChange">
292 <![CDATA[
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;
296 ]]>
297                                                                                 </script>
298                                                                         </div>
299                                                                 </td>
300                                                         </tr>
301                                                         <tr>
302                                                                 <th>&conify.org_unit.editor_pane.opac_visible;</th>
303                                                                 <td>
304                                                                         <input
305                                                                           id="editor_pane_opac_visible"
306                                                                           jsId="editor_pane_opac_visible"
307                                                                           type="checkbox"
308                                                                           dojoType="dijit.form.CheckBox"
309                                                                           onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
310                                                                         />
311                                                                 </td>
312                                                         </tr>
313                                                 </table>
314         
315                                                 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
316         
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;
320                                                                 </script>
321                                                         </button>
322         
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;
326                                                                 </script>
327                                                                 <script type="dojo/connect" event="onClick">
328 <![CDATA[
329                                                                         var old_name = ou_list_store.getValue( current_ou, 'name' );
330
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' )] ) );
334                                                                                 return false;
335                                                                         }
336
337                                                                         if ( current_ou.children ) {
338                                                                                 var kids = current_ou.children;
339                                                                                 if (!dojo.isArray(kids)) kids = [kids];
340         
341                                                                                 var existing_kids = dojo.filter(
342                                                                                         kids,
343                                                                                         function(kid){ return kid.isdeleted[0] != 1 }
344                                                                                 );
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] ) );
348                                                                                         return;
349                                                                                 }
350                                                                         }
351         
352                                                                         if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
353                                                                                 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
354         
355                                                                                 var modified_ou = new aou().fromStoreItem( current_ou );
356                                                                                 modified_ou.isdeleted( 1 );
357         
358                                                                                 pCRUD.request({
359                                                                                         method : 'open-ils.permacrud.delete.aou',
360                                                                                         timeout : 10,
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]));
365                                                                                         },
366                                                                                         oncomplete : function (r) {
367                                                                                                 var res = r.recv();
368                                                                                                 if ( res && res.content() ) {
369         
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
375                                                                                                         });
376         
377                                                                                                         current_ou = null;
378         
379                                                                                                         new_kid_button.disabled = true;
380                                                                                                         save_ou_button.disabled = true;
381                                                                                                         delete_ou_button.disabled = true;
382                         
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
388                                                                                                         }
389                         
390                                                                                                         highlighter.editor_pane.green.play();
391                                                                                                         status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
392                                                                                                 } else {
393                                                                                                         highlighter.editor_pane.red.play();
394                                                                                                         status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
395                                                                                                 }
396                                                                                         }
397                                                                                 }).send();
398         
399                                                                         }
400 ]]>
401                                                                 </script>
402                                                         </button>
403         
404                                                 </div>
405         
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;
409                                                         </script>
410                                                         <script type="dojo/connect" event="onClick">
411 <![CDATA[
412                                                                 var new_fm_obj = new aou().fromHash({
413                                                                         isnew                   : 1,
414                                                                         name                    : aou_strings.LABEL_NEW_BRANCH,
415                                                                         opac_visible    : 'f',
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' )
419                                                                 });
420         
421                                                                 var new_obj;
422         
423                                                                 pCRUD.request({
424                                                                         method : 'open-ils.permacrud.create.aou',
425                                                                         timeout : 10,
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 );
430                                                                         },
431                                                                         oncomplete : function (r) {
432                                                                                 var res = r.recv();
433                                                                                 if ( res && res.content() ) {
434                                                                                         ou_list_store.newItem(
435                                                                                                 res.content().toHash(),
436                                                                                                 { parent : current_ou, attribute : 'children' }
437                                                                                         );
438                                                                                 } else {
439                                                                                         highlighter.editor_pane.red.play();
440                                                                                         status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
441                                                                                 }
442                                                                         },
443                                                                 }).send();
444         
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' )] ) );
448 ]]>
449                                                         </script>
450                                                 </button>
451         
452                                         </div>
453
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>
461                                                         </tr>
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>
466                                                         </tr>
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>
471                                                         </tr>
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>
476                                                         </tr>
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>
481                                                         </tr>
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>
486                                                         </tr>
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>
491                                                         </tr>
492                                                 </table>
493         
494                                                 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
495                                                         <script type="dojo/connect" event="onClick">
496 <![CDATA[
497                                                                 var method_name = 'open-ils.permacrud.update.aouhoo';
498                                                                 if (current_ou_hoo.isnew() == 1) method_name = 'open-ils.permacrud.create.aouhoo';
499         
500                                                                 pCRUD.request({
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' )] ) );
506                                                                         },
507                                                                         oncomplete : function (r) {
508                                                                                 var res = r.recv();
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' )] ) );
513                                                                                 } else {
514                                                                                         highlighter.editor_pane.red.play();
515                                                                                         status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
516                                                                                 }
517                                                                         },
518                                                                 }).send();
519 ]]>
520                                                         </script>
521                                                 </button>
522         
523                                         </div>
524         
525                                         <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
526                                                 
527                                                 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
528         
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;
534                                                         </script>
535         
536                                                         <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
537                                                                 <table class="tundra" style="margin:10px;">
538                                                                         <tr>
539                                                                                 <th>&conify.org_unit.addresses_pane.type;</th>
540                                                                                 <td colspan="3">
541                                                                                         <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"/>
542                                                                                 </td>
543                                                                                 <th>&conify.org_unit.addresses_pane.valid;</th><td>
544                                                                                         <input
545                                                                                           type="checkbox"
546                                                                                           jsId="billing_addr_valid"
547                                                                                           dojoType="dijit.form.CheckBox"
548                                                                                           value='t'
549                                                                                           onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
550                                                                                         />
551                                                                                 </td>
552                                                                         </tr>
553                                                                         <tr>
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>
555                                                                         </tr>
556                                                                         <tr>
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>
558                                                                         </tr>
559                                                                         <tr>
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>
563                                                                         </tr>
564                                                                         <tr>
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>
567                                                                         </tr>
568                                                                 </table>
569         
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;
573                                                                         </script>
574                                                                         <script type="dojo/connect" event="onClick">
575 <![CDATA[
576                                                                                 var method_name = 'open-ils.permacrud.update.aoa';
577                                                                                 if (current_billing_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
578         
579                                                                                 pCRUD.request({
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' )] ) );
585                                                                                         },
586                                                                                         oncomplete : function (r) {
587                                                                                                 var res = r.recv();
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() );
592                                                                                                                 save_org();
593                                                                                                         }
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' )] ) );
597                                                                                                 } else {
598                                                                                                         highlighter.addresses_pane.red.play();
599                                                                                                         status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
600                                                                                                 }
601                                                                                         },
602                                                                                 }).send();
603 ]]>
604                                                                         </script>
605                                                                 </button>
606                                                         </div>
607
608                                                         <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
609                                                                 <table class="tundra" style="margin:10px;">
610                                                                         <tr>
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>
613                                                                                         <input
614                                                                                           type="checkbox"
615                                                                                           jsId="holds_addr_valid"
616                                                                                           dojoType="dijit.form.CheckBox"
617                                                                                           value='t'
618                                                                                           onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
619                                                                                         />
620                                                                                 </td>
621                                                                         </tr>
622                                                                         <tr>
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>
624                                                                         </tr>
625                                                                         <tr>
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>
627                                                                         </tr>
628                                                                         <tr>
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>
632                                                                         </tr>
633                                                                         <tr>
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>
636                                                                         </tr>
637                                                                 </table>
638         
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;
642                                                                         </script>
643                                                                         <script type="dojo/connect" event="onClick">
644 <![CDATA[
645                                                                                 var method_name = 'open-ils.permacrud.update.aoa';
646                                                                                 if (current_holds_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
647         
648                                                                                 pCRUD.request({
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' )] );
654                                                                                         },
655                                                                                         oncomplete : function (r) {
656                                                                                                 var res = r.recv();
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() );
661                                                                                                                 save_org();
662                                                                                                         }
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' )] ) );
666                                                                                                 } else {
667                                                                                                         highlighter.addresses_pane.red.play();
668                                                                                                         throw dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] );
669                                                                                                 }
670                                                                                         },
671                                                                                 }).send();
672 ]]>
673                                                                         </script>
674                                                                 </button>
675                                                         </div>
676
677                                                         <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
678                                                                 <table class="tundra" style="margin:10px;">
679                                                                         <tr>
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>
682                                                                                         <input
683                                                                                           type="checkbox"
684                                                                                           jsId="mailing_addr_valid"
685                                                                                           dojoType="dijit.form.CheckBox"
686                                                                                           onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
687                                                                                         />
688                                                                                 </td>
689                                                                         </tr>
690                                                                         <tr>
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>
692                                                                         </tr>
693                                                                         <tr>
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>
695                                                                         </tr>
696                                                                         <tr>
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>
700                                                                         </tr>
701                                                                         <tr>
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>
704                                                                         </tr>
705                                                                 </table>
706         
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;
710                                                                         </script>
711                                                                         <script type="dojo/connect" event="onClick">
712 <![CDATA[
713                                                                                 var method_name = 'open-ils.permacrud.update.aoa';
714                                                                                 if (current_mailing_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
715         
716                                                                                 pCRUD.request({
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' )] );
722                                                                                         },
723                                                                                         oncomplete : function (r) {
724                                                                                                 var res = r.recv();
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() );
729                                                                                                                 save_org();
730                                                                                                         }
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' )] ) );
734                                                                                                 } else {
735                                                                                                         highlighter.addresses_pane.red.play();
736                                                                                                         throw dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] );
737                                                                                                 }
738                                                                                         },
739                                                                                 }).send();
740 ]]>
741                                                                         </script>
742                                                                 </button>
743                                                         </div>
744
745                                                         <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
746                                                                 <table class="tundra" style="margin:10px;">
747                                                                         <tr>
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>
750                                                                                         <input
751                                                                                           type="checkbox"
752                                                                                           jsId="ill_addr_valid"
753                                                                                           dojoType="dijit.form.CheckBox"
754                                                                                           onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
755                                                                                         />
756                                                                                 </td>
757                                                                         </tr>
758                                                                         <tr>
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>
760                                                                         </tr>
761                                                                         <tr>
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>
763                                                                         </tr>
764                                                                         <tr>
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>
768                                                                         </tr>
769                                                                         <tr>
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>
772                                                                         </tr>
773                                                                 </table>
774         
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;
778                                                                         </script>
779                                                                         <script type="dojo/connect" event="onClick">
780 <![CDATA[
781                                                                                 var method_name = 'open-ils.permacrud.update.aoa';
782                                                                                 if (current_ill_address.isnew() == 1) method_name = 'open-ils.permacrud.create.aoa';
783         
784                                                                                 pCRUD.request({
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' )] );
790                                                                                         },
791                                                                                         oncomplete : function (r) {
792                                                                                                 var res = r.recv();
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() );
797                                                                                                                 save_org();
798                                                                                                         }
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' )] ) );
802                                                                                                 } else {
803                                                                                                         highlighter.addresses_pane.red.play();
804                                                                                                         throw dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] );
805                                                                                                 }
806                                                                                         },
807                                                                                 }).send();
808 ]]>
809                                                                         </script>
810                                                                 </button>
811                                                         </div>
812                                                 </div>
813                                         </div>
814                                 </div>
815                         </div>
816                 </div>
817
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>
819         </body>
820 </html>