From a7e0cf4c7d7ebdc05f601c97bd5a166e988db1b9 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 22 Jul 2008 22:21:03 +0000 Subject: [PATCH] syncing with head git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@10089 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/conify/global/admin.html | 1 + .../web/conify/global/config/marc_code_maps.html | 195 ++++++++++++++++++--- .../web/conify/global/config/marc_code_maps.js | 30 +++- 3 files changed, 191 insertions(+), 35 deletions(-) diff --git a/Open-ILS/web/conify/global/admin.html b/Open-ILS/web/conify/global/admin.html index 8a4ff3f868..a5aa53eb3f 100644 --- a/Open-ILS/web/conify/global/admin.html +++ b/Open-ILS/web/conify/global/admin.html @@ -63,6 +63,7 @@
  • Permission Groups
  • Permissions
  • Copy Statuses
  • +
  • MARC Codes
  • diff --git a/Open-ILS/web/conify/global/config/marc_code_maps.html b/Open-ILS/web/conify/global/config/marc_code_maps.html index 19180a742d..549c22a254 100644 --- a/Open-ILS/web/conify/global/config/marc_code_maps.html +++ b/Open-ILS/web/conify/global/config/marc_code_maps.html @@ -14,7 +14,7 @@ --> - Confiy :: Global :: Permission :: Permission List + Confiy :: Global :: Config :: MARC Code Maps @@ -61,6 +60,8 @@ var grid_row_object_cache = {}; var layouts = {}; + console.log('create the special layout for cam'); + layouts.cam = [ { cells : [ [ @@ -81,7 +82,6 @@ 'dojo.query(".cam_value_' + row + '").'+ 'instantiate('+ 'openils.widget.TranslatorPopup,{field:"value",'+ - 'unique:"cam_'+row+'",'+ 'targetObject:"grid_row_object_cache.cam['+row+']"}'+ ');'+ 'cam_grid.rowHeightChanged('+row+');', @@ -106,7 +106,6 @@ 'dojo.query(".cam_description_' + row + '").'+ 'instantiate('+ 'openils.widget.TranslatorPopup,{field:"description",'+ - 'unique:"cam_'+row+'",'+ 'targetObject:"grid_row_object_cache.cam['+row+']"}'+ ');'+ 'cam_grid.rowHeightChanged('+row+');', @@ -124,10 +123,13 @@ } ]; - var codelist = ['cam','cblvl','cifm','citm','clm','clfm','cvrfm']; + var codelist = ['cam','cblvl','cifm','citm','clm','clfm'];//,'cvrfm']; var hashes = {}; var objects = {}; var models = {}; + + console.log('about to loop over codelist: ' + codelist); + for (var i in codelist) { var classname = codelist[i]; @@ -136,6 +138,8 @@ [ { query : { code : { '!=' : null } } } ] ); + console.log('created hashes for ' + classname); + if (!hashes[classname]) continue; objects[classname] = dojo.map( @@ -143,18 +147,20 @@ new Function('x', 'return new fieldmapper.' + classname + '().fromHash( x );') ); + console.log('created objects for ' + classname); + stores[classname] = new dojo.data.ItemFileWriteStore( { data : fieldmapper[classname].toStoreData( objects[classname], 'value' ) } ); + console.log('create store for ' + classname); + if (classname != 'cam') { layouts[classname] = [ { cells : [ [ { name : "Code", field : "code", width : "5em", editor : dojox.grid.editors.Dijit, rowSpan : "2" }, - { name : "Value", field : "value", width : "auto", editor : dojox.grid.editors.Editor, style : "minHeight:1em;" } - ], - [ + { name : "Value", field : "value", width : "auto", editor : dojox.grid.editors.Editor, style : "minHeight:1em;" }, { name : "Translation", width : "10em", height : "2em", @@ -167,14 +173,11 @@ 'dojo.query(".'+classname+'_value_' + row + '").'+ 'instantiate('+ 'openils.widget.TranslatorPopup,{field:"value",'+ - 'unique:"'+classname+'_'+row+'",'+ 'targetObject:"grid_row_object_cache.'+classname+'['+row+']"}'+ ');'+ classname+'_grid.rowHeightChanged('+row+');', 0 ); - var oldnode = dojo.byId('value_translation_'+classname+'_' + row); - if (oldnode) dijit.byNode(oldnode).destroyRecursive(); return ''; } return ''; @@ -193,58 +196,198 @@ -
    +
    -
    +
    +
    -
    +
    New Audience Map:
    + +
    - -
    + +
    -
    -
    - +
    +
    -
    +
    New Bib Level:
    + +
    -
    +
    - +
    + +
    + +
    + +
    + + +
    + +
    +
    New Item Form:
    + + + + + + +
    + +
    +
    +
    -
    +
    + -
    - -
    +
    + +
    +
    New Item Type:
    + + + + + + +
    + +
    +
    +
    +
    + +
    + +
    + +
    + + +
    + +
    +
    New Language:
    + + + + + + +
    +
    +
    +
    +
    + +
    + +
    + +
    + + +
    + +
    +
    New Literary Form:
    + + + + + + +
    + +
    +
    +
    +
    + +
    + +
    + +
    + + +
    + +
    +
    New Video Recording Format:
    + + + + + + +
    + +
    +
    +
    +
    + +
    + +
    + +
    + diff --git a/Open-ILS/web/conify/global/config/marc_code_maps.js b/Open-ILS/web/conify/global/config/marc_code_maps.js index e5d6aef923..4eed81b1d3 100644 --- a/Open-ILS/web/conify/global/config/marc_code_maps.js +++ b/Open-ILS/web/conify/global/config/marc_code_maps.js @@ -34,24 +34,36 @@ dojo.require('dojox.grid.Grid'); dojo.require('dojox.grid._data.model'); dojo.require("dojox.grid.editors"); + +console.log('loading marc_code_maps.js'); + // some handy globals var cgi = new CGI(); var ses = dojo.cookie('ses') || cgi.param('ses'); var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); +console.log('initialized pcrud session'); + var stores = {}; var current_item = {}; + +/* var highlighter = { green : dojox.fx.highlight( { color : '#B4FFB4', node : 'grid_container', duration : 500 } ), red : dojox.fx.highlight( { color : '#FF2018', node : 'grid_container', duration : 500 } ) }; +console.log('highlighters set up'); +*/ + var dirtyStore = []; function status_update (markup) { if (parent !== window && parent.status_update) parent.status_update( markup ); } +console.log('local status function built'); + function save_code (classname) { var item = current_item[classname]; @@ -68,17 +80,17 @@ function save_code (classname) { timeout : 10, params : [ ses, modified_ppl ], onerror : function (r) { - highlighter.red.play(); + //highlighter.red.play(); status_update( 'Problem saving data for ' + classname + ' ' + obj.code() ); }, oncomplete : function (r) { var res = r.recv(); if ( res && res.content() ) { stores[classname].setValue( current_item, 'ischanged', 0 ); - highlighter.green.play(); + //highlighter.green.play(); status_update( 'Saved changes to ' + stores[classname].getValue( item, 'code' ) ); } else { - highlighter.red.play(); + //highlighter.red.play(); status_update( 'Problem saving data for ' + classname + ' ' + stores[classname].getValue( item, 'code' ) ); } }, @@ -147,7 +159,7 @@ function delete_grid_selection(classname, grid ) { timeout : 10, params : [ ses, obj ], onerror : function (r) { - highlighter.red.play(); + //highlighter.red.play(); status_update( 'Problem deleting ' + grid.model.store.getValue( item, 'value' ) ); }, oncomplete : function (r) { @@ -161,10 +173,10 @@ function delete_grid_selection(classname, grid ) { scope : grid.model.store }); - highlighter.green.play(); + //highlighter.green.play(); status_update( old_name + ' deleted' ); } else { - highlighter.red.play(); + //highlighter.red.play(); status_update( 'Problem deleting ' + old_name ); } } @@ -196,7 +208,7 @@ function create_marc_code (data) { timeout : 10, params : [ ses, new_fm_obj ], onerror : function (r) { - highlighter.red.play(); + //highlighter.red.play(); status_update( 'Problem calling method to create new ' + cl ); err = true; }, @@ -206,9 +218,9 @@ function create_marc_code (data) { var new_item_hash = res.content().toHash(); stores[cl].newItem( new_item_hash ); status_update( 'New ' + new_item_hash.code + ' ' + cl + ' created' ); - highlighter.green.play(); + //highlighter.green.play(); } else { - highlighter.red.play(); + //highlighter.red.play(); status_update( 'Problem creating new Permission' ); err = true; } -- 2.11.0