]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/conify/global/actor/org_unit.html
replace Cookie.js/cookieManager with dojo.cookie. Some things to watch out for as...
[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 type="text/css">
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/CGI.js' type='text/javascript'></script>
52                 <script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
53
54                 <!-- Dojo goodness -->
55                 <script type="text/javascript" src="../admin.js"></script>
56
57                 <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
58                 <script type="text/javascript" src="/js/dojo/dojo/openils_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
73                     pcrud.retrieveAll( 'aou', {
74                         timeout : 10, order_by : { aou : 'shortname' },
75                         onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_ORGS); },
76                         oncomplete : function (r) {
77                             var _ou_list = r.recv().content();
78                             var _ou_data = aou.toStoreData( _ou_list );
79                             ou_list_store = new dojo.data.ItemFileWriteStore({ data : _ou_data });
80
81                             ou_list_store.onSet = function (item, attr, o, n) {
82                                 if (attr == 'ischanged') return;
83                                 if ((n == o) || ((o == null) && (n == ''))) return;
84                                 this.setValue( item, 'ischanged', 1);
85                             };
86
87                             dojo.addOnUnload( function (event) {
88
89                                 ou_list_store.fetch({
90                                     query : { ischanged : 1 },
91                                     queryOptions : { deep : true },
92                                     onItem : function (item, req) {
93                                         try {
94                                             if (this.isItem( item )) window.dirtyStore.push( item );
95                                         } catch (e) {}
96                                     },
97                                     scope : window.ou_list_store
98                                 });
99
100                                 if (window.dirtyStore.length > 0) {
101                                     var confirmation = confirm(aou_strings.CONFIRM_EXIT_AOU);
102
103                                     if (confirmation) {
104                                         for (var i in dirtyStore) {
105                                             current_ou = window.dirtyStore[i];
106                                             save_org(true);
107                                         }
108                                     }
109                                 }
110                             });
111                         }
112                     });
113
114                     pcrud.retrieveAll( 'aout', {
115                         timeout : 10, order_by : { aout : 'depth' },
116                         onerror : function (r) { status_update(aou_strings.ERROR_FETCHING_TYPES_AOUT); },
117                         oncomplete : function (r) {
118                             window._ou_type_list = r.recv().content();
119                             window._ou_type_data = aout.toStoreData( window._ou_type_list );
120                             window.ou_type_store = new dojo.data.ItemFileReadStore({ data : window._ou_type_data });
121                        }
122                     });
123
124                                         highlighter.ou_tree = {};
125                                         highlighter.editor_pane = {};
126                                         highlighter.hoo_pane = {};
127                                         highlighter.addresses_pane = {};
128
129                                         highlighter.ou_tree.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'ou_tree', duration : 500 } );
130                                         highlighter.ou_tree.red = dojox.fx.highlight( { color : '#FF2018', node : 'ou_tree', duration : 500 } );
131
132                                         highlighter.editor_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'editor_pane', duration : 500 } );
133                                         highlighter.editor_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'editor_pane', duration : 500 } );
134
135                                         highlighter.hoo_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'hoo_pane', duration : 500 } );
136                                         highlighter.hoo_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'hoo_pane', duration : 500 } );
137
138                                         highlighter.addresses_pane.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'addresses_pane', duration : 500 } );
139                                         highlighter.addresses_pane.red = dojox.fx.highlight( { color : '#FF2018', node : 'addresses_pane', duration : 500 } );
140 ]]>
141                                 </script>
142                                 <div
143                                   id="ou_tree"
144                                   label="&conify.org_unit.ou_tree.label;"
145                                   query="{'_top':'true'}"
146                                   dojoType="dijit.Tree"
147                                   store="ou_list_store"
148                                   minSize="200"
149                                   jsId="ou_tree"
150                                 >
151
152                                         <script type="dojo/method" event="onClick" args="item,node">
153 <![CDATA[
154                                                 right_pane_toggler.show();
155
156                                                 current_ou = item;
157                                                 window.current_fm_ou = new aou().fromStoreItem(item);
158
159                                                 highlighter.editor_pane.green.play();
160                                                 status_update( dojo.string.substitute( aou_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )] ) );
161
162                                                 new_kid_button.disabled = false;
163                                                 save_ou_button.disabled = false;
164                                                 delete_ou_button.disabled = false;
165
166                                                 dojo.byId('current_ou_name').innerHTML = this.store.getValue( current_ou, 'name' );
167
168                                                 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type' ];
169                                                 for ( var i in main_settings_fields ) {
170                                                         var field = main_settings_fields[i];
171                                                         var value = this.store.getValue( current_ou, field );
172
173                                                         if (!value) {
174                                                                 window["editor_pane_" + field].setValue( '' ); // unset the value
175                                                                 window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
176                                                         } else window["editor_pane_" + field].setValue( value );
177                                                 }
178
179                                                 if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) {
180                                                         editor_pane_parent_ou.disabled = true;
181                                                         editor_pane_parent_ou.setValue(null);
182                                                         editor_pane_parent_ou.setDisplayedValue('');
183                                                         editor_pane_parent_ou.validate(false);
184                                                 } else {
185                                                         editor_pane_parent_ou.disabled = false;
186                                                         editor_pane_parent_ou.validate(true);
187                                                         editor_pane_parent_ou.setValue( this.store.getValue( current_ou, 'parent_ou' ) );
188                                                 }
189
190                                                 editor_pane_opac_visible.setChecked( this.store.getValue( current_ou, 'opac_visible' ) == 't' ? true : false );
191
192                                                 hoo_load();
193                                                 addr_load();
194 ]]>
195                                         </script>
196
197                                         <script type="dojo/method" event="getLabel" args="item,pI">
198                                                 var label = this.store.getValue(item,'shortname') + ' : ' + this.store.getValue(item,'name');
199                                                 if (this.store.getValue(item,'ischanged') == 1) label = '* ' + label;
200                                                 return label;
201                                         </script>
202
203                                 </div>
204                         </div>
205
206                         <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane"  sizeShare="200">
207                                 <script type="dojo/method">
208                                         window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
209                                         window.right_pane_toggler.hide();
210                                 </script>
211
212                                 <div id="right_tabpane" dojoType="dijit.layout.TabContainer">
213         
214                                         <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.editor_pane.title;">
215
216                                                 <table class="tundra" style="margin:10px;">
217                                                         <tr>
218                                                                 <th>&conify.org_unit.editor_pane.org_unit_name;</th>
219                                                                 <td>
220                                                                         <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
221                                                                                 <script type="dojo/connect" event="onChange">
222                                                                                         if (current_ou) ou_list_store.setValue( current_ou, "name", this.getValue() );
223                                                                                 </script>
224                                                                         </span>
225                                                                         <span dojoType="openils.widget.TranslatorPopup" targetObject="current_fm_ou" field="name"></span>
226                                                                 </td>
227                                                         </tr>
228                                                         <tr>
229                                                                 <th>&conify.org_unit.editor_pane.org_unit_code;</th>
230                                                                 <td>
231                                                                         <span id="editor_pane_shortname" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_shortname" uppercase="true" regExp=".+" required="true">
232                                                                                 <script type="dojo/connect" event="onChange">
233                                                                                         if (current_ou) ou_list_store.setValue( current_ou, "shortname", this.getValue() );
234                                                                                 </script>
235                                                                         </span>
236                                                                 </td>
237                                                         </tr>
238                                                         <tr>
239                                                                 <th>&conify.org_unit.editor_pane.main_email;</th>
240                                                                 <td>
241                                                                         <span id="editor_pane_email" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_email" regExp="^\w+(?:\.\w+)*\@\w+(?:\.\w+)+$">
242                                                                                 <script type="dojo/connect" event="onChange">
243                                                                                         if (current_ou) ou_list_store.setValue( current_ou, "email", this.getValue() );
244                                                                                 </script>
245                                                                         </span>
246                                                                 </td>
247                                                         </tr>
248                                                         <tr>
249                                                                 <th>&conify.org_unit.editor_pane.main_phone;</th>
250                                                                 <td>
251                                                                         <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+.*)$">
252                                                                                 <script type="dojo/connect" event="onChange">
253                                                                                         if (current_ou) ou_list_store.setValue( current_ou, "phone", this.getValue() );
254                                                                                 </script>
255                                                                         </span>
256                                                                 </td>
257                                                         </tr>
258                                                         <tr>
259                                                                 <th>&conify.org_unit.editor_pane.org_unit_type;</th>
260                                                                 <td>
261                                                                         <div
262                                                                           id="editor_pane_ou_type"
263                                                                           dojoType="dijit.form.FilteringSelect"
264                                                                           jsId="editor_pane_ou_type"
265                                                                           store="ou_type_store"
266                                                                           searchAttr="name"
267                                                                           ignoreCase="true"
268                                                                           required="true"
269                                                                         >
270                                                                                 <script type="dojo/method" event="onChange">
271                                                                                         if (current_ou) ou_list_store.setValue( current_ou, "ou_type", this.getValue() );
272                                                                                 </script>
273                                                                         </div>
274                                                                 </td>
275                                                         </tr>
276                                                         <tr>
277                                                                 <th>&conify.org_unit.editor_pane.parent;</th>
278                                                                 <td>
279                                                                         <div
280                                                                           id="editor_pane_parent_ou"
281                                                                           dojoType="dijit.form.FilteringSelect"
282                                                                           jsId="editor_pane_parent_ou"
283                                                                           store="ou_list_store"
284                                                                           searchAttr="shortname"
285                                                                           ignoreCase="true"
286                                                                           required="true"
287                                                                         >
288                                                                                 <script type="dojo/method" event="onChange">
289 <![CDATA[
290                                                                                         if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
291                                                                                         if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
292                                                                                         else this.required = true;
293 ]]>
294                                                                                 </script>
295                                                                         </div>
296                                                                 </td>
297                                                         </tr>
298                                                         <tr>
299                                                                 <th>&conify.org_unit.editor_pane.opac_visible;</th>
300                                                                 <td>
301                                                                         <input
302                                                                           id="editor_pane_opac_visible"
303                                                                           jsId="editor_pane_opac_visible"
304                                                                           type="checkbox"
305                                                                           dojoType="dijit.form.CheckBox"
306                                                                           onChange="if (current_ou) ou_list_store.setValue( current_ou, 'opac_visible', this.checked ? 't' : 'f' );"
307                                                                         />
308                                                                 </td>
309                                                         </tr>
310                                                 </table>
311         
312                                                 <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
313         
314                                                         <button jsId="save_ou_button" dojoType="dijit.form.Button" label="&conify.save_button.label;" onClick="save_org()">
315                                                                 <script type="dojo/connect" event="startup">
316                                                                         this.disabled = true;
317                                                                 </script>
318                                                         </button>
319         
320                                                         <button jsId="delete_ou_button" dojoType="dijit.form.Button" label="&conify.delete_button.label;">
321                                                                 <script type="dojo/connect" event="startup">
322                                                                         this.disabled = true;
323                                                                 </script>
324                                                                 <script type="dojo/connect" event="onClick">
325 <![CDATA[
326                                                                         var old_name = ou_list_store.getValue( current_ou, 'name' );
327
328                                                                         if (ou_list_store.getValue( current_ou, '_trueRoot' ) == 'true') {
329                                                                                 highlighter.editor_pane.red.play();
330                                                                                 status_update( dojo.string.substitute( aou_strings.ERROR_DELETING_LAST_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
331                                                                                 return false;
332                                                                         }
333
334                                                                         if ( current_ou.children ) {
335                                                                                 var kids = current_ou.children;
336                                                                                 if (!dojo.isArray(kids)) kids = [kids];
337         
338                                                                                 var existing_kids = dojo.filter(
339                                                                                         kids,
340                                                                                         function(kid){ return kid.isdeleted[0] != 1 }
341                                                                                 );
342                                                                                 if ( existing_kids.length > 0) {
343                                                                                         highlighter.editor_pane.red.play();
344                                                                                         status_update( dojo.string.substitute( aou_strings.ERROR_ORPHANS, [ou_list_store.getValue( current_ou, 'name' ), existing_kids.length] ) );
345                                                                                         return;
346                                                                                 }
347                                                                         }
348         
349                                                                         if (confirm(dojo.string.substitute(aou_strings.CONFIRM_DELETE, [current_ou.name]))) {
350                                                                                 ou_list_store.setValue( current_ou, 'isdeleted', 1 );
351
352                                                                                 var modified_ou = new aou().fromStoreItem( current_ou );
353                                                                                 modified_ou.isdeleted( 1 );
354
355                                         var objs = [];
356                                         objs.push(modified_ou);
357                                                                                 if (!current_billing_address.isnew()) {
358                                             current_billing_address.isdeleted( 1 );
359                                             objs.push(current_billing_address);
360                                         }
361                                                                                 if (!current_mailing_address.isnew()) {
362                                             current_mailing_address.isdeleted( 1 );
363                                             objs.push(current_mailing_address);
364                                         }
365                                                                                 if (!current_holds_address.isnew()) {
366                                             current_holds_address.isdeleted( 1 );
367                                             objs.push(current_holds_address);
368                                         }
369                                                                                 if (!current_ill_address.isnew()) {
370                                             current_ill_address.isdeleted( 1 );
371                                             objs.push(current_ill_address);
372                                         }
373                                         if (!current_ou_hoo.isnew()) {
374                                             current_ou_hoo.isdeleted( 1 );
375                                             objs.push(current_ou_hoo);
376                                         }
377                                         pcrud.apply(objs, {
378                                                                                         timeout : 10,
379                                                                                         onerror : function (r) {
380                                                                                                 highlighter.editor_pane.red.play();
381                                                                                                 status_update(dojo.string.substitute(aou_strings.ERROR_DELETING, [old_name]));
382                                                                                         },
383                                                                                         oncomplete : function (r) {
384                                                                                                 new_kid_button.disabled = true;
385                                                                                                 save_ou_button.disabled = true;
386                                                                                                 delete_ou_button.disabled = true;
387
388                                                                                                 var main_settings_fields = [ 'name', 'shortname', 'email', 'phone', 'ou_type', 'parent_ou' ];
389                                                                                                 for ( var i in main_settings_fields ) {
390                                                                                                         var field = main_settings_fields[i];
391                                                                                                         window["editor_pane_" + field].setValue( '' ); // unset the value
392                                                                                                         window["editor_pane_" + field].setDisplayedValue( '' ); // unset the value
393                                                                                                 }
394
395                                                                                                 ou_list_store.fetch({
396                                                                                                         query : { id : ou_list_store.getValue( current_ou, 'id' ) },
397                                                                                                         queryOptions : { deep : true },
398                                                                                                         onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { } },
399                                                                                                         scope : ou_list_store
400                                                                                                 });
401
402                                                 current_billing_address = null;
403                                                 current_mailing_address = null;
404                                                 current_holds_address = null;
405                                                 current_ill_address = null;
406                                                 current_ou_hoo = null;
407                                                                                                 current_ou = null;
408
409                                                                                                 highlighter.editor_pane.green.play();
410                                                                                                 status_update(dojo.string.substitute(aou_strings.STATUS_DELETED, [old_name]));
411                                                                                         }
412                                                                                 });
413                                                                         }
414 ]]>
415                                                                 </script>
416                                                         </button>
417         
418                                                 </div>
419         
420                                                 <button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.new_kid_button.label;">
421                                                         <script type="dojo/connect" event="startup">
422                                                                 this.disabled = true;
423                                                         </script>
424                                                         <script type="dojo/connect" event="onClick">
425 <![CDATA[
426                                                                 var new_fm_obj = new aou().fromHash({
427                                                                         isnew                   : 1,
428                                                                         name                    : aou_strings.LABEL_NEW_BRANCH + virgin_ou_id,
429                                                                         opac_visible    : 'f',
430                                                                         shortname               : ou_list_store.getValue( current_ou, 'shortname' ) + '-NEW' + virgin_ou_id--,
431                                                                         parent_ou               : ou_list_store.getValue( current_ou, 'id' ),
432                                                                         ou_type                 : ou_list_store.getValue( current_ou, 'ou_type' )
433                                                                 });
434
435                                                                 pcrud.create( new_fm_obj, {
436                                                                         timeout : 10,
437                                                                         onerror : function (r) {
438                                                                                 highlighter.editor_pane.red.play();
439                                                                                 status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
440                                                                         },
441                                                                         oncomplete : function (r) {
442                                                                                 var res = r.recv();
443                                                                                 if ( res && res.content() ) {
444                                                                                         ou_list_store.newItem(
445                                                                                                 res.content().toHash(),
446                                                                                                 { parent : current_ou, attribute : 'children' }
447                                                                                         );
448                                                                                 } else {
449                                                                                         highlighter.editor_pane.red.play();
450                                                                                         status_update( aou_strings.ERROR_CREATING_CHILD_AOU );
451                                                                                 }
452                                                                         }
453                                                                 });
454         
455                                                                 highlighter.editor_pane.green.play();
456                                                                 highlighter.ou_tree.green.play();
457                                                                 status_update( dojo.string.substitute(aou_strings.SUCCESS_CREATING_CHILD_AOU, [ou_list_store.getValue( current_ou, 'name' )] ) );
458 ]]>
459                                                         </script>
460                                                 </button>
461         
462                                         </div>
463
464                                         <div id="hoo_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.hoo_pane.title;">
465                                                 <table class="tundra" style="margin:10px;">
466                                                         <tr><th/><th>&conify.org_unit.hoo_pane.open_time;</th><th>&conify.org_unit.hoo_pane.close_time;</th></tr>
467                                                         <tr><th>&conify.org_unit.hoo_pane.monday;</th>
468                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_open" onChange="current_ou_hoo.dow_0_open( this.getDisplayedValue() );"/></td>
469                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_0_close" onChange="current_ou_hoo.dow_0_close( this.getDisplayedValue() );"/></td>
470                                                                 <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>
471                                                         </tr>
472                                                         <tr><th>&conify.org_unit.hoo_pane.tuesday;</th>
473                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_open" onChange="current_ou_hoo.dow_1_open( this.getDisplayedValue() );"/></td>
474                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_1_close" onChange="current_ou_hoo.dow_1_close( this.getDisplayedValue() );"/></td>
475                                                                 <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>
476                                                         </tr>
477                                                         <tr><th>&conify.org_unit.hoo_pane.wednesday;</th>
478                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_open" onChange="current_ou_hoo.dow_2_open( this.getDisplayedValue() );"/></td>
479                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_2_close" onChange="current_ou_hoo.dow_2_close( this.getDisplayedValue() );"/></td>
480                                                                 <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>
481                                                         </tr>
482                                                         <tr><th>&conify.org_unit.hoo_pane.thursday;</th>
483                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_open" onChange="current_ou_hoo.dow_3_open( this.getDisplayedValue() );"/></td>
484                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_3_close" onChange="current_ou_hoo.dow_3_close( this.getDisplayedValue() );"/></td>
485                                                                 <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>
486                                                         </tr>
487                                                         <tr><th>&conify.org_unit.hoo_pane.friday;</th>
488                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_open" onChange="current_ou_hoo.dow_4_open( this.getDisplayedValue() );"/></td>
489                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_4_close" onChange="current_ou_hoo.dow_4_close( this.getDisplayedValue() );"/></td>
490                                                                 <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>
491                                                         </tr>
492                                                         <tr><th>&conify.org_unit.hoo_pane.saturday;</th>
493                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_open" onChange="current_ou_hoo.dow_5_open( this.getDisplayedValue() );"/></td>
494                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_5_close" onChange="current_ou_hoo.dow_5_close( this.getDisplayedValue() );"/></td>
495                                                                 <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>
496                                                         </tr>
497                                                         <tr><th>&conify.org_unit.hoo_pane.sunday;</th>
498                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_open" onChange="current_ou_hoo.dow_6_open( this.getDisplayedValue() );"/></td>
499                                                                 <td><span dojoType="dijit.form.TimeTextBox" style="width:8em;" jsId="dow_6_close" onChange="current_ou_hoo.dow_6_close( this.getDisplayedValue() );"/></td>
500                                                                 <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>
501                                                         </tr>
502                                                 </table>
503         
504                                                 <button jsId="save_hoo_button" dojoType="dijit.form.Button" label="&conify.save_button.label;">
505                             <script type="dojo/connect" event="startup">
506                                 this.disabled = true;
507                             </script>
508                                                         <script type="dojo/connect" event="onClick">
509 <![CDATA[
510                                 if (!current_ou_hoo.isnew()) {
511                                     current_ou_hoo.ischanged( 1 );
512                                 }
513
514                                 pcrud.apply( current_ou_hoo, {
515                                     timeout : 10,
516                                     onerror : function (r) {
517                                         highlighter.hoo_pane.red.play();
518                                         status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
519                                     },
520                                     oncomplete : function (r) {
521                                         current_ou_hoo.isnew( 0 );
522                                         current_ou_hoo.ischanged( 0 );
523                                         highlighter.hoo_pane.green.play();
524                                         status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOO, [ou_list_store.getValue( current_ou, 'name' )] ) );
525                                     },
526                                 });
527 ]]>
528                                                         </script>
529                                                 </button>
530         
531                                         </div>
532         
533                                         <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.title;">
534                                                 
535                                                 <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
536         
537                                                         <script type="dojo/method">
538                                                                 current_billing_address = null;
539                                                                 current_mailing_address = null;
540                                                                 current_holds_address = null;
541                                                                 current_ill_address = null;
542                                                         </script>
543         
544                                                         <div id="billing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.physical.title;">
545                                                                 <table class="tundra" style="margin:10px;">
546                                                                         <tr>
547                                                                                 <th>&conify.org_unit.addresses_pane.type;</th>
548                                                                                 <td colspan="3">
549                                                                                         <span jsId="billing_addr_type" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_billing_address.address_type( this.getValue() )"/>
550                                                                                 </td>
551                                                                                 <th>&conify.org_unit.addresses_pane.valid;</th><td>
552                                                                                         <input
553                                                                                           type="checkbox"
554                                                                                           jsId="billing_addr_valid"
555                                                                                           dojoType="dijit.form.CheckBox"
556                                                                                           value='t'
557                                                                                           onChange="if (current_billing_address) current_billing_address.valid( this.checked ? 't' : 'f' );"
558                                                                                         />
559                                                                                 </td>
560                                                                         </tr>
561                                                                         <tr>
562                                                                                 <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>
563                                                                         </tr>
564                                                                         <tr>
565                                                                                 <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>
566                                                                         </tr>
567                                                                         <tr>
568                                                                                 <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>
569                                                                                 <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>
570                                                                                 <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>
571                                                                         </tr>
572                                                                         <tr>
573                                                                                 <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>
574                                                                                 <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>
575                                                                         </tr>
576                                                                 </table>
577         
578                                                                 <button jsId="save_billing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
579                                                                         <script type="dojo/connect" event="startup">
580                                                                                 this.disabled = true;
581                                                                         </script>
582                                                                         <script type="dojo/connect" event="onClick">
583 <![CDATA[
584                                         if (!current_billing_address.isnew()) {
585                                             current_billing_address.ischanged( 1 );
586                                         }
587
588                                         pcrud.apply( current_billing_address, {
589                                             timeout : 10,
590                                             onerror : function (r) {
591                                                 highlighter.addresses_pane.red.play();
592                                                 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
593                                             },
594                                             oncomplete : function (r) {
595                                                 var res = r.recv();
596                                                 if (res && res.content()
597                                                     && (current_billing_address.isnew() == 1)) {
598                                                     current_billing_address = res.content();
599
600                                                     ou_list_store.setValue( current_ou, "billing_address", current_billing_address.id());
601                                                     save_org();
602                                                 }
603                                                 current_billing_address.isnew( 0 );
604                                                 current_billing_address.ischanged( 0 );
605                                                 highlighter.addresses_pane.green.play();
606                                                 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_PHYSICAL, [ou_list_store.getValue( current_ou, 'name' )] ) );
607                                             },
608                                         });
609 ]]>
610                                                                         </script>
611                                                                 </button>
612                                                         </div>
613
614                                                         <div id="holds_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.holds.title;">
615                                                                 <table class="tundra" style="margin:10px;">
616                                                                         <tr>
617                                                                                 <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>
618                                                                                 <th>&conify.org_unit.addresses_pane.valid;</th><td>
619                                                                                         <input
620                                                                                           type="checkbox"
621                                                                                           jsId="holds_addr_valid"
622                                                                                           dojoType="dijit.form.CheckBox"
623                                                                                           value='t'
624                                                                                           onChange="if (current_holds_address) current_holds_address.valid( this.checked ? 't' : 'f' );"
625                                                                                         />
626                                                                                 </td>
627                                                                         </tr>
628                                                                         <tr>
629                                                                                 <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>
630                                                                         </tr>
631                                                                         <tr>
632                                                                                 <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>
633                                                                         </tr>
634                                                                         <tr>
635                                                                                 <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>
636                                                                                 <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>
637                                                                                 <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>
638                                                                         </tr>
639                                                                         <tr>
640                                                                                 <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>
641                                                                                 <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>
642                                                                         </tr>
643                                                                 </table>
644         
645                                                                 <button jsId="save_holds_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
646                                                                         <script type="dojo/connect" event="startup">
647                                                                                 this.disabled = true;
648                                                                         </script>
649                                                                         <script type="dojo/connect" event="onClick">
650 <![CDATA[
651                                         if (!current_holds_address.isnew()) {
652                                             current_holds_address.ischanged( 1 );
653                                         }
654
655                                         pcrud.apply( current_holds_address, {
656                                             timeout : 10,
657                                             onerror : function (r) {
658                                                 highlighter.addresses_pane.red.play();
659                                                 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
660                                             },
661                                             oncomplete : function (r) {
662                                                 var res = r.recv();
663                                                 if (res && res.content()
664                                                     && (current_holds_address.isnew() == 1)) {
665                                                     current_holds_address = res.content();
666
667                                                     ou_list_store.setValue( current_ou, "holds_address", current_holds_address.id());
668                                                     save_org();
669                                                 }
670                                                 current_holds_address.isnew( 0 );
671                                                 current_holds_address.ischanged( 0 );
672                                                 highlighter.addresses_pane.green.play();
673                                                 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_HOLDS, [ou_list_store.getValue( current_ou, 'name' )] ) );
674                                             },
675                                         });
676 ]]>
677                                                                         </script>
678                                                                 </button>
679                                                         </div>
680
681                                                         <div id="mailing_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.mailing.title;">
682                                                                 <table class="tundra" style="margin:10px;">
683                                                                         <tr>
684                                                                                 <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>
685                                                                                 <th>&conify.org_unit.addresses_pane.valid;</th><td>
686                                                                                         <input
687                                                                                           type="checkbox"
688                                                                                           jsId="mailing_addr_valid"
689                                                                                           dojoType="dijit.form.CheckBox"
690                                                                                           onChange="if (current_mailing_address) current_mailing_address.valid( this.checked ? 't' : 'f' );"
691                                                                                         />
692                                                                                 </td>
693                                                                         </tr>
694                                                                         <tr>
695                                                                                 <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>
696                                                                         </tr>
697                                                                         <tr>
698                                                                                 <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>
699                                                                         </tr>
700                                                                         <tr>
701                                                                                 <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>
702                                                                                 <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>
703                                                                                 <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>
704                                                                         </tr>
705                                                                         <tr>
706                                                                                 <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>
707                                                                                 <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>
708                                                                         </tr>
709                                                                 </table>
710         
711                                                                 <button jsId="save_mailing_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
712                                                                         <script type="dojo/connect" event="startup">
713                                                                                 this.disabled = true;
714                                                                         </script>
715                                                                         <script type="dojo/connect" event="onClick">
716 <![CDATA[
717                                         if (!current_mailing_address.isnew()) {
718                                             current_mailing_address.ischanged( 1 );
719                                         }
720
721                                         pcrud.apply( current_mailing_address, {
722                                             timeout : 10,
723                                             onerror : function (r) {
724                                                 highlighter.addresses_pane.red.play();
725                                                 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
726                                             },
727                                             oncomplete : function (r) {
728                                                 var res = r.recv();
729                                                 if (res && res.content()
730                                                     && (current_mailing_address.isnew() == 1)) {
731                                                     current_mailing_address = res.content();
732
733                                                     ou_list_store.setValue( current_ou, "mailing_address", current_mailing_address.id());
734                                                     save_org();
735                                                 }
736                                                 current_mailing_address.isnew( 0 );
737                                                 current_mailing_address.ischanged( 0 );
738                                                 highlighter.addresses_pane.green.play();
739                                                 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_MAILING, [ou_list_store.getValue( current_ou, 'name' )] ) );
740                                             },
741                                         });
742 ]]>
743                                                                         </script>
744                                                                 </button>
745                                                         </div>
746
747                                                         <div id="ill_address" dojoType="dijit.layout.ContentPane" title="&conify.org_unit.addresses_pane.ill.title;">
748                                                                 <table class="tundra" style="margin:10px;">
749                                                                         <tr>
750                                                                                 <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>
751                                                                                 <th>&conify.org_unit.addresses_pane.valid;</th><td>
752                                                                                         <input
753                                                                                           type="checkbox"
754                                                                                           jsId="ill_addr_valid"
755                                                                                           dojoType="dijit.form.CheckBox"
756                                                                                           onChange="if (current_ill_address) current_ill_address.valid( this.checked ? 't' : 'f' );"
757                                                                                         />
758                                                                                 </td>
759                                                                         </tr>
760                                                                         <tr>
761                                                                                 <th>&conify.org_unit.addresses_pane.street1;</th><td colspan="5"><span jsId="ill_addr_street1" style="width:100%;" dojoType="dijit.form.ValidationTextBox" onChange="current_ill_address.street1( this.getValue() )" required="true"/></td>
762                                                                         </tr>
763                                                                         <tr>
764                                                                                 <th>&conify.org_unit.addresses_pane.street2;</th><td colspan="5"><span jsId="ill_addr_street2" style="width:100%;" dojoType="dijit.form.TextBox" onChange="current_ill_address.street2( this.getValue() )"/></td>
765                                                                         </tr>
766                                                                         <tr>
767                                                                                 <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>
768                                                                                 <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>
769                                                                                 <th>&conify.org_unit.addresses_pane.zip;</th><td><span jsId="ill_addr_post_code" style="width:100%;" dojoType="dijit.form.ValidationTextBox" size="10" maxSize="10" regExp="^\d{5}(?:-\d{4})?$" uppercase="true" onChange="current_ill_address.post_code( this.getValue() )" required="true"/></td>
770                                                                         </tr>
771                                                                         <tr>
772                                                                                 <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>
773                                                                                 <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>
774                                                                         </tr>
775                                                                 </table>
776         
777                                                                 <button jsId="save_ill_address" dojoType="dijit.form.Button" label="&conify.save_button.label;">
778                                                                         <script type="dojo/connect" event="startup">
779                                                                                 this.disabled = true;
780                                                                         </script>
781                                                                         <script type="dojo/connect" event="onClick">
782 <![CDATA[
783                                         if (!current_ill_address.isnew()) {
784                                             current_ill_address.ischanged( 1 );
785                                         }
786
787                                         pcrud.apply( current_ill_address, {
788                                             timeout : 10,
789                                             onerror : function (r) {
790                                                 highlighter.addresses_pane.red.play();
791                                                 status_update( dojo.string.substitute( aou_strings.ERROR_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
792                                             },
793                                             oncomplete : function (r) {
794                                                 var res = r.recv();
795                                                 if (res && res.content()
796                                                     && (current_ill_address.isnew() == 1)) {
797                                                     current_ill_address = res.content();
798
799                                                     ou_list_store.setValue( current_ou, "ill_address", current_ill_address.id());
800                                                     save_org();
801                                                 }
802                                                 current_ill_address.isnew( 0 );
803                                                 current_ill_address.ischanged( 0 );
804                                                 highlighter.addresses_pane.green.play();
805                                                 status_update( dojo.string.substitute( aou_strings.SUCCESS_SAVING_ILL, [ou_list_store.getValue( current_ou, 'name' )] ) );
806                                             },
807                                         });
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>