From: erickson Date: Mon, 26 May 2008 19:52:40 +0000 (+0000) Subject: Merged revisions 9671-9672,9675,9677-9678,9684-9686,9695,9698-9699,9703-9707 via... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f78982a34eb0828beaf845c189b6a97abad45456;p=Evergreen.git Merged revisions 9671-9672,9675,9677-9678,9684-9686,9695,9698-9699,9703-9707 via svnmerge from svn://svn.open-ils.org/ILS/trunk ........ r9671 | miker | 2008-05-22 15:44:21 -0400 (Thu, 22 May 2008) | 1 line teach JS about the shortname field on slim org lists ........ r9672 | miker | 2008-05-22 15:54:45 -0400 (Thu, 22 May 2008) | 1 line adding locale param to org unit fetcher ........ r9675 | miker | 2008-05-22 17:18:10 -0400 (Thu, 22 May 2008) | 1 line use the configured identifier field ........ r9677 | miker | 2008-05-22 17:32:52 -0400 (Thu, 22 May 2008) | 1 line further fix for Identifier support ........ r9678 | miker | 2008-05-22 17:44:00 -0400 (Thu, 22 May 2008) | 1 line identifier is class based ........ r9684 | miker | 2008-05-22 22:20:41 -0400 (Thu, 22 May 2008) | 1 line Stop being Dan's problem ........ r9685 | dbs | 2008-05-22 22:27:40 -0400 (Thu, 22 May 2008) | 3 lines Avoid uninitialized variable warning if no locale has been passed in (Yes, it's okay to have the trailing . in the no-locale situation) ........ r9686 | miker | 2008-05-22 22:43:39 -0400 (Thu, 22 May 2008) | 1 line start of code map admin interfaces ........ r9695 | phasefx | 2008-05-25 01:14:19 -0400 (Sun, 25 May 2008) | 1 line I18N version of a patch from Bill Ott for a New Window button on the login window. Thanks! ........ r9698 | phasefx | 2008-05-25 02:47:49 -0400 (Sun, 25 May 2008) | 1 line remove redundant (and broken) code so alternate pull list works again; thanks to Ryan Laverdiere and Dan Scott ........ r9699 | miker | 2008-05-25 08:58:23 -0400 (Sun, 25 May 2008) | 1 line add a copy of the DCO for convenience ........ r9703 | dbs | 2008-05-26 12:05:02 -0400 (Mon, 26 May 2008) | 2 lines Fix missing close-quote character (regression introduced in r9650) ........ r9704 | dbs | 2008-05-26 12:28:56 -0400 (Mon, 26 May 2008) | 2 lines miker's bane: typo: visiblity -> visibility ........ r9705 | dbs | 2008-05-26 13:25:00 -0400 (Mon, 26 May 2008) | 2 lines Typo: Fromat -> Format (and a reminder to self to figure out how to i18n-ize this) ........ r9706 | dbs | 2008-05-26 13:33:12 -0400 (Mon, 26 May 2008) | 3 lines Django admin is dead; alas, multi-db branch was never merged to Django core Long live Conify in its place! ........ r9707 | dbs | 2008-05-26 14:17:52 -0400 (Mon, 26 May 2008) | 1 line Merge from svn ........ git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9708 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/DCO-1.1.txt b/DCO-1.1.txt new file mode 100644 index 0000000000..c7290977e1 --- /dev/null +++ b/DCO-1.1.txt @@ -0,0 +1,29 @@ + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +Signed-off-by: [submitter's name and email address here] + diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf index 58cb576238..c693f862a0 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf +++ b/Open-ILS/examples/apache/eg_vhost.conf @@ -261,23 +261,3 @@ OSRFGatewayConfig /openils/conf/opensrf_core.xml allow from all - -# ---------------------------------------------------------------------------------- -# Django admin interface (experimental) -# - requires mod_python and django -# - requires a symlink from WEBROOT/media to -# /usr/lib/python2.4/site-packages/django/contrib/admin/media/ (or similar) -# ---------------------------------------------------------------------------------- -# -# Order deny,allow -# Deny from all -# Allow from 10.0.0.0/8 -# SetHandler mod_python -# PythonHandler django.core.handlers.modpython -# SetEnv DJANGO_SETTINGS_MODULE ils_admin.settings -# PythonDebug On -# PythonPath "['/openils/var/admin/', '/usr/lib/python2.4/site-packages/'] +sys.path" -# PythonAutoReload On -# - - diff --git a/Open-ILS/src/extras/org_tree_js.pl b/Open-ILS/src/extras/org_tree_js.pl index 342b576cdb..2bed194f9f 100644 --- a/Open-ILS/src/extras/org_tree_js.pl +++ b/Open-ILS/src/extras/org_tree_js.pl @@ -13,6 +13,8 @@ use OpenSRF::Utils::Cache; die "usage: perl org_tree_js.pl " unless $ARGV[0]; OpenSRF::System->bootstrap_client(config_file => $ARGV[0]); +my $locale = $ARGV[1] || ''; + Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL")); # must be loaded after the IDL is parsed @@ -20,15 +22,17 @@ require OpenILS::Utils::CStoreEditor; warn "removing OrgTree from the cache...\n"; my $cache = OpenSRF::Utils::Cache->new; -$cache->delete_cache('orgtree'); +$cache->delete_cache("orgtree.$locale"); # fetch the org_unit's and org_unit_type's my $e = OpenILS::Utils::CStoreEditor->new; +$e->session->session_locale($locale) if ($locale); + my $types = $e->retrieve_all_actor_org_unit_type; my $tree = $e->request( 'open-ils.cstore.direct.actor.org_unit.search.atomic', {id => {"!=" => undef}}, - {order_by => {aou => 'name'}} + {order_by => {aou => 'name'}, no_i18n => $locale ? 0 : 1 } ); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm index d02d4ff623..1b93f236fe 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm @@ -315,7 +315,7 @@ sub show_template { -
Record Fromat: +
Record Format: + + + + + + +
+
+
+ +
+ + + + + +
+ +
+ +
+
New Bib Level:
+ + + + +
+ +
+
+
+ +
+ +
+ +
+ + + +
+ +
+ + + diff --git a/Open-ILS/web/conify/global/config/marc_code_maps.js b/Open-ILS/web/conify/global/config/marc_code_maps.js new file mode 100644 index 0000000000..e5d6aef923 --- /dev/null +++ b/Open-ILS/web/conify/global/config/marc_code_maps.js @@ -0,0 +1,220 @@ +/* +# --------------------------------------------------------------------------- +# Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc +# Mike Rylander +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# --------------------------------------------------------------------------- +*/ + +dojo.require('fieldmapper.dojoData'); +dojo.require('openils.widget.TranslatorPopup'); +dojo.require('dojo.cookie'); +dojo.require('dojo.parser'); +dojo.require('dojo.string'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dijit.form.TextBox'); +dojo.require('dijit.form.ValidationTextBox'); +dojo.require('dijit.form.Textarea'); +dojo.require('dijit.layout.TabContainer'); +dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.BorderContainer'); +dojo.require('dojox.widget.Toaster'); +dojo.require('dojox.fx'); +dojo.require('dojox.grid.Grid'); +dojo.require('dojox.grid._data.model'); +dojo.require("dojox.grid.editors"); + +// some handy globals +var cgi = new CGI(); +var ses = dojo.cookie('ses') || cgi.param('ses'); +var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); + +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 } ) +}; + +var dirtyStore = []; + +function status_update (markup) { + if (parent !== window && parent.status_update) parent.status_update( markup ); +} + +function save_code (classname) { + + var item = current_item[classname]; + var obj = new fieldmapper[classname]().fromStoreItem( item ); + + obj.ischanged( 1 ); + obj.code( dojo.string.trim( obj.code() ) ); + obj.value( dojo.string.trim( obj.value() ) ); + if(classname == 'cam' || classname == 'clfm') + obj.description( dojo.string.trim( obj.description() ) ); + + pCRUD.request({ + method : 'open-ils.permacrud.update.' + classname, + timeout : 10, + params : [ ses, modified_ppl ], + onerror : function (r) { + 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(); + status_update( 'Saved changes to ' + stores[classname].getValue( item, 'code' ) ); + } else { + highlighter.red.play(); + status_update( 'Problem saving data for ' + classname + ' ' + stores[classname].getValue( item, 'code' ) ); + } + }, + }).send(); +} + +function save_them_all (event) { + + for (var classname in stores) { + + var store = stores[classname]; + store.fetch({ + query : { ischanged : 1 }, + onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } }, + scope : perm_store + }); + + var confirmation = true; + + if (event && dirtyStore.length > 0) { + confirmation = confirm( + 'There are unsaved modified ' + classname + ' codes! '+ + 'OK to save these changes, Cancel to abandon them.' + ); + event = null; + } + + if (confirmation) { + for (var i in dirtyStore) { + current_item[classname] = dirtyStore[i]; + save_object(classname); + } + + dirtyStore = []; + } + } +} + +dojo.addOnUnload( save_them_all ); + +function delete_grid_selection(classname, grid ) { + + var selected_rows = grid.selection.getSelected(); + + var selected_items = []; + for (var i in selected_rows) { + selected_items.push( + grid.model.getRow( selected_rows[i] ).__dojo_data_item + ); + } + + grid.selection.clear(); + + for (var i in selected_items) { + var item = selected_items[i]; + + if ( confirm('Are you sure you want to delete ' + grid.model.store.getValue( item, 'value' ) + '?')) { + + grid.model.store.setValue( item, 'isdeleted', 1 ); + + var obj = new fieldmapper[classname]().fromStoreItem( item ); + obj.isdeleted( 1 ); + + pCRUD.request({ + method : 'open-ils.permacrud.delete.' + classname, + timeout : 10, + params : [ ses, obj ], + onerror : function (r) { + highlighter.red.play(); + status_update( 'Problem deleting ' + grid.model.store.getValue( item, 'value' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + var old_name = grid.model.store.getValue( item, 'value' ); + if ( res && res.content() ) { + + grid.model.store.fetch({ + query : { code : grid.model.store.getValue( item, 'code' ) }, + onItem : function (item, req) { try { if (this.isItem( item )) this.deleteItem( item ); } catch (e) { /* meh */ } }, + scope : grid.model.store + }); + + highlighter.green.play(); + status_update( old_name + ' deleted' ); + } else { + highlighter.red.play(); + status_update( 'Problem deleting ' + old_name ); + } + } + }).send(); + + } + } +} + +function create_marc_code (data) { + + var cl = data.classname; + if (!cl) return false; + + data.code = dojo.string.trim( data.code ); + data.value = dojo.string.trim( data.value ); + + if(!data.code || !data.value) return false; + + if(cl == 'cam' || cl == 'clfm') + data.description = dojo.string.trim( data.description ); + + var new_fm_obj = new fieldmapper[cl]().fromHash( data ) + new_fm_obj.isnew(1); + + var err = false; + pCRUD.request({ + method : 'open-ils.permacrud.create.' + cl, + timeout : 10, + params : [ ses, new_fm_obj ], + onerror : function (r) { + highlighter.red.play(); + status_update( 'Problem calling method to create new ' + cl ); + err = true; + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + 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(); + } else { + highlighter.red.play(); + status_update( 'Problem creating new Permission' ); + err = true; + } + } + }).send(); + + return false; +} + diff --git a/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js b/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js index 776b5db650..131d601cd0 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js +++ b/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js @@ -144,7 +144,6 @@ if(!dojo._hasResource["fieldmapper.Fieldmapper"]){ constructor : function () { if (!this.a) this.a = []; this.classname = this.declaredClass; - this.Identifier = 'id'; this._fields = fmclasses[this.classname]; for( var pos = 0; pos < this._fields.length; pos++ ) { var p = parseInt(pos) + 3; @@ -154,6 +153,7 @@ if(!dojo._hasResource["fieldmapper.Fieldmapper"]){ } }); fieldmapper[cl] = window[cl]; // alias into place + fieldmapper[cl].Identifier = 'id'; // alias into place } diff --git a/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js b/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js index 55b3412039..e01bbe805f 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js +++ b/Open-ILS/web/js/dojo/fieldmapper/OrgUtils.js @@ -24,6 +24,7 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){ dojo.require("fieldmapper.OrgTree", true); dojo.require("fieldmapper.OrgLasso", true); + fieldmapper.aou.slim_ok = true; fieldmapper.aou.globalOrgTree = {}; fieldmapper.aou.OrgCache = {}; fieldmapper.aou.OrgCacheSN = {}; @@ -45,12 +46,14 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){ } fieldmapper.aou.LoadOrg = function (id, slim_ok) { + if (slim_ok == null) slim_ok = fieldmapper.aou.slim_ok; var slim_o = fieldmapper.aou.OrgCache[id]; if (slim_o && (slim_ok || slim_o.loaded)) return fieldmapper.aou.OrgCache[id].org; var o = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_unit.retrieve'],[null,id]); + o.children = fieldmapper.aou.OrgCache[o.id()].children; fieldmapper.aou.OrgCache[o.id()] = { loaded : true, org : o }; return o; } @@ -65,7 +68,8 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){ ou_type : _l[i][1], parent_ou : _l[i][2], name : _l[i][3], - opac_visible : _l[i][4] + opac_visible : _l[i][4], + shortname : _l[i][5] }) }; @@ -125,21 +129,25 @@ if(!dojo._hasResource["fieldmapper.OrgUtils"]){ return null; } - fieldmapper.aou.findOrgUnitSN = function (sn) { + fieldmapper.aou.findOrgUnitSN = function (sn, slim_ok) { + if (slim_ok == null) slim_ok = fieldmapper.aou.slim_ok; var org = fieldmapper.aou.OrgCacheSN[sn]; if (!org) { for (var i in fieldmapper.aou.OrgCache) { var o = fieldmapper.aou.OrgCache[i]; - if (o.loaded && o.org.shortname() == sn) { + if (o.org.shortname() == sn) { fieldmapper.aou.OrgCacheSN[o.org.shortname()] = o; - return o.org; + org = o; } } - org = fieldmapper.standardRequest(fieldmapper.OpenSRF.methods.FETCH_ORG_BY_SHORTNAME, sn); + if (!slim_ok && !fieldmapper.aou.OrgCache[org.id()].loaded) { + org = fieldmapper.standardRequest(fieldmapper.OpenSRF.methods.FETCH_ORG_BY_SHORTNAME, sn); - fieldmapper.aou.OrgCache[org.id()] = { loaded : true, org : org }; - fieldmapper.aou.OrgCacheSN[org.shortname()] = { loaded : true, org : org }; + org.children = fieldmapper.aou.OrgCache[org.id()].children; + fieldmapper.aou.OrgCache[org.id()] = { loaded : true, org : org }; + fieldmapper.aou.OrgCacheSN[org.shortname()] = { loaded : true, org : org }; + } } diff --git a/Open-ILS/web/js/dojo/fieldmapper/dojoData.js b/Open-ILS/web/js/dojo/fieldmapper/dojoData.js index 48c917210d..a0ab494c9a 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/dojoData.js +++ b/Open-ILS/web/js/dojo/fieldmapper/dojoData.js @@ -42,7 +42,7 @@ if(!dojo._hasResource['fieldmapper.dojoData']){ if (!list) list = {}; // a sane default - if (!params.identifier) params.identifier = 'id'; + if (!params.identifier) params.identifier = this.Identifier; if (!label) label = params.label; if (!label) label = params.identifier; @@ -96,17 +96,17 @@ if(!dojo._hasResource['fieldmapper.dojoData']){ fieldmapper.aou.toStoreData = function (list, label) { if (!label) label = 'shortname'; - return _toStoreData(list, label, { 'parent' : 'parent_ou', 'children' : 'children' }); + return _toStoreData.call(this, list, label, { 'parent' : 'parent_ou', 'children' : 'children' }); } fieldmapper.aout.toStoreData = function (list, label) { if (!label) label = 'name'; - return _toStoreData(list, label, { 'parent' : 'parent', 'children' : 'children' }); + return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' }); } fieldmapper.pgt.toStoreData = function (list, label) { if (!label) label = 'name'; - return _toStoreData(list, label, { 'parent' : 'parent', 'children' : 'children' }); + return _toStoreData.call(this, list, label, { 'parent' : 'parent', 'children' : 'children' }); } /* diff --git a/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js b/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js index 7c7262e7a3..9947425e6e 100644 --- a/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js +++ b/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js @@ -39,7 +39,7 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) { [dijit._Widget, dijit._Templated], { - templateString : "
Translate
", + templateString : "
Translate
", widgetsInTemplate: true, field : "", diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js index 4cb92ab1fb..9faf49ed2d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -246,6 +246,25 @@ function main_init() { }, false ); + + var y = document.getElementById('new_window_btn'); + y.setAttribute('label', offlineStrings.getString('main.new_window_btn.label')); + y.addEventListener( + 'command', + function() { + if (G.data.session) { + try { + G.window.open('chrome://open_ils_staff_client/content/main/menu_frame.xul?server=' + + G.data.server,'main','chrome,resizable' ); + + } catch(E) { alert(E); } + } else { + alert ( offlineStrings.getString('main.new_window_btn.login_first_warning') ); + } + }, + false + ); + if ( found_ws_info_in_Achrome() ) { //var hbox = x.parentNode; var b = document.createElement('button'); //b.setAttribute('label','Migrate legacy settings'); hbox.appendChild(b); diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.xul b/Open-ILS/xul/staff_client/chrome/content/main/main.xul index 35b1c67115..13fe535afc 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.xul @@ -85,6 +85,9 @@