From b29b7fcf42ee7f72c48070e2eb565d41cc5271f1 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 9 Sep 2011 16:00:51 -0400 Subject: [PATCH] TPac: move hold status chunk to separate template ...for easier local overrideing of text that dislays for hold status Signed-off-by: Bill Erickson --- Open-ILS/src/templates/opac/myopac/holds.tt2 | 1 + Open-ILS/src/templates/opac/myopac/holds/edit.tt2 | 1 + Open-ILS/src/templates/opac/parts/hold_status.tt2 | 28 +++++++++++++++++++++++ Open-ILS/src/templates/opac/parts/misc_util.tt2 | 22 ------------------ 4 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 Open-ILS/src/templates/opac/parts/hold_status.tt2 diff --git a/Open-ILS/src/templates/opac/myopac/holds.tt2 b/Open-ILS/src/templates/opac/myopac/holds.tt2 index 4690f67644..b6bb84c000 100644 --- a/Open-ILS/src/templates/opac/myopac/holds.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds.tt2 @@ -1,5 +1,6 @@ [% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_status.tt2"; WRAPPER "opac/parts/myopac/base.tt2"; myopac_page = "holds" %]
diff --git a/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 b/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 index f0b1e52531..711a6c3620 100644 --- a/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 @@ -1,5 +1,6 @@ [% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; + PROCESS "opac/parts/hold_status.tt2"; PROCESS "opac/parts/org_selector.tt2"; WRAPPER "opac/parts/base.tt2" + "opac/parts/myopac/base.tt2"; myopac_page = "holds"; # in this case, just for tab coloring. diff --git a/Open-ILS/src/templates/opac/parts/hold_status.tt2 b/Open-ILS/src/templates/opac/parts/hold_status.tt2 new file mode 100644 index 0000000000..a15ec5f82a --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/hold_status.tt2 @@ -0,0 +1,28 @@ +[% BLOCK get_hold_status %] +
+ [% + IF hold.hold.status == 4; + l("Available"); + IF ahr.shelf_expire_time; + l('
Expires [_1]', + date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)); + END; + + ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0; + # estimated wait is delivered as seconds. + SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400); + l("Estimated wait: [quant,_1,day,days]", hwait); + + ELSIF hold.hold.status == 3; + l("In Transit"); + + ELSIF hold.hold.status < 3; + l("Waiting for copy"); + END + %] +
+
+ [% l('[_1] hold on [quant,_2,circulating copy,circulating copies]', + hold.hold.queue_position, hold.hold.potential_copies) %] +
+[% END %] diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index f1ded0e2bb..713a0be235 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -139,26 +139,4 @@ END; END; END; - - BLOCK get_hold_status; - IF hold.hold.status == 4; - l("Available"); - IF ahr.shelf_expire_time; - l('
Expires [_1]', - date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)); - END; - ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0; - # estimated wait is delivered as seconds. - SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400); - l("Estimated wait: [quant,_1,day,days]", hwait); - ELSIF hold.hold.status == 3; - l("In Transit"); - ELSIF hold.hold.status < 3; - l("Waiting for copy"); - END %] -
- [% l('[_1] hold on [quant,_2,circulating copy,circulating copies]', - hold.hold.queue_position, hold.hold.potential_copies) %] -
- [% END %] -- 2.11.0