[open-ils-commits] [GIT] Evergreen ILS branch master updated. c4e56c4c40c6a69887834a2fd5d7d099c9987097

Evergreen Git git at git.evergreen-ils.org
Mon Dec 5 13:33:20 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  c4e56c4c40c6a69887834a2fd5d7d099c9987097 (commit)
       via  86e08c1b4b92b44f5531f3fc8804c3cbece84723 (commit)
       via  55258cb47a8fcd52bea496918bbfe7a2214a3bb6 (commit)
       via  a99b57ae6d48977bd0bacd230f740d635177b433 (commit)
       via  a835939bcff6eb25df489488105c5c64704bf69a (commit)
       via  741e1869ddc7d62207cd242e02afd88bb32c2f76 (commit)
       via  da556c7f5fedf03ed1d6e84050033c237b774b1c (commit)
      from  e0a936729ada587e33ab3a701901c3d0a1ed3acb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c4e56c4c40c6a69887834a2fd5d7d099c9987097
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Dec 5 13:32:23 2011 -0500

    Add versioned upgrade script for "Bib source: can have copies"
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index fa53141..8852183 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0654', :eg_version); -- phasefx/tsbere
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0655', :eg_version); -- dyrcona/dbs
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0655.config.bib_source.can_have_copies.sql b/Open-ILS/src/sql/Pg/upgrade/0655.config.bib_source.can_have_copies.sql
new file mode 100644
index 0000000..6d34581
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0655.config.bib_source.can_have_copies.sql
@@ -0,0 +1,15 @@
+-- Evergreen DB patch 0655.config.bib_source.can_have_copies.sql
+--
+-- This column introduces the ability to prevent bib records associated
+-- with specific bib sources from being able to have volumes or MFHD
+-- records attached to them.
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0655', :eg_version);
+
+ALTER TABLE config.bib_source
+ADD COLUMN can_have_copies BOOL NOT NULL DEFAULT TRUE;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql
deleted file mode 100644
index 102da7a..0000000
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE config.bib_source
-ADD COLUMN can_have_copies BOOL NOT NULL DEFAULT TRUE;

commit 86e08c1b4b92b44f5531f3fc8804c3cbece84723
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Tue Nov 15 19:31:12 2011 -0500

    Refactor retrieval of cbs object into cat.util.get_cbs_for_bre_id().
    
    Avoid code duplication.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
index 189d523..df04c3d 100644
--- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js
+++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
@@ -171,20 +171,8 @@ function add_volumes() {
         }
 
         try {
-            var bibObj = g.network.request(
-                api.FM_BRE_RETRIEVE_VIA_ID.app,
-                api.FM_BRE_RETRIEVE_VIA_ID.method,
-				[ ses(), [docid] ]
-            );
-
-            bibObj = bibObj[0];
-
-            var cbsObj = g.network.request(
-                api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
-                api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
-                [ ses(), bibObj.source() ]
-            );
-
+            JSAN.use('cat.util');
+            var cbsObj = cat.util.get_cbs_for_bre_id(docid);
             if (cbsObj.can_have_copies() != get_db_true()) {
                 alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
                 return;
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
index 90cad41..046c88e 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
@@ -1855,17 +1855,8 @@ cat.copy_browser.prototype = {
     'source_init' : function() {
         var obj = this;
         try {
-            var bibObj = obj.network.request(
-                api.FM_BRE_RETRIEVE_VIA_ID.app,
-                api.FM_BRE_RETRIEVE_VIA_ID.method,
-                [ ses(), [obj.docid] ]
-            );
-            bibObj = bibObj[0];
-            var cbsObj = obj.network.request(
-                api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
-                api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
-                [ ses(), bibObj.source() ]
-            );
+            JSAN.use('cat.util');
+            var cbsObj = cat.util.get_cbs_for_bre_id(obj.docid);
             obj.can_have_copies = (cbsObj.can_have_copies() == get_db_true());
             obj.source = cbsObj.source();
         } catch(E) {
diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js
index 5719987..046c20f 100644
--- a/Open-ILS/xul/staff_client/server/cat/util.js
+++ b/Open-ILS/xul/staff_client/server/cat/util.js
@@ -12,7 +12,7 @@ cat.util.EXPORT_OK    = [
     'render_loan_duration', 'mark_item_as_missing_pieces', 'render_callnumbers_for_bib_menu',
     'render_cn_prefix_menuitems', 'render_cn_suffix_menuitems', 'render_cn_class_menu',
     'render_cn_prefix_menu', 'render_cn_suffix_menu', 'transfer_specific_title_holds',
-    'request_items', 'mark_for_overlay'
+    'request_items', 'mark_for_overlay', 'get_cbs_for_bre_id'
 ];
 cat.util.EXPORT_TAGS    = { ':all' : cat.util.EXPORT_OK };
 
@@ -1263,5 +1263,22 @@ cat.util.mark_for_overlay = function(doc_id,doc_mvr) {
     }
 }
 
+cat.util.get_cbs_for_bre_id = function(doc_id) {
+    try {
+        JSAN.use('util.network'); var network = new util.network();
+        var bibObj = network.simple_request(
+            'FM_BRE_RETRIEVE_VIA_ID',
+            [ ses(), [ doc_id ] ]
+        );
+        bibObj = bibObj[0];
+        var cbsObj = network.simple_request(
+            'FM_CBS_RETRIEVE_VIA_PCRUD',
+            [ ses(), bibObj.source() ]
+        );
+        return cbsObj;
+    } catch(E) {
+        alert('Error in cat.util.cbs_can_have_copies(): ' + E);
+    }
+}
 
 dump('exiting cat/util.js\n');

commit 55258cb47a8fcd52bea496918bbfe7a2214a3bb6
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Tue Oct 4 16:54:32 2011 -0400

    Add can have copies check to the Add MFHD Record link in rdetail.
    
    This prevents the button from the JSPAC from being able to add MFHD
    records to the affected bib record.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/web/js/dojo/openils/opac/nls/opac.js b/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
index 9db079d..59ae500 100644
--- a/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
+++ b/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
@@ -37,5 +37,6 @@
     "HOLD_STATUS_PLURAL": "hold # ${0} of ${1} total holds and ${2} potential items",
     "HOLD_STATUS_SINGULAR": "hold # ${0} of ${1} total holds and ${2} potential item",
     "MORE": "More",
-    "MORE_COPIES_FULL_RECORD": "... more copies listed in full record"
+    "MORE_COPIES_FULL_RECORD": "... more copies listed in full record",
+    "SOURCE_CANNOT_HAVE_COPIES": "Records from ${0} cannot have copies."
 }
diff --git a/Open-ILS/web/opac/common/js/config.js b/Open-ILS/web/opac/common/js/config.js
index 1cdc09d..6c87b73 100644
--- a/Open-ILS/web/opac/common/js/config.js
+++ b/Open-ILS/web/opac/common/js/config.js
@@ -365,6 +365,7 @@ var FETCH_ISSUANCE					= 'open-ils.serial:open-ils.serial.issuance.pub_fleshed.b
 var FETCH_COPY_LOCATIONS		= 'open-ils.circ:open-ils.circ.copy_location.retrieve.all';
 var FETCH_COPY_NOTES				= 'open-ils.circ:open-ils.circ.copy_note.retrieve.all';
 var FETCH_COPY_STAT_CATS		= 'open-ils.circ:open-ils.circ.asset.stat_cat_entries.fleshed.retrieve_by_copy';
+var FETCH_BIB_SOURCE            = 'open-ils.pcrud:open-ils.pcrud.retrieve.cbs';
 
 /* XXX deprecated.  Use ccvm's instead  */
 var FETCH_LIT_FORMS             = 'open-ils.search:open-ils.search.biblio.lit_form_map.retrieve.all';
diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js
index 13c5eab..da5f86c 100644
--- a/Open-ILS/web/opac/skin/default/js/rdetail.js
+++ b/Open-ILS/web/opac/skin/default/js/rdetail.js
@@ -191,9 +191,19 @@ function rdetailDraw() {
 			dojo.place("<div id='mfhd_ad_menu'></div>", "rdetail_details_table", "after");
 			var mfhd_add = new dijit.Menu({style:"float: right;"});
 			new dijit.MenuItem({onClick:function(){
-				var req = new Request(CREATE_MFHD_RECORD, G.user.session, 1, here.id(), getRid());
-				var res = req.send();
-				alert(dojo.string.substitute(opac_strings.CREATED_MFHD_RECORD, [here.name()]));
+				var bibReq = new Request(FETCH_BRE, [getRid()]);
+				bibReq.send(true);
+				var bib = bibReq.result()[0];
+				var sourceReq = new Request(FETCH_BIB_SOURCE, G.user.session, bib.source());
+				sourceReq.send(true);
+				var source = sourceReq.result();
+				if (source.can_have_copies() == 'f') {
+					alert(dojo.string.substitute(opac_strings.SOURCE_CANNOT_HAVE_COPIES, [source.source()]));
+				} else {
+					var req = new Request(CREATE_MFHD_RECORD, G.user.session, 1, here.id(), getRid());
+					var res = req.send();
+					alert(dojo.string.substitute(opac_strings.CREATED_MFHD_RECORD, [here.name()]));
+				}
 			}, label:opac_strings.CREATE_MFHD}).placeAt(mfhd_add);
 			mfhd_add.placeAt(mfhd_ad_menu);
 		}

commit a99b57ae6d48977bd0bacd230f740d635177b433
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Tue Oct 4 10:29:23 2011 -0400

    Modify copy browser to check for bib_source.can_have_copies.
    
    Add code to server/cat/copy_browser.js.
    Add error string to server/local/en-US/cat.properties.
    Swap obj. for g. that was copied from opac.js.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
index d234f37..90cad41 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
@@ -34,6 +34,8 @@ cat.copy_browser.prototype = {
 
             obj.list_init(params);
 
+            obj.source_init();
+
             obj.controller.render();
 
             obj.default_depth = obj.depth_menu_init();
@@ -339,6 +341,11 @@ cat.copy_browser.prototype = {
 
                                     if (edit==0) return; // no read-only view for this interface
 
+                                    if (!obj.can_have_copies) {
+                                        alert(document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.can_have_copies.false', obj.source));
+                                        return;
+                                    }
+
                                     var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_item.title');
 
                                     var url;
@@ -633,6 +640,11 @@ cat.copy_browser.prototype = {
                                         return; // no read-only view for this interface
                                     }
 
+                                    if (!obj.can_have_copies) {
+                                        alert(document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.can_have_copies.false', obj.source));
+                                        return;
+                                    }
+
                                     var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.title');
 
                                     var url;
@@ -1839,6 +1851,29 @@ cat.copy_browser.prototype = {
         }
     },
 
+    // Sets can_have_copies and source member variables.
+    'source_init' : function() {
+        var obj = this;
+        try {
+            var bibObj = obj.network.request(
+                api.FM_BRE_RETRIEVE_VIA_ID.app,
+                api.FM_BRE_RETRIEVE_VIA_ID.method,
+                [ ses(), [obj.docid] ]
+            );
+            bibObj = bibObj[0];
+            var cbsObj = obj.network.request(
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
+                [ ses(), bibObj.source() ]
+            );
+            obj.can_have_copies = (cbsObj.can_have_copies() == get_db_true());
+            obj.source = cbsObj.source();
+        } catch(E) {
+            obj.error.sdump('D_ERROR','can have copies check: ' + E);
+            alert(E);
+        }
+    },
+
     'toggle_actions' : function() {
         var obj = this;
         try {
diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
index 3e8b411..f8ac40c 100644
--- a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
+++ b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
@@ -50,6 +50,7 @@ staff.cat.edit_volume.title=Volume
 staff.cat.edit_volume.title.plural=Volumes
 staff.cat.edit_volumes.override.confirm=Override volume re-labeling collision and merge the volumes?
 staff.cat.edit_volumes.label_exists.details=%1$s
+staff.cat.copy_browser.can_have_copies.false=Records from %1$s cannot have copies.
 staff.cat.copy_browser.delete_volume.prompt=Are you sure you would like to delete this volume?
 staff.cat.copy_browser.delete_volume.prompt.plural=Are you sure you would like to delete these %1$s volumes?
 staff.cat.copy_browser.delete_volume.title=Delete Volumes?

commit a835939bcff6eb25df489488105c5c64704bf69a
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Mon Oct 3 20:09:37 2011 -0400

    Modify server/cat/bib_brief.js to check for source can have volumes.
    
    Copy/paste code from chrome/content/cat/opac.js.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
index d197422..189d523 100644
--- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js
+++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
@@ -170,6 +170,31 @@ function add_volumes() {
             return; // no read-only view for this interface
         }
 
+        try {
+            var bibObj = g.network.request(
+                api.FM_BRE_RETRIEVE_VIA_ID.app,
+                api.FM_BRE_RETRIEVE_VIA_ID.method,
+				[ ses(), [docid] ]
+            );
+
+            bibObj = bibObj[0];
+
+            var cbsObj = g.network.request(
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
+                [ ses(), bibObj.source() ]
+            );
+
+            if (cbsObj.can_have_copies() != get_db_true()) {
+                alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
+                return;
+            }
+        } catch(E) {
+            g.error.sdump('D_ERROR','can have copies check: ' + E);
+            alert('Error in server/cat/bib_brief.js, add_volumes(): ' + E);
+            return;
+        }
+
         var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]);
 
         var url;

commit 741e1869ddc7d62207cd242e02afd88bb32c2f76
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Sat Oct 1 12:02:16 2011 -0400

    Check for bib_source.can_have_copies in cataloging.
    
    Retrieve the BRE and CBS object in the add_volumes method of
    opac.js.
    
    Check if the CBS can have copies, and if not, tell the user such
    and return.
    
    Also required adding an api entry in constants.js and a new message
    in offline.properties.
    
    This is the beginning of the client code changes. There are very
    likely to be more.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

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 92d4dcc..a07b9a4 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
@@ -557,6 +557,32 @@ function set_serctrl_view() {
 }
 
 function create_mfhd() {
+    // Check if the source is allowed to have copies, first.
+    try {
+        var bibObj = g.network.request(
+            api.FM_BRE_RETRIEVE_VIA_ID.app,
+            api.FM_BRE_RETRIEVE_VIA_ID.method,
+            [ ses(), [docid] ]
+        );
+
+        bibObj = bibObj[0];
+
+        var cbsObj = g.network.request(
+            api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
+            api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
+            [ ses(), bibObj.source() ]
+        );
+
+        if (cbsObj.can_have_copies() != get_db_true()) {
+            alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
+            return;
+        }
+    } catch(E) {
+        g.error.sdump('D_ERROR','can have copies check: ' + E);
+        alert('Error in chrome/content/cat/opac.js, create_mfhd(): ' + E);
+        return;
+    }
+
     try {
         JSAN.use('util.window'); var win = new util.window();
         var select_aou_window = win.open(
@@ -906,6 +932,32 @@ function add_volumes() {
             return; // no read-only view for this interface
         }
 
+        // Check if the source is allowed to have copies.
+        try {
+            var bibObj = g.network.request(
+                api.FM_BRE_RETRIEVE_VIA_ID.app,
+                api.FM_BRE_RETRIEVE_VIA_ID.method,
+				[ ses(), [docid] ]
+            );
+
+			bibObj = bibObj[0];
+
+            var cbsObj = g.network.request(
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.app,
+                api.FM_CBS_RETRIEVE_VIA_PCRUD.method,
+                [ ses(), bibObj.source() ]
+            );
+
+            if (cbsObj.can_have_copies() != get_db_true()) {
+                alert(document.getElementById('offlineStrings').getFormattedString('staff.cat.bib_source.can_have_copies.false', [cbsObj.source()]));
+                return;
+            }
+        } catch(E) {
+            g.error.sdump('D_ERROR','can have copies check: ' + E);
+            alert('Error in chrome/content/cat/opac.js, add_volumes(): ' + E);
+            return;
+        }
+
         var title = document.getElementById('offlineStrings').getFormattedString('staff.circ.copy_status.add_volumes.title', [docid]);
 
         var url;
diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
index b7d517f..2d775d3 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
@@ -26,7 +26,7 @@
         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     </script>
         <scripts id="openils_util_scripts"/>
-
+<script type="text/javascript" src="chrome://openils_staff_client/content/OpenILS/util/fmall.js"/>
     <script type="text/javascript" src="chrome://open_ils_staff_client/content/main/JSAN.js"/>
     <script type="text/javascript" src="chrome://open_ils_staff_client/content/cat/opac.js"/>
     
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index 1de4e6c..f7ecfe0 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -228,6 +228,7 @@ var api = {
     'FM_BRE_DELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.delete', 'secure' : false },
     'FM_BRE_UNDELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.undelete', 'secure' : false },
     'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false },
+    'FM_CBS_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.cbs' },
     'FM_CBT_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.billing_type.ranged.retrieve.all', 'secure' : false },
     'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false },
     'FM_CIRC_AGE_TO_LOST' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.age_to_lost' },
diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
index ca7eedf..eaef490 100644
--- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
+++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
@@ -280,6 +280,7 @@ staff.cat.opac.title_for_hold_transfer.failure.label=Holds not transferred.
 staff.cat.opac.related_items=Related Lineitems
 staff.cat.opac.serial_alt_mgmt=Subscriptions
 staff.cat.create_or_rebarcode_items=Create or Re-barcode Items
+staff.cat.bib_source.can_have_copies.false=Records from %1$s cannot have copies.
 printing.nothing_to_reprint=Nothing to re-print
 printing.prompt_for_external_print_cmd=Enter external print command and parameters (use %receipt.txt% or %receipt.html% as the file containing the print data. Those values will be substituted with the proper path.):
 printing.print_strategy_saved=Print strategy (%1$s) for %2$s context saved to file system.

commit da556c7f5fedf03ed1d6e84050033c237b774b1c
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Fri Sep 30 11:28:08 2011 -0400

    Add can_have_copies field to config.bib_source.
    
    Add the column definition to config.bib_source in
    002.schema.config.sql.
    
    Insert TRUE into the column for the default sources created in
    950.data.seed-values.sql.
    
    Add the field definition to class id cbs in fm_IDL.xml.
    
    Teach OpenILS/Application/Storage/CDBI/config.pm about new field.
    
    Add upgrade script for config.bib_source.can_have_copies.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index d605f1d..ec1cac6 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -4863,6 +4863,7 @@ SELECT  usr,
 			<field name="quality" reporter:datatype="int" />
 			<field name="source" reporter:datatype="text"/>
 			<field name="transcendant" reporter:datatype="bool"/>
+			<field name="can_have_copies" reporter:datatype="bool"/>
 		</fields>
 		<links/>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm
index 5034730..54a13e3 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm
@@ -24,7 +24,7 @@ package config::bib_source;
 use base qw/config/;
 __PACKAGE__->table('config_bib_source');
 __PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/quality source transcendant/);
+__PACKAGE__->columns(Essential => qw/quality source transcendant can_have_copies/);
 #-------------------------------------------------------------------------------
 
 package config::metabib_field;
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 54865b3..fa53141 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,13 +92,16 @@ CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
 	quality		INT	CHECK ( quality BETWEEN 0 AND 100 ),
 	source		TEXT	NOT NULL UNIQUE,
-	transcendant	BOOL	NOT NULL DEFAULT FALSE
+	transcendant	BOOL	NOT NULL DEFAULT FALSE,
+	can_have_copies	BOOL	NOT NULL DEFAULT TRUE
 );
 COMMENT ON TABLE config.bib_source IS $$
 This is table is used to set up the relative "quality" of each
 MARC source, such as OCLC.  Also identifies "transcendant" sources,
 i.e., sources of bib records that should display in the OPAC
-even if no copies or located URIs are attached.
+even if no copies or located URIs are attached. Also indicates if
+the source is allowed to have actual copies on its bibs. Volumes
+for targeted URIs are unaffected by this setting.
 $$;
 
 CREATE TABLE config.standing (
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 628856f..41e8d19 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1,10 +1,10 @@
 --002.schema.config.sql:
-INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES 
-    (1, 90, oils_i18n_gettext(1, 'oclc', 'cbs', 'source'), FALSE);
-INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES 
-    (2, 10, oils_i18n_gettext(2, 'System Local', 'cbs', 'source'), FALSE);
-INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES 
-    (3, 1, oils_i18n_gettext(3, 'Project Gutenberg', 'cbs', 'source'), TRUE);
+INSERT INTO config.bib_source (id, quality, source, transcendant, can_have_copies) VALUES 
+    (1, 90, oils_i18n_gettext(1, 'oclc', 'cbs', 'source'), FALSE, TRUE);
+INSERT INTO config.bib_source (id, quality, source, transcendant, can_have_copies) VALUES 
+    (2, 10, oils_i18n_gettext(2, 'System Local', 'cbs', 'source'), FALSE, TRUE);
+INSERT INTO config.bib_source (id, quality, source, transcendant, can_have_copies) VALUES 
+    (3, 1, oils_i18n_gettext(3, 'Project Gutenberg', 'cbs', 'source'), TRUE, TRUE);
 SELECT SETVAL('config.bib_source_id_seq'::TEXT, 100);
 
 INSERT INTO biblio.peer_type (id,name) VALUES
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql
new file mode 100644
index 0000000..102da7a
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql
@@ -0,0 +1,2 @@
+ALTER TABLE config.bib_source
+ADD COLUMN can_have_copies BOOL NOT NULL DEFAULT TRUE;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |    1 +
 .../lib/OpenILS/Application/Storage/CDBI/config.pm |    2 +-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    9 ++-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   12 ++--
 .../0655.config.bib_source.can_have_copies.sql     |   15 ++++++
 Open-ILS/web/js/dojo/openils/opac/nls/opac.js      |    3 +-
 Open-ILS/web/opac/common/js/config.js              |    1 +
 Open-ILS/web/opac/skin/default/js/rdetail.js       |   16 +++++-
 .../xul/staff_client/chrome/content/cat/opac.js    |   52 ++++++++++++++++++++
 .../xul/staff_client/chrome/content/cat/opac.xul   |    2 +-
 .../staff_client/chrome/content/main/constants.js  |    1 +
 .../chrome/locale/en-US/offline.properties         |    1 +
 Open-ILS/xul/staff_client/server/cat/bib_brief.js  |   13 +++++
 .../xul/staff_client/server/cat/copy_browser.js    |   26 ++++++++++
 Open-ILS/xul/staff_client/server/cat/util.js       |   19 +++++++-
 .../server/locale/en-US/cat.properties             |    1 +
 16 files changed, 158 insertions(+), 16 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0655.config.bib_source.can_have_copies.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list