fixing check boxes -- yay for dojo 1.1!
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 28 Mar 2008 16:15:17 +0000 (16:15 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 28 Mar 2008 16:15:17 +0000 (16:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/dojo-admin@9157 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/conify/global/actor/org_unit.html
Open-ILS/web/conify/global/actor/org_unit_type.html

index 12e3a60..e7a6e3e 100644 (file)
@@ -52,7 +52,7 @@
 
                <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
 
-                       <div dojoType="dijit.layout.ContentPane" sizeMin="200" sizeShare="100">
+                       <div dojoType="dijit.layout.ContentPane" sizeShare="100">
                                <script type="dojo/method">
 
                                        var ou_list_data = { label : 'shortname', identifier : 'id' };
                                </div>
                        </div>
 
-                       <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane"  sizeMin="200" sizeShare="300">
+                       <div jsId="right_pane" id="right_pane" dojoType="dijit.layout.ContentPane"  sizeShare="200">
                                <script type="dojo/method">
                                        window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
                                        window.right_pane_toggler.hide();
                                                                          required="true"
                                                                        >
                                                                                <script type="dojo/method" event="onChange">
-                                                                                       if (current_ou) this.store.setValue( current_ou, "parent_ou", this.getValue() );
+                                                                                       if (current_ou && this.getValue()) this.store.setValue( current_ou, "parent_ou", this.getValue() );
                                                                                        if ( this.store.getValue( current_ou, '_trueRoot' ) == 'true' ) this.required = false;
                                                                                        else this.required = true;
                                                                                </script>
                                                                          jsId="editor_pane_opac_visible"
                                                                          type="checkbox"
                                                                          dojoType="dijit.form.CheckBox"
-                                                                         value='t'
-                                                                       >
-                                                                               <script type="dojo/connect" event="onChange">
-                                                                                       if (current_ou) ou_list_store.setValue( current_ou, "opac_visible", this.isChecked() ? "t":"f" );
-                                                                               </script>
-                                                                       </input>
+                                                                         onChange='if (current_ou) ou_list_store.setValue( current_ou, "opac_visible", this.checked ? "t" : "f" );'
+                                                                       />
                                                                </td>
                                                        </tr>
                                                </table>
        
                                        <div id="addresses_pane" dojoType="dijit.layout.ContentPane" title="Addresses">
                                                
-                                               <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" sizeMin="200" sizeShare="300" style="margin-top:10px">
+                                               <div id="billing_address_pane" dojoType="dijit.layout.TabContainer" style="margin-top:10px">
        
                                                        <script type="dojo/method">
                                                                window.current_billing_address = null;
                                                                                          jsId="billing_addr_valid"
                                                                                          dojoType="dijit.form.CheckBox"
                                                                                          value='t'
+                                                                                         onChange='if (current_billing_address) current_billing_address.valid( this.checked ? "t" : "f" );'
                                                                                        />
-                                                                                               <script type="dojo/connect" event="onChange">
-                                                                                                       if (current_billing_address) current_billing_address.valid( this.isChecked() ? 't' : 'f' );
-                                                                                               </script>
                                                                                </td>
                                                                        </tr>
                                                                        <tr>
                                                                                          jsId="holds_addr_valid"
                                                                                          dojoType="dijit.form.CheckBox"
                                                                                          value='t'
+                                                                                         onChange='if (current_holds_address) current_holds_address.valid( this.checked ? "t" : "f" );'
                                                                                        />
-                                                                                               <script type="dojo/connect" event="onChange">
-                                                                                                       if (current_holds_address) current_holds_address.valid( this.isChecked() ? 't' : 'f' );
-                                                                                               </script>
                                                                                </td>
                                                                        </tr>
                                                                        <tr>
                                                                                          type="checkbox"
                                                                                          jsId="mailing_addr_valid"
                                                                                          dojoType="dijit.form.CheckBox"
-                                                                                         value='t'
+                                                                                         onChange='if (current_mailing_address) current_mailing_address.valid( this.checked ? "t" : "f" );'
                                                                                        />
-                                                                                               <script type="dojo/connect" event="onChange">
-                                                                                                       if (current_mailing_address) current_mailing_address.valid( this.isChecked() ? 't' : 'f' );
-                                                                                               </script>
                                                                                </td>
                                                                        </tr>
                                                                        <tr>
                                                                                          type="checkbox"
                                                                                          jsId="ill_addr_valid"
                                                                                          dojoType="dijit.form.CheckBox"
-                                                                                         value='t'
+                                                                                         onChange='if (current_ill_address) current_ill_address.valid( this.checked ? "t" : "f" );'
                                                                                        />
-                                                                                               <script type="dojo/connect" event="onChange">
-                                                                                                       if (current_ill_address) current_ill_address.valid( this.isChecked() ? 't' : 'f' );
-                                                                                               </script>
                                                                                </td>
                                                                        </tr>
                                                                        <tr>
index 17b47d8..cc49013 100644 (file)
@@ -41,7 +41,7 @@
                <script language='javascript' src='/opac/common/js/OrgTree.js' type='text/javascript'></script>
 
                <!-- Dojo goodness -->
-               <script type="text/javascript" src="/conify/js/dojo/dojo.js.uncompressed.js" djConfig="parseOnLoad: true"></script>
+               <script type="text/javascript" src="/conify/js/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
                <script type="text/javascript" src="/conify/js/dijit/dijit.js"></script>
 
                <script type="text/javascript" src="org_unit_type.js"></script>
 
                <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" style="height: 100%">
 
-                       <div dojoType="dijit.layout.ContentPane" sizeMin="100" sizeShare="100">
+                       <div dojoType="dijit.layout.ContentPane" sizeShare="100">
                                <script type="dojo/method">
                                        window.dirtyStore = [];
 
                     pCRUD.request({
                         method : 'open-ils.permacrud.search.aout.atomic',
                         timeout : 10,
-                        params : [ ses, { id : { "!=" : null } }, { order_by : { aou : 'name' } } ],
+                        params : [ ses, { id : { "!=" : null } }, { order_by : { aout : 'name' } } ],
                         onerror : function (r) { status_update('Problem fetching types') },
                         oncomplete : function (r) {
                             ou_type_store = new dojo.data.ItemFileWriteStore({ data : aout.toStoreData( r.recv().content() ) });
 
                                        <script type="dojo/method" event="onClick" args="item,node">
 
+                                               right_pane_toggler.show();
                                                current_type = item;
 
                                                highlighter.editor_pane.green.play();
                                                        editor_pane_parent.setValue( this.store.getValue( current_type, 'parent' ) );
                                                }
 
-                                               editor_pane_can_have_vols.setChecked( this.store.getValue( current_type, 'can_have_vols' ) == '1' ? true : false );
-                                               editor_pane_can_have_users.setChecked( this.store.getValue( current_type, 'can_have_users' ) == '1' ? true : false );
+                                               editor_pane_can_have_vols.setChecked( this.store.getValue( current_type, 'can_have_vols' ) == 't' ? true : false );
+                                               editor_pane_can_have_users.setChecked( this.store.getValue( current_type, 'can_have_users' ) == 't' ? true : false );
 
                                        </script>
 
                                </div>
                        </div>
 
-                       <div id="right_pane" dojoType="dijit.layout.ContentPane"  sizeMin="100" sizeShare="300">
+                       <div id="right_pane" dojoType="dijit.layout.ContentPane"  sizeShare="200">
+                               <script type="dojo/method">
+                                       window.right_pane_toggler = new dojo.fx.Toggler({ node: 'right_pane'});
+                                       window.right_pane_toggler.hide();
+                               </script>
 
                                        <div id="editor_pane" dojoType="dijit.layout.ContentPane">
                                                <script type="dojo/method">
                                                                          required="true"
                                                                        >
                                                                                <script type="dojo/method" event="onChange" args=>
-                                                                                       if (current_type) {
-                                                                                               if ( this.store.getValue( current_type, 'depth' ) == this.getValue() ) return;
+                                                                                       if (current_type && this.getValue()) {
+                                                                                               if ( this.store.getValue( current_type, 'parent' ) == this.getValue() ) return;
 
                                                                                                this.store.setValue( current_type, "parent", this.getValue() );
                                                                                                this.store.fetch({
                                                                          jsId="editor_pane_can_have_vols"
                                                                          type="checkbox"
                                                                          dojoType="dijit.form.CheckBox"
-                                                                         value='t'
-                                                                       >
-                                                                               <script type="dojo/connect" event="onChange">
-                                                                                       if (current_type) {
-                                                                                               ou_type_store.setValue( current_type, "can_have_vols", this.isChecked() ? "1":"0" );
-                                                                                       }
-                                                                               </script>
-                                                                       </input>
+                                                                         onChange='if (current_type) ou_type_store.setValue( current_type, "can_have_vols", this.checked ? "t" : "f" );'
+                                                                       />
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                          jsId="editor_pane_can_have_users"
                                                                          type="checkbox"
                                                                          dojoType="dijit.form.CheckBox"
-                                                                         value='t'
-                                                                       >
-                                                                               <script type="dojo/connect" event="onChange">
-                                                                                       if (current_type) {
-                                                                                               ou_type_store.setValue( current_type, "can_have_users", this.isChecked() ? "1":"0" );
-                                                                                       }
-                                                                               </script>
-                                                                       </input>
+                                                                         onChange='if (current_type) ou_type_store.setValue( current_type, "can_have_users", this.checked ? "t" : "f" );'
+                                                                       />
                                                                </td>
                                                        </tr>
                                                </table>
                                                                var new_fm_obj = new aout().fromHash({
                                                                        isnew                   : 1,
                                                                        name                    : 'New Type',
-                                                                       can_have_vols   : '0',
-                                                                       can_have_users  : '0',
+                                                                       can_have_vols   : 'f',
+                                                                       can_have_users  : 'f',
                                                                        depth                   : 1 + parseInt(ou_type_store.getValue( current_type, 'depth' )),
                                                                        opac_label              : ou_type_store.getValue( current_type, 'opac_label' ) + ' child' + virgin_out_id--,
                                                                        parent                  : ou_type_store.getValue( current_type, 'id' )