From fb7cc5523a23246b22b41dc4344a655d1b0b1bf6 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 5 Nov 2013 17:02:34 -0500 Subject: [PATCH] ff ui / list columns in template Signed-off-by: Bill Erickson --- .../templates/staff/fulfillment/t_item_table.tt2 | 100 +++++++++------------ .../src/templates/staff/fulfillment/t_status.tt2 | 2 +- .../web/js/ui/default/staff/fulfillment/app.js | 14 +-- 3 files changed, 51 insertions(+), 65 deletions(-) diff --git a/Open-ILS/src/templates/staff/fulfillment/t_item_table.tt2 b/Open-ILS/src/templates/staff/fulfillment/t_item_table.tt2 index 7238ee784b..eb7ff3a143 100644 --- a/Open-ILS/src/templates/staff/fulfillment/t_item_table.tt2 +++ b/Open-ILS/src/templates/staff/fulfillment/t_item_table.tt2 @@ -5,75 +5,57 @@ +[% +# define the full set of columns here for ease of sharing +# the data between the template and the JS env. +COLUMNS = [ + {name => 'index', label => l('#'), extra => ' + 1'}, + {name => 'hold_id', label => l('Request ID'), tabs => 'tab_pending'}, + {name => 'transit_id', label => l('Transit ID'), tabs => 'tab_inbound || tab_outbound'}, + {name => 'circ_id', label => l('Circ ID'), tabs => 'tab_circulating'}, + {name => 'copy_barcode', label => l('Item Barcode')}, + {name => 'copy_circ_lib', label => l('Copy Library')}, + {name => 'request_time', label => l('Request Date'), tabs => 'tab_pending', extra => '| date'}, + {name => 'expire_time', label => l('Expire Date'), tabs => 'tab_pending', extra => '| date'}, + {name => 'hold_request_lib', label => l('Requesting Library'), tabs => 'tab_pending'}, + {name => 'hold_pickup_lib', label => l('Pickup Library'), tabs => 'tab_pending'} + {name => 'transit_time', label => l('Transit Date'), tabs => 'tab_inbound || tab_outbound', extra => '| date'}, + {name => 'transit_source', label => l('Transit Source'), tabs => 'tab_inbound || tab_outbound'}, + {name => 'transit_dest', label => l('Transit Destination'), tabs => 'tab_inbound || tab_outbound'}, + {name => 'hold_shelf_time', label => l('Shelf Date'), tabs => 'tab_onshelf', extra => '| date'}, + {name => 'patron_given_name', label => l('Patron First'), tabs => 'tab_circulating || tab_onshelf'}, + {name => 'patron_family_name', label => l('Patron Last'), tabs => 'tab_circulating || tab_onshelf'}, + {name => 'patron_barcode', label => l('Patron Barcode'), tabs => 'tab_circulating || tab_onshelf'}, + {name => 'xact_start', label => l('Checkout Date'), tabs => 'tab_circulating', extra => '| date'}, + {name => 'due_date', label => l('Due Date'), tabs => 'tab_circulating', extra => '| date'}, + {name => 'circ_circ_lib', label => l('Circulating Library'), tabs => 'tab_circulating'}, + {name => 'title', label => l('Title')} +]; +%] + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + [% FOREACH col IN COLUMNS %] + + [% END %] - - - - - - - - - - - - - - - - - - - - - - - - + [% END %]
#[% l('Request ID') %][% l('Transit ID') %][% l('Circ ID') %][% l('Item Barcode') %][% l('Copy Library') %][% l('Request Date') %][% l('Expire Date') %][% l('Requesting Library') %][% l('Pickup Library') %][% l('Transit Date') %][% l('Transit Source') %][% l('Transit Destination') %][% l('Shelf Date') %][% l('Patron Name') %][% l('Patron Barcode') %][% l('Checkout Date') %][% l('Due Date') %][% l('Circulating Library') %][% l('Title') %][% col.label %]
{{item.index + 1}}{{item.hold_id}}{{item.transit_id}}{{item.circ_id}} - {{item.copy_barcode}} + [% FOREACH col IN COLUMNS %] + + [% IF col.name == 'copy_barcode' %] + {{item.copy_barcode}} + [% ELSE %] + {{item.[% col.name %][% col.extra IF col.extra %]}} + [% END %] {{item.copy_circ_lib}}{{item.request_time | date}}{{item.expire_time | date}}{{item.request_lib}}{{item.pickup_lib}}{{item.transit_time | date}}{{item.transit_source}}{{item.transit_dest}}{{item.hold_shelf_time | date}}{{item.patron_given_name}} {{item.patron_family_name}}{{item.patron_barcode}}{{item.xact_start | date}}{{item.due_date | date}}{{item.circ_circ_lib}}{{item.title}}
diff --git a/Open-ILS/src/templates/staff/fulfillment/t_status.tt2 b/Open-ILS/src/templates/staff/fulfillment/t_status.tt2 index 76e633d7bd..223789f191 100644 --- a/Open-ILS/src/templates/staff/fulfillment/t_status.tt2 +++ b/Open-ILS/src/templates/staff/fulfillment/t_status.tt2 @@ -80,7 +80,7 @@ Circulating Library:{{item.circ_circ_lib}} - Circulating Patron:{{item.circ_usr}} + Circulating Patron:{{item.patron_name}} Checkout date:{{item.circ_xact_start | date}} Due Date:{{item.due_date | date}} Circ Status: diff --git a/Open-ILS/web/js/ui/default/staff/fulfillment/app.js b/Open-ILS/web/js/ui/default/staff/fulfillment/app.js index 2766c06838..c475d0aaa2 100644 --- a/Open-ILS/web/js/ui/default/staff/fulfillment/app.js +++ b/Open-ILS/web/js/ui/default/staff/fulfillment/app.js @@ -144,7 +144,11 @@ function ($scope, $q, $compile, $timeout, $rootScope, $location, $scope.illRouteParams = $routeParams; $scope.itemList = egList.create({limit : 10}); // limit TBD - + $scope.columns = []; + $scope.addColumn = function(col) { + $scope.columns.push(col); + } + // map of flattener fields to retrieve for each query type $scope.flatFields = { ahr : { @@ -156,8 +160,8 @@ function ($scope, $q, $compile, $timeout, $rootScope, $location, patron_barcode : {path : 'usr.card.barcode'}, patron_given_name : {path : 'usr.first_given_name'}, patron_family_name : {path : 'usr.family_name'}, - request_lib : {path : 'request_lib.shortname'}, // TODO: causes query problem, wha? - pickup_lib : {path : 'pickup_lib.shortname'}, + hold_request_lib : {path : 'request_lib.shortname'}, // TODO: causes query problem, wha? + hold_pickup_lib : {path : 'pickup_lib.shortname'}, title : {path : 'bib_rec.bib_record.simple_record.title'}, author : {path : 'bib_rec.bib_record.simple_record.author'}, copy_id : {path : 'current_copy.id'}, @@ -189,8 +193,8 @@ function ($scope, $q, $compile, $timeout, $rootScope, $location, id : {path : 'id'}, transit_id : {path : 'id'}, hold_id : {path : 'hold_transit_copy.hold.id'}, - request_lib : {path : 'hold_transit_copy.hold.request_lib'}, - pickup_lib : {path : 'hold_transit_copy.hold.pickup_lib.shortname'}, + hold_request_lib : {path : 'hold_transit_copy.hold.request_lib.shortname'}, + hold_pickup_lib : {path : 'hold_transit_copy.hold.pickup_lib.shortname'}, patron_id : {path : 'hold_transit_copy.hold.usr.id'}, patron_barcode : {path : 'hold_transit_copy.hold.usr.card.barcode'}, patron_given_name : {path : 'hold_transit_copy.hold.usr.first_given_name'}, -- 2.11.0