KPAC root, OPAC root: we all live under one root
authorDan Scott <dscott@laurentian.ca>
Thu, 23 Jan 2014 17:05:20 +0000 (12:05 -0500)
committerDan Scott <dscott@laurentian.ca>
Sat, 25 Jan 2014 14:20:07 +0000 (09:20 -0500)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/library/core_info.tt2
Open-ILS/src/templates/opac/parts/library_name_link.tt2

index b48c0d7..1398f70 100644 (file)
@@ -1,3 +1,9 @@
+[%-
+    opac_root = ctx.opac_root;
+    IF ctx.kpac_root;
+        opac_root = ctx.kpac_root;
+    END;
+-%]
 <div id="content-wrapper">
     <div id="main-content" class="content-wrapper-library-page" vocab="http://schema.org/" typeof="Library">
     <h1 property="name">[% ctx.library.name | html %]</h1>
@@ -41,7 +47,7 @@
     [%- 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 | html %]</a>
+        <a property="branchOf" href="[% mkurl(opac_root _ '/library/' _ ctx.parent.shortname, {}, 1) %]">[% ctx.parent.name | html %]</a>
     </div>
     [%  END; -%]
 
index c002ce2..3179e5f 100644 (file)
@@ -1,10 +1,15 @@
 [%-
+    opac_root = ctx.opac_root;
+    IF ctx.kpac_root;
+        opac_root = ctx.kpac_root;
+    END;
+
     org_name = ctx.get_aou(copy_info.circ_lib).name;
     org_sname = ctx.get_aou(copy_info.circ_lib).shortname;
     lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url');
     prefer_external_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.prefer_external_url');
     UNLESS lib_url && prefer_external_url;
-        lib_url = mkurl(ctx.opac_root _ '/library/' _ ctx.get_aou(copy_info.circ_lib).shortname, {}, 1);
+        lib_url = mkurl(opac_root _ '/library/' _ ctx.get_aou(copy_info.circ_lib).shortname, {}, 1);
     END; 
     IF lib_url; '<a property="seller" typeof="Library" href="'; lib_url | url; '">'; END;
     '<span property="name">'; org_name | html; '</span>';