added sanity check for holds that point to non-existent recs/metarecs
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Aug 2006 20:44:27 +0000 (20:44 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Aug 2006 20:44:27 +0000 (20:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5594 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/css/layout.css
Open-ILS/web/opac/skin/default/js/myopac.js
Open-ILS/web/opac/skin/default/xml/common/holds.xml

index 1765d52..901efca 100644 (file)
@@ -228,3 +228,6 @@ table { border-collapse: collapse; }
 .disabled_option { color: #808080; }
 
 .copy_more_info { padding-left: 6px; color: #804070; }
+
+
+.invalid_hold { background: #F0F0D0; }
index 8296c56..683c1bb 100644 (file)
@@ -361,6 +361,7 @@ function myOPACDrawHoldTitle(hold) {
                var req = new Request(method, hold.target());
                req.callback(myOPACFleshHoldTitle);
                req.request.hold = hold;
+               req.request.alertEvent = false;
                req.send();
 
        } else {
@@ -384,6 +385,13 @@ function _myOPACFleshHoldTitle(hold, holdObjects) {
        var title_link = $n(row, "myopac_holds_title_link");
        var author_link = $n(row, "myopac_holds_author_link");
 
+       if(!record || checkILSEvent(record) ) {
+               addCSSClass(row, 'invalid_hold');
+               $n(row, 'myopac_holds_edit_link').setAttribute('href', 'javascript:void(0);');
+               $n(row, 'myopac_holds_edit_link').onclick = function(){alertId('invalid_hold');};
+               return;
+       }
+
        buildTitleDetailLink(record, title_link);
        buildSearchLink(STYPE_AUTHOR, record.author(), author_link);
 
index 9ccdb3d..ee88bb9 100644 (file)
                Please see any notes in the "Staff Notes" section of your "My Account" page or contact your local library.
        </span>
 
+       <span id='invalid_hold' class='hide_me'>
+               This hold is no longer valid.  
+               It's likely that the target for the hold was deleted from the system.
+               Please cancel this hold and place a new one.
+       </span>
+
 </div>