layout tweaks
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Aug 2006 19:55:28 +0000 (19:55 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Aug 2006 19:55:28 +0000 (19:55 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5524 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_summary.xul
Open-ILS/xul/staff_client/server/circ/copy_details.xul

index 6d6caad..a77271c 100644 (file)
 
                                $('caption').setAttribute('tooltiptext','Copy ID = ' + (copy_id || copy.id() ) );
 
+                               JSAN.use('circ.util');
+                               var columns = circ.util.columns( 
+                                       { 
+                                               'barcode' : { 'hidden' : false },
+                                               'location' : { 'hidden' : false },
+                                               'owning_lib' : { 'hidden' : false },
+                                               'circ_lib' : { 'hidden' : false },
+                                               'call_number' : { 'hidden' : false },
+                                               'status' : { 'hidden' : false },
+                                               'alert_message' : { 'hidden' : false },
+                                       } 
+                               ).concat(
+                                       {
+                                               'id' : 'total_circs', 'label' : 'Total Circs', 'flex' : 1,
+                                               'primary' : false, 'hidden' : false, 'persist' : 'hidden width ordinal',
+                                               'render' : 'obj.network.simple_request("FM_CIRC_COUNT_RETRIEVE_VIA_COPY",[ my.acp.id() ]).total.count' 
+                                       }
+                               );
+
+                               JSAN.use('util.list'); g.list = new util.list('item_summary_list');
+                               g.list.init(
+                                       {
+                                               'columns' : columns,
+                                               'map_row_to_column' : circ.util.std_map_row_to_column(),
+                                       }
+                               );
+       
                                function acp_callback(req) {
                                        try {
                                                var copy = req.getResultObject();
                                                if (typeof copy.ilsevent != 'undefined') throw(copy);
-                                               g.network.simple_request(
-                                                       'FM_ACN_RETRIEVE',
-                                                       [ copy.call_number() ],
-                                                       function (rreq) {
-                                                               try {
-                                                                       $w('barcode',copy.barcode());   
-                                                                       $w('ref',get_bool(copy.ref()) ? 'Yes' : 'No');  
-                                                                       $w('opac_visible',get_bool(copy.opac_visible()) ? 'Yes' : 'No');        
-                                                                       $w('circulate',get_bool(copy.circulate()) ? 'Yes' : 'No');      
-                                                                       $w('holdable',get_bool(copy.holdable()) ? 'Yes' : 'No');        
-                                                                       $w('age_protect',copy.age_protect() == null ? '<Unset>' : ( typeof copy.age_protect() == 'object' ? copy.age_protect().name() : g.data.hash.crahp[ copy.age_protect() ].name() ) );     
-                                                                       $w('location',typeof copy.location() == 'object' ? copy.location().name() : g.data.lookup('acpl',copy.location()).name() );     
-                                                                       $w('create_date',util.date.formatted_date(copy.create_date(),'%F'));
-                                                                       $w('edit_date',util.date.formatted_date(copy.edit_date(),'%F'));
-                                                                       $w('status',typeof copy.status() == 'object' ? copy.status().name() : g.data.hash.ccs[ copy.status() ].name() );        
-                                                               } catch(E) {
-                                                                       g.error.standard_unexpected_error_alert('rendering copy',E);
-                                                               }
-                                                               try {
-                                                                       var cn = rreq.getResultObject();
-                                                                       if (typeof cn.ilsevent != 'undefined') {
-                                                                               switch(cn.ilsevent) {
-                                                                                       case 1508 /* ASSET_CALL_NUMBER_NOT_FOUND */ :
-                                                                                               $w('callnumber','Not Cataloged');       
-                                                                                       break;
-                                                                                       default:
-                                                                                               throw(cn);
-                                                                                       break;
-                                                                               }
-                                                                       } else {
-                                                                               $w('callnumber',cn.label());    
-                                                                       }
-                                                               } catch(E) {
-                                                                       g.error.standard_unexpected_error_alert('retrieving volume',E);
-                                                               }
-                                                       }
-                                               );
+                                               g.list.append({'row':{'my':{'acp':copy}}});
                                        } catch(E) {
                                                g.error.standard_unexpected_error_alert('retrieving copy',E);
                                        }
                                        g.network.simple_request( 'FM_ACP_RETRIEVE', [ copy_id ], acp_callback);
                                } else {
                                        acp_callback( { 'getResultObject' : function() { return copy; } } );
-                                       copy_id = copy.id();
                                }
 
-                               g.network.simple_request('FM_CIRC_COUNT_RETRIEVE_VIA_COPY',[ copy_id ],function(req) {
-                                       try {
-                                               var robj = req.getResultObject();
-                                               if (typeof robj.ilsevent != 'undefined') throw(robj);
-                                               $w('total_circs',robj.total.count);
-                                       } catch(E) {
-                                               g.error.standard_unexpected_error_alert('retrieving circ total',E);
-                                       }
-                               });
-
                        } catch(E) {
                                var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
                                        "system administrator or software developer the following:\ncat/copy_summary.xul\n" + E + '\n';
        ]]>
        </script>
 
-       <groupbox id="groupbox" flex="1" style="overflow: auto; min-height: 100px;">
+       <groupbox id="groupbox" flex="1" style="overflow: none; min-height: 80;">
                <caption label="Item Summary" id="caption"/>
-               <grid>
-                       <columns>
-                               <column/>
-                               <column/>
-                               <column/>
-                               <column/>
-                               <column/>
-                               <column/>
-                               <column/>
-                               <column/>
-                       </columns>
-                       <rows>
-                               <row>
-                                       <label style="font-weight: bold" value="Barcode:"/>
-                                       <label id="barcode" style="color: blue; text-decoration: underline; -moz-user-focus: normal;" onclick="copy_to_clipboard(event);"/>
-                                       <label style="font-weight: bold" value="Location:"/>
-                                       <label id="location"/>
-                                       <label style="font-weight: bold" value="Call Number:"/>
-                                       <label id="callnumber"/>
-                                       <label style="font-weight: bold" value="Status:"/>
-                                       <label id="status"/>
-                               </row>
-                               <row>
-                                       <label style="font-weight: bold" value="Circulate:"/>
-                                       <label id="circulate"/>
-                                       <label style="font-weight: bold" value="Reference:"/>
-                                       <label id="ref"/>
-                                       <label style="font-weight: bold" value="Holdable:"/>
-                                       <label id="holdable"/>
-                                       <label style="font-weight: bold" value="Opac Visible:"/>
-                                       <label id="opac_visible"/>
-                               </row>
-                               <row>
-                                       <label style="font-weight: bold" value="Created:"/>
-                                       <label id="create_date"/>
-                                       <label style="font-weight: bold" value="Edited:"/>
-                                       <label id="edit_date"/>
-                                       <label style="font-weight: bold" value="Age Protect:"/>
-                                       <label id="age_protect"/>
-                                       <label style="font-weight: bold" value="Total Circs:"/>
-                                       <label id="total_circs"/>
-                               </row>
-                       </rows>
-               </grid>
+               <tree id="item_summary_list" enableColumnDrag="true" flex="1"/>
        </groupbox>
 
 </window>
index 2e6b68e..9b30f53 100644 (file)
@@ -66,7 +66,7 @@
                                if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
 
                                $('top').setAttribute('src',urls.XUL_BIB_BRIEF + '?docid=' + g.callnumber.record());
-                               g.data.temp_copy = g.copy; g.data.stash('temp_copy'); $('mid').setAttribute('src',urls.XUL_COPY_SUMMARY);
+                               g.data.temp_copy = g.copy; g.data.stash('temp_copy'); $('item_summary').setAttribute('src',urls.XUL_COPY_SUMMARY);
 
                                $('r_last').disabled = true;
                                if (g.circ) {
        </script>
 
        <vbox flex="1" style="overflow: auto;">
-               <iframe flex="1" id="top" style="overflow: none; min-height: 80;"/>
+               <vbox style="border: none; overflow: none; min-height: 80;">
+                       <iframe flex="1" id="top" style="overflow: none; min-height: 80;"/>
+               </vbox>
                <splitter><grippy/></splitter>
-               <iframe flex="1" id="mid" style="overflow: none; min-height: 80;"/>
+               <vbox style="border: none; overflow: none; min-height: 80;">
+                       <iframe flex="1" id="item_summary" style="overflow: none; min-height: 80;"/>
+               </vbox>
                <splitter><grippy/></splitter>
-               <groupbox flex="1" id="circs" style="overflow: none; min-height: 80;">
-                       <caption id="circ_caption" label="Last/Current Circulation" style="font-weight: bold"/>
-                       <iframe id="circ" style="min-height: 80" flex="1"/>
+               <groupbox flex="1" id="holds" style="overflow: none; min-height: 80;">
+                       <caption id="hold_caption" label="Captured for Hold"/>
+                       <label id="patron_name" class="patronNameLarge"/>
+                       <tree id="hold" flex="1" enableColumnDrag="true"/>
+                       <spacer FIXME="label and tree get swapped without this"/>
                </groupbox>
                <splitter><grippy/></splitter>
                <groupbox flex="1" id="transits" style="overflow: none; min-height: 80;">
                        <caption id="transit_caption" label="In Transit"/>
-                       <tree id="transit" flex="1" />
+                       <tree id="transit" flex="1" enableColumnDrag="true"/>
                </groupbox>
                <splitter><grippy/></splitter>
-               <groupbox flex="1" id="holds" style="overflow: none; min-height: 80;">
-                       <caption id="hold_caption" label="Captured for Hold"/>
-                       <label id="patron_name" class="patronNameLarge"/>
-                       <tree id="hold" flex="1" />
-                       <spacer FIXME="label and tree get swapped without this"/>
+               <groupbox flex="1" id="circs" style="overflow: none; min-height: 80;">
+                       <caption id="circ_caption" label="Last/Current Circulation" style="font-weight: bold"/>
+                       <iframe id="circ" style="min-height: 80" flex="1"/>
                </groupbox>
        </vbox>
        <hbox>