From: Bill Erickson Date: Mon, 30 Jan 2012 17:32:43 +0000 (-0500) Subject: kpac : initial holds; misc X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b1384443bc5e0053793dba6aca90795705880d01;p=evergreen%2Fpines.git kpac : initial holds; misc Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 1f31081553..6f68647377 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -436,7 +436,7 @@ sub load_login { # ----------------------------------------------------------------------------- sub load_logout { my $self = shift; - my $redirect_to = shift; + my $redirect_to = shift || $self->cgi->param('redirect_to'); # If the user was adding anyting to an anonymous cache # while logged in, go ahead and clear it out. diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm index 4e9dbea172..93e88913ab 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm @@ -27,8 +27,6 @@ sub load { return $self->load_simple("index") if $path =~ m|kpac/index|; return $self->load_simple("category") if $path =~ m|kpac/category|; - return $self->load_simple("checkout") if $path =~ m|kpac/checkout|; - return $self->load_simple("checkout_results") if $path =~ m|kpac/checkout_results|; # note: sets page=rresult return $self->load_rresults if $path =~ m|kpac/search_results|; # inherited from tpac @@ -40,21 +38,15 @@ sub load { # Everything below here requires SSL # ---------------------------------------------------------------- return $self->redirect_ssl unless $self->cgi->https; - return $self->load_logout if $path =~ m|kpac/logout|; - - if($path =~ m|kpac/login|) { - return $self->load_login unless $self->editor->requestor; # already logged in? - - # This will be less confusing to users than to be shown a login form - # when they're already logged in. - return $self->generic_redirect( - sprintf( - "https://%s%s/kpac/index", - $self->apache->hostname, $self->ctx->{base_path} - ) - ); + + if ($path =~ m|kpac/checkout|) { + my $stat = $self->load_record(no_search => 1); + $self->ctx->{page} = 'checkout'; # repair the page + return $stat; } + # XXX auth vs. no-auth, pending list answers + return $self->load_simple("checkout_results") if $path =~ m|kpac/checkout_results|; # ---------------------------------------------------------------- # Everything below here requires authentication diff --git a/Open-ILS/src/templates/kpac/checkout.tt2 b/Open-ILS/src/templates/kpac/checkout.tt2 index 884368d400..7050494167 100644 --- a/Open-ILS/src/templates/kpac/checkout.tt2 +++ b/Open-ILS/src/templates/kpac/checkout.tt2 @@ -1,24 +1,15 @@ -[% PROCESS "opac/parts/header.tt2"; - PROCESS "kpac/parts/grid.tt2"; +[% + PROCESS "opac/parts/header.tt2"; + PROCESS "opac/parts/misc_util.tt2"; # MARC WRAPPER "kpac/parts/subpage.tt2"; - ctx.page_title = l('Get it') %] + attrs = {marc_xml => ctx.marc_xml}; + PROCESS get_marc_attrs args=attrs; + ctx.page_title = attrs.title | html +%] -
-
-
item image
-
-
Book Name
-
by Author Name
-
Call Number
-
Publisher, Year, Size
-
-
-
 book 
-
Book
-
-
 
-
-
+
+ [% INCLUDE 'kpac/parts/record_row.tt2' rec_id=ctx.bre_id%] +
[% IF !loop.last %] diff --git a/Open-ILS/src/templates/kpac/search_results.tt2 b/Open-ILS/src/templates/kpac/search_results.tt2 index 582307ebaa..8a8dc0d631 100644 --- a/Open-ILS/src/templates/kpac/search_results.tt2 +++ b/Open-ILS/src/templates/kpac/search_results.tt2 @@ -16,42 +16,7 @@ attrs = {marc_xml => rec.marc_xml}; PROCESS get_marc_attrs args=attrs %] -
-
- [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] - [% l('Image of item') %]
- [% ELSE %] - [% l('Image of item') %] - [% END %] -
-
- -
[% l('by [_1]', attrs.author) %]
-
[% attrs.holdings.0.label | html %]
-
- [% l('[_1], [_2]', attrs.publisher, attrs.pubdate) | html %] - [% IF attrs.phys_desc %]
[% attrs.phys_desc | html; END %] -
-
-
more info
-
get it
-
 
-
-
-
-
-  [% attrs.format_label %]  - -
-
[% attrs.format_label %]
-
-
 
-
+ [% INCLUDE 'kpac/parts/record_row.tt2' show_actions=1 rec_id=rec.id%] [% END %]
diff --git a/Open-ILS/src/templates/kpac/detailed.tt2 b/Open-ILS/src/templates/kpac/detailed.tt2 index 5e66ee5871..7690773c82 100644 --- a/Open-ILS/src/templates/kpac/detailed.tt2 +++ b/Open-ILS/src/templates/kpac/detailed.tt2 @@ -7,7 +7,6 @@ ctx.page_title = attrs.title | html %] -
@@ -49,7 +48,7 @@
-
[% l('Get it') | html %]
diff --git a/Open-ILS/src/templates/kpac/parts/header.tt2 b/Open-ILS/src/templates/kpac/parts/header.tt2 index f280b662c8..e10889dc6d 100644 --- a/Open-ILS/src/templates/kpac/parts/header.tt2 +++ b/Open-ILS/src/templates/kpac/parts/header.tt2 @@ -14,9 +14,15 @@
- Login - Get a Library Card - Help + [% IF ctx.user %] + [% redir = CGI.url('-base' => 1) _ ctx.kpac_root _ '/index' %] + [% l('Logout') %] + [% ELSE %] + [% l('Login') %] + [% END %] + [% l('Get a Library Card') %] + [% l('Help') %]
 
diff --git a/Open-ILS/src/templates/kpac/parts/record_row.tt2 b/Open-ILS/src/templates/kpac/parts/record_row.tt2 new file mode 100644 index 0000000000..4522afb390 --- /dev/null +++ b/Open-ILS/src/templates/kpac/parts/record_row.tt2 @@ -0,0 +1,40 @@ +
+
+ [% img_src = ctx.media_prefix _ '/images/kpac/item_image.jpg'; # default image + ident = attrs.isbn_clean || attrs.upc; + IF ident; + img_src = ctx.media_prefix _ '/opac/extras/ac/jacket/medium/' _ ident; + END; + %] + [% l('Image of item') %]
+
+
+ +
[% l('by [_1]', attrs.author) %]
+
[% attrs.holdings.0.label | html %]
+
+ [% l('[_1], [_2]', attrs.publisher, attrs.pubdate) | html %] + [% IF attrs.phys_desc %]
[% attrs.phys_desc | html; END %] +
+ [% IF show_actions %] +
+
more info
+
get it
+
 
+
+ [% END %] +
+
+
+  [% attrs.format_label %]  + +
+
[% attrs.format_label %]
+
+
 
+
+ diff --git a/Open-ILS/src/templates/kpac/parts/searchbox.tt2 b/Open-ILS/src/templates/kpac/parts/searchbox.tt2 index d53cb9e654..714eb92e18 100644 --- a/Open-ILS/src/templates/kpac/parts/searchbox.tt2 +++ b/Open-ILS/src/templates/kpac/parts/searchbox.tt2 @@ -19,7 +19,8 @@ qtype = qtype_blob.keys.0 %]
+ [% IF (CGI.param('qtype') == qtype) OR + (!CGI.param('qtype') AND qtype == 'keyword') %]checked="checked"[% END %]/>