[open-ils-commits] r7658 - in trunk/Open-ILS/xul/staff_client:
chrome/content/OpenILS server server/cat server/locale
server/locale/en-US
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Aug 10 11:41:11 EDT 2007
Author: phasefx
Date: 2007-08-10 11:37:57 -0400 (Fri, 10 Aug 2007)
New Revision: 7658
Added:
trunk/Open-ILS/xul/staff_client/server/locale/
trunk/Open-ILS/xul/staff_client/server/locale/en-US/
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
Log:
Let's give messagecatalog a spin in remote xul and make the bad status/batch delete error message friendlier in the process...
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2007-08-09 18:46:30 UTC (rev 7657)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2007-08-10 15:37:57 UTC (rev 7658)
@@ -1,3 +1,5 @@
+ function $(id) { return document.getElementById(id); }
+
function ses(a) {
JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
switch(a) {
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js 2007-08-09 18:46:30 UTC (rev 7657)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js 2007-08-10 15:37:57 UTC (rev 7658)
@@ -461,7 +461,22 @@
}
var robj = obj.network.simple_request('FM_ACP_FLESHED_BATCH_UPDATE',[ ses(), copies, true]);
- if (typeof robj.ilsevent != 'undefined') obj.error.standard_unexpected_error_alert('Batch Item Deletion',robj);
+ if (typeof robj.ilsevent != 'undefined') {
+ switch(robj.ilsevent) {
+ case 1227 /* COPY_DELETE_WARNING */ :
+ var copy;
+ for (var i = 0; i < copies.length; i++) { if (copies[i].id()==robj.payload) copy = function(a){return a;}(copies[i]); }
+ /* The copy in question is not in an ideal status for deleting */
+ var err = '*** ' + robj.desc + ' ***\n';
+ /* The barcode for the item is {1} */
+ err += $('catStrings').getFormattedString('cat.barcode_for_item',[ copy.barcode() ]) + '\n';
+ /* The whole batch operation failed */
+ err += $('catStrings').getString('cat.batch_operation_failed') + '\n';
+ alert(err);
+ break;
+ default: obj.error.standard_unexpected_error_alert('Batch Item Deletion',robj);
+ }
+ }
obj.render_pending_copies(); // FIXME -- need a generic refresh for lists
setTimeout(
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.xul 2007-08-09 18:46:30 UTC (rev 7657)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.xul 2007-08-10 15:37:57 UTC (rev 7658)
@@ -75,6 +75,8 @@
]]>
</script>
+ <messagecatalog id="catStrings" src="/server/xul/locale/<!--#echo var='locale' -->/cat.properties"/>
+
<commandset id="copy_buckets_cmds">
<command id="sel_clip1" />
<command id="save_columns1" />
Added: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties (rev 0)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2007-08-10 15:37:57 UTC (rev 7658)
@@ -0,0 +1,2 @@
+cat.barcode_for_item=The barcode for the item is %1$S
+cat.batch_operation_failed=The whole batch operation failed. %1$S
More information about the open-ils-commits
mailing list