Changeset 9487

Show
Ignore:
Timestamp:
04/29/08 20:27:17 (2 weeks ago)
Author:
djfiander
Message:

Pretty display of fund names instead of fund IDs

Files:
1 modified

Legend:

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

    r9480 r9487  
    1313        dojo.require("dijit.layout.SplitContainer") 
    1414        dojo.require('openils.acq.Picklist'); 
     15        // For decoding fund IDs into names 
     16        dojo.require("openils.acq.Fund"); 
    1517    </script> 
    1618    <script type='text/javascript'> 
    1719        function getJUBTitle(rowIndex) { 
    18             data = pickListGrid.model.getRow(rowIndex); 
     20            var data = pickListGrid.model.getRow(rowIndex); 
    1921            if (!data) return ''; 
    2022            return openils.acq.Picklist.find_attr(data.id, "title", "lineitem_marc_attr_definition") 
    2123        } 
    2224        function getJUBPrice(rowIndex) { 
    23             data = pickListGrid.model.getRow(rowIndex); 
     25            var data = pickListGrid.model.getRow(rowIndex); 
    2426            if (!data) return; 
    2527            return openils.acq.Picklist.find_attr(data.id, "price", "lineitem_marc_attr_definition") 
     28        } 
     29        function getLIDFundName(rowIndex) { 
     30            var data = lineItemGrid.model.getRow(rowIndex); 
     31            if (!data) return; 
     32            try { 
     33                return openils.acq.Fund.retrieve(data.fund).name(); 
     34            } catch (evt) { 
     35                return data.fund; 
     36            } 
    2637        } 
    2738    </script> 
     
    5869 
    5970                var lineitemLayout = [{ cells: [[ 
    60                     {name:'ID', field:'id'}, 
    61                     {name:'Fund', field:'fund'}, 
    62                     {name:'Location', field:'location'} ]] }]; 
     71                    {name:"ID", field:"id"}, 
     72                    {name:"Fund", get:getLIDFundName}, 
     73                    {name:"Location", field:"location"} ]] }]; 
    6374 
    6475                openils.acq.Picklist.createStore(${c.oils.acq.picklist.value.id()},