Show
Ignore:
Timestamp:
04/29/08 21:19:37 (5 months ago)
Author:
djfiander
Message:

Pretty display of Library names now works. Also speed up display
of line items by not talking to the server if the fund or org
unit fields are null.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html

    r9487 r9488  
    1515        // For decoding fund IDs into names 
    1616        dojo.require("openils.acq.Fund"); 
     17        // For decoding Library IDs into names 
     18        dojo.require("fieldmapper.OrgUtils"); 
    1719    </script> 
    1820    <script type='text/javascript'> 
     
    2931        function getLIDFundName(rowIndex) { 
    3032            var data = lineItemGrid.model.getRow(rowIndex); 
    31             if (!data) return; 
     33            if (!data || !data.fund) return; 
    3234            try { 
    3335                return openils.acq.Fund.retrieve(data.fund).name(); 
    3436            } catch (evt) { 
    3537                return data.fund; 
     38            } 
     39        } 
     40        function getLIDLibName(rowIndex) { 
     41            var data = lineItemGrid.model.getRow(rowIndex); 
     42            if (!data || !data.owning_lib) return; 
     43            try { 
     44                return fieldmapper.aou.findOrgUnit(data.owning_lib, true).name(); 
     45            } catch (evt) { 
     46                return data.owning_lib; 
    3647            } 
    3748        } 
     
    7182                    {name:"ID", field:"id"}, 
    7283                    {name:"Fund", get:getLIDFundName}, 
    73                     {name:"Location", field:"location"} ]] }]; 
     84                    {name:"Location", get:getLIDLibName} ]] }]; 
    7485 
    7586                openils.acq.Picklist.createStore(${c.oils.acq.picklist.value.id()},