From: Jason Etheridge <jason@esilibrary.com>
Date: Tue, 8 Nov 2011 23:42:18 +0000 (-0500)
Subject: LP887822 mint_condition/Quality not set correctly
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b415ad55eb6ffa1edf6ba0fa4db42fe5ef466563;p=evergreen%2Fmasslnc.git

LP887822 mint_condition/Quality not set correctly

during item creation.

Specifically, the Javascript object for a new item (acp) does not explicitly set
the mint_condition field, leaving it null. The item attribute editor treats the
null as false (which it displays as "Mediocre" for that field). The database has
a not null constraint the corresponding column in asset.copy, and defaults to
true. So a new item in the attribute editor will show "Mediocre", but when
actually created, will become "Good".

This branch just sets mint_condition to true when an item is created.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
---

diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
index f64883ee58..92d4dcc6ec 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
@@ -215,6 +215,7 @@ function set_marc_edit() {
                             copy_obj.holdable(get_db_true());
                             copy_obj.opac_visible(get_db_true());
                             copy_obj.ref(get_db_false());
+                            copy_obj.mint_condition(get_db_true());
 
                             JSAN.use('util.window'); var win = new util.window();
 
diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js
index 70149f920a..5719987b42 100644
--- a/Open-ILS/xul/staff_client/server/cat/util.js
+++ b/Open-ILS/xul/staff_client/server/cat/util.js
@@ -603,6 +603,7 @@ cat.util.fast_item_add = function(doc_id,cn_label,cp_barcode) {
         copy_obj.holdable(get_db_true());
         copy_obj.opac_visible(get_db_true());
         copy_obj.ref(get_db_false());
+        copy_obj.mint_condition(get_db_true());
 
         JSAN.use('util.window'); var win = new util.window();
         JSAN.use('cat.util');
diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
index 107ce19169..d41b824be7 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
@@ -1023,6 +1023,7 @@ g.gather_copies = function() {
             copy.holdable(get_db_true());
             copy.opac_visible(get_db_true());
             copy.ref(get_db_false());
+            copy.mint_condition(get_db_true());
             return copy;
         }