use OpenILS::WWW::EGCatLoader::Util;
use OpenILS::WWW::EGCatLoader::Account;
use OpenILS::WWW::EGCatLoader::Browse;
+use OpenILS::WWW::EGCatLoader::Library;
use OpenILS::WWW::EGCatLoader::Search;
use OpenILS::WWW::EGCatLoader::Record;
use OpenILS::WWW::EGCatLoader::Container;
return $self->load_simple("advanced") if
$path =~ m:opac/(advanced|numeric|expert):;
+ return $self->load_library if $path =~ m|opac/library|;
return $self->load_rresults if $path =~ m|opac/results|;
return $self->load_print_record if $path =~ m|opac/record/print|;
return $self->load_record if $path =~ m|opac/record/\d|;
--- /dev/null
+package OpenILS::WWW::EGCatLoader;
+use strict; use warnings;
+use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST);
+use OpenSRF::Utils::Logger qw/$logger/;
+use OpenILS::Utils::CStoreEditor qw/:funcs/;
+use OpenILS::Utils::Fieldmapper;
+use OpenILS::Application::AppUtils;
+my $U = 'OpenILS::Application::AppUtils';
+
+# context additions:
+# library : aou object
+# parent: aou object
+sub load_library {
+ my $self = shift;
+ my %kwargs = @_;
+ my $ctx = $self->ctx;
+ $ctx->{page} = 'library';
+
+ $self->timelog("load_library() began");
+
+ my $lib_id = $ctx->{page_args}->[0];
+
+ $self->apache->log->warn("got library $lib_id!");
+ $lib_id = $self->_resolve_org_id_or_shortname($lib_id);
+ $self->apache->log->warn("now got library $lib_id!");
+
+ return Apache2::Const::HTTP_BAD_REQUEST
+ unless $lib_id;
+
+ my $aou = $ctx->{get_aou}->($lib_id);
+ my $sname = $aou->parent_ou;
+ $self->apache->log->warn("now got library $sname");
+
+ $ctx->{library} = $aou;
+ if ($aou->parent_ou) {
+ $ctx->{parent} = $ctx->{get_aou}->($aou->parent_ou);
+ }
+
+ $self->timelog("got basic lib info");
+
+ return Apache2::Const::OK;
+}
+
+1;
--- /dev/null
+[%- PROCESS "opac/parts/header.tt2";
+ WRAPPER "opac/parts/base.tt2";
+ INCLUDE "opac/parts/topnav.tt2";
+ ctx.page_title = l("Library details: [_1]", ctx.library.name);
+-%]
+ [% INCLUDE "opac/parts/searchbar.tt2" %]
+ <div id="content-wrapper" class="content-wrapper-library-page" vocab="http://schema.org/" typeof="Library">
+ <h1 property="name">[% ctx.library.name %]</h1>
+
+ [%- IF (ctx.library.email OR ctx.library.phone); %]
+ <h2 id="contact-info">[% l('Contact information') %]</h2>
+ [%- IF ctx.library.email; %]
+ <div>[% l('Email address: ') %]<a href="mailto:[% ctx.library.email %]" property="email">[% ctx.library.email %]</a></div>
+ [%- END; %]
+ [%- IF ctx.library.phone; %]
+ <div>[% l('Telephone: ') %]<span property="telephone">[% ctx.library.phone %]</span></div>
+ [% END; %]
+ [% END; %]
+
+ <h2>[% l('Opening hours') %]</h2>
+ <div>Pull in from actor.hours_of_operation</div>
+
+ <div id="addresses">
+ [%- IF ctx.library.mailing_address; %]
+ <div id="mailing" property="location address" typeof="PostalAddess">
+ <h3 property="contactType">[% l('Mailing address') %]</h3>
+ [%# Pull in actor.org_address properties here %]
+ <span property="streetAddress">ctx.library.mailing_address.street1<br />
+ IF we have it - ctx.library.mailing_address.street2
+ </span><br />
+ <span property="addressLocality">ctx.library.mailing_address.city</span><br />
+ <span property="addressRegion">ctx.library.mailing_address.state</span><br />
+ <span property="addressCountry" typeof="Country">ctx.library.mailing_address.country</span><br />
+ <span property="postalCode">ctx.library.mailing_address.post_code</span><br />
+ </div>
+ [%- END; %]
+ </div>
+
+ [%- IF ctx.library.parent_ou; %]
+ <h2>Branch relationship</h2>
+ <div id="branch-info">[% l('Parent library: ') %]
+ <a property="branchOf" href="[% mkurl(ctx.opac_root _ '/library/' _ ctx.parent.shortname, {}, 1) %]">[% ctx.parent.name %]</a>
+ </div>
+ [% END; -%]
+
+ </div>
+[%- END %]