svn://svn.open-ils.org/ILS/trunk
........
r10837 | erickson | 2008-10-15 21:09:18 -0400 (Wed, 15 Oct 2008) | 1 line
by default, wait less time for added content data to return (to prevent apache process exhaustion), but be more forgiving of errors
........
r10838 | dbs | 2008-10-15 23:54:49 -0400 (Wed, 15 Oct 2008) | 3 lines
Add a quick Dojo resource bundle <-> POT roundtripping script
Ensure Dojo resource bundles adhere to JSON formatting specs
........
r10841 | erickson | 2008-10-16 11:36:04 -0400 (Thu, 16 Oct 2008) | 1 line
removed import of non-public packages. testing showed they were not required and they change with dojo 1.2
........
r10842 | erickson | 2008-10-16 12:06:41 -0400 (Thu, 16 Oct 2008) | 1 line
added vandelay menu label and copy-location editor hold verify labels
........
r10843 | dbs | 2008-10-16 12:19:56 -0400 (Thu, 16 Oct 2008) | 1 line
Enable localization of Conify
........
r10844 | phasefx | 2008-10-16 12:35:31 -0400 (Thu, 16 Oct 2008) | 1 line
change the titlebar for the login window to indicate the target server version
........
r10845 | phasefx | 2008-10-16 12:46:39 -0400 (Thu, 16 Oct 2008) | 1 line
exercise the No Propogate Search option when staff opens a new catalog search tab
........
r10846 | phasefx | 2008-10-16 12:54:06 -0400 (Thu, 16 Oct 2008) | 56 lines
Patch to better handle migration of settings on the filesystem. Thanks Jeff!
===
Greetings-
I found that when using open-ils.write_in_user_chrome_directory set to
true, the staff client would store local settings in the application
chrome directory, but the next time the client was run, it would
inappropriately attempt to migrate the settings from the application
chrome directory to the user chrome directory.
If you allowed the settings to be migrated, on the third run, things would
get even more confused.
The attached patch causes the migration check in main_init() to respect
the open-ils.write_in_user_chrome_directory preference, and not migrate
the local settings out of the application chrome directory if the
preference dictates that they should remain there.
DCO inline below, patch is attached. Feedback welcome!
-jeff
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: Jeff Godin <jeff@tcnet.org>
--
Jeff Godin <jeff@tcnet.org>
Traverse Area District Library
........
r10847 | erickson | 2008-10-16 13:53:55 -0400 (Thu, 16 Oct 2008) | 1 line
dummied up a native catalog z-source config blob
........
r10848 | dbs | 2008-10-16 14:10:40 -0400 (Thu, 16 Oct 2008) | 1 line
Add Conify i18n build rules and POT files
........
r10849 | phasefx | 2008-10-16 14:37:18 -0400 (Thu, 16 Oct 2008) | 1 line
use the xul service row for native-evergreen-catalog since it's I18N'ized
........
r10850 | phasefx | 2008-10-16 15:03:06 -0400 (Thu, 16 Oct 2008) | 1 line
we're going to let the middle layer completely handle the limit for past circ retrieval
........
r10851 | erickson | 2008-10-16 15:04:09 -0400 (Thu, 16 Oct 2008) | 1 line
if no max is configured and no valid count from the SC, default to 4, which was the previous default
........
r10852 | phasefx | 2008-10-16 15:57:47 -0400 (Thu, 16 Oct 2008) | 1 line
rough cut of Checkout interface using checkout.full method. Appears to work, but at least one rough spot with redundant override dialogs
........
r10853 | erickson | 2008-10-16 16:27:04 -0400 (Thu, 16 Oct 2008) | 1 line
during precats, assume override on checkout.full
........
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@10856
dcc99617-32d9-48b4-a31d-
7c20da2025e4
# Conify - next-generation Evergreen administration interface
# ----------------------------------------------------------------------------------
RewriteEngine on
-RewriteRule ^/conify/.*/global/(.*)$ /conify/global/$1
+RewriteRule ^/conify/(.*)/global/(.*)$ /conify/global/$2 [E=locale:$1]
<Location /conify>
XMLEntStripPI "yes"
XMLEntEscapeScript "no"
XMLEntStripComments "no"
XMLEntContentType "text/html; charset=utf-8"
- AddOutputFilter INCLUDES .html
+ AddOutputFilter INCLUDES;XMLENT .html
SetHandler perl-script
PerlSetVar OILSProxyTitle "Dojo Admin Login"
return data. Data not returned within the timeout is considered
a failure
-->
- <timeout>4</timeout>
+ <timeout>1</timeout>
<!--
After added content lookups have been disabled due to too many
maximum number of consecutive lookup errors a given process can
have before added content lookups are disabled for everyone
-->
- <max_errors>4</max_errors>
+ <max_errors>15</max_errors>
<!-- If a userid is required to access the added content.. -->
<userid>MY_USER_ID</userid>
my $max_history = $U->ou_ancestor_setting_value(
$e->requestor->ws_ou, 'circ.item_checkout_history.max', $e);
- $count = $max_history if $max_history and (!$count or $count > $max_history);
-
- return [] unless $count;
+ if(defined $max_history) {
+ $count = $max_history unless defined $count and $count < $max_history;
+ } else {
+ $count = 4 unless defined $count;
+ }
return $e->search_action_circulation([
{target_copy => $copyid},
} elsif( $api =~ /checkout.full/ ) {
+ # requesting a precat checkout implies that any required
+ # overrides have been performed. Go ahead and re-override.
+ $circulator->override(1) if $circulator->request_precat;
$circulator->do_permit();
unless( $circulator->bail_out ) {
$circulator->events([]);
}
}
+ # Define the set of native catalog services
+ # XXX There are i18n problems here, but let's get the staff client working first
+ # XXX Move into the DB?
+ $hash->{'native-evergreen-catalog'} = {
+ attrs => {
+ title => {code => 'title', label => 'Title'},
+ author => {code => 'author', label => 'Author'},
+ subject => {code => 'subject', label => 'Subject'},
+ keyword => {code => 'keyword', label => 'Keyword'},
+ tcn => {code => 'tcn', label => 'TCN'},
+ isbn => {code => 'isbn', label => 'ISBN'},
+ issn => {code => 'issn', label => 'ISSN'},
+ publisher => {code => 'publisher', label => 'Publisher'},
+ pubdate => {code => 'pubdate', label => 'Pub Date'},
+ item_type => {code => 'item_type', label => 'Item Type'},
+ }
+ };
+
return $hash;
}
dojo.require('dojox.widget.Toaster');
dojo.require('dojox.fx');
dojo.require('dojox.grid.Grid');
-dojo.require('dojox.grid.compat._data.model');
-dojo.require("dojox.grid.compat._data.editors");
// some handy globals
var cgi = new CGI();
dojo.require('dojox.widget.Toaster');
dojo.require('dojox.fx');
dojo.require('dojox.grid.Grid');
-dojo.require('dojox.grid.compat._data.model');
-dojo.require("dojox.grid.compat._data.editors");
dojo.require('dojox.widget.Toaster');
dojo.require('dojox.fx');
dojo.require('dojox.grid.Grid');
-dojo.require('dojox.grid.compat._data.model');
-dojo.require("dojox.grid.compat._data.editors");
// some handy globals
var cgi = new CGI();
dojo.require('dojox.widget.Toaster');
dojo.require('dojox.fx');
dojo.require('dojox.grid.Grid');
-dojo.require('dojox.grid.compat._data.model');
-dojo.require("dojox.grid.compat._data.editors");
// some handy globals
var cgi = new CGI();
{
- CONFIRM_DELETE: "Are you sure you want to delete ${0}?",
- CONFIRM_EXIT: "There are unsaved changes to one or more organizational units. Click OK to save these changes, or Cancel to abandon them.",
- ERROR_CREATING_CHILD: "Problem creating child Organizational Unit",
- ERROR_DELETING: "Problem deleting ${0}",
- ERROR_DELETING_LAST: "Cannot delete ${0}, you need at least one.",
- ERROR_FETCHING_HOLDS: "Problem fetching Holds Address for ${0}",
- ERROR_FETCHING_HOURS: "Problem fetching hours of operation for ${0}",
- ERROR_FETCHING_ILL: "Problem fetching ILL Address for ${0}",
- ERROR_FETCHING_MAILING: "Problem fetching Mailing Address for ${0}",
- ERROR_FETCHING_ORGS: "Problem fetching organizational unit data",
- ERROR_FETCHING_PHYSICAL: "Problem fetching Physical Address for ${0}",
- ERROR_FETCHING_TYPES: "Problem fetching organizational unit type data",
- ERROR_ORPHANS: "Cannot delete ${0}, ${1} subordinates still exist.",
- ERROR_SAVING_HOO: "Problem saving Hours of Operation data for ${0}",
- ERROR_SAVING_DATA: "Problem saving data for ${0}",
- ERROR_SAVING_HOLDS: "Problem saving Holds Address data for ${0}",
- ERROR_SAVING_ILL: "Problem saving ILL Address data for ${0}",
- ERROR_SAVING_MAILING: "Problem saving Mailing Address data for ${0}",
- ERROR_SAVING_PHYSICAL: "Problem saving Physical Address data for ${0}",
- LABEL_NEW_BRANCH: "New Branch",
- STATUS_DELETED: "${0} deleted",
- STATUS_EDITING: "Now editing ${0}",
- SUCCESS_CREATING_CHILD: "New child Organizational Unit created for ${0}",
- SUCCESS_SAVE: "Saved changes to ${0}",
- SUCCESS_SAVING_HOO: "Hours of Operation updated for ${0}",
- SUCCESS_SAVING_HOLDS: "Saved changes to the Holds Address of ${0}",
- SUCCESS_SAVING_ILL: "Saved changes to the ILL Address of ${0}",
- SUCCESS_SAVING_MAILING: "Saved changes to the Mailing Address of ${0}",
- SUCCESS_SAVING_PHYSICAL: "Saved changes to the Physical Address of ${0}"
+ "CONFIRM_DELETE": "Are you sure you want to delete ${0}?",
+ "CONFIRM_EXIT": "There are unsaved changes to one or more organizational units. Click OK to save these changes, or Cancel to abandon them.",
+ "ERROR_CREATING_CHILD": "Problem creating child Organizational Unit",
+ "ERROR_DELETING": "Problem deleting ${0}",
+ "ERROR_DELETING_LAST": "Cannot delete ${0}, you need at least one.",
+ "ERROR_FETCHING_HOLDS": "Problem fetching Holds Address for ${0}",
+ "ERROR_FETCHING_HOURS": "Problem fetching hours of operation for ${0}",
+ "ERROR_FETCHING_ILL": "Problem fetching ILL Address for ${0}",
+ "ERROR_FETCHING_MAILING": "Problem fetching Mailing Address for ${0}",
+ "ERROR_FETCHING_ORGS": "Problem fetching organizational unit data",
+ "ERROR_FETCHING_PHYSICAL": "Problem fetching Physical Address for ${0}",
+ "ERROR_FETCHING_TYPES": "Problem fetching organizational unit type data",
+ "ERROR_ORPHANS": "Cannot delete ${0}, ${1} subordinates still exist.",
+ "ERROR_SAVING_HOO": "Problem saving Hours of Operation data for ${0}",
+ "ERROR_SAVING_DATA": "Problem saving data for ${0}",
+ "ERROR_SAVING_HOLDS": "Problem saving Holds Address data for ${0}",
+ "ERROR_SAVING_ILL": "Problem saving ILL Address data for ${0}",
+ "ERROR_SAVING_MAILING": "Problem saving Mailing Address data for ${0}",
+ "ERROR_SAVING_PHYSICAL": "Problem saving Physical Address data for ${0}",
+ "LABEL_NEW_BRANCH": "New Branch",
+ "STATUS_DELETED": "${0} deleted",
+ "STATUS_EDITING": "Now editing ${0}",
+ "SUCCESS_CREATING_CHILD": "New child Organizational Unit created for ${0}",
+ "SUCCESS_SAVE": "Saved changes to ${0}",
+ "SUCCESS_SAVING_HOO": "Hours of Operation updated for ${0}",
+ "SUCCESS_SAVING_HOLDS": "Saved changes to the Holds Address of ${0}",
+ "SUCCESS_SAVING_ILL": "Saved changes to the ILL Address of ${0}",
+ "SUCCESS_SAVING_MAILING": "Saved changes to the Mailing Address of ${0}",
+ "SUCCESS_SAVING_PHYSICAL": "Saved changes to the Physical Address of ${0}"
}
{
-
- CONFIRM_UNSAVED_CHANGES: "There are unsaved changes to one or more organization types. Click OK to save these changes, or Cancel to abandon them.",
- CONFIRM_DELETE: "Are you sure you want to delete ${0}?",
- ERROR_CREATING_CHILD: "Problem creating child Organization Type",
- ERROR_CREATING_CHILD_METHOD: "Problem calling method to create child Organization Type",
- ERROR_DELETING: "Problem deleting ${0}",
- ERROR_DELETING_LAST: "Cannot delete ${0}. You need at least one organization type.",
- ERROR_ORPHANS: "Cannot delete ${0}; ${1} subordinates still exist.",
- ERROR_SAVING_DATA: "Problem saving data for ${0}",
- ERROR_FETCHING_TYPES: "Problem fetching organization types",
- LABEL_NEW_TYPE: "New Type",
- STATUS_DELETED: "${0} deleted",
- STATUS_EDITING: "Now editing ${0}",
- SUCCESS_CREATING_CHILD: "New child Organization Type created for ${0}",
- SUCCESS_SAVING_DATA: "Saved changes to ${0}"
+ "CONFIRM_UNSAVED_CHANGES": "There are unsaved changes to one or more organization types. Click OK to save these changes, or Cancel to abandon them.",
+ "CONFIRM_DELETE": "Are you sure you want to delete ${0}?",
+ "ERROR_CREATING_CHILD": "Problem creating child Organization Type",
+ "ERROR_CREATING_CHILD_METHOD": "Problem calling method to create child Organization Type",
+ "ERROR_DELETING": "Problem deleting ${0}",
+ "ERROR_DELETING_LAST": "Cannot delete ${0}. You need at least one organization type.",
+ "ERROR_ORPHANS": "Cannot delete ${0}; ${1} subordinates still exist.",
+ "ERROR_SAVING_DATA": "Problem saving data for ${0}",
+ "ERROR_FETCHING_TYPES": "Problem fetching organization types",
+ "LABEL_NEW_TYPE": "New Type",
+ "STATUS_DELETED": "${0} deleted",
+ "STATUS_EDITING": "Now editing ${0}",
+ "SUCCESS_CREATING_CHILD": "New child Organization Type created for ${0}",
+ "SUCCESS_SAVING_DATA": "Saved changes to ${0}"
}
<!ENTITY staff.main.menu.cat.search_bib_id.label "Retrieve record by Record ID">
<!ENTITY staff.main.menu.cat.volume_status.key "V">
<!ENTITY staff.main.menu.cat.volume_status.label "Display Volume">
+<!ENTITY staff.main.menu.cat.vandelay.label "MARC Batch Import/Export">
<!ENTITY staff.main.menu.cat.z39_50_import.accesskey "Z">
<!ENTITY staff.main.menu.cat.z39_50_import.label "Import Record from Z39.50">
<!ENTITY staff.main.menu.circ.barcode.retrieve_patron "Retrieve Patron by Barcode">
<!ENTITY staff.server.admin.copy_locations.editor.create "Create a new copy location">
<!ENTITY staff.server.admin.copy_locations.editor.name "Name: ">
<!ENTITY staff.server.admin.copy_locations.editor.holdable.label "Holdable: ">
+<!ENTITY staff.server.admin.copy_locations.editor.hold_verify.label "Hold Verify: ">
<!ENTITY staff.server.admin.copy_locations.editor.yes "Yes">
<!ENTITY staff.server.admin.copy_locations.editor.no "No">
<!ENTITY staff.server.admin.copy_locations.editor.opac_visible.label "OPAC Visible: ">
<!ENTITY staff.server.admin.copy_locations.editor.library "Owning Library">
<!ENTITY staff.server.admin.copy_locations.editor.library.filter "Focus Location:">
<!ENTITY staff.server.admin.copy_locations.editor.holdable "Holdable">
+<!ENTITY staff.server.admin.copy_locations.editor.hold_verify "Hold Verify">
<!ENTITY staff.server.admin.copy_locations.editor.help "Help">
<!ENTITY staff.server.admin.copy_locations.editor.opac_visible "OPAC Visible">
<!ENTITY staff.server.admin.copy_locations.editor.circulate "Circulate">
const urls = {
- 'opac' : '/opac/en-US/skin/default/xml/advanced.xml',
+ 'opac' : '/opac/en-US/skin/default/xml/advanced.xml?nps=1',
'opac_rdetail' : '/opac/en-US/skin/default/xml/rdetail.xml',
'opac_rresult' : '/opac/en-US/skin/default/xml/rresult.xml',
'org_tree' : '/opac/common/js/OrgTree.js',
- 'browser' : '/opac/en-US/skin/default/xml/advanced.xml',
+ 'browser' : '/opac/en-US/skin/default/xml/advanced.xml?nps=1',
'fieldmapper' : '/opac/common/js/fmall.js',
'isodate_lib_remote' : '/opac/common/js/DP_DateExtensions.js',
'isodate_lib_local' : 'chrome://open_ils_staff_client/content/OpenILS/util/DP_DateExtensions.js',
// vim:noet:sw=4:ts=4:
var offlineStrings;
+var authStrings;
function grant_perms(url) {
var perms = "UniversalXPConnect UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead UniversalFileRead";
// Now we can safely load the strings without the cache getting wiped
offlineStrings = document.getElementById('offlineStrings');
+ authStrings = document.getElementById('authStrings');
if (typeof JSAN == 'undefined') {
throw(
version = 'versionless debug build';
document.getElementById('debug_gb').hidden = false;
}
+ window.title = authStrings.getFormattedString('staff.auth.titlebar.label', version);
//var x = document.getElementById('version_label');
//x.setAttribute('value','Build ID: ' + version);
var x = document.getElementById('about_btn');
false
);
- if ( found_ws_info_in_Achrome() ) {
+ var pref = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
+
+ if ( found_ws_info_in_Achrome() && pref.getBoolPref("open-ils.write_in_user_chrome_directory") ) {
//var hbox = x.parentNode; var b = document.createElement('button');
//b.setAttribute('label','Migrate legacy settings'); hbox.appendChild(b);
//b.addEventListener(
staff.auth.session.unregistered=%1$s is not registered with this server.
staff.auth.session.login_failed=Login failed. Please check your Server Hostname, Username, Password, and your CAPS LOCK key.
staff.auth.session.init_false=open-ils.auth.authenticate.init returned false
+staff.auth.titlebar.label=Evergreen Staff Client - %1$s
var x = document.getElementById('service_rows');
for (var i in obj.services) {
try {
+ if (i == 'native-evergreen-catalog') continue;
var r = document.createElement('row'); x.appendChild(r);
var cb = document.createElement('checkbox');
if (obj.services[i].label) {
alert(E);
}
}
- obj.services[ 'native-evergreen-catalog' ] = { 'attrs' : { 'author' : {}, 'title' : {} } };
+ //obj.services[ 'native-evergreen-catalog' ] = { 'attrs' : { 'author' : {}, 'title' : {} } };
setTimeout(
function() {
if (obj.creds.hosts[ obj.data.server_unadorned ]) {
'_checkout_pending_hash' : {},
- '_checkout' : function(params) {
+ '_checkout' : function(params,permit) {
var obj = this;
try {
}
/**********************************************************************************************************************/
- /* This does the actual checkout/renewal */
+ /* This used to do the actual checkout/renewal */
var x = document.createElement('label');
x.setAttribute('style','color: green');
}
document.getElementById('msg_area').appendChild(x);
+ /*
obj.network.request(
api.CHECKOUT.app,
api.CHECKOUT.method,
_checkout_callback(req,x);
}
);
+ */
if (typeof params.noncat == 'undefined') { obj.items_out_count++; }
+
+ /* new */
+ _checkout_callback({ 'getResultObject' : function() { return permit; } },x);
} catch(E) {
x.setAttribute('style','color: red');
/**********************************************************************************************************************/
- /* Permissibility test before checkout */
+ /* This used to be the Permissibility test before checkout */
try {
params.patron = obj.patron_id;
- var permit = obj.network.request(
- api.CHECKOUT_PERMIT.app,
- api.CHECKOUT_PERMIT.method,
+ var permit = obj.network.simple_request(
+ //api.CHECKOUT_PERMIT.app,
+ 'CHECKOUT_FULL',
[ ses(), params, obj.items_out_count ],
null,
{
JSAN.use('util.sound'); var sound = new util.sound(); sound.circ_good();
params.permit_key = permit.payload;
- obj._checkout( params );
+ obj._checkout( params, permit );
/**********************************************************************************************************************/
/* Item not cataloged or barcode mis-scan. Prompt for pre-cat option */
params.precat = 1;
if (params.dummy_title !== '') {
- obj._checkout( params );
+ //obj._checkout( params ); No real request method here anymore
+ obj.checkout( params );
} else {
alert(document.getElementById('circStrings').getString('staff.circ.checkout.cancelled'));
}
- }
+ }
+
+ return;
}
var test_permit;
g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul');
g.copy_id = xul_param('copy_id',{'modal_xulG':true});
- g.count = xul_param('count',{'modal_xulG':true});
JSAN.use('util.network'); g.network = new util.network();
JSAN.use('util.date');
try {
$('r_last').disabled = true; $('r_all').disabled = true;
g.circs = g.network.simple_request('FM_CIRC_RETRIEVE_VIA_COPY',
- [ ses(), g.copy_id, g.count ]);
+ [ ses(), g.copy_id ]);
if (g.circs == null || typeof g.circs.ilsevent != 'undefined') throw(circs);
if (g.circs.length == 0) return;
//g.circs = g.circs.reverse(); /* put the most recent at the top */
};
-circ.util.show_last_few_circs = function(selection_list,count) {
+circ.util.show_last_few_circs = function(selection_list) {
var obj = {};
JSAN.use('util.error'); obj.error = new util.error();
JSAN.use('util.window'); obj.win = new util.window();
JSAN.use('util.network'); obj.network = new util.network();
JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
- if (!count) count = 4;
-
for (var i = 0; i < selection_list.length; i++) {
try {
if (typeof selection_list[i].copy_id == 'undefined' || selection_list[i].copy_id == null) continue;
var url = xulG.url_prefix( urls.XUL_CIRC_SUMMARY ); // + '?copy_id=' + selection_list[i].copy_id + '&count=' + count;
- var my_xulG = obj.win.open( url, 'show_last_few_circs', 'chrome,resizable,modal', { 'copy_id' : selection_list[i].copy_id, 'count' : count } );
+ var my_xulG = obj.win.open( url, 'show_last_few_circs', 'chrome,resizable,modal', { 'copy_id' : selection_list[i].copy_id } );
if (typeof my_xulG.retrieve_these_patrons == 'undefined') continue;
var patrons = my_xulG.retrieve_these_patrons;
DTDDIR=../../Open-ILS/web/opac/locale
CHROME_PROPSDIR=../../Open-ILS/xul/staff_client/chrome/locale
SERVER_PROPSDIR=../../Open-ILS/xul/staff_client/server/locale
+DOJO_LOCALE := $(shell echo ${LOCALE} | tr '[:upper:]-' '[:lower:]/')
+DOJOSRC=../../Open-ILS/web/js/dojo/openils/conify/nls
FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
FMIDLOUT=fm_IDL.pot
FMIDLENT=fm_IDL.xml
@echo "Generated new PO files for locale $(LOCALE)"
# Generate a new set of POT files and entityized fieldmapper IDL
-newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot
+newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot dojo2pot
@echo "Generated new POT files"
# Generate DTD, JavaScript message catalogs, fieldmapper IDL,
# and SQL insert files from PO for locale LOCALE
-project: po2dtds po2props po2sql fmidlpo2entity po2ils
+project: po2dtds po2props po2sql fmidlpo2entity po2ils po2dojo
@echo "Generated project files for locale $(LOCALE)"
# Update PO files with new and changed strings from POT files
dtds2pot:
@moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
+dojo2pot:
+ @scripts/dojo_resource.py --pot $(DOJOSRC)/aou.js --output $(POTSRC)/conify.aou.pot
+ @scripts/dojo_resource.py --pot $(DOJOSRC)/aout.js --output $(POTSRC)/conify.aout.pot
+
+po2dojo:
+ @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.aou.po --output $(PROJECT)/$(LOCALE)/conify.aou.js
+ @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.aout.po --output $(PROJECT)/$(LOCALE)/conify.aout.js
+
ils2pot:
@scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
@scripts/merge_ils_events.py --master $(EVTSRC) --localization $(PROJECT)/$(LOCALE)/$(EVTXML) --output $(EVTSRC)
cp $(PROJECT)/$(LOCALE)/$(SQLOUT).sql $(SQLSRCDIR)/$(SQLOUT)-$(LOCALE).sql
cp $(POOUTDIR)/$(FMIDLENT) $(REPORTDIR)/$(FMIDLENT)
+ mkdir -p $(DOJOSRC)/$(DOJO_LOCALE)
+ cp $(PROJECT)/$(LOCALE)/conify.aou.js $(DOJOSRC)/$(DOJO_LOCALE)/aou.js
+ cp $(PROJECT)/$(LOCALE)/conify.aout.js $(DOJOSRC)/$(DOJO_LOCALE)/aout.js
--- /dev/null
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Evergreen 1.4\n"
+"Report-Msgid-Bugs-To: open-ils-dev@list.georgialibraries.org\n"
+"POT-Creation-Date: 2008-10-16 14:07:01-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: aou.js:SUCCESS_SAVING_PHYSICAL
+msgid "Saved changes to the Physical Address of ${0}"
+msgstr "Saved changes to the Physical Address of ${0}"
+
+#: aou.js:ERROR_FETCHING_TYPES
+msgid "Problem fetching organizational unit type data"
+msgstr "Problem fetching organizational unit type data"
+
+#: aou.js:ERROR_FETCHING_PHYSICAL
+msgid "Problem fetching Physical Address for ${0}"
+msgstr "Problem fetching Physical Address for ${0}"
+
+#: aou.js:ERROR_SAVING_DATA
+msgid "Problem saving data for ${0}"
+msgstr "Problem saving data for ${0}"
+
+#: aou.js:LABEL_NEW_BRANCH
+msgid "New Branch"
+msgstr "New Branch"
+
+#: aou.js:ERROR_FETCHING_HOURS
+msgid "Problem fetching hours of operation for ${0}"
+msgstr "Problem fetching hours of operation for ${0}"
+
+#: aou.js:ERROR_FETCHING_ILL
+msgid "Problem fetching ILL Address for ${0}"
+msgstr "Problem fetching ILL Address for ${0}"
+
+#: aou.js:SUCCESS_CREATING_CHILD
+msgid "New child Organizational Unit created for ${0}"
+msgstr "New child Organizational Unit created for ${0}"
+
+#: aou.js:SUCCESS_SAVING_HOO
+msgid "Hours of Operation updated for ${0}"
+msgstr "Hours of Operation updated for ${0}"
+
+#: aou.js:ERROR_DELETING_LAST
+msgid "Cannot delete ${0}, you need at least one."
+msgstr "Cannot delete ${0}, you need at least one."
+
+#: aou.js:ERROR_SAVING_HOO
+msgid "Problem saving Hours of Operation data for ${0}"
+msgstr "Problem saving Hours of Operation data for ${0}"
+
+#: aou.js:ERROR_SAVING_PHYSICAL
+msgid "Problem saving Physical Address data for ${0}"
+msgstr "Problem saving Physical Address data for ${0}"
+
+#: aou.js:CONFIRM_EXIT
+msgid "There are unsaved changes to one or more organizational units. Click OK to save these changes, or Cancel to abandon them."
+msgstr "There are unsaved changes to one or more organizational units. Click OK to save these changes, or Cancel to abandon them."
+
+#: aou.js:SUCCESS_SAVE
+msgid "Saved changes to ${0}"
+msgstr "Saved changes to ${0}"
+
+#: aou.js:SUCCESS_SAVING_MAILING
+msgid "Saved changes to the Mailing Address of ${0}"
+msgstr "Saved changes to the Mailing Address of ${0}"
+
+#: aou.js:ERROR_FETCHING_MAILING
+msgid "Problem fetching Mailing Address for ${0}"
+msgstr "Problem fetching Mailing Address for ${0}"
+
+#: aou.js:ERROR_FETCHING_ORGS
+msgid "Problem fetching organizational unit data"
+msgstr "Problem fetching organizational unit data"
+
+#: aou.js:SUCCESS_SAVING_HOLDS
+msgid "Saved changes to the Holds Address of ${0}"
+msgstr "Saved changes to the Holds Address of ${0}"
+
+#: aou.js:SUCCESS_SAVING_ILL
+msgid "Saved changes to the ILL Address of ${0}"
+msgstr "Saved changes to the ILL Address of ${0}"
+
+#: aou.js:ERROR_DELETING
+msgid "Problem deleting ${0}"
+msgstr "Problem deleting ${0}"
+
+#: aou.js:STATUS_EDITING
+msgid "Now editing ${0}"
+msgstr "Now editing ${0}"
+
+#: aou.js:ERROR_CREATING_CHILD
+msgid "Problem creating child Organizational Unit"
+msgstr "Problem creating child Organizational Unit"
+
+#: aou.js:CONFIRM_DELETE
+msgid "Are you sure you want to delete ${0}?"
+msgstr "Are you sure you want to delete ${0}?"
+
+#: aou.js:ERROR_ORPHANS
+msgid "Cannot delete ${0}, ${1} subordinates still exist."
+msgstr "Cannot delete ${0}, ${1} subordinates still exist."
+
+#: aou.js:ERROR_SAVING_HOLDS
+msgid "Problem saving Holds Address data for ${0}"
+msgstr "Problem saving Holds Address data for ${0}"
+
+#: aou.js:ERROR_FETCHING_HOLDS
+msgid "Problem fetching Holds Address for ${0}"
+msgstr "Problem fetching Holds Address for ${0}"
+
+#: aou.js:ERROR_SAVING_MAILING
+msgid "Problem saving Mailing Address data for ${0}"
+msgstr "Problem saving Mailing Address data for ${0}"
+
+#: aou.js:STATUS_DELETED
+msgid "${0} deleted"
+msgstr "${0} deleted"
+
+#: aou.js:ERROR_SAVING_ILL
+msgid "Problem saving ILL Address data for ${0}"
+msgstr "Problem saving ILL Address data for ${0}"
--- /dev/null
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Evergreen 1.4\n"
+"Report-Msgid-Bugs-To: open-ils-dev@list.georgialibraries.org\n"
+"POT-Creation-Date: 2008-10-16 14:07:02-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: aout.js:ERROR_FETCHING_TYPES
+msgid "Problem fetching organization types"
+msgstr "Problem fetching organization types"
+
+#: aout.js:SUCCESS_SAVING_DATA
+msgid "Saved changes to ${0}"
+msgstr "Saved changes to ${0}"
+
+#: aout.js:LABEL_NEW_TYPE
+msgid "New Type"
+msgstr "New Type"
+
+#: aout.js:STATUS_DELETED
+msgid "${0} deleted"
+msgstr "${0} deleted"
+
+#: aout.js:ERROR_DELETING
+msgid "Problem deleting ${0}"
+msgstr "Problem deleting ${0}"
+
+#: aout.js:STATUS_EDITING
+msgid "Now editing ${0}"
+msgstr "Now editing ${0}"
+
+#: aout.js:SUCCESS_CREATING_CHILD
+msgid "New child Organization Type created for ${0}"
+msgstr "New child Organization Type created for ${0}"
+
+#: aout.js:ERROR_CREATING_CHILD
+msgid "Problem creating child Organization Type"
+msgstr "Problem creating child Organization Type"
+
+#: aout.js:CONFIRM_DELETE
+msgid "Are you sure you want to delete ${0}?"
+msgstr "Are you sure you want to delete ${0}?"
+
+#: aout.js:CONFIRM_UNSAVED_CHANGES
+msgid "There are unsaved changes to one or more organization types. Click OK to save these changes, or Cancel to abandon them."
+msgstr "There are unsaved changes to one or more organization types. Click OK to save these changes, or Cancel to abandon them."
+
+#: aout.js:ERROR_ORPHANS
+msgid "Cannot delete ${0}; ${1} subordinates still exist."
+msgstr "Cannot delete ${0}; ${1} subordinates still exist."
+
+#: aout.js:ERROR_SAVING_DATA
+msgid "Problem saving data for ${0}"
+msgstr "Problem saving data for ${0}"
+
+#: aout.js:ERROR_CREATING_CHILD_METHOD
+msgid "Problem calling method to create child Organization Type"
+msgstr "Problem calling method to create child Organization Type"
+
+#: aout.js:ERROR_DELETING_LAST
+msgid "Cannot delete ${0}. You need at least one organization type."
+msgstr "Cannot delete ${0}. You need at least one organization type."
--- /dev/null
+#!/usr/bin/env python
+# dojo_resource.py
+"""
+This class enables translation of Dojo resource bundles using gettext format.
+
+Requires polib from http://polib.googlecode.com
+
+Source event definitions are structured as follows:
+{
+ MSG_ID1: "This is a message with 1 variable - ${0}.",
+ MSG_ID2: "This is a message with two variables: ${0} and ${1}."
+}
+
+Note that this is a deliberately limited subset of the variable substitution
+allowed by http://api.dojotoolkit.org/jsdoc/dojo/1.2/dojo.string.substitute
+
+"""
+# Copyright 2007 Dan Scott <dscott@laurentian.ca>
+#
+# 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.
+
+import basel10n
+import optparse
+import polib
+import re
+import sys
+import simplejson
+import os.path
+
+class DojoResource (basel10n.BaseL10N):
+ """
+ This class provides methods for extracting translatable strings from
+ Evergreen's Dojo resource bundle files, generating translatable POT files,
+ reading translated PO files, and generating an updated Dojo resource bundle
+ files with additional or changed strings.
+ """
+
+ def __init__(self):
+ self.pot = None
+ basel10n.BaseL10N.__init__(self)
+ self.msgs = {}
+
+ def get_strings(self, source):
+ """
+ Extracts translatable strings from Evergreen's Dojo resource bundles.
+ """
+ self.pothead()
+
+ bundle = simplejson.load(open(source, 'r'))
+
+ for key, value in bundle.iteritems():
+ poe = polib.POEntry()
+ poe.occurrences = [(os.path.basename(source), key)]
+ poe.msgid = value
+ poe.msgstr = value
+ self.pot.append(poe)
+
+ def create_bundle(self):
+ """
+ Creates a Dojo resource bundle file based on a translated PO file.
+ """
+
+ msg = "\t\"%s\": \"%s\""
+
+ for entry in self.pot:
+ for filename, msgkey in entry.occurrences:
+ if entry.msgstr == '':
+ # No translation available; use the en-US definition
+ self.msgs[msgkey] = entry.msgid
+ else:
+ self.msgs[msgkey] = entry.msgstr
+
+def main():
+ """
+ Determine what action to take
+ """
+ opts = optparse.OptionParser()
+ opts.add_option('-p', '--pot', action='store', \
+ help='Create a POT file from the specified Dojo resource bundle file', \
+ metavar='FILE')
+ opts.add_option('-c', '--create', action='store', \
+ help='Create a Dojo resource bundle file from a translated PO FILE', \
+ metavar='FILE')
+ opts.add_option('-o', '--output', dest='outfile', \
+ help='Write output to FILE (defaults to STDOUT)', metavar='FILE')
+ (options, args) = opts.parse_args()
+
+ pot = DojoResource()
+
+ # Generate a new POT file from the Dojo resource bundle file
+ if options.pot:
+ pot.get_strings(options.pot)
+ if options.outfile:
+ pot.savepot(options.outfile)
+ else:
+ sys.stdout.write(pot.pot.__str__())
+
+ # Generate an Dojo resource bundle file from a PO file
+ elif options.create:
+ pot.loadpo(options.create)
+ pot.create_bundle()
+ if options.outfile:
+ outfile = open(options.outfile, 'w')
+ simplejson.dump(pot.msgs, outfile, indent=4)
+ else:
+ print(simplejson.dumps(pot.msgs, indent=4))
+
+ # No options were recognized - print help and bail
+ else:
+ opts.print_help()
+
+if __name__ == '__main__':
+ main()