]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/library_name_link.tt2
LP1753536 - Add a new Owning Library column to the OPAC Items Out
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / library_name_link.tt2
1 [%-
2     opac_root = ctx.opac_root;
3     IF ctx.kpac_root;
4         opac_root = ctx.kpac_root;
5     END;
6
7     # Allow fleshed circ_libs
8     IF copy_info.circ_lib.name; 
9        org_id = copy_info.circ_lib.id;
10        org_name = copy_info.circ_lib.name; 
11        org_sname = copy_info.circ_lib.shortname; 
12     ELSE;
13        org_id = copy_info.circ_lib;
14        org_name = ctx.get_aou(org_id).name;
15        org_sname = ctx.get_aou(org_id).shortname;
16     END;
17
18     lib_url = ctx.get_org_setting(org_id, 'lib.info_url');
19     prefer_external_url = ctx.get_org_setting(org_id, 'lib.prefer_external_url');
20     UNLESS lib_url && prefer_external_url;
21         lib_url = mkurl(opac_root _ '/library/' _ org_sname, {}, 1);
22     END; 
23     IF lib_url; '<a property="offeredBy" typeof="Library" href="'; lib_url | html; '">'; END;
24     '<span property="name">'; org_name | html; '</span>';
25     IF lib_url; '</a>'; END;
26 -%]
27