tweak magical statuses and mark item actions
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 14 Aug 2006 19:57:01 +0000 (19:57 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 14 Aug 2006 19:57:01 +0000 (19:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5501 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/cat/util.js

index 1d6a0a5..f833d29 100644 (file)
@@ -2,10 +2,10 @@ dump('Loading constants.js\n');
 
 const my_constants = {
        'magical_statuses' : {
-               '1' : 't', /* | Checked out    | t */
-               '3' : 't', /* | Lost           | f */
-               '6' : 't', /* | In transit     | t */
-               '8' : 't', /* | On holds shelf | t */
+               '1' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : true }, /* | Checked out    | t */
+               '3' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : true }, /* | Lost           | f */
+               '6' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : true }, /* | In transit     | t */
+               '8' : { 'disable_in_copy_editor' : true, 'block_mark_item_action' : false }, /* | On holds shelf | t */
        }
 }
 
index fef6f33..ea107e0 100644 (file)
@@ -205,7 +205,8 @@ cat.util.mark_item_damaged = function(copy_ids) {
                var magic_status = false;
                for (var i = 0; i < copies.length; i++) {
                        var status = copies[i].status(); if (typeof status == 'object') status = status.id();
-                       if (typeof my_constants.magical_statuses[ status ] != 'undefined') magic_status = true;
+                       if (typeof my_constants.magical_statuses[ status ] != 'undefined') 
+                               if (my_constants.magical_statuses[ status ].block_mark_item_action) magic_status = true;
                }
                if (magic_status) {
                
@@ -213,7 +214,7 @@ cat.util.mark_item_damaged = function(copy_ids) {
 
                } else {
 
-                       var r = error.yns_alert('Change the status for these items to Damaged?  You will have to manually retrieve the last circulation if you need to bill a patron.  Barcodes: ' + util.functional.map_list( copies, function(o) { return o.barcode(); } ).join(", "), 'Mark Damaged', 'OK', 'Cancel', null, 'Check here to confirm this action');
+                       var r = error.yns_alert('Change the status for these items to Damaged?  You will have to manually retrieve the last circulation if you need to bill a patron.  You will also have to manually adjust any pertinent holds.  Barcodes: ' + util.functional.map_list( copies, function(o) { return o.barcode(); } ).join(", "), 'Mark Damaged', 'OK', 'Cancel', null, 'Check here to confirm this action');
 
                        if (r == 0) {
                                var count = 0;
@@ -246,7 +247,8 @@ cat.util.mark_item_missing = function(copy_ids) {
                var magic_status = false;
                for (var i = 0; i < copies.length; i++) {
                        var status = copies[i].status(); if (typeof status == 'object') status = status.id();
-                       if (typeof my_constants.magical_statuses[ status ] != 'undefined') magic_status = true;
+                       if (typeof my_constants.magical_statuses[ status ] != 'undefined') 
+                               if (my_constants.magical_statuses[ status ].block_mark_item_action) magic_status = true;
                }
                if (magic_status) {
                
@@ -254,7 +256,7 @@ cat.util.mark_item_missing = function(copy_ids) {
 
                } else {
 
-                       var r = error.yns_alert('Change the status for these items to Missing?  Barcodes: ' + util.functional.map_list( copies, function(o) { return o.barcode(); } ).join(", "), 'Mark Missing', 'OK', 'Cancel', null, 'Check here to confirm this action');
+                       var r = error.yns_alert('Change the status for these items to Missing?  You will have to manually adjust any pertinent holds.  Barcodes: ' + util.functional.map_list( copies, function(o) { return o.barcode(); } ).join(", "), 'Mark Missing', 'OK', 'Cancel', null, 'Check here to confirm this action');
 
                        if (r == 0) {
                                var count = 0;