# -----------------------------------------------------------------------------
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.
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
# 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
-[% 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
+%]
- <div id="search_results_parent">
- <div class="search_results checkout_item_pad">
- <div class="item_detail_image"><a href="javascript:;"><img alt="item image" src="[% ctx.media_prefix %]/images/kpac/item_image.jpg" /></a></div>
- <div class="item_detail_info">
- <div class="item_detail_name">Book Name</div>
- <div class="item_detail_author">by Author Name</div>
- <div class="item_detail_callnumber">Call Number</div>
- <div class="item_detail_extra_info">Publisher, Year, Size</div>
- </div>
- <div class="item_icon_wrapper">
- <div class="item_icon"> <img alt="book" src="[% ctx.media_prefix %]/images/kpac/icon_book.png" /> <!-- put a single around each side of the image - for vertical centering --></div>
- <div class="item_icon_type_text">Book</div>
- </div>
- <div class="clear"> </div>
- </div>
- </div>
+<div id="search_results_parent">
+ [% INCLUDE 'kpac/parts/record_row.tt2' rec_id=ctx.bre_id%]
+</div>
<div class="checkout_options">
<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="top" class="left_brain_cell">
ctx.page_title = attrs.title | html
%]
- <!-- did somebody order the div salad? -->
<div class="item_detail_header">
<div class="item_detail_image">
</div>
<div class="item_detail_header_buttons">
- <div class="item_detail_getit_btn"><a href="[% mkurl(ctx.kpac_root _ '/checkout') %]"><img
+ <div class="item_detail_getit_btn"><a href="[% mkurl(ctx.kpac_root _ '/checkout/' _ ctx.bre_id) %]"><img
alt="[% l('Get it') | html %]" src="[% ctx.media_prefix %]/images/kpac/get_it_btn.png" /></a>
</div>
<div class="item_detail_goback_btn">
</div>
<div class="header_menu">
<!-- menu rendered in reverse order -->
- <a href="javascript:;">Login</a>
- <a href="javascript:;">Get a Library Card</a>
- <a href="javascript:;">Help</a>
+ [% IF ctx.user %]
+ [% redir = CGI.url('-base' => 1) _ ctx.kpac_root _ '/index' %]
+ <a href="[% mkurl(ctx.logout_page,
+ {redirect_to => redir.replace('^https:', 'http:')}, 1) %]">[% l('Logout') %]</a>
+ [% ELSE %]
+ <a href="[% mkurl(ctx.opac_root _ '/login').replace('^http:', 'https:') %]">[% l('Login') %]</a>
+ [% END %]
+ <a href="javascript:;">[% l('Get a Library Card') %]</a>
+ <a href="javascript:;">[% l('Help') %]</a>
</div>
<div class="clear"> </div>
</div>
--- /dev/null
+<div class="search_results">
+ <div class="item_detail_image">
+ [% 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;
+ %]
+ <a href="[% mkurl(ctx.kpac_root _ '/detailed/' _ rec_id) %]"><img
+ alt="[% l('Image of item') %]" width="167"
+ src='[% mkurl(img_src, {}, 1) %]' /></a><br />
+ </div>
+ <div class="item_detail_info">
+ <div class="item_detail_name"><a href="[% mkurl(ctx.kpac_root _ '/detailed/' _ rec_id) %]">[% attrs.title %]</a></div>
+ <div class="item_detail_author">[% l('by [_1]', attrs.author) %]</div>
+ <div class="item_detail_callnumber">[% attrs.holdings.0.label | html %]</div>
+ <div class="item_detail_extra_info">
+ [% l('[_1], [_2]', attrs.publisher, attrs.pubdate) | html %] <!-- TODO fix commas, etc. -->
+ [% IF attrs.phys_desc %]<br/>[% attrs.phys_desc | html; END %]
+ </div>
+ [% IF show_actions %]
+ <div class="item_detail_actions">
+ <div class="button"><a href="[% mkurl(ctx.kpac_root _ '/detailed/' _ rec_id) %]"><img
+ src="[% ctx.media_prefix %]/images/kpac/more_info_btn.png" alt="more info" /></a></div>
+ <div class="button"><a href="[% mkurl(ctx.kpac_root _ '/checkout/' _ rec_id) %]"><img
+ src="[% ctx.media_prefix %]/images/kpac/get_it_btn_sm.png" alt="get it" /></a></div>
+ <div class="clear"> </div>
+ </div>
+ [% END %]
+ </div>
+ <div class="item_icon_wrapper">
+ <div class="item_icon">
+ <img width="35" alt="[% attrs.format_label %]" src="[% attrs.format_icon %]" />
+ <!-- put a single around each side of the image - for vertical centering -->
+ </div>
+ <div class="item_icon_type_text">[% attrs.format_label %]</div>
+ </div>
+ <div class="clear"> </div>
+</div>
+
qtype = qtype_blob.keys.0 %]
<td class="st_radio_btn">
<input type="radio" name="qtype" value="[% qtype %]" id="st_[% qtype %]"
- [% IF CGI.param('qtype') == qtype %]checked="checked"[% END %]/>
+ [% IF (CGI.param('qtype') == qtype) OR
+ (!CGI.param('qtype') AND qtype == 'keyword') %]checked="checked"[% END %]/>
</td>
<td class="st_label"><label for="st_[% qtype %]">[% qtype_blob.$qtype | html %]</label></td>
[% IF !loop.last %]
attrs = {marc_xml => rec.marc_xml};
PROCESS get_marc_attrs args=attrs %]
- <div class="search_results" id="search_results_template">
- <div class="item_detail_image">
- [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
- <a href="[% mkurl('detailed/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
- width="167"
- src='[% ctx.media_prefix %]/opac/extras/ac/jacket/medium/[% ident | uri %]' /></a><br />
- [% ELSE %]
- <a href="[% mkurl('detailed/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
- src="[% ctx.media_prefix %]/images/kpac/item_image.jpg" /></a>
- [% END %]
- </div>
- <div class="item_detail_info">
- <div class="item_detail_name"><a href="[% mkurl('detailed/' _ rec.id) %]">[% attrs.title %]</a></div>
- <div class="item_detail_author">[% l('by [_1]', attrs.author) %]</div>
- <div class="item_detail_callnumber">[% attrs.holdings.0.label | html %]</div>
- <div class="item_detail_extra_info">
- [% l('[_1], [_2]', attrs.publisher, attrs.pubdate) | html %] <!-- TODO fix commas, etc. -->
- [% IF attrs.phys_desc %]<br/>[% attrs.phys_desc | html; END %]
- </div>
- <div class="item_detail_actions">
- <div class="button"><a href="[% mkurl(ctx.kpac_root _ '/detailed/' _ rec.id) %]"><img
- src="[% ctx.media_prefix %]/images/kpac/more_info_btn.png" alt="more info" /></a></div>
- <div class="button"><a href="javascript:;"><img
- src="[% ctx.media_prefix %]/images/kpac/get_it_btn_sm.png" alt="get it" /></a></div>
- <div class="clear"> </div>
- </div>
- </div>
- <div class="item_icon_wrapper">
- <div class="item_icon">
- <img width="35" alt="[% attrs.format_label %]" src="[% attrs.format_icon %]" />
- <!-- put a single around each side of the image - for vertical centering -->
- </div>
- <div class="item_icon_type_text">[% attrs.format_label %]</div>
- </div>
- <div class="clear"> </div>
- </div>
+ [% INCLUDE 'kpac/parts/record_row.tt2' show_actions=1 rec_id=rec.id%]
[% END %]
</div>