OPAC display of fully compressed serials holding. Mostly miker's work except
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 14 Sep 2010 21:44:39 +0000 (21:44 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 14 Sep 2010 21:44:39 +0000 (21:44 +0000)
the OU setting part

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17661 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/0397.data.coust.opac_fully_compresssed.sql [new file with mode: 0644]
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml

index f727f5a..98d4245 100644 (file)
@@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0396'); -- senator
+INSERT INTO config.upgrade_log (version) VALUES ('0397'); -- senator
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 5aeb7f7..03707b5 100644 (file)
@@ -2038,7 +2038,13 @@ INSERT into config.org_unit_setting_type
 ( 'circ.password_reset_request_throttle',
     oils_i18n_gettext('circ.password_reset_request_throttle', 'Circulation: Maximum concurrently active self-serve password reset requests', 'coust', 'label'),
     oils_i18n_gettext('circ.password_reset_request_throttle', 'Prevent the creation of new self-serve password reset requests until the number of active requests drops back below this number.', 'coust', 'description'),
-    'string')
+    'string'),
+
+( 'opac.fully_compressed_serial_holdings',
+    'OPAC: Use fully compressed serial holdings',
+    'Show fully compressed serial holdings for all libraries at and below
+    the current context unit',
+    'bool')
 ;
 
 UPDATE config.org_unit_setting_type
diff --git a/Open-ILS/src/sql/Pg/upgrade/0397.data.coust.opac_fully_compresssed.sql b/Open-ILS/src/sql/Pg/upgrade/0397.data.coust.opac_fully_compresssed.sql
new file mode 100644 (file)
index 0000000..24ce1b4
--- /dev/null
@@ -0,0 +1,14 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0397');
+
+INSERT INTO config.org_unit_setting_type (name, label, description, datatype)
+    VALUES (
+        'opac.fully_compressed_serial_holdings',
+        'OPAC: Use fully compressed serial holdings',
+        'Show fully compressed serial holdings for all libraries at and below
+        the current context unit',
+        'bool'
+    );
+
+COMMIT;
index dc5cac3..fe18c0d 100644 (file)
@@ -155,7 +155,11 @@ function rdetailDraw() {
     }
 
 
-       if (rdetailDisplaySerialHoldings) {
+       if (rdetailDisplaySerialHoldings && (
+        isXUL() || !fetchOrgSettingDefault(
+            getLocation(), "opac.fully_compressed_serial_holdings")
+        )
+    ) {
                var req = new Request(FETCH_MFHD_SUMMARY, getRid());
                req.callback(_holdingsDraw);
                req.send();
index b3f8300..69a876c 100644 (file)
                                        ]]></script>
                                </td>
                        </tr>
+                       <tr templated="true"
+                               name="serial_holdings_label"
+                               class="result_table_title_cell hide_me"
+                               type="opac/slot-data"
+                               query="datafield[tag=901] subfield[code=c]">
+                               <td colspan="2">Issues Held: ${holdingsStatement}
+                                       <span class="hide_me" name="holdingsStatement" type="opac/template-value"><![CDATA[
+                                               if (fetchOrgSettingDefault(
+                                                       getLocation(), "opac.fully_compressed_serial_holdings"
+                                               )) {
+                                                       var blob = fieldmapper.standardRequest(
+                                                               ['open-ils.serial','open-ils.serial.bib.summary_statements'],
+                                                               [BT.textContent(item_list[0]), { orgid : getLocation(), depth : getDepth() }]
+                                                       );
+
+                                                       var ret = dojo.create('div');
+                                                       for (var i in blob) {
+                                                               var br = dojo.create('br', null, ret);
+                                                               var span = dojo.create('span',{class : 'holding_type_'+ i, innerHTML :  blob[i].join(', ') }, ret);
+                                                       }
+
+                                                       dojo.removeClass(slot,'hide_me');
+                                                       return ret.innerHTML;
+                                               } else {
+                                                       return "";
+                                               }
+                                       ]]></span>
+                               </td>
+                       </tr>
 
                </tbody>
        </table>