transit columns for holds.. Available On
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Aug 2006 21:37:42 +0000 (21:37 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Aug 2006 21:37:42 +0000 (21:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5351 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/patron/holds.js

index b41c63d..267903f 100644 (file)
@@ -47,6 +47,7 @@ const api = {
        'FM_AHR_CANCEL' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.cancel' },
        'FM_AHR_UPDATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.update' },
        'FM_AHR_RESET' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.reset' },
+       'FM_AHR_STATUS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.status.retrieve' },
        'FM_AIHU_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.in_house_use.create' },
        'FM_ANCC_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.non_cataloged_circulation.retrieve' },
        'FM_ANCC_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.open_non_cataloged_circulation.user' },
index fc88fc7..a333038 100644 (file)
@@ -509,12 +509,16 @@ circ.util.hold_columns = function(modify,params) {
                        'render' : 'my.ahr.request_time().toString().substr(0,10)'
                },
                {
+                       'persist' : 'hidden width', 'id' : 'available_time', 'label' : 'Available On', 'flex' : 1,
+                       'primary' : false, 'hidden' : false,  'render' : 'my.ahr.transit() ? ( my.ahr.transit().dest_recv_time() ? my.ahr.transit().dest_recv_time().toString().substr(0,10) : "") : ( my.ahr.capture_time() ? my.ahr.capture_time().toString().substr(0,10) : "" )',
+               },
+               {
                        'persist' : 'hidden width', 'id' : 'capture_time', 'label' : getString('staff.ahr_capture_time_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true,  'render' : 'my.ahr.capture_time()'
+                       'primary' : false, 'hidden' : true,  'render' : 'my.ahr.capture_time() ? my.ahr.capture_time().toString().substr(0,10) : "???"'
                },
                {
                        'persist' : 'hidden width', 'id' : 'status', 'label' : getString('staff.ahr_status_label'), 'flex' : 1,
-                       'primary' : false, 'hidden' : true,  'render' : 'my.ahr.status()'
+                       'primary' : false, 'hidden' : false,  'render' : 'switch(my.status) { case 1: case "1": "Waiting for copy"; break; case 2: case "2": "Waiting for capture"; break; case 3: case "3": "In-Transit"; break; case 4: case "4" : "Ready for pickup"; break; default: my.status; break;}'
                },
                {
                        'persist' : 'hidden width', 'id' : 'hold_type', 'label' : getString('staff.ahr_hold_type_label'), 'flex' : 0,
@@ -606,6 +610,22 @@ circ.util.hold_columns = function(modify,params) {
                        'persist' : 'hidden width', 'id' : 'tcn', 'label' : 'TCN', 'flex' : 1,
                        'primary' : false, 'hidden' : true, 'render' : 'my.mvr.tcn();'
                },
+               {
+                       'persist' : 'hidden width', 'id' : 'transit_source', 'label' : 'Transit Source', 'flex' : 1,
+                       'primary' : false, 'hidden' : true, 'render' : 'my.ahr.transit() ?  obj.data.hash.aou[ my.ahr.transit().source() ].shortname() : ""'
+               },
+               {
+                       'persist' : 'hidden width', 'id' : 'transit_source_send_time', 'label' : 'Transitted On', 'flex' : 1,
+                       'primary' : false, 'hidden' : true, 'render' : 'my.ahr.transit() ?  my.ahr.transit().source_send_time() : ""'
+               },
+               {
+                       'persist' : 'hidden width', 'id' : 'transit_dest_lib', 'label' : 'Transit Destination', 'flex' : 1,
+                       'primary' : false, 'hidden' : true, 'render' : 'my.ahr.transit() ?  obj.data.hash.aou[ my.ahr.transit().dest() ].shortname() : ""'
+               },
+               {
+                       'persist' : 'hidden width', 'id' : 'transit_dest_recv_time', 'label' : 'Transit Completed On', 'flex' : 1,
+                       'primary' : false, 'hidden' : true, 'render' : 'my.ahr.transit() ?  my.ahr.transit().dest_recv_time() : ""'
+               },
 
 
        ];
index 6a3494a..eaed2e2 100644 (file)
@@ -28,9 +28,9 @@ patron.holds.prototype = {
                                'title' : { 'hidden' : false, 'flex' : '3' },
                                'request_time' : { 'hidden' : false },
                                'pickup_lib_shortname' : { 'hidden' : false },
-                               'hold_type' : { 'hidden' : false },
-                               'current_copy' : { 'hidden' : false },
-                               'capture_time' : { 'hidden' : false },
+                               'hold_type' : { 'hidden' : true },
+                               'current_copy' : { 'hidden' : true },
+                               'capture_time' : { 'hidden' : true },
                        } 
                );
 
@@ -42,6 +42,8 @@ patron.holds.prototype = {
                                'retrieve_row' : function(params) {
                                        var row = params.row;
                                        try {
+                                               var status_robj = obj.network.simple_request('FM_AHR_STATUS',[ ses(), row.my.ahr.id() ]);
+                                               row.my.status = status_robj;
                                                if (row.my.ahr.current_copy()) {
                                                        row.my.acp = obj.network.simple_request( 'FM_ACP_RETRIEVE', [ row.my.ahr.current_copy() ]);
                                                }