context checkin tweaks, and columns again
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 16:51:57 +0000 (16:51 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 16:51:57 +0000 (16:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1491 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/circ/circ_utils.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js

index d5b5420..067d383 100644 (file)
@@ -390,10 +390,6 @@ function circ_cols() {
                        'primary' : false, 'hidden' : true, 'fm_class' : 'circ', 'fm_field_render' : '.xact_finish()'
                },
                {
-                       'id' : 'renewal_remaining', 'label' : getString('circ_label_renewal_remaining'), 'flex' : 1,
-                       'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.renewal_remaining()'
-               },
-               {
                        'id' : 'due_date', 'label' : getString('circ_label_due_date'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.due_date().substr(0,10)'
                },
@@ -406,6 +402,10 @@ function circ_cols() {
                        'primary' : false, 'hidden' : false, 'fm_class' : 'mvr', 'fm_field_render' : '.author()'
                },
                {
+                       'id' : 'renewal_remaining', 'label' : getString('circ_label_renewal_remaining'), 'flex' : 0,
+                       'primary' : false, 'hidden' : false, 'fm_class' : 'circ', 'fm_field_render' : '.renewal_remaining()'
+               },
+               {
                        'id' : 'status', 'label' : getString('acp_label_status'), 'flex' : 1,
                        'primary' : false, 'hidden' : false, 'fm_class' : 'acp', 'fm_field_render' : 'mw.G.ccs_hash[ $$.status() ].name()'
                }
index 8c5fa21..1c6e07b 100755 (executable)
@@ -215,10 +215,15 @@ function patron_display_patron_items_init(p) {
                                                        var idx = patron_items[i].getAttribute('record_id'); 
                                                        var copy = p._patron.checkouts()[ idx ].copy;
                                                        var check = checkin_by_copy_barcode( copy.barcode(), null );
-                                                       if (check.status == 0) {
+                                                       if (check != null) {
+                                                               if (parseInt(check.route_to)) {
+                                                                       try {
+                                                                               check.route_to = mw.G.org_tree_hash[check.route_to].shortname();
+                                                                       } catch(E) {
+                                                                               sdump('D_ERROR',js2JSON(E) + '\n');
+                                                                       }
+                                                               }
                                                                alert('Check In: ' + check.text + '  Route To: ' + check.route_to);
-                                                       } else {
-                                                               alert('Check In: ' + check.text + '  Route To: ' + mw.G.org_tree_hash[check.route_to].shortname());
                                                        }
                                                        p.refresh();
                                                } catch(E) {
@@ -410,13 +415,18 @@ function patron_display_patron_checkout_items_init(p) {
                                                        var check = checkin_by_copy_barcode( copy.barcode(), null );
                                                        if (check == null) { // change this to whatever it takes
                                                                keep_these.push( checkouts[ idx ] );    
-                                                       }
-                                                       checkouts = keep_these;
-                                                       if (check.status == 0) {
-                                                               alert('Check In: ' + check.text + '  Route To: ' + check.route_to);
                                                        } else {
-                                                               alert('Check In: ' + check.text + '  Route To: ' + mw.G.org_tree_hash[check.route_to].shortname());
+                                                               if (parseInt(check.route_to)) {
+                                                                       try {
+                                                                               check.route_to = mw.G.org_tree_hash[check.route_to].shortname();
+                                                                       } catch(E) {
+                                                                               sdump('D_ERROR',js2JSON(E) + '\n');
+                                                                       }
+                                                               }
+                                                               alert('Check In: ' + check.text + '  Route To: ' + check.route_to);
                                                        }
+
+                                                       checkouts = keep_these;
                                                        p.refresh();
                                                } catch(E) {
                                                        alert(E);