From: erickson Date: Mon, 5 Jan 2009 21:03:00 +0000 (+0000) Subject: fleshing more objects (marc type/form video form) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=40fff6112c8424dc1ec9feb902c705dc239cf4c5;p=evergreen%2Ftadl.git fleshing more objects (marc type/form video form) git-svn-id: svn://svn.open-ils.org/ILS/trunk@11746 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js b/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js index 53af2fedbc..3ad0ea1a29 100644 --- a/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js +++ b/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js @@ -3,19 +3,131 @@ dojo.require('dojox.grid.cells.dijit'); dojo.require('dojo.data.ItemFileWriteStore'); dojo.require('dijit.form.CheckBox'); dojo.require('dijit.form.FilteringSelect'); +dojo.require('fieldmapper.OrgUtils'); +//dojo.require('openils.widget.OrgUnitFilteringSelect'); +dojo.require('openils.PermGrp'); +dojo.require('openils.PermaCrud'); +var marcType = {}; +var marcForm = {}; +var vrForm = {}; +var pcrud = new openils.PermaCrud(); + + +function getOrgInfo(rowIndex, item) { + if(!item) return ''; + var orgId = this.grid.store.getValue(item, this.field); + if(orgId != null) { + return fieldmapper.aou.findOrgUnit(orgId).shortname(); + } + return ''; +} +function getGroupName (rowIndex, item) { + if(!item) return ''; + var grpId = this.grid.store.getValue(item, this.field); + if (grpId != null) { + grpName = openils.PermGrp.groupIdMap[grpId].name(); + return grpName; + } + return ''; +} +function getMarcType(rowIndex, item) { + if(!item) return ''; + var mt = this.grid.store.getValue(item, this.field); + if(mt != null){ + mtObject = marcType[mt]; + return mtObject.value(); + } + return''; +} +function getMarcForm(rowIndex, item){ + if(!item) return ''; + var mf = this.grid.store.getValue(item, this.field); + if(mf != null){ + mfObject = marcForm[mf]; + return mfObject.value(); + } + return''; +} +function getVrForm(rowIndex, item){ + if(!item) return ''; + var vr = this.grid.store.getValue(item, this.field); + console.log(vr); + if(vr != null){ + vrObject = vrForm[vr]; + return vrObject.value(); + } + return''; +} +function formatReference(inDatum) { + switch (inDatum) { + case 't': + return ""; + case 'f': + return ""; + default: + return ''; + } +} + +function init() { + var pending = 4 + + pcrud.retrieveAll( + 'citm', + { async : true, + oncomplete: function (r) { + var list = openils.Util.readResponse(r); + marcType = openils.Util.mapList(list, 'code', true); + if(--pending == 0) { + buildHMGrid(); + } + } + } + ); + pcrud.retrieveAll( + 'cifm', + { async : true, + oncomplete: function (r) { + var list = openils.Util.readResponse(r); + marcForm = openils.Util.mapList(list, 'code', true); + if(--pending == 0) { + buildHMGrid(); + } + } + } + ); + pcrud.retrieveAll( + 'cvrfm', + { async : true, + oncomplete: function (r) { + var list = openils.Util.readResponse(r); + vrForm = openils.Util.mapList(list, 'code', true); + if(--pending == 0) { + buildHMGrid(); + } + } + } + ); + openils.PermGrp.fetchGroupTree( + function() { + openils.PermGrp.flatten(); + if(--pending == 0) { + buildHMGrid(); + } + } + ); +} function buildHMGrid() { - var store = new dojo.data.ItemFileWriteStore({data:chmm.initStoreData('id', {identifier:'id'})}) + var store = new dojo.data.ItemFileWriteStore({data:chmm.initStoreData('id', {identifier:'id'})}); hmGrid.setStore(store); hmGrid.render(); - // dojo.connect(store, 'onSet', cmGridChanged); - console.log(js2JSON(store)); + fieldmapper.standardRequest( ['open-ils.pcrud', 'open-ils.pcrud.search.chmm'], { async: true, params: [openils.User.authtoken, {id:{'!=':null}}], onresponse: function (r) { - console.log('blah'); if(obj = openils.Util.readResponse(r)) { store.newItem(chmm.itemToStoreData(obj)); // cmCache[obj.code()] = obj; @@ -25,4 +137,4 @@ function buildHMGrid() { ); } -openils.Util.addOnLoad(buildHMGrid); \ No newline at end of file +openils.Util.addOnLoad(init); \ No newline at end of file diff --git a/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 b/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 index 4f0a7dfe21..7820791c10 100644 --- a/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 +++ b/Open-ILS/web/templates/default/conify/global/config/hold_matrix_matchpoint.tt2 @@ -14,28 +14,28 @@ Active? User Home Library + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getOrgInfo'>User Home Library Request Library - Pickup Library + cellType='dojox.grid.cells.Select' get='getOrgInfo'>Request Library + Pickup Library Owning Library + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getOrgInfo'>Owning Library Item Circ Library + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getOrgInfo'>Item Circ Library User Permission Group + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getGroupName'>User Permission Group Requestor Permission Group + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getGroupName'>Requestor Permission Group Circulation Modifier MARC Type + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getMarcType'>MARC Type MARC Format + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getMarcForm'>MARC Format Videorecording Format + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' get='getVrForm'>Videorecording Format Reference? + cellType='dojox.grid.cells._Widget' widgetClass='dijit.form.TextBox' formatter='formatReference'>Reference?