From 6acc6a391278a876b1b09f97650a7cc0d2e914a4 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 5 Mar 2009 21:30:59 +0000 Subject: [PATCH] basic circ/hold matrix config ui git-svn-id: svn://svn.open-ils.org/ILS/trunk@12433 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../global/config/hold_matrix_matchpoint.js | 166 ------------------ .../global/config/circ_matrix_matchpoint.tt2 | 10 +- .../global/config/hold_matrix_matchpoint.tt2 | 67 +++---- 3 files changed, 32 insertions(+), 211 deletions(-) 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 6175e7cf44..e69de29bb2 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 @@ -1,166 +0,0 @@ -dojo.require('dojox.grid.DataGrid'); -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(); -var hmCache = []; - -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'})}); - hmGrid.setStore(store); - hmGrid.render(); - - fieldmapper.standardRequest( - ['open-ils.pcrud', 'open-ils.pcrud.search.chmm'], - { async: true, - params: [openils.User.authtoken, {id:{'!=':null}}], - onresponse: function (r) { - if(obj = openils.Util.readResponse(r)) { - store.newItem(chmm.toStoreItem(obj)); - // cmCache[obj.code()] = obj; - } - } - } - ); -} -function deleteFromGrid() { - _deleteFromGrid(hmGrid.selection.getSelected(), 0); -} - -function _deleteFromGrid(list, idx) { - if(idx >= list.length) // we've made it through the list - return; - - var item = list[idx]; - var id = hmGrid.store.getValue(item, 'id'); - - fieldmapper.standardRequest( - ['open-ils.permacrud', 'open-ils.permacrud.delete.chmm'], - { async: true, - params: [openils.User.authtoken, id], - oncomplete: function(r) { - if(stat = openils.Util.readResponse(r)) { - // delete succeeded, remove it from the grid and the local cache - hmGrid.store.deleteItem(item); - delete hmCache[item.code]; - } - _deleteFromGrid(list, ++idx); - } - } - ); -} - -openils.Util.addOnLoad(init); diff --git a/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2 b/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2 index f39d7180b3..e18d30bc56 100644 --- a/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2 +++ b/Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2 @@ -4,18 +4,24 @@ dojo.require('dijit.layout.ContentPane'); dojo.require('dijit.form.Button'); dojo.require('openils.widget.AutoGrid'); + openils.Util.addOnLoad( + function(){ + cmGrid.loadAll({order_by:{ccmm:'circ_modifier'}}); + } + );
Circulation Policy Configuration
-
+
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 7820791c10..f92924f9ec 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 @@ -1,46 +1,27 @@ +[% ctc.page_title = 'Hold Policy Configuration' %] [% WRAPPER default/base.tt2 %] - -

Hold Matrix Matchpoint


- -
- - - -
- - - - - - - - - - - - - - - - - - - - -
Matchpoint IDActive?User Home LibraryRequest LibraryPickup LibraryOwning LibraryItem Circ LibraryUser Permission GroupRequestor Permission GroupCirculation ModifierMARC TypeMARC FormatVideorecording FormatReference?
-
+ +
+
Hold Policy Configuration
+
+
+
+ +
- [% END %] -- 2.43.2